From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGKRm-0000As-2i for guix-patches@gnu.org; Thu, 01 Jun 2017 03:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGKRi-0001tO-7C for guix-patches@gnu.org; Thu, 01 Jun 2017 03:23:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:45684) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGKRi-0001tK-42 for guix-patches@gnu.org; Thu, 01 Jun 2017 03:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dGKRh-0006xz-V6 for guix-patches@gnu.org; Thu, 01 Jun 2017 03:23:01 -0400 Subject: bug#27180: [PATCH core-updates] utils: Add helper method to invoke programs. Resent-Message-ID: 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 From: Danny Milosavljevic Date: Thu, 1 Jun 2017 09:22:07 +0200 Message-Id: <20170601072207.27718-1-dannym@scratchpost.org> 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: 27180@debbugs.gnu.org * 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.