guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: build-system/gnu: Add 'reset-gzip-timestamps' phase.


From: Ludovic Courtès
Subject: 03/03: build-system/gnu: Add 'reset-gzip-timestamps' phase.
Date: Thu, 26 Jan 2017 21:09:40 +0000 (UTC)

civodul pushed a commit to branch core-updates
in repository guix.

commit 1d636d63193b66f67fbd0f10315cd61818f132c1
Author: Ludovic Courtès <address@hidden>
Date:   Thu Jan 26 22:05:49 2017 +0100

    build-system/gnu: Add 'reset-gzip-timestamps' phase.
    
    * guix/build/gnu-build-system.scm (reset-gzip-timestamps): New
    procedure.
    (%standard-phases): Add it.
---
 guix/build/gnu-build-system.scm |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index a19d2a3..39ed1e4 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -482,6 +482,23 @@ and 'man/'.  This phase moves directories to the right 
place if needed."
      (for-each validate-output directories)))
   #t)
 
+(define* (reset-gzip-timestamps #:key outputs #:allow-other-keys)
+  "Reset embedded timestamps in gzip files found in OUTPUTS."
+  (define (process-directory directory)
+    (let ((files (find-files directory
+                             (lambda (file stat)
+                               (and (eq? 'regular (stat:type stat))
+                                    (or (string-suffix? ".gz" file)
+                                        (string-suffix? ".tgz" file))
+                                    (gzip-file? file)))
+                             #:stat lstat)))
+      (for-each reset-gzip-timestamp files)))
+
+  (match outputs
+    (((names . directories) ...)
+     (for-each process-directory directories)))
+  #t)
+
 (define* (compress-documentation #:key outputs
                                  (compress-documentation? #t)
                                  (documentation-compressor "gzip")
@@ -604,6 +621,7 @@ which cannot be found~%"
             validate-documentation-location
             delete-info-dir-file
             patch-dot-desktop-files
+            reset-gzip-timestamps
             compress-documentation)))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]