From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:57492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN3IC-0003ax-5L for guix-patches@gnu.org; Sat, 04 May 2019 18:38:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hN3IA-0005zC-EZ for guix-patches@gnu.org; Sat, 04 May 2019 18:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39031) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hN3I9-0005xw-PO for guix-patches@gnu.org; Sat, 04 May 2019 18:38:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hN3I9-0007Vr-LV for guix-patches@gnu.org; Sat, 04 May 2019 18:38:01 -0400 Subject: [bug#35570] [PATCH 1/8] gnu: ant-build-system: Don't override symlinks. Resent-Message-ID: Date: Sun, 5 May 2019 00:37:16 +0200 From: =?UTF-8?Q?Bj=C3=B6rn_?= =?UTF-8?Q?H=C3=B6fling?= Message-ID: <20190505003716.4a38433e@alma-ubu> In-Reply-To: <20190505003450.3bc9058a@alma-ubu> References: <20190505003450.3bc9058a@alma-ubu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/8+rBdrsrwAU6hBYWbtLjs=O"; protocol="application/pgp-signature" 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: 35570@debbugs.gnu.org --Sig_/8+rBdrsrwAU6hBYWbtLjs=O Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable When repacking jar-files, don't work on symlinks: Otherwise, they would be overridden with the repacked jar-file. * guix/build/ant-build-system.scm (regular-jar-file-predicate): New procedu= re. (generate-jar-indices, strip-jar-timestamps): Use it. --- guix/build/ant-build-system.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/guix/build/ant-build-system.scm b/guix/build/ant-build-system.= scm index d79a2d55ed..0fec06f497 100644 --- a/guix/build/ant-build-system.scm +++ b/guix/build/ant-build-system.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2016, 2018 Ricardo Wurmus +;;; Copyright =C2=A9 2019 Bj=C3=B6rn H=C3=B6fling ;;; ;;; This file is part of GNU Guix. ;;; @@ -171,6 +172,12 @@ to the default GNU unpack strategy." #:allow-other-keys) (apply invoke `("ant" ,build-target ,@make-flags))) =20 +(define (regular-jar-file-predicate file stat) + "Predicate returning true if FILE is ending on '.jar' +and STAT indicates it is a regular file." + (and ((file-name-predicate "\\.jar$") file stat) + (eq? 'regular (stat:type stat)))) + (define* (generate-jar-indices #:key outputs #:allow-other-keys) "Generate file \"META-INF/INDEX.LIST\". This file does not use word wra= ps and is preferred over \"META-INF/MANIFEST.MF\", which does use word wraps, @@ -181,7 +188,10 @@ dependencies of this jar file." (invoke "jar" "-i" jar)) (for-each (match-lambda ((output . directory) - (for-each generate-index (find-files directory "\\.jar$")))) + (for-each generate-index + (find-files + directory + regular-jar-file-predicate)))) outputs) #t) =20 @@ -222,7 +232,8 @@ repack them. This is necessary to ensure that archives= are reproducible." =20 (for-each (match-lambda ((output . directory) - (for-each repack-archive (find-files directory "\\.jar$")))) + (for-each repack-archive + (find-files directory regular-jar-file-predicate)= ))) outputs) #t) =20 --=20 2.21.0 --Sig_/8+rBdrsrwAU6hBYWbtLjs=O Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXM4UHAAKCRC/KGy2WT5f /XWUAJkBVwSPbEZrMcCQybfVzT5XJxJG9wCgr31aVylFUIotUJmfeu+CcweCBfA= =DhtJ -----END PGP SIGNATURE----- --Sig_/8+rBdrsrwAU6hBYWbtLjs=O--