guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: utils: Use $0 instead of absolute path to original program in 'wr


From: Andreas Enge
Subject: 01/02: utils: Use $0 instead of absolute path to original program in 'wrap-program'.
Date: Mon, 16 Feb 2015 14:04:27 +0000

andreas pushed a commit to branch core-updates
in repository guix.

commit b01f89675d03202851a00c38d4995424bbb1879f
Author: Andreas Enge <address@hidden>
Date:   Sun Feb 15 17:14:53 2015 +0100

    utils: Use $0 instead of absolute path to original program in 
'wrap-program'.
    
    * guix/build/utils.scm (wrap-program): Create scripts that use $0 (which is
        usually just the base name) instead of the absolute path to the original
        program. Alternative implementation of 2ed11b3.
    
    Co-authored-by: Ludovic Court├Ęs <address@hidden>
    
    Closes <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=19742>.
---
 guix/build/utils.scm |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index c7fdd1d..a3446cb 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -816,7 +816,7 @@ contents:
   #!location/of/bin/bash
   export PATH=\"/gnu/.../bar/bin\"
   export CERT_PATH=\"$CERT_PATH${CERT_PATH:+:}/gnu/.../baz/certs:/qux/certs\"
-  exec -a location/of/foo location/of/.foo-real \"address@hidden"
+  exec -a $0 location/of/.foo-real \"address@hidden"
 
 This is useful for scripts that expect particular programs to be in $PATH, for
 programs that expect particular shared libraries to be in $LD_LIBRARY_PATH, or
@@ -870,11 +870,10 @@ the previous wrapper."
     (with-output-to-file prog-tmp
       (lambda ()
         (format #t
-                "#!~a~%~a~%exec -a \"~a\" \"~a\" \"address@hidden"~%"
+                "#!~a~%~a~%exec -a \"$0\" \"~a\" \"address@hidden"~%"
                 (which "bash")
                 (string-join (map export-variable vars)
                              "\n")
-                (canonicalize-path prog)
                 (canonicalize-path target))))
 
     (chmod prog-tmp #o755)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]