From mboxrd@z Thu Jan 1 00:00:00 1970 From: nee Subject: bug#28602: [PATCH] guix: gnu-build-system: warn about missing unzip input unzip Date: Mon, 9 Oct 2017 23:00:29 +0200 Message-ID: <7075db45-09ad-f2d7-1bd4-27f2c9755a42@cock.li> References: <2c2ccbd7-bb47-5292-74d9-e4c7fdc2c990@cock.li> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E2723A09A93805169AB0EC89" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1fAh-0003Yw-Q0 for bug-guix@gnu.org; Mon, 09 Oct 2017 17:01:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1fAd-0001qZ-SW for bug-guix@gnu.org; Mon, 09 Oct 2017 17:01:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:50021) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1fAd-0001qG-GT for bug-guix@gnu.org; Mon, 09 Oct 2017 17:01:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e1fAc-0000H5-R4 for bug-guix@gnu.org; Mon, 09 Oct 2017 17:01:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <2c2ccbd7-bb47-5292-74d9-e4c7fdc2c990@cock.li> Content-Language: en-GB List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 28602@debbugs.gnu.org This is a multi-part message in MIME format. --------------E2723A09A93805169AB0EC89 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hello here is a patch to fix this bug. It changes the gnu-build-system, so the hashes of almost all packages will also change. I guess core-updates is the right branch for this. --------------E2723A09A93805169AB0EC89 Content-Type: text/x-patch; name="0001-guix-gnu-build-system-warn-about-missing-unzip-input.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-guix-gnu-build-system-warn-about-missing-unzip-input.pa"; filename*1="tch" >From 089b9741a734f0682a671df6c0c36dfefcbd407c Mon Sep 17 00:00:00 2001 From: nee Date: Mon, 9 Oct 2017 22:49:12 +0200 Subject: [PATCH] guix: gnu-build-system: warn about missing unzip input during unpack. --- guix/build/gnu-build-system.scm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index e37b75140..c16d15964 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -67,6 +67,21 @@ See https://reproducible-builds.org/specs/source-date-epoch/." #f dir)) +(define (unzip filepath) + "Unzip archive file. +Warn the user when unzip fails and the executable is not present." + (define exit-code (system* "unzip" filepath)) + (define program-not-found-code 32512) + (cond ((zero? exit-code) #t) + ((eqv? exit-code program-not-found-code) + (format (current-error-port) + "warning: Archive with .zip suffix failed to unpack. +Please add unzip as native-input to the package, +e.g. (native-inputs `((\"unzip\" ,unzip)))") + (newline (current-error-port)) + #f) + (else #f))) + (define* (set-paths #:key target inputs native-inputs (search-paths '()) (native-search-paths '()) #:allow-other-keys) @@ -154,7 +169,7 @@ working directory." #:keep-mtime? #t) #t) (and (if (string-suffix? ".zip" source) - (zero? (system* "unzip" source)) + (unzip source) (zero? (system* "tar" "xvf" source))) (chdir (first-subdirectory "."))))) -- 2.14.1 --------------E2723A09A93805169AB0EC89--