patch rejects?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > patch rejects?




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    patch rejects?  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:19 PM


Why does patch reject this patch?


% diff -NaurtbB --exclude 'zmg-dom.lisp*' zebu-3.5.5-original/COMPILE-ZEBU.l
isp zebu-3.5.5/COMPILE-ZEBU.lisp
--- zebu-3.5.5-original/COMPILE-ZEBU.lisp	1997-10-03 00:57:58.000000000 +020
0
+++ zebu-3.5.5/COMPILE-ZEBU.lisp	2003-11-13 03:45:35.000000000 +0100
@@ -174,6 +174,7 @@
(when (or (null odate) (> idate odate))
;; now do the postponed loads
(do-post-poned-load)
+               (ensure-directories-exist ofile)
(compile-file ifile :output-file ofile))))
(load                         ; postpone load
(push file-path load-before-compile))


while at the same time, it can patch three other files in the same batch:

% patch -p0 < zebu-clisp.patch
patching file zebu-3.5.5/COMPILE-ZEBU.lisp
Hunk #1 FAILED at 174.
1 out of 1 hunk FAILED -- saving rejects to file zebu-3.5.5/COMPILE-ZEBU.lis
p.rej
patching file zebu-3.5.5/ZEBU-init.lisp
Hunk #1 succeeded at 38 with fuzz 2.
patching file zebu-3.5.5/zebu-aux.lisp
patching file zebu-3.5.5/zebu-package.lisp


--
__Pascal_Bourguignon__
http://www.informatimago.com/





[ Post a follow-up to this message ]



    Re: patch rejects?  
Juha Laiho


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:20 PM

Pascal Bourguignon <spam@thalassa.informatimago.com> said:
quote:
>Why does patch reject this patch?
Because the old file doesn't in that rejected chunk match what patch expected to be there.
quote:
>% diff -NaurtbB --exclude 'zmg-dom.lisp*' >zebu-3.5.5-original/COMPILE-ZEBU.lisp zebu-3.5.5/COMPILE-ZEBU.lisp >--- zebu-3.5.5-original/COMPILE-ZEBU.lisp 1997-10-03 00:57:58.000000000 +02 00 >+++ zebu-3.5.5/COMPILE-ZEBU.lisp 2003-11-13 03:45:35.000000000 +0100 >@@ -174,6 +174,7 @@ > (when (or (null odate) (> idate odate)) > ;; now do the postponed loads > (do-post-poned-load) >+ (ensure-directories-exist ofile) > (compile-file ifile :output-file ofile)))) > (load ; postpone load > (push file-path load-before-compile))
... so, look at the six lines starting at line 174 in COMPILE-ZEBU.lisp. They should match the piece above - except that the original file should not contain the fourth line of above listing (the one that starts with a + -sign). Note that the difference can also be a very small one - even different amounts of whitespace (or different whitespace - space against TAB) can cause the patch to fail. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison)




[ Post a follow-up to this message ]



    Re: patch rejects?  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:20 PM


Juha Laiho <Juha.Laiho@iki.fi> writes:
quote:
> Pascal Bourguignon <spam@thalassa.informatimago.com> said: > > Because the old file doesn't in that rejected chunk match what patch > expected to be there. > > > ... so, look at the six lines starting at line 174 in COMPILE-ZEBU.lisp. > They should match the piece above - except that the original file > should not contain the fourth line of above listing (the one that starts > with a + -sign). > > Note that the difference can also be a very small one - even different > amounts of whitespace (or different whitespace - space against TAB) can > cause the patch to fail.
Well, I would have tried very hard to avoid asking the question if such was the case, but it's not: $ diff {zebu-3.5.5-original,zebu-3.5.5}/COMPILE-ZEBU.lisp 176a177
quote:
> (ensure-directories-exist ofile)
$ patch --version patch 2.5.4 Copyright 1984-1988 Larry Wall Copyright 1989-1999 Free Software Foundation, Inc. This program comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of this program under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING. written by Larry Wall and Paul Eggert $ It's rather easy to insert just one line either with vi or emacs without damaging surrounding lines... So, is this a bug in patch? -- __Pascal_Bourguignon__ http://www.informatimago.com/




[ Post a follow-up to this message ]



    Re: patch rejects?  
Bjorn Reese


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:20 PM

On Fri, 14 Nov 2003 14:28:33 +0100, Pascal Bourguignon wrote:
quote:
> So, is this a bug in patch?
Does the problem persist if you use contextual, rather than unified diff? -- mail1dotstofanetdotdk




[ Post a follow-up to this message ]



    Re: patch rejects?  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:20 PM

"Bjorn Reese" <breese@see.signature> writes:
quote:
> On Fri, 14 Nov 2003 14:28:33 +0100, Pascal Bourguignon wrote: > > > Does the problem persist if you use contextual, rather than > unified diff?
Yes, same problem: [pascal@thalassa hp]$ diff -NacrtbB {zebu-3.5.5-original,zebu-3.5.5}/COMPILE -ZEBU.lisp>p [pascal@thalassa hp]$ cp zebu-3.5.5-original/COMPILE-ZEBU.lisp . [pascal@thalassa hp]$ patch -p1<p patching file COMPILE-ZEBU.lisp Hunk #1 FAILED at 174. 1 out of 1 hunk FAILED -- saving rejects to file COMPILE-ZEBU.lisp.rej [pascal@thalassa hp]$ cat p *** zebu-3.5.5-original/COMPILE-ZEBU.lisp 1997-10-03 00:57:58.00000000 0 +0200 --- zebu-3.5.5/COMPILE-ZEBU.lisp 2003-11-13 04:21:02.000000000 +0100 *************** *** 174,179 **** --- 174,180 ---- (when (or (null odate) (> idate odate)) ;; now do the postponed loads (do-post-poned-load) + (ensure-directories-exist ofile) (compile-file ifile :output-file ofile)))) (load ; postpone load (push file-path load-before-compile)) [pascal@thalassa hp]$ cat COMPILE-ZEBU.lisp.rej *************** *** 174,179 **** (when (or (null odate) (> idate odate)) ;; now do the postponed loads (do-post-poned-load) (compile-file ifile :output-file ofile)))) (load ; postpone load (push file-path load-before-compile)) --- 174,180 ---- (when (or (null odate) (> idate odate)) ;; now do the postponed loads (do-post-poned-load) + (ensure-directories-exist ofile) (compile-file ifile :output-file ofile)))) (load ; postpone load (push file-path load-before-compile)) -- __Pascal_Bourguignon__ http://www.informatimago.com/




