From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:47244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmF46-0002FU-43 for guix-patches@gnu.org; Wed, 23 Jan 2019 04:43:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmErD-0000ae-8m for guix-patches@gnu.org; Wed, 23 Jan 2019 04:30:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42739) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmErC-0000ZO-R2 for guix-patches@gnu.org; Wed, 23 Jan 2019 04:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gmErC-0006vY-F1 for guix-patches@gnu.org; Wed, 23 Jan 2019 04:30: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> From: Ricardo Wurmus In-reply-to: <20190122220928.17927-1-mail@cbaines.net> Date: Wed, 23 Jan 2019 10:28:53 +0100 Message-ID: <87imyf7mei.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Christopher Baines Cc: 33185@debbugs.gnu.org Hi Chris, thanks for the patch! > * 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)) > + (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 no= t all obvious (e.g. why =E2=80=9Clib=E2=80=9D is copied to =E2=80=9Cdocs=E2=80=9D). > + (simple-format #t "replacing template pwclient symlink") Use =E2=80=9Cdisplay=E2=80=9D instead of =E2=80=9Csimple-format #t=E2=80=9D? > + (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. > + ;; Create a patchwork specific version of Django's command line= 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/patchwork= -admin") > + (lambda (port) > + (display "#!/usr/bin/env python3 Should this really say =E2=80=9C#!/usr/bin/env python3=E2=80=9D? -- Ricardo