From patchwork Sat May 4 22:37:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QmrDtnJuIEjDtmZsaW5n?= X-Patchwork-Id: 13894 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BD3C216F9C; Sat, 4 May 2019 23:38:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 2A17F16F99 for ; Sat, 4 May 2019 23:38:08 +0100 (BST) Received: from localhost ([127.0.0.1]:33622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hN3IF-0003bG-Pk for patchwork@mira.cbaines.net; Sat, 04 May 2019 18:38:07 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#35570] [PATCH 1/8] gnu: ant-build-system: Don't override symlinks. Resent-From: =?utf-8?b?QmrDtnJuIEjDtmZsaW5n?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 May 2019 22:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35570 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 35570@debbugs.gnu.org Received: via spool by 35570-submit@debbugs.gnu.org id=B35570.155700944028825 (code B ref 35570); Sat, 04 May 2019 22:38:01 +0000 Received: (at 35570) by debbugs.gnu.org; 4 May 2019 22:37:20 +0000 Received: from localhost ([127.0.0.1]:52575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN3HT-0007Uq-KJ for submit@debbugs.gnu.org; Sat, 04 May 2019 18:37:19 -0400 Received: from m4s11.vlinux.de ([83.151.27.109]:57026 helo=bjoernhoefling.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hN3HS-0007Uj-Dt for 35570@debbugs.gnu.org; Sat, 04 May 2019 18:37:18 -0400 Received: from alma-ubu (p508AC174.dip0.t-ipconnect.de [80.138.193.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bjoernhoefling.de (Postfix) with ESMTPSA id 8C7533F85A for <35570@debbugs.gnu.org>; Sun, 5 May 2019 00:37:17 +0200 (CEST) Date: Sun, 5 May 2019 00:37:16 +0200 From: =?utf-8?b?QmrDtnJuIEjDtmZsaW5n?= Message-ID: <20190505003716.4a38433e@alma-ubu> In-Reply-To: <20190505003450.3bc9058a@alma-ubu> References: <20190505003450.3bc9058a@alma-ubu> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 procedure. (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 © 2016, 2018 Ricardo Wurmus +;;; Copyright © 2019 Björn Höfling ;;; ;;; 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))) +(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 wraps 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) @@ -222,7 +232,8 @@ repack them. This is necessary to ensure that archives are reproducible." (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)