all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Bavier <ericbavier@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH] utils: Preserve makefile shell arguments during patch.
Date: Wed, 27 Aug 2014 10:36:33 -0500	[thread overview]
Message-ID: <874mwydjwe.fsf@member.fsf.org> (raw)

[-- 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

             reply	other threads:[~2014-08-27 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 15:36 Eric Bavier [this message]
2014-08-28 11:44 ` [PATCH] utils: Preserve makefile shell arguments during patch Ludovic Courtès
2014-08-28 14:46   ` Eric Bavier
2014-08-28 15:41     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mwydjwe.fsf@member.fsf.org \
    --to=ericbavier@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.