From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Bavier Subject: [PATCH] utils: Preserve makefile shell arguments during patch. Date: Wed, 27 Aug 2014 10:36:33 -0500 Message-ID: <874mwydjwe.fsf@member.fsf.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMfHW-0001E8-9m for guix-devel@gnu.org; Wed, 27 Aug 2014 11:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMfHQ-0005e4-KC for guix-devel@gnu.org; Wed, 27 Aug 2014 11:37:06 -0400 Received: from mail-ob0-x233.google.com ([2607:f8b0:4003:c01::233]:47595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMfHQ-0005e0-EV for guix-devel@gnu.org; Wed, 27 Aug 2014 11:37:00 -0400 Received: by mail-ob0-f179.google.com with SMTP id wn1so300245obc.38 for ; Wed, 27 Aug 2014 08:36:59 -0700 (PDT) Received: from cooper.gmail.com (chippewa-nat.cray.com. [136.162.34.1]) by mx.google.com with ESMTPSA id n4sm748381obi.12.2014.08.27.08.36.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 27 Aug 2014 08:36:58 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= 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? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-utils-Preserve-makefile-shell-arguments-during-patch.patch >From e1743a6de5b72cc7150c4e01e79a200e1667f627 Mon Sep 17 00:00:00 2001 From: Eric Bavier 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 --=-=-= -- Eric Bavier --=-=-=--