[ Post a follow-up to this message ]



    Re: patch rejects?  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

2003/11/13, 03:58(+01), Pascal Bourguignon:
quote:
> Why does patch reject this patch?
Did you try it in a C or POSIX locale? Are there any '\0' or other weird chars in the input files? -- Stéphane ["Stephane.Chazelas" at "free.fr"]




[ Post a follow-up to this message ]



    Re: patch rejects?  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

2003/11/13, 03:58(+01), Pascal Bourguignon:
[...]
quote:
> --- zebu-3.5.5-original/COMPILE-ZEBU.lisp 1997-10-03 00:57:58.000000000 +0 200 > +++ zebu-3.5.5/COMPILE-ZEBU.lisp 2003-11-13 03:45:35.000000000 +0100
[...]
quote:
> % patch -p0 < zebu-clisp.patch > patching file zebu-3.5.5/COMPILE-ZEBU.lisp
[...] You're patching the wrong file! zebu-3.5.5-original/COMPILE-ZEBU.lisp needs to be patched, not zebu-3.5.5/COMPILE-ZEBU.lisp. -- Stéphane ["Stephane.Chazelas" at "free.fr"]




[ Post a follow-up to this message ]



    Re: patch rejects?  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

Stephane CHAZELAS <this.address@is.invalid> writes:
quote:
> 2003/11/13, 03:58(+01), Pascal Bourguignon: > [...] > [...] > [...] > > You're patching the wrong file! > > zebu-3.5.5-original/COMPILE-ZEBU.lisp needs to be patched, not > zebu-3.5.5/COMPILE-ZEBU.lisp.
Not exactly. The actual procedure is: ;;... (EXT:SHELL (CONCATENATE 'STRING "cd /usr/local/share/lisp/packages/com/hp ;" "rm -rf zebu-3.5.5 zebu ;" "tar zxf /data/mirrors/cmu-ai-repository/new/zebu-3.5.5.tgz ;" "patch -p0 < zebu-clisp.patch ;" "ln -s zebu-3.5.5 zebu ;" "ln -s COMPILE-ZEBU.lisp zebu/compile-zebu.lisp ;" "ln -s ZEBU-init.lisp zebu/zebu-init.lisp ;" )) ;;... So I'm patching the right files. I just cut too much from xterm to gnus... -- __Pascal_Bourguignon__ http://www.informatimago.com/




[ Post a follow-up to this message ]



    Re: patch rejects?  
Pascal Bourguignon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

Stephane CHAZELAS <this.address@is.invalid> writes:
quote:
> 2003/11/13, 03:58(+01), Pascal Bourguignon: > > Did you try it in a C or POSIX locale? Are there any '\0' or > other weird chars in the input files?
No ASCII NUL and no strange character (emacs says it's a plain ASCII file). I have the following locale, but even when removing it, I still have the problem. I guess I'll have to run patch in gdb... [pascal@thalassa hp]$ od -t x1 zebu-3.5.5-original/COMPILE-ZEBU.lisp | cut - c 8-80|grep 00 [pascal@thalassa hp]$ env | grep LC LC_MONETARY=es_ES LC_NUMERIC=en_US LC_MESSAGES=en_US LC_COLLATE=C LC_CTYPE=fr_FR LC_TIME=en_US [pascal@thalassa hp]$ env|grep LC|awk -F= '{printf "unset %s\n",$1}'>u [pascal@thalassa hp]$ cat u unset LC_MONETARY unset LC_NUMERIC unset LC_MESSAGES unset LC_COLLATE unset LC_CTYPE unset LC_TIME [pascal@thalassa hp]$ . u [pascal@thalassa hp]$ mv zebu-3.5.5/COMPILE-ZEBU.lisp zebu-3.5.5/COMPILE-ZEB U.lisp.good [pascal@thalassa hp]$ cp zebu-3.5.5-original/COMPILE-ZEBU.lisp zebu-3.5.5/ [pascal@thalassa hp]$ patch -p0<p patching file zebu-3.5.5/COMPILE-ZEBU.lisp Hunk #1 FAILED at 41. Hunk #2 FAILED at 174. 2 out of 2 hunks FAILED -- saving rejects to file zebu-3.5.5/COMPILE-ZEBU.li sp.rej -- __Pascal_Bourguignon__ http://www.informatimago.com/




[ Post a follow-up to this message ]



    Re: patch rejects?  
Stephane CHAZELAS


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:21 PM

2003/11/13, 03:58(+01), Pascal Bourguignon:
quote:
> > Why does patch reject this patch? > > % diff -NaurtbB --exclude 'zmg-dom.lisp*' zebu-3.5.5-original/COMPILE-ZEBU.lisp zebu-3.5.5 /COMPILE-ZEBU.lisp
[...]
quote:
> % patch -p0 < zebu-clisp.patch
[...] You need the "-l" flag to patch if you use the "-b" flag to diff. -- Stéphane ["Stephane.Chazelas" at "free.fr"]




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:27 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register