From 089b167812624cc69aac95d5a1b69688e3f97117 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 1 Aug 2016 17:42:09 +0200 Subject: publish: Do not compress already-compressed files. * guix/scripts/publish.scm (narinfo-string): Force %NO-COMPRESSION when STORE-PATH matches 'compressed-file?'. * guix/utils.scm (compressed-file?): New procedure. * tests/publish.scm ("/*.narinfo for a compressed file"): New test. --- guix/utils.scm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guix/utils.scm') diff --git a/guix/utils.scm b/guix/utils.scm index 9e1b8ead0a..c68094cf49 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -79,6 +79,7 @@ (define-module (guix utils) arguments-from-environment-variable file-extension file-sans-extension + compressed-file? switch-symlinks call-with-temporary-output-file call-with-temporary-directory @@ -551,6 +552,11 @@ (define (file-sans-extension file) (substring file 0 dot) file))) +(define (compressed-file? file) + "Return true if FILE denotes a compressed file." + (->bool (member (file-extension file) + '("gz" "bz2" "xz" "lz" "tgz" "tbz2" "zip")))) + (define (switch-symlinks link target) "Atomically switch LINK, a symbolic link, to point to TARGET. Works both when LINK already exists and when it does not." -- cgit v1.2.3