From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:33846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn8f0-0002ws-EB for guix-patches@gnu.org; Fri, 25 Jan 2019 16:05:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gn8et-00058A-Cg for guix-patches@gnu.org; Fri, 25 Jan 2019 16:05:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46336) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gn8es-00057Q-Om for guix-patches@gnu.org; Fri, 25 Jan 2019 16:05:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gn8es-0008Qo-En for guix-patches@gnu.org; Fri, 25 Jan 2019 16:05:02 -0500 Subject: [bug#33185] [PATCH v2 1/2] gnu: Add patchwork. Resent-Message-ID: References: <87y3aie8a1.fsf@cbaines.net> <20190122220928.17927-1-mail@cbaines.net> <87imyf7mei.fsf@elephly.net> From: Christopher Baines In-reply-to: <87imyf7mei.fsf@elephly.net> Date: Fri, 25 Jan 2019 21:04:46 +0000 Message-ID: <875zucih3l.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; 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: Ricardo Wurmus Cc: 33185@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ricardo Wurmus writes: > Hi Chris, > > thanks for the patch! And thanks for your feedback :) I've sent some updated patches. >> * gnu/packages/patchutils.scm (patchwork): New variable. > [=E2=80=A6] >> + (replace 'check >> + (lambda* (#:key tests? #:allow-other-keys) >> + (or (not tests?) >> + (begin >> + (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings= .dev") >> + (invoke >> + "python" "-Wonce" "./manage.py" "test" "--noinput") >> + #t)))) > > Maybe write this as > > (replace 'check > (lambda* (#:key tests? #:allow-other-keys) > (when tests? > (setenv "DJANGO_SETTINGS_MODULE" "patchwork.settings.dev") > (invoke > "python" "-Wonce" "./manage.py" "test" "--noinput")) > #t)) Yep, I've updated it to use when now. >> + (replace 'install >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let ((out (assoc-ref outputs "out"))) [=E2=80=A6] > > This phase might be less verbose if you let-bound the result of > (site-packages inputs outputs) at the beginning. It would also be good > if there were more comments about what=E2=80=99s going on. It=E2=80=99s = not all obvious > (e.g. why =E2=80=9Clib=E2=80=9D is copied to =E2=80=9Cdocs=E2=80=9D). I've used let more now, and tried to be a bit more descriptive in the comments. I'll reconfigure the patchwork instances I host at some point and hopefully add more detail then. >> + (simple-format #t "replacing template pwclient symlink") > > Use =E2=80=9Cdisplay=E2=80=9D instead of =E2=80=9Csimple-format #t=E2=80= =9D? That was just a debugging thing, I've removed it. >> + (add-after 'install 'install-hasher >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out"))) >> + (chmod (string-append (site-packages inputs outputs) >> + "/patchwork/hasher.py") >> + #o555) >> + (symlink (string-append (site-packages inputs outputs) >> + "/patchwork/hasher.py") >> + (string-append out "/bin/hasher"))) >> + #t)) > > Here also consider simplifying with let. Yep, I've used let here more now. >> + ;; Create a patchwork specific version of Django's command lin= e admin >> + ;; utility. >> + (add-after 'install 'install-patchwork-admin >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out"))) >> + (mkdir-p (string-append out "/bin")) >> + (call-with-output-file (string-append out "/bin/patchwor= k-admin") >> + (lambda (port) >> + (display "#!/usr/bin/env python3 > > Should this really say =E2=80=9C#!/usr/bin/env python3=E2=80=9D? So this was fine, as it was replaced in a future stage. But yes, it's probably better to use a more appropriate value that isn't changed later on. I've updated this now. So yes, I've sent some updated patches, still a few niggles, but they're getting better. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlxLee5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XejxA//WEE1AuWYyVTmFva7uny4cMHWlTQy43SvXsDSRSdJNqEup0QaNBn9SMb4 STPp++qcMngul5FhrvCOaUNxJ4OfSHUkPvlVC/mOqsek9h5dOTTzaBoIhLg9QA0I ZpFe+ZPq7Td6BPhlk0G6eZNIGL3UASSOAjMEFp3Y5dLHAtdjGx2DaI2p8R8cIBAf 9mwKrUjApdLcXtsoW5PXLlb0pQgqaCB3r/brXDQGJV57Okwvw3P0HllL+Z0YiUtd PZEax2ZlHnyfvO9Abyf+wxex/UU4enBbFdmUoCeU3hsjahovOowiUiaJ9MWTNN2d OHQ3KNfCVDsVqtryEd67zPnXClyDwX7iSuF3XytWz+PvmL5zd1r/K6nYe3TN2sto 8w14M4DqhI4tDmN5MOd5aBx44R3jfla9hFBcfGjPDnEr8StJmalkDz0WfW3IzYZO VhAC0hfJNDImPM6s5TtqWUcN+kdhgzGtSHE8H5wMYUFYGfm5P0P28Hh6Bda8eEEu T8Db7QxL7jtdkZn3SHdYaU4I8nAhjH05HDRGyTIlZlsn5Mv1Z2wufyDYWj6GsePH PJ3cwuulOpt+Z7+c5jY7xhjv5YXEaVcfdo0s+gkRQi33lHidUszYGwtpj8hl4T8B kr2oPVmI2MKfJqbpUJOnEYxBOEVGvIduqwuqIR7t3M73tZOSOUk= =V/28 -----END PGP SIGNATURE----- --=-=-=--