From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts. Date: Tue, 09 Feb 2016 20:19:41 +0100 Message-ID: <87ziv9elo2.fsf@gnu.org> References: <87egcpeono.fsf@gnu.org> <87egcmkvwr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTDpK-0000lY-6Y for guix-devel@gnu.org; Tue, 09 Feb 2016 14:19:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTDpC-0003Db-1Z for guix-devel@gnu.org; Tue, 09 Feb 2016 14:19:50 -0500 In-Reply-To: <87egcmkvwr.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 09 Feb 2016 11:41:56 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Out of curiosity, what package was this? I encountered it first in jison, a javascript parser generator. > Since this is a rebuild-the-world change, I applied to to a new > =E2=80=98core-updates=E2=80=99 branch (and adjusted the commit log.) Yes, I got bitten by that, trying to test it. I had an interesting learning experience getting to know guix and getting this to work and reverted to using (#phases (replace 'patch-source-shebangs ;;patch-source-shebangs-no-symlinks (lambda* (#:key outputs #:allow-other-keys) (for-each patch-shebang (remove (lambda (file) (or (not (file-exists? file)) ;dangling= symlink ;;(file-is-symlink? file) (and (file-exists? file) (eq? 'symlink (stat:type (lsta= t file)))) (file-is-directory? file))) (find-files "."))))) in the package itself. Rebuilding the world is no fun when you want to get things done. When I actually got to test it, it appears that something like the above is still necessary. It seems that the previous patch merely avoids visiting any symlinked directories, while this version actually looks at the script to be patched. Greetings, Jan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-gnu-build-system-do-not-patch-symlinks.-Fixes-locati.patch >From 5a1793944b6ba1368a355edfa5be1b5c542ba48c Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 6 Feb 2016 15:59:51 +0100 Subject: [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts. * guix/build/gnu-build-system.scm (patch-shebangs): avoid patching symlinks. Fixes scripts --- guix/build/gnu-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 2abaa6e..34edff7 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -303,7 +303,7 @@ makefiles." (define (list-of-files dir) (map (cut string-append dir "/" <>) (or (scandir dir (lambda (f) - (let ((s (stat (string-append dir "/" f)))) + (let ((s (lstat (string-append dir "/" f)))) (eq? 'regular (stat:type s))))) '()))) -- 2.1.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20 --=-=-=--