unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: 02/02: gnu: certbot: Share python-acme's arguments.
       [not found] ` <20170408172502.6332922054@vcs0.savannah.gnu.org>
@ 2017-04-09 22:48   ` Marius Bakke
  2017-04-10 19:48     ` Leo Famulari
  0 siblings, 1 reply; 2+ messages in thread
From: Marius Bakke @ 2017-04-09 22:48 UTC (permalink / raw)
  To: Leo Famulari, guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 3541 bytes --]

Leo Famulari <leo@famulari.name> writes:

> lfam pushed a commit to branch master
> in repository guix.
>
> commit f26d6e4e9c5efbe060697f54456cfc9144350114
> Author: Leo Famulari <leo@famulari.name>
> Date:   Sat Apr 8 12:45:16 2017 -0400
>
>     gnu: certbot: Share python-acme's arguments.
>     
>     * gnu/packages/tls.scm (certbot)[arguments]: Use substitute-keyword-arguments to
>     inherit from python-acme.
> ---
>  gnu/packages/tls.scm | 39 +++++++++++++++------------------------
>  1 file changed, 15 insertions(+), 24 deletions(-)
>
> diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
> index ac5e406..08cc607 100644
> --- a/gnu/packages/tls.scm
> +++ b/gnu/packages/tls.scm
> @@ -478,8 +478,6 @@ security, and applying best practice development processes.")
>          "05cqadwzgfcianw3v0qxwja65dxnzw429f7dk8w0mnh21pib72bl"))))
>      (build-system python-build-system)
>  
> -    ;; TODO factorize the 'docs' phase and share arguments between python-acme
> -    ;; and certbot.
>      (arguments
>       `(#:phases
>         (modify-phases %standard-phases
> @@ -541,28 +539,21 @@ security, and applying best practice development processes.")
>      (build-system python-build-system)
>      (arguments
>       `(#:python ,python-2
> -       #:phases
> -       (modify-phases %standard-phases
> -         (add-after 'unpack 'patch-dependency
> -           ;; This module is part of the Python standard library, so we don't
> -           ;; need to use an external package.
> -           ;; https://github.com/certbot/certbot/pull/2249
> -           (lambda _
> -             (substitute* "setup.py"
> -               (("'argparse',") ""))
> -             #t))
> -         (add-after 'build 'docs
> -           (lambda* (#:key outputs #:allow-other-keys)
> -             (let* ((out (assoc-ref outputs "out"))
> -                    (man1 (string-append out "/share/man/man1"))
> -                    (man7 (string-append out "/share/man/man7"))
> -                    (info (string-append out "/info")))
> -               (and
> -                 (zero? (system* "make" "-C" "docs" "man" "info"))
> -                 (install-file "docs/_build/texinfo/Certbot.info" info)
> -                 (install-file "docs/_build/man/certbot.1" man1)
> -                 (install-file "docs/_build/man/certbot.7" man7)
> -                 #t)))))))
> +       ,@(substitute-keyword-arguments (package-arguments python-acme)
> +           ((#:phases phases)
> +            `(modify-phases ,phases
> +              (replace 'docs
> +                (lambda* (#:key outputs #:allow-other-keys)
> +                  (let* ((out (assoc-ref outputs "out"))
> +                         (man1 (string-append out "/share/man/man1"))
> +                         (man7 (string-append out "/share/man/man7"))
> +                         (info (string-append out "/info")))
> +                    (and
> +                      (zero? (system* "make" "-C" "docs" "man" "info"))
> +                      (install-file "docs/_build/texinfo/Certbot.info" info)
> +                      (install-file "docs/_build/man/certbot.1" man1)
> +                      (install-file "docs/_build/man/certbot.7" man7)
> +                      #t)))))))))

Not to pick on this patch, since this problem was present before..but:

"install-file" has an unspecified return value, so I don't think it's
safe to use in an "and" block. The attached patch should be more
correct. WDYT?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-certbot-python-acme-Build-documentation-in-separ.patch --]
[-- Type: text/x-patch, Size: 3246 bytes --]

From e3bd8d6df932986c35a2f8088c491eb6f89ee6d5 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Mon, 10 Apr 2017 00:26:45 +0200
Subject: [PATCH] gnu: certbot, python-acme: Build documentation in separate
 phase.

* gnu/packages/tls.scm (python-acme)[arguments]<:phases>: Add
'build-documentation' phase. Rename 'docs' phase to 'install-documentation'.
(certbot)[arguments]<:phases>: Adjust accordingly.
---
 gnu/packages/tls.scm | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
index 08cc6075b..7b7de01cb 100644
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -489,15 +489,17 @@ security, and applying best practice development processes.")
              (substitute* "setup.py"
                (("'argparse',") ""))
              #t))
-         (add-after 'build 'docs
+         (add-after 'build 'build-documentation
+           (lambda _
+             (zero? (system* "make" "-C" "docs" "man" "info"))))
+         (add-after 'install 'install-documentation
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (man (string-append out "/share/man/man1"))
                     (info (string-append out "/info")))
-               (and (zero? (system* "make" "-C" "docs" "man" "info"))
-                    (install-file "docs/_build/texinfo/acme-python.info" info)
-                    (install-file "docs/_build/man/acme-python.1" man)
-                    #t)))))))
+               (install-file "docs/_build/texinfo/acme-python.info" info)
+               (install-file "docs/_build/man/acme-python.1" man)
+               #t))))))
     ;; TODO: Add optional inputs for testing.
     (native-inputs
      `(("python-mock" ,python-mock)
@@ -542,18 +544,16 @@ security, and applying best practice development processes.")
        ,@(substitute-keyword-arguments (package-arguments python-acme)
            ((#:phases phases)
             `(modify-phases ,phases
-              (replace 'docs
+              (replace 'install-documentation
                 (lambda* (#:key outputs #:allow-other-keys)
                   (let* ((out (assoc-ref outputs "out"))
                          (man1 (string-append out "/share/man/man1"))
                          (man7 (string-append out "/share/man/man7"))
                          (info (string-append out "/info")))
-                    (and
-                      (zero? (system* "make" "-C" "docs" "man" "info"))
-                      (install-file "docs/_build/texinfo/Certbot.info" info)
-                      (install-file "docs/_build/man/certbot.1" man1)
-                      (install-file "docs/_build/man/certbot.7" man7)
-                      #t)))))))))
+                    (install-file "docs/_build/texinfo/Certbot.info" info)
+                    (install-file "docs/_build/man/certbot.1" man1)
+                    (install-file "docs/_build/man/certbot.7" man7)
+                    #t))))))))
     ;; TODO: Add optional inputs for testing.
     (native-inputs
      `(("python2-nose" ,python2-nose)
-- 
2.12.2


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: 02/02: gnu: certbot: Share python-acme's arguments.
  2017-04-09 22:48   ` 02/02: gnu: certbot: Share python-acme's arguments Marius Bakke
@ 2017-04-10 19:48     ` Leo Famulari
  0 siblings, 0 replies; 2+ messages in thread
From: Leo Famulari @ 2017-04-10 19:48 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 793 bytes --]

On Mon, Apr 10, 2017 at 12:48:27AM +0200, Marius Bakke wrote:
> Not to pick on this patch, since this problem was present before..but:
> 
> "install-file" has an unspecified return value, so I don't think it's
> safe to use in an "and" block. The attached patch should be more
> correct. WDYT?
> 

> From e3bd8d6df932986c35a2f8088c491eb6f89ee6d5 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Mon, 10 Apr 2017 00:26:45 +0200
> Subject: [PATCH] gnu: certbot, python-acme: Build documentation in separate
>  phase.
> 
> * gnu/packages/tls.scm (python-acme)[arguments]<:phases>: Add
> 'build-documentation' phase. Rename 'docs' phase to 'install-documentation'.
> (certbot)[arguments]<:phases>: Adjust accordingly.

LGTM, thanks for being picky :)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-10 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20170408172501.10323.59373@vcs0.savannah.gnu.org>
     [not found] ` <20170408172502.6332922054@vcs0.savannah.gnu.org>
2017-04-09 22:48   ` 02/02: gnu: certbot: Share python-acme's arguments Marius Bakke
2017-04-10 19:48     ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).