Bug 216167 - shells/fish fails to build when applying extra patch /usr/ports/shells/fish/files/extra-patch-Makefile.in
Summary: shells/fish fails to build when applying extra patch /usr/ports/shells/fish/f...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-17 09:27 UTC by David Guyot
Modified: 2017-02-09 08:30 UTC (History)
1 user (show)

See Also:
asomers: maintainer-feedback+


Attachments
Update optional patch for DOCS=off (1.88 KB, patch)
2017-01-17 16:21 UTC, Alan Somers
asomers: maintainer-approval+
Details | Diff
Post-patch extra-patch-Makefile.in (648 bytes, patch)
2017-01-20 09:12 UTC, David Guyot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Guyot 2017-01-17 09:27:28 UTC
Hello, there.

When trying to make install clean shells/fish in order to update it, I get the following output:
root@Bitra /u/p/s/fish {⌗0/⬓42}[0]♆# make install clean
===>  Patching for fish-2.4.0
===>  Applying extra patch /usr/ports/shells/fish/files/extra-patch-Makefile.in
1 out of 1 hunks failed--saving rejects to ./Makefile.in.rej
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/shells/fish
*** Error code 1

Stop.
make: stopped in /usr/ports/shells/fish
root@Bitra /u/p/s/fish {⌗0/⬓42}[0]♆# cat work/fish-2.4.0/Makefile.in.rej
@@ -639,12 +639,12 @@
                true; \
        done;

