You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Travis Vitek <tv...@quovadx.com> on 2007/09/21 21:10:10 UTC
Problems applying patches
Hello all,
I'm attempting to make a final patch to for STDCXX-552, and I'm running
into an issue that I hope someone here knows the answer to. The problem
is that I cannot apply a patch created with svn diff. I've recreated the
series of commands below.
I believe that the problem is that svn diff strips the contents of $Id$
but doesn't report it as a changed line. The result is that the patch
utility cannot use the resulting diff to locate the actual lines to
update [even if the line numbers are in the diff, patch uses them as a
hint to find where to apply the patch]. Interestingly enough, I don't
have any problem using TortiseSVN to apply the patchfile on windows.
Travis
[vitek@fornax] 915 % head mapfile.gcc
########################################################################
###
#
# $Id: mapfile.gcc 354455 2005-12-06 15:49:44Z sebor $
#
########################################################################
###
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
[vitek@fornax] 916 % svn diff mapfile.gcc
Index: mapfile.gcc
===================================================================
--- mapfile.gcc (revision 577797)
+++ mapfile.gcc (working copy)
@@ -1,6 +1,28 @@
+#######################################################################
####
#
# $Id$
#
+#######################################################################
####
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed
+# with this work for additional information regarding copyright
+# ownership. The ASF licenses this file to you under the Apache
+# License, Version 2.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# Copyright 1994-2007 Rogue Wave Software.
+#
+#######################################################################
####
RWSTD.4.1.3
{
[vitek@fornax] 917 % svn diff mapfile.gcc > patchfile
[vitek@fornax] 918 % svn revert mapfile.gcc
Reverted 'mapfile.gcc'
[vitek@fornax] 919 % patch mapfile.gcc patchfile
patching file mapfile.gcc
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file mapfile.gcc.rej
[vitek@fornax] 920 %
RE: Problems applying patches
Posted by Travis Vitek <tv...@quovadx.com>.
>Martin Sebor wrote:
>
>Travis Vitek wrote:
>> Hello all,
>>
>> I'm attempting to make a final patch to for STDCXX-552, and
>> I'm running into an issue that I hope someone here knows the
>> answer to. The problem is that I cannot apply a patch created
>> with svn diff. I've recreated the series of commands below.
>
>I was able to reproduce this with several different implementations
>of patch (HP-UX, Linux, and Solaris) but I'm not sure I understand
>what's causing it. A patch to add either line 1 alone or line 5
>alone applies (with fuzz of 2, whatever that means), but a patch
>to add both lines fails.
>
Yes, that is the same behavior that I'm seeing. Thanks!
To confirm that the $Id$ being stripped is the problem, I matched the
$Id$ line in mapfile.gcc with that of the patchfile. The patch applied
cleanly. Same results the other way. As long as the $Id$ line matches
between the two, the patch applies.
Shrug.
>Martin
>
Re: Problems applying patches
Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
> Hello all,
>
> I'm attempting to make a final patch to for STDCXX-552, and I'm running
> into an issue that I hope someone here knows the answer to. The problem
> is that I cannot apply a patch created with svn diff. I've recreated the
> series of commands below.
I was able to reproduce this with several different implementations
of patch (HP-UX, Linux, and Solaris) but I'm not sure I understand
what's causing it. A patch to add either line 1 alone or line 5
alone applies (with fuzz of 2, whatever that means), but a patch
to add both lines fails.
Martin
>
> I believe that the problem is that svn diff strips the contents of $Id$
> but doesn't report it as a changed line. The result is that the patch
> utility cannot use the resulting diff to locate the actual lines to
> update [even if the line numbers are in the diff, patch uses them as a
> hint to find where to apply the patch]. Interestingly enough, I don't
> have any problem using TortiseSVN to apply the patchfile on windows.
>
> Travis
>
> [vitek@fornax] 915 % head mapfile.gcc
> ########################################################################
> ###
> #
> # $Id: mapfile.gcc 354455 2005-12-06 15:49:44Z sebor $
> #
> ########################################################################
> ###
> #
> # Licensed to the Apache Software Foundation (ASF) under one or more
> # contributor license agreements. See the NOTICE file distributed
> # with this work for additional information regarding copyright
> # ownership. The ASF licenses this file to you under the Apache
> [vitek@fornax] 916 % svn diff mapfile.gcc
> Index: mapfile.gcc
> ===================================================================
> --- mapfile.gcc (revision 577797)
> +++ mapfile.gcc (working copy)
> @@ -1,6 +1,28 @@
> +#######################################################################
> ####
> #
> # $Id$
> #
> +#######################################################################
> ####
> +#
> +# Licensed to the Apache Software Foundation (ASF) under one or more
> +# contributor license agreements. See the NOTICE file distributed
> +# with this work for additional information regarding copyright
> +# ownership. The ASF licenses this file to you under the Apache
> +# License, Version 2.0 (the "License"); you may not use this file
> +# except in compliance with the License. You may obtain a copy of
> +# the License at
> +#
> +# http://www.apache.org/licenses/LICENSE-2.0
> +#
> +# Unless required by applicable law or agreed to in writing, software
> +# distributed under the License is distributed on an "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
> +# implied. See the License for the specific language governing
> +# permissions and limitations under the License.
> +#
> +# Copyright 1994-2007 Rogue Wave Software.
> +#
> +#######################################################################
> ####
>
> RWSTD.4.1.3
> {
> [vitek@fornax] 917 % svn diff mapfile.gcc > patchfile
> [vitek@fornax] 918 % svn revert mapfile.gcc
> Reverted 'mapfile.gcc'
> [vitek@fornax] 919 % patch mapfile.gcc patchfile
> patching file mapfile.gcc
> Hunk #1 FAILED at 1.
> 1 out of 1 hunk FAILED -- saving rejects to file mapfile.gcc.rej
> [vitek@fornax] 920 %