utils: Preserve makefile shell arguments during patch.
authorEric Bavier <bavier@member.fsf.org>
Wed, 27 Aug 2014 15:26:54 +0000 (10:26 -0500)
committerEric Bavier <bavier@member.fsf.org>
Thu, 28 Aug 2014 16:16:19 +0000 (11:16 -0500)
* guix/build/utils.scm (patch-makefile-SHELL): Preserve shell arguments.

guix/build/utils.scm

index 2f3dc9c..f38b2ca 100644 (file)
@@ -582,14 +582,15 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged."
 
   (let ((st (stat file)))
    (substitute* file
-     (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)[[:blank:]]*" _ dir shell)
+     (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)[[:blank:]]*(.*)$"
+       _ dir shell args)
       (let* ((old (string-append dir shell))
              (new (or (find-shell shell) old)))
         (unless (string=? new old)
           (format (current-error-port)
                   "patch-makefile-SHELL: ~a: changing `SHELL' from `~a' to `~a'~%"
                   file old new))
-        (string-append "SHELL = " new "\n"))))
+        (string-append "SHELL = " new " " args))))
 
    (when keep-mtime?
      (set-file-time file st))))