From unknown Sat Sep 06 02:32:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Jun 2017 07:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 27180@debbugs.gnu.org Cc: Danny Milosavljevic X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149630174726723 (code B ref -1); Thu, 01 Jun 2017 07:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 1 Jun 2017 07:22:27 +0000 Received: from localhost ([127.0.0.1]:48361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGKR8-0006wx-Li for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGKR6-0006wj-LA for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGKR0-0001WC-Oh for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGKR0-0001W6-LC for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGKQz-0008P4-Le for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGKQw-0001VT-FX for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:17 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:48770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGKQw-0001VG-9a for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:14 -0400 Received: from dayas.3.home (178.113.243.58.wireless.dyn.drei.com [178.113.243.58]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 400101CA0DBA; Thu, 1 Jun 2017 09:22:12 +0200 (CEST) From: Danny Milosavljevic Date: Thu, 1 Jun 2017 09:22:07 +0200 Message-Id: <20170601072207.27718-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.12.1 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/build/utils.scm (invoke): New variable. --- guix/build/utils.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 6d3c29d00..b2307d9d6 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -84,6 +84,7 @@ fold-port-matches remove-store-references wrap-program + invoke locale-category->string)) @@ -1058,6 +1059,13 @@ with definitions for VARS." (chmod prog-tmp #o755) (rename-file prog-tmp prog)))) +(define invoke + "Invokes the program (array-ref ARGS 0) and gives it ARGS. + If the exit code is non-zero, raises an error." + (lambda args + (if (not (zero? (system* args))) + (error (format #f "Failed to invoke ~a" args))))) + ;;; ;;; Locales. From unknown Sat Sep 06 02:32:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs. Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 01 Jun 2017 12:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 27180@debbugs.gnu.org Received: via spool by 27180-submit@debbugs.gnu.org id=B27180.14963191989314 (code B ref 27180); Thu, 01 Jun 2017 12:14:02 +0000 Received: (at 27180) by debbugs.gnu.org; 1 Jun 2017 12:13:18 +0000 Received: from localhost ([127.0.0.1]:48697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGOyc-0002QA-Co for submit@debbugs.gnu.org; Thu, 01 Jun 2017 08:13:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGOyb-0002Pv-DA for 27180@debbugs.gnu.org; Thu, 01 Jun 2017 08:13:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGOyT-000544-2h for 27180@debbugs.gnu.org; Thu, 01 Jun 2017 08:13:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGOyS-00053s-VN; Thu, 01 Jun 2017 08:13:09 -0400 Received: from [193.50.110.69] (port=43230 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dGOyS-0006fJ-DC; Thu, 01 Jun 2017 08:13:08 -0400 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170601072207.27718-1-dannym@scratchpost.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Prairial an 225 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu Date: Thu, 01 Jun 2017 14:13:05 +0200 In-Reply-To: <20170601072207.27718-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Thu, 1 Jun 2017 09:22:07 +0200") Message-ID: <87shjjzz1q.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Danny Milosavljevic skribis: > * guix/build/utils.scm (invoke): New variable. > --- > guix/build/utils.scm | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/guix/build/utils.scm b/guix/build/utils.scm > index 6d3c29d00..b2307d9d6 100644 > --- a/guix/build/utils.scm > +++ b/guix/build/utils.scm > @@ -84,6 +84,7 @@ > fold-port-matches > remove-store-references > wrap-program > + invoke >=20=20 > locale-category->string)) >=20=20 > @@ -1058,6 +1059,13 @@ with definitions for VARS." > (chmod prog-tmp #o755) > (rename-file prog-tmp prog)))) >=20=20 > +(define invoke > + "Invokes the program (array-ref ARGS 0) and gives it ARGS. > + If the exit code is non-zero, raises an error." > + (lambda args > + (if (not (zero? (system* args))) > + (error (format #f "Failed to invoke ~a" args))))) Good idea. I would suggest writing it this way though: (define (invoke program . args) "Invoke PROGRAM with the given ARGS. Raise an error if the exit code is non-zero; otherwise return #t." (let ((status (apply system* program args))) (unless (zero? status) (error (format #f "program ~s exited with non-zero code" program) status)) #t)) If that=E2=80=99s fine with you, please push to =E2=80=98core-updates=E2=80= =99. (Just in time!) Thanks, Ludo=E2=80=99. From unknown Sat Sep 06 02:32:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Danny Milosavljevic Subject: bug#27180: closed (Re: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs.) Message-ID: References: <20170601190900.75571862@scratchpost.org> <20170601072207.27718-1-dannym@scratchpost.org> X-Gnu-PR-Message: they-closed 27180 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 27180@debbugs.gnu.org Date: Thu, 01 Jun 2017 17:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1496337002-11258-1" This is a multi-part message in MIME format... ------------=_1496337002-11258-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #27180: [PATCH core-updates] utils: Add helper method to invoke programs. which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 27180@debbugs.gnu.org. --=20 27180: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27180 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1496337002-11258-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 27180-done) by debbugs.gnu.org; 1 Jun 2017 17:09:07 +0000 Received: from localhost ([127.0.0.1]:49940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGTat-0002uP-96 for submit@debbugs.gnu.org; Thu, 01 Jun 2017 13:09:07 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:37922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGTas-0002uG-3I for 27180-done@debbugs.gnu.org; Thu, 01 Jun 2017 13:09:06 -0400 Received: from localhost (77.118.208.106.wireless.dyn.drei.com [77.118.208.106]) by dd1012.kasserver.com (Postfix) with ESMTPSA id B412B1CA0678; Thu, 1 Jun 2017 19:09:03 +0200 (CEST) Date: Thu, 1 Jun 2017 19:09:00 +0200 From: Danny Milosavljevic To: ludo@gnu.org (Ludovic =?ISO-8859-1?Q?Court=E8s?=) Subject: Re: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs. Message-ID: <20170601190900.75571862@scratchpost.org> In-Reply-To: <87shjjzz1q.fsf@gnu.org> References: <20170601072207.27718-1-dannym@scratchpost.org> <87shjjzz1q.fsf@gnu.org> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27180-done Cc: 27180-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Good idea to end it with #t :) Pushed your variant as 3f65c190d23296e7e718c3deff413e8beb61d8ba to core-updates. ------------=_1496337002-11258-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Jun 2017 07:22:27 +0000 Received: from localhost ([127.0.0.1]:48361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGKR8-0006wx-Li for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGKR6-0006wj-LA for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGKR0-0001WC-Oh for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGKR0-0001W6-LC for submit@debbugs.gnu.org; Thu, 01 Jun 2017 03:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGKQz-0008P4-Le for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGKQw-0001VT-FX for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:17 -0400 Received: from dd1012.kasserver.com ([85.13.128.8]:48770) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dGKQw-0001VG-9a for guix-patches@gnu.org; Thu, 01 Jun 2017 03:22:14 -0400 Received: from dayas.3.home (178.113.243.58.wireless.dyn.drei.com [178.113.243.58]) by dd1012.kasserver.com (Postfix) with ESMTPSA id 400101CA0DBA; Thu, 1 Jun 2017 09:22:12 +0200 (CEST) From: Danny Milosavljevic To: guix-patches@gnu.org Subject: [PATCH core-updates] utils: Add helper method to invoke programs. Date: Thu, 1 Jun 2017 09:22:07 +0200 Message-Id: <20170601072207.27718-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.12.1 Tags: patch X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit Cc: Danny Milosavljevic X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) * guix/build/utils.scm (invoke): New variable. --- guix/build/utils.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 6d3c29d00..b2307d9d6 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -84,6 +84,7 @@ fold-port-matches remove-store-references wrap-program + invoke locale-category->string)) @@ -1058,6 +1059,13 @@ with definitions for VARS." (chmod prog-tmp #o755) (rename-file prog-tmp prog)))) +(define invoke + "Invokes the program (array-ref ARGS 0) and gives it ARGS. + If the exit code is non-zero, raises an error." + (lambda args + (if (not (zero? (system* args))) + (error (format #f "Failed to invoke ~a" args))))) + ;;; ;;; Locales. ------------=_1496337002-11258-1--