guix-commits
[Top][All Lists]
Advanced

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

01/02: pack: Use maximum compression; use '-n' for gzip.


From: Ludovic Courtès
Subject: 01/02: pack: Use maximum compression; use '-n' for gzip.
Date: Tue, 14 Mar 2017 18:18:40 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 36f213fb704b96856d037df26e8e125aeb08edf2
Author: Ludovic Courtès <address@hidden>
Date:   Tue Mar 14 21:31:10 2017 +0100

    pack: Use maximum compression; use '-n' for gzip.
    
    * guix/scripts/pack.scm (<compressor>)[tar-option]: Remove.
    [command]: New field.
    (%compressors): Provide complete commands.  Use '-9' or equivalent for
    each compressor; use '-n' for gzip.
    (self-contained-tarball)[build]: Adjust accordingly.
---
 guix/scripts/pack.scm | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 7a0e54d..c3d85c5 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -43,20 +43,19 @@
 
 ;; Type of a compression tool.
 (define-record-type <compressor>
-  (compressor name package extension tar-option)
+  (compressor name package extension command)
   compressor?
   (name       compressor-name)                    ;string (e.g., "gzip")
   (package    compressor-package)                 ;package
   (extension  compressor-extension)               ;string (e.g., "lz")
-  (tar-option compressor-tar-option))             ;string (e.g., "--lzip")
+  (command    compressor-command))                ;list (e.g., '("gzip" "-9n"))
 
 (define %compressors
   ;; Available compression tools.
-  ;; FIXME: Use '--no-name' for gzip.
-  (list (compressor "gzip"  gzip  "gz"  "--gzip")
-        (compressor "lzip"  lzip  "lz"  "--lzip")
-        (compressor "xz"    xz    "xz"  "--xz")
-        (compressor "bzip2" bzip2 "bz2" "--bzip2")))
+  (list (compressor "gzip"  gzip  "gz"  '("gzip" "-9n"))
+        (compressor "lzip"  lzip  "lz"  '("lzip" "-9"))
+        (compressor "xz"    xz    "xz"  '("xz" "-e"))
+        (compressor "bzip2" bzip2 "bz2" '("bzip2" "-9"))))
 
 (define (lookup-compressor name)
   "Return the compressor object called NAME.  Error out if it could not be
@@ -130,7 +129,8 @@ added to the pack."
           ;; length limitation.
           (with-directory-excursion %root
             (exit
-             (zero? (apply system* "tar" #$(compressor-tar-option compressor)
+             (zero? (apply system* "tar"
+                           "-I" #$(string-join (compressor-command compressor))
                            "--format=gnu"
 
                            ;; Avoid non-determinism in the archive.  Use



reply via email to

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