From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjmZD-0002m9-Ea for guix-patches@gnu.org; Sun, 29 Jul 2018 10:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjmZC-0006vL-8L for guix-patches@gnu.org; Sun, 29 Jul 2018 10:21:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57187) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjmZC-0006vB-2L for guix-patches@gnu.org; Sun, 29 Jul 2018 10:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fjmZB-0006LS-T1 for guix-patches@gnu.org; Sun, 29 Jul 2018 10:21:01 -0400 Subject: [bug#32102] [PATCH v2 2/2] gnu: gajim: Combine wrap-program phases. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180711192652.20186-1-arunisaac@systemreboot.net> <20180711192652.20186-3-arunisaac@systemreboot.net> <87zhyv1qe8.fsf@lassieur.org> Date: Sun, 29 Jul 2018 16:20:03 +0200 In-Reply-To: (Arun Isaac's message of "Sun, 29 Jul 2018 02:12:58 +0530") Message-ID: <87y3dudsz0.fsf@gnu.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: 32102@debbugs.gnu.org, =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Hello Arun, I=E2=80=99m a bit late to the party, but hey! Arun Isaac skribis: > From 6ee5cf4423109ab64df58c85f4114e456dda098b Mon Sep 17 00:00:00 2001 > From: Arun Isaac > Date: Wed, 11 Jul 2018 13:03:33 +0530 > Subject: [PATCH v3 1/3] build-system: python: Do not double wrap executab= les. > To: clement@lassieur.org > Cc: mhw@netris.org, > andreas@enge.fr, > 32102@debbugs.gnu.org Hmm, weird! > * guix/build/python-build-system.scm (wrap): Only wrap executables that h= ave > not already been wrapped. > * guix/build/utils.scm (is-wrapped?): New function. [...] > --- a/guix/build/python-build-system.scm > +++ b/guix/build/python-build-system.scm [...] > (define* (wrap #:key inputs outputs #:allow-other-keys) > (define (list-of-files dir) > - (map (cut string-append dir "/" <>) > - (or (scandir dir (lambda (f) > - (let ((s (stat (string-append dir "/" f)))) > - (eq? 'regular (stat:type s))))) > - '()))) > + (find-files dir (lambda (file stat) > + (and (eq? 'regular (stat:type stat)) > + (not (is-wrapped? file)))))) Something I don=E2=80=99t get is that =E2=80=98wrap-program=E2=80=99 itself= is supposed to detect already-wrapped program. I vaguely remember discussing it before but I forgot what the conclusions were; do we really need extra =E2=80=98wrapped?=E2=80=99 checks? Can=E2=80=99t we fix =E2=80=98wrap-prog= ram=E2=80=99 itself? > (define bindirs > (append-map (match-lambda > diff --git a/guix/build/utils.scm b/guix/build/utils.scm > index c58a1afd1..c310b792c 100644 > --- a/guix/build/utils.scm > +++ b/guix/build/utils.scm [...] > +(define (is-wrapped? prog) > + "Return #t if PROG is already wrapped using wrap-program, else return = #f." > + (with-directory-excursion (dirname prog) > + (and-let* ((match-record (string-match "^\\.(.*)-real$" (basename pr= og)))) > + (access? (match:substring match-record 1) X_OK)))) By convention I=E2=80=99d suggest calling it =E2=80=98wrapped?=E2=80=99 rat= her than =E2=80=98is-wrapped?=E2=80=99. In fact, a more accurate name would be =E2= =80=98wrapper?=E2=80=99. Also I=E2=80=99d suggest not using SRFI-2 because IMO it doesn=E2=80=99t br= ing much and it=E2=80=99s not used anywhere in Guix currently. Also, =E2=80=98file-exis= ts?=E2=80=99 rather than =E2=80=98access?=E2=80=99, and no need to change directories. So: (define (wrapper? prog) "Return #t if PROG is a wrapper as produced by 'wrap-program'." (and (file-exists? prog) (let ((base (basename prog))) (and (string-prefix? "." base) (string-suffix? "-real" base))))) > From 71a7f6e39bd5b68b596bda2a75b1d245179349d0 Mon Sep 17 00:00:00 2001 > From: Arun Isaac > Date: Sat, 28 Jul 2018 17:31:44 +0530 > Subject: [PATCH v3 3/3] gnu: gajim: Return #t from wrap-gsettings-schema-= dir > phase. > To: clement@lassieur.org > Cc: mhw@netris.org, > andreas@enge.fr, > 32102@debbugs.gnu.org > > * gnu/packages/messaging.scm (gajim)[arguments]: Return #t from > wrap-gsettings-schema-dir phase. LGTM! Thanks, Ludo=E2=80=99.