From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCkg-0004Hh-6D for guix-patches@gnu.org; Tue, 22 Aug 2017 13:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCkc-00037e-3f for guix-patches@gnu.org; Tue, 22 Aug 2017 13:14:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41123) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dkCkb-00037P-Vw for guix-patches@gnu.org; Tue, 22 Aug 2017 13:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dkCkb-0002gY-QT for guix-patches@gnu.org; Tue, 22 Aug 2017 13:14:01 -0400 Subject: [bug#28185] [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39630) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjm-00042l-7r for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkCji-0002W1-5M for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:10 -0400 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:48046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkCjh-0002VS-S3 for guix-patches@gnu.org; Tue, 22 Aug 2017 13:13:06 -0400 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 72AC113D23A for ; Tue, 22 Aug 2017 18:13:03 +0100 (BST) Received: from localhost.localdomain (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id f075fbfd for ; Tue, 22 Aug 2017 17:13:03 +0000 (UTC) From: Christopher Baines Date: Tue, 22 Aug 2017 18:13:03 +0100 Message-Id: <20170822171303.21754-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 28185@debbugs.gnu.org Modify the install phase to detect when nothing has been installed, and error if this happens. This is preferable to continuing, and allowing the next phase to fail. Also, when nothing can be found to be installed, print out each file that was considered, along with the regular expressions that were used to include and exclude it. * gnu/build/emacs-build-system.scm (install-file?): Add additional error checking and logging. --- guix/build/emacs-build-system.scm | 45 ++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index bda699ddf..d67d7b49c 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -110,22 +110,41 @@ store in '.el' files." (define source (getcwd)) - (define (install-file? file stat) - (let ((stripped-file (string-trim (string-drop file (string-length source)) #\/))) - (and (any (cut string-match <> stripped-file) include) - (not (any (cut string-match <> stripped-file) exclude))))) + (define* (install-file? file stat #:key verbose?) + (let* ((stripped-file (string-trim + (string-drop file (string-length source)) #\/))) + (define (match-stripped-file action regex) + (let ((result (string-match regex stripped-file))) + (if (and result verbose?) + (format #t "info: ~A ~A as it matches \"~A\"\n" + stripped-file action regex)) + result)) + + (if verbose? + (format #t "info: considering installing ~A\n" stripped-file)) + + (and (any (cut match-stripped-file "included" <>) include) + (not (any (cut match-stripped-file "excluded" <>) exclude))))) (let* ((out (assoc-ref outputs "out")) (elpa-name-ver (store-directory->elpa-name-version out)) - (target-directory (string-append out %install-suffix "/" elpa-name-ver))) - (for-each - (lambda (file) - (let* ((stripped-file (string-drop file (string-length source))) - (target-file (string-append target-directory stripped-file))) - (format #t "`~a' -> `~a'~%" file target-file) - (install-file file (dirname target-file)))) - (find-files source install-file?))) - #t) + (target-directory (string-append out %install-suffix "/" elpa-name-ver)) + (files-to-install (find-files source install-file?))) + (if (null? files-to-install) + (begin + (format #t "error: No files found to install.\n") + (find-files source (lambda (file stat) + (install-file? file stat #:verbose? #t))) + #f) + (begin + (for-each + (lambda (file) + (let* ((stripped-file (string-drop file (string-length source))) + (target-file (string-append target-directory stripped-file))) + (format #t "`~a' -> `~a'~%" file target-file) + (install-file file (dirname target-file)))) + files-to-install) + #t)))) (define* (move-doc #:key outputs #:allow-other-keys) "Move info files from the ELPA package directory to the info directory." -- 2.13.1