From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] utils: Clean trailing whitespace at end of SHELL Date: Thu, 04 Sep 2014 21:31:54 +0200 Message-ID: <87ppfb89n9.fsf@gnu.org> References: <87bnqv31hc.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]:43399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPclJ-0007aC-PD for guix-devel@gnu.org; Thu, 04 Sep 2014 15:32:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPclA-0001KU-Or for guix-devel@gnu.org; Thu, 04 Sep 2014 15:32:05 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:58702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPclA-0001KN-IB for guix-devel@gnu.org; Thu, 04 Sep 2014 15:31:56 -0400 In-Reply-To: <87bnqv31hc.fsf@member.fsf.org> (Eric Bavier's message of "Thu, 04 Sep 2014 09:27:11 -0500") 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: Eric Bavier Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eric Bavier skribis: > I found an unfortunate bug in the last patch I made to > patch-makefile-SHELL that would leave a trailing ' ' at the end of SHELL > assignments. This is fine for most packages, but caused > gobject-introspection to fail building for me just now (for the curious: > it effectively does an "(apply system* (string-split (string-append SHELL > " " "./libtool") #\space))" which causes sh to try to execute "") AFAIK trailing whitespace in assignments is ignored by =E2=80=98make=E2=80= =99. I grepped gobject-introspection out of curiosity and couldn=E2=80=99t find = any suspicious SHELL assignment. Do you still have it around? > --- a/guix/build/utils.scm > +++ b/guix/build/utils.scm > @@ -590,7 +590,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are= kept unchanged." > (format (current-error-port) > "patch-makefile-SHELL: ~a: changing `SHELL' from `~a' = to `~a'~%" > file old new)) > - (string-append "SHELL =3D " new " " args)))) > + (string-append "SHELL =3D " new (if (string=3D? args "\n") "" " = ") args)))) The (string=3D? args "\n") seems specific and non-obvious. Wouldn=E2=80=99t this work better: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/utils.scm b/guix/build/utils.scm index f38b2ca..057dcd2 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -582,7 +582,7 @@ 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:]]*(.*)$" + (("^ *SHELL[[:blank:]]*=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$" _ dir shell args) (let* ((old (string-append dir shell)) (new (or (find-shell shell) old))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpUaGFua3MsDQpMdWRv4oCZLg0K --=-=-=--