-       $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
-       for i in user_doc/html/* ChangeLog; do \
-               if test -f $$i; then \
-                       $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
-               fi; \
-       done;
+#      $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
+#      for i in user_doc/html/* ChangeLog; do \
+#              if test -f $$i; then \
+#                      $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
+#              fi; \
+#      done;
        $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
        for i in $(MANUALS); do \
                $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \

Being a novice FreeBSD user, I'm not able to fix it myself, at least currently. I guess the bugfix is trivial, but I could break things further trying to fix it for myself, and I'm not willing to try that before knowing if the above data and the corresponding bugfix is useful for others or only for me.

Awaiting your answers,

Regards.
Comment 1 Alan Somers freebsd_committer freebsd_triage 2017-01-17 16:21:10 UTC
Created attachment 178997 [details]
Update optional patch for DOCS=off

Please try the attached patch
Comment 2 David Guyot 2017-01-18 09:42:31 UTC
(In reply to Alan Somers from comment #1)
Well, I must be missing something here:
root@Bitra /u/src {⌗0/⬓49}[124]♆# wget "https://bz-attachments.freebsd.org/attachment.cgi?id=178997"                             
--2017-01-18 10:37:16--  https://bz-attachments.freebsd.org/attachment.cgi?id=178997                                             
Résolution de bz-attachments.freebsd.org (bz-attachments.freebsd.org)… 2001:1900:2254:206a::50:0, 8.8.178.110                    
Connexion à bz-attachments.freebsd.org (bz-attachments.freebsd.org)|2001:1900:2254:206a::50:0|:443… connecté.                    
requête HTTP transmise, en attente de la réponse… 200 OK                                                                         
Un cookie provenant de bz-attachments.freebsd.org a tenté de changer le domaine en bugs.freebsd.org                              
Taille : 1930 (1,9K) [text/plain]                                                                                                
Sauvegarde en : « attachment.cgi?id=178997 »                                                                                     
                                                                                                                                 
attachment.cgi?id=178997          100%[=============================================================>]   1,88K  --.-KB/s    in 0s
                                                                                                                                 
2017-01-18 10:37:18 (422 MB/s) — « attachment.cgi?id=178997 » sauvegardé [1930/1930]                                             
                                                                                                                                 
root@Bitra /u/src {⌗0/⬓49}[0]♆# mv attachment.cgi\?id=178997 fish.patch                                                          
root@Bitra /u/src {⌗0/⬓49}[0]♆# patch -C < fish.patch                                                                            
Hmm...  Looks like a unified diff to me...                                                                                       
The text leading up to this was:                                                                                                 
--------------------------                                                                                                       
|Index: shells/fish/Makefile                                                                                                     
|===================================================================                                                             
|--- shells/fish/Makefile       (revision 431398)                                                                                
|+++ shells/fish/Makefile       (working copy)                                                                                   
--------------------------                                                                                                       
Patching file Makefile using Plan A...                                                                                           
Hunk #1 failed at 3.                                                                                                             
1 out of 1 hunks failed while patching Makefile                                                                                  
Hmm...  The next patch looks like a unified diff to me...                                                                        
The text leading up to this was:                                                                                                 
--------------------------                                                                                                       
|Index: shells/fish/files/extra-patch-Makefile.in                                                                                
|===================================================================                                                             
|--- shells/fish/files/extra-patch-Makefile.in  (revision 431398)                                                                
|+++ shells/fish/files/extra-patch-Makefile.in  (working copy)                                                                   
--------------------------                                                                                                       
File to patch:                                                                                                                   
No file found--skip this patch? [n] n                                                                                            
File to patch: shells/fish/files/extra-patch-Makefile.in                                                                         
No file found--skip this patch? [n] n                                                                                            
patch: **** can't find shells/fish/files/extra-patch-Makefile.in                                                                 

I probably didn't correctly answered to the prompts, but I can't tell, as I'm a noob. Please don't hit my head too hard if so.
Comment 3 Alan Somers freebsd_committer freebsd_triage 2017-01-18 16:00:34 UTC
David, it looks like you're trying to apply that patch to /usr/src.  You need to apply it to /usr/ports instead.
Comment 4 David Guyot 2017-01-18 16:22:52 UTC
(In reply to Alan Somers from comment #3)

Oh, dear… Sorry, just corrected that, but it still doesn't build:
root@Bitra /u/p/s/fish {⌗0/⬓49}[0]♆# make install
===>  License GPLv2 accepted by the user
===>  Found saved configuration for fish-2.4.0
===>   fish-2.4.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by fish-2.4.0 for building
===>  Extracting for fish-2.4.0
=> SHA256 Checksum OK for fish-2.4.0.tar.gz.
===>  Patching for fish-2.4.0
===>  Applying extra patch /usr/ports/shells/fish/files/extra-patch-Makefile.in
1 out of 1 hunks failed--saving rejects to ./Makefile.in.rej
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/shells/fish
*** Error code 1

Stop.
make: stopped in /usr/ports/shells/fish
root@Bitra /u/p/s/fish {⌗0/⬓49}[0]♆# cat work/fish-2.4.0/Makefile.in.rej
@@ -639,12 +639,12 @@
                true; \
        done;

-       $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
-       for i in user_doc/html/* ChangeLog; do \
-               if test -f $$i; then \
-                       $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
-               fi; \
-       done;
+#      $(INSTALL) -m 755 -d $(DESTDIR)$(docdir)
+#      for i in user_doc/html/* ChangeLog; do \
+#              if test -f $$i; then \
+#                      $(INSTALL) -m 644 $$i $(DESTDIR)$(docdir); \
+#              fi; \
+#      done;
        $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
        for i in $(MANUALS); do \
                $(INSTALL) -m 644 $$i $(DESTDIR)$(mandir)/man1/; \
root@Bitra /u/p/s/fish {⌗0/⬓49}[0]♆# make showconfig
===> The following configuration options are available for fish-2.4.0:
     DOCS=off: Build and/or install documentation
     NLS=on: Native Language Support
===> Use 'make config' to modify these settings
Comment 5 Alan Somers freebsd_committer freebsd_triage 2017-01-18 16:31:23 UTC
David, was your workdir clean before you tried the patch?  If so, perhaps your web browser is changing line endings or something.  Run md5 on the patch file and check that it matches mine.

MD5 (files/extra-patch-Makefile.in) = f61a621b856b2a7c2df334deb6aa4da7
Comment 6 David Guyot 2017-01-19 10:33:29 UTC
(In reply to Alan Somers from comment #5)
Well, there is a problem: even after `make clean` and `portsnap fetch update; portsnap extract`, my MD5 is a8979c04c1ef6abc17afd03048d88d8e. Aren't my commands supposed to reset the ports tree?
Comment 7 Alan Somers freebsd_committer freebsd_triage 2017-01-19 17:10:35 UTC
David, portsnap doesn't manage that patch file; I haven't committed it yet.  Just download the patch through your browser and check its md5.  If the md5 is wrong, then your browser mangled it somehow, perhaps by changing the line endings from LF to CRLF. If so, you could try fixing it by running "dos2unix" on it.  The md5 of the patch file should be:

MD5 (216167.diff) = 91ed41d51f4839505600100a198a84b8

And after you've applied it, the md5 of the resulting extra-patch-Makefile.in in shells/fish/files should be:

MD5 (files/extra-patch-Makefile.in) = f61a621b856b2a7c2df334deb6aa4da7
Comment 8 David Guyot 2017-01-20 09:12:18 UTC
Created attachment 179130 [details]
Post-patch extra-patch-Makefile.in

(In reply to Alan Somers from comment #7)
Alan, I talked about portsnap to say that I did an extract to reset the ports tree. I just did it again and then applied your patch: although the patch has the right MD5 and correctly applies, the extra-patch-Makefile.in still doesn't have the right checksum:
root@Bitra /u/ports {⌗0/⬓50}[124]♆# curl "https://bz-attachments.freebsd.org/attachment.cgi?id=178997" > fish.patch
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                    
                                 Dload  Upload   Total   Spent    Left  Speed                                      
100  1930  100  1930    0     0   1202      0  0:00:01  0:00:01 --:--:--  1203                                     
root@Bitra /u/ports {⌗0/⬓50}[0]♆# md5 fish.patch                                                                   
MD5 (fish.patch) = 91ed41d51f4839505600100a198a84b8                                                                
root@Bitra /u/ports {⌗0/⬓50}[0]♆# patch -C < fish.patch                                                            
Hmm...  Looks like a unified diff to me...                                                                         
The text leading up to this was:                                                                                   
--------------------------                                                                                         
|Index: shells/fish/Makefile                                                                                       
|===================================================================                                               
|--- shells/fish/Makefile       (revision 431398)                                                                  
|+++ shells/fish/Makefile       (working copy)                                                                     
--------------------------                                                                                         
Patching file shells/fish/Makefile using Plan A...                                                                 
Hunk #1 succeeded at 3.                                                                                            
Hmm...  The next patch looks like a unified diff to me...                                                          
The text leading up to this was:                                                                                   
--------------------------                                                                                         
|Index: shells/fish/files/extra-patch-Makefile.in                                                                  
|===================================================================                                               
|--- shells/fish/files/extra-patch-Makefile.in  (revision 431398)                                                  
|+++ shells/fish/files/extra-patch-Makefile.in  (working copy)                                                     
--------------------------                                                                                         
Patching file shells/fish/files/extra-patch-Makefile.in using Plan A...                                            
Hunk #1 succeeded at 1.                                                                                            
done                                                                                                               
root@Bitra /u/ports {⌗0/⬓50}[0]♆# md5 shells/fish/files/extra-patch-Makefile.in                                    
MD5 (shells/fish/files/extra-patch-Makefile.in) = a8979c04c1ef6abc17afd03048d88d8e

Here, I did another portsnap fetch; portsnap extract, to be sure, but, still:
root@Bitra /u/ports {⌗0/⬓50}[0]♆# patch -C < fish.patch                                                            
Hmm...  Looks like a unified diff to me...                                                                         
The text leading up to this was:                                                                                   
--------------------------                                                                                         
|Index: shells/fish/Makefile                                                                                       
|===================================================================                                               
|--- shells/fish/Makefile       (revision 431398)                                                                  
|+++ shells/fish/Makefile       (working copy)                                                                     
--------------------------                                                                                         
Patching file shells/fish/Makefile using Plan A...                                                                 
Hunk #1 succeeded at 3.                                                                                            
Hmm...  The next patch looks like a unified diff to me...                                                          
The text leading up to this was:                                                                                   
--------------------------                                                                                         
|Index: shells/fish/files/extra-patch-Makefile.in                                                                  
|===================================================================                                               
|--- shells/fish/files/extra-patch-Makefile.in  (revision 431398)                                                  
|+++ shells/fish/files/extra-patch-Makefile.in  (working copy)                                                     
--------------------------                                                                                         
Patching file shells/fish/files/extra-patch-Makefile.in using Plan A...                                            
Hunk #1 succeeded at 1.                                                                                            
done                                                                                                               
root@Bitra /u/ports {⌗0/⬓50}[0]♆# md5 shells/fish/files/extra-patch-Makefile.in                                    
MD5 (shells/fish/files/extra-patch-Makefile.in) = a8979c04c1ef6abc17afd03048d88d8e                                 

And then, after a make clean:
root@Bitra /u/ports {⌗0/⬓50}[0]♆# patch -C < fish.patch                           
Hmm...  Looks like a unified diff to me...                                        
The text leading up to this was:                                                  
--------------------------                                                        
|Index: shells/fish/Makefile                                                      
|===================================================================              
|--- shells/fish/Makefile       (revision 431398)                                 
|+++ shells/fish/Makefile       (working copy)                                    
--------------------------                                                        
Patching file shells/fish/Makefile using Plan A...                                
Hunk #1 succeeded at 3.                                                           
Hmm...  The next patch looks like a unified diff to me...                         
The text leading up to this was:                                                  
--------------------------                                                        
|Index: shells/fish/files/extra-patch-Makefile.in                                 
|===================================================================              
|--- shells/fish/files/extra-patch-Makefile.in  (revision 431398)                 
|+++ shells/fish/files/extra-patch-Makefile.in  (working copy)                    
--------------------------                                                        
Patching file shells/fish/files/extra-patch-Makefile.in using Plan A...           
Hunk #1 succeeded at 1.                                                           
done                                                                              
root@Bitra /u/ports {⌗0/⬓50}[0]♆# md5 shells/fish/files/extra-patch-Makefile.in   
MD5 (shells/fish/files/extra-patch-Makefile.in) = a8979c04c1ef6abc17afd03048d88d8e

Definitely, the extra-patch-Makefile.in differs from what you have; here it comes in the post-patch state.
Comment 9 commit-hook freebsd_committer freebsd_triage 2017-02-09 00:11:01 UTC
A commit references this bug:

Author: asomers
Date: Thu Feb  9 00:09:59 UTC 2017
New revision: 433701
URL: https://svnweb.freebsd.org/changeset/ports/433701

Log:
  Fix two bugs in shells/fish

  1) The build would fail when DOCS=off (PR 216167)
  2) Tab completion doesn't work for "mount -t" (PR 216032)

  PR:	216167
  PR:	216032
  Reported by:	Maxfx <maficccc@gmail.com>
  Reported by:	David Guyot <david.guyot@europecamions-interactive.com>
  Approved by:	brd (ports)

Changes:
  head/shells/fish/Makefile
  head/shells/fish/files/extra-patch-Makefile.in
  head/shells/fish/files/patch-share_functions_____fish__print__filesystems.fish
Comment 10 David Guyot 2017-02-09 08:30:06 UTC
If useful, I confirm the fix works; thanks a lot for your help.