From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dntCZ-0005Vf-82 for guix-patches@gnu.org; Fri, 01 Sep 2017 17:10:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dntCU-0001ux-91 for guix-patches@gnu.org; Fri, 01 Sep 2017 17:10:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:60217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dntCU-0001uX-5d for guix-patches@gnu.org; Fri, 01 Sep 2017 17:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dntCT-0000XN-WA for guix-patches@gnu.org; Fri, 01 Sep 2017 17:10:02 -0400 Subject: bug#28185: [PATCH] build: emacs-build-system: Make the install phase more helpful. Resent-To: guix-patches@gnu.org Resent-Message-ID: Date: Fri, 1 Sep 2017 22:08:55 +0100 From: Christopher Baines Message-ID: <20170901220855.65406f21@cbaines.net> In-Reply-To: References: <20170822171303.21754-1-mail@cbaines.net> <6f595802.AEMAPOK4d0UAAAAAAAAAAAPmDT4AAAACwQwAAAAAAAW9WABZpnJ1@mailjet.com> <20170831224136.7499acc1@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/Vpql4FI9ec0l/KMPR3ZOE5f"; protocol="application/pgp-signature" 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: Arun Isaac Cc: 28185-done@debbugs.gnu.org --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 01 Sep 2017 10:32:18 +0530 Arun Isaac wrote: > >> > + (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))) =20 > >> > >> I understand that the verbose output also shows the regexp due to > >> which the file was excluded, and that has debugging value. But, > >> perhaps, it'll be better to just print that here instead of a call > >> back to `install-file?'. > >> > >> WDYT? =20 > > > > I put this in install-file? as I didn't want to duplicate the > > behaviour inside the function, firstly to avoid duplication, but > > also to avoid the possiblily that if they were duplicated, they > > would diverge in behaviour. I'm happy to experiment with splitting > > the "verbose" output out of install-file though? =20 >=20 > Yes, I meant that you should split the verbose output out of > `install-file?'. But, it's not a big deal. I'm only nitpicking. Do go > ahead with your original code if you think it's alright. >=20 > >> > + #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)))) =20 > >> > >> Could you please rewrite this section using `cond' instead of `if'? > >> That way, we can get rid of the `begin'. Also, it might be better > >> if we used "positive logic" -- meaning, we first check for > >> truthiness of `files-to-install' instead of checking for (null? > >> files-to-install). Then, the else statement would take care of the > >> empty files-to-install case, and we would never have to call > >> `null?' explicitly. =20 > > > > I tried this, but it seems that cond will treat '() as if it > > evaluates to true: > > > > scheme@(guile-user)> (cond ('() #t) (else #f)) > > $1 =3D #t > > > > So this might need to still use null?, or even (not (null? > > files-to-install))? =20 >=20 > Ah, yes. Sorry, I'm confusing scheme's behaviour with that of other > lisps. We still need `null?'. >=20 > The patch LGTM. Great, I've pushed this now :) --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmpzGdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xc1HRAAgajG18yg5LDVdQqaFRuoT/ZfrcCSdo5Af8+3MHWFfvhVbGyxzAJJbpyg CMDThMCw/C42T4OfDQy4XNvHl2ZvD14W54mxqQDKFb+hC4TOXfkNtw/XqczI1HOK Q7+nE+St7E2vuOhDNHPTPnSQX0UNiGfHYhmxbhXwyk3SYSnPCe5ehFYuvS0+ugZr aadVhl2xUQk15Bcg59TgRVKgitQwiYE4DnSaiUmua1eL6eQMGEiCrMvlAI5T5Pr5 qNfZQgL2lVXqtyzPU4eiIhG0jycAHxVd3YaOO/dB3h7lfQHKh4WmXOdl9/vwyOcy QswbyDJMNcXjNZrvGbuix5Fx5w5n0gxz0wCqiz02TBvAakmEGqSU2MvHOFqNl1kI Z8TDS2O6zqi9kiOsmkrCBNQ61nAKXvwR12QIcusupGwtvpEFcUPQ+0bbDskNIBph 6JOrrr8WDPM5B2uT5YePKu7cnH0QZmKzR5RB9cmMwMudhD0TQmW1t4NWCsDMOOsW CbzYoOsa3QbnR6119xAVAyxhx1Cr0cHtQh5AmkR+b/PBUizCHDTBGx12yiXVjfTm N496N5D8blh6ceroJV1BSYJJ9NcgGPyRZkiuhMq7sKPloYHQy3ZSzZy4tIMuzhXe E1PIwT3c++rROH6WTCGgptjqV4Fyv1top4LIagaAdQDlcFHj91s= =grNb -----END PGP SIGNATURE----- --Sig_/Vpql4FI9ec0l/KMPR3ZOE5f--