unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts.
@ 2016-02-06 17:26 Jan Nieuwenhuizen
  2016-02-09 10:41 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Nieuwenhuizen @ 2016-02-06 17:26 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

Hi,

When patch-shebang encounters a script that is a symlink, say

    bin/script -> ../lib/foo/thescript

it will change it into a file with rewritten #! .  That breaks whenever
`thescript' assumes it lives in lib/foo.

Attached is a patch that has patch-shebangs skip symlinks.

Greetings, Jan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-build-system-do-not-patch-symlinks.-Fixes-locati.patch --]
[-- Type: text/x-diff, Size: 998 bytes --]

From 5a1793944b6ba1368a355edfa5be1b5c542ba48c Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
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


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-02-10 21:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-06 17:26 [PATCH] gnu-build-system: do not patch symlinks. Fixes location-aware scripts Jan Nieuwenhuizen
2016-02-09 10:41 ` Ludovic Courtès
2016-02-09 19:19   ` Jan Nieuwenhuizen
2016-02-09 20:59     ` Ludovic Courtès
2016-02-09 22:15       ` Jan Nieuwenhuizen
2016-02-10 21:30         ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).