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. --- tests/publish.scm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/publish.scm') diff --git a/tests/publish.scm b/tests/publish.scm index 4dc807505c..7499553aeb 100644 --- a/tests/publish.scm +++ b/tests/publish.scm @@ -200,6 +200,20 @@ References: ~%" (_ #f))) (recutils->alist body))))) +(unless (zlib-available?) + (test-skip 1)) +(test-equal "/*.narinfo for a compressed file" + '("none" "nar") ;compression-less nar + ;; Assume 'guix publish -C' is already running on port 6799. + (let* ((item (add-text-to-store %store "fake.tar.gz" + "This is a fake compressed file.")) + (url (string-append "http://localhost:6799/" + (store-path-hash-part item) ".narinfo")) + (body (http-get-port url)) + (info (recutils->alist body))) + (list (assoc-ref info "Compression") + (dirname (assoc-ref info "URL"))))) + (test-equal "/nar/ with properly encoded '+' sign" "Congrats!" (let ((item (add-text-to-store %store "fake-gtk+" "Congrats!"))) -- cgit v1.2.3