GNU bug report logs - #35570
java-tomcat: Make it the full package

Previous Next

Package: guix-patches;

Reported by: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Date: Sat, 4 May 2019 22:36:02 UTC

Severity: normal

Done: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 35570 <at> debbugs.gnu.org (full text, mbox):

From: Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
To: 35570 <at> debbugs.gnu.org
Subject: [PATCH 1/8] gnu: ant-build-system: Don't override symlinks.
Date: Sun, 5 May 2019 00:37:16 +0200
[Message part 1 (text/plain, inline)]
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 <rekado <at> elephly.net>
+;;; Copyright © 2019 Björn Höfling <bjoern.hoefling <at> bjoernhoefling.de>
 ;;;
 ;;; 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)
 
-- 
2.21.0

[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 5 years and 226 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.