aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-05-06 11:27:48 +0300
committerEfraim Flashner <efraim@flashner.co.il>2020-05-18 09:52:47 +0300
commit5b77e9ca14ff7fc74b849492e96353939f29664b (patch)
tree3e4ab0644f0bf1ea9af73d947809c533b3524ee4
parent843e77205162013b1001f0be898142309704e495 (diff)
downloadpatches-5b77e9ca14ff7fc74b849492e96353939f29664b.tar
patches-5b77e9ca14ff7fc74b849492e96353939f29664b.tar.gz
build: minify-build-system: Fail to install empty files.
* guix/build/minify-build-system.scm (install): Produce an error if the minified file is zero bytes.
-rw-r--r--guix/build/minify-build-system.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/build/minify-build-system.scm b/guix/build/minify-build-system.scm
index 563def88e9..92158a033f 100644
--- a/guix/build/minify-build-system.scm
+++ b/guix/build/minify-build-system.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -54,8 +55,12 @@
(let* ((out (assoc-ref outputs "out"))
(js (string-append out "/share/javascript/")))
(mkdir-p js)
- (for-each (cut install-file <> js)
- (find-files "guix/build" "\\.min\\.js$")))
+ (for-each
+ (lambda (file)
+ (if (not (zero? (stat:size (stat file))))
+ (install-file file js)
+ (error "File is empty: " file)))
+ (find-files "guix/build" "\\.min\\.js$")))
#t)
(define %standard-phases