From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdsjJ-00069U-Al for guix-patches@gnu.org; Fri, 13 Jul 2018 03:43:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdsjG-00075z-7n for guix-patches@gnu.org; Fri, 13 Jul 2018 03:43:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:49729) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdsjG-00075F-3F for guix-patches@gnu.org; Fri, 13 Jul 2018 03:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdsjF-00006r-Jw for guix-patches@gnu.org; Fri, 13 Jul 2018 03:43:01 -0400 Subject: [bug#32102] [PATCH v2 1/2] build-system: python: Only wrap non-hidden executable files. Resent-Message-ID: References: <20180711192652.20186-1-arunisaac@systemreboot.net> <20180711192652.20186-2-arunisaac@systemreboot.net> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <20180711192652.20186-2-arunisaac@systemreboot.net> Date: Fri, 13 Jul 2018 09:42:02 +0200 Message-ID: <87a7qvmvjp.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Arun Isaac Cc: mhw@netris.org, 32102@debbugs.gnu.org Arun Isaac writes: > * guix/build/python-build-system.scm (wrap): Only wrap non-hidden executa= ble > files. This prevents wrapped executables from being wrapped once again. > --- > guix/build/python-build-system.scm | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/guix/build/python-build-system.scm b/guix/build/python-build= -system.scm > index 376ea81f1..37e35eec0 100644 > --- a/guix/build/python-build-system.scm > +++ b/guix/build/python-build-system.scm > @@ -5,6 +5,7 @@ > ;;; Copyright =C2=A9 2015, 2018 Mark H Weaver > ;;; Copyright =C2=A9 2016 Hartmut Goebel > ;;; Copyright =C2=A9 2018 Ricardo Wurmus > +;;; Copyright =C2=A9 2018 Arun Isaac > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -189,7 +190,11 @@ when running checks after installing the package." > (map (cut string-append dir "/" <>) > (or (scandir dir (lambda (f) > (let ((s (stat (string-append dir "/" f)))) > - (eq? 'regular (stat:type s))))) > + (and (eq? 'regular (stat:type s)) > + ;; Only wrap non-hidden files. This > + ;; prevents wrapped executables from = being > + ;; wrapped again. > + (not (string-prefix? "." f)))))) > '()))) >=20=20 > (define bindirs What about adding a function like 'is-wrapped?'? Because it could be used somewhere else, and it would make the code self-descriptive. It would check that the name looks like .xxx-real, and also check that xxx exists. (And check that it's an executable.) WDYT? Cl=C3=A9ment