all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] utils: Preserve makefile shell arguments during patch.
@ 2014-08-27 15:36 Eric Bavier
  2014-08-28 11:44 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Bavier @ 2014-08-27 15:36 UTC (permalink / raw)
  To: guix-devel

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

With the talk of potentially merging the core-updates branch, I thought
I should get this patch reviewed, since it triggers a full rebuild.

While working with some Imake-based packages recently, I found that
patch-makefile-SHELL did not like when the SHELL definition contained
arguments.  For example, one package would define::

  SHELL = /bin/sh -e

And patch-makefile-SHELL would turn that into::

  SHELL = /gnu/store/.../bin/bash
  -e

which Make would subsequently choke on.

Thoughts?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-utils-Preserve-makefile-shell-arguments-during-patch.patch --]
[-- Type: text/x-diff, Size: 1335 bytes --]

From e1743a6de5b72cc7150c4e01e79a200e1667f627 Mon Sep 17 00:00:00 2001
From: Eric Bavier <bavier@member.fsf.org>
Date: Wed, 27 Aug 2014 10:26:54 -0500
Subject: [PATCH] utils: Preserve makefile shell arguments during patch.

* guix/build/utils.scm (patch-makefile-SHELL): Preserve shell arguments.
---
 guix/build/utils.scm |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index 2f3dc9c..7ec44fd 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -582,14 +582,14 @@ 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))))
-- 
1.7.9.5


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


-- 
Eric Bavier

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

end of thread, other threads:[~2014-08-28 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 15:36 [PATCH] utils: Preserve makefile shell arguments during patch Eric Bavier
2014-08-28 11:44 ` Ludovic Courtès
2014-08-28 14:46   ` Eric Bavier
2014-08-28 15:41     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.