Patchwork [1/1] gnu: borg: Install more documentation.

login
register
mail settings
Submitter Leo Famulari
Date Oct. 18, 2016, 3:03 a.m.
Message ID <3cd4136ec4d14a25c803d2dbf2e0262d37a3dc8e.1476759536.git.leo@famulari.name>
Download mbox | patch
Permalink /patch/16607/
State New
Headers show

Comments

Leo Famulari - Oct. 18, 2016, 3:03 a.m.
* gnu/packages/backup.scm (borg)[arguments]: Install more documentation
in 'install-doc' phase.
---
 gnu/packages/backup.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
Ricardo Wurmus - Oct. 18, 2016, 7:19 a.m.
Leo Famulari <leo@famulari.name> writes:

> * gnu/packages/backup.scm (borg)[arguments]: Install more documentation
> in 'install-doc' phase.
> ---
>  gnu/packages/backup.scm | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
> index eb5e98d..b75e99b 100644
> --- a/gnu/packages/backup.scm
> +++ b/gnu/packages/backup.scm
> @@ -439,8 +439,15 @@ detection, and lossless compression.")
>           (add-after 'install 'install-doc
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let* ((out (assoc-ref outputs "out"))
> -                    (man (string-append out "/share/man/man1")))
> +                    (man (string-append out "/share/man/man1"))
> +                    (misc (string-append out "/share/borg/misc")))
>                 (and
> +                 (for-each (lambda (file)
> +                             (install-file file misc))

I like “cut” from srfi-26 in simple cases like this:

    (for-each (cut install-file <> misc)
              (find-files …))

> +                           (find-files "docs/misc"
> +                                       (string-append "create_chunker-params|"
> +                                                      "internals-picture|"
> +                                                      "prune-example")))

I don’t think “string-append” is needed here.  You can just break the
string and escape the line break.

~~ Ricardo
Alex Kost - Oct. 18, 2016, 4:47 p.m.
Leo Famulari (2016-10-17 23:03 -0400) wrote:

> * gnu/packages/backup.scm (borg)[arguments]: Install more documentation
> in 'install-doc' phase.
> ---
>  gnu/packages/backup.scm | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
> index eb5e98d..b75e99b 100644
> --- a/gnu/packages/backup.scm
> +++ b/gnu/packages/backup.scm
> @@ -439,8 +439,15 @@ detection, and lossless compression.")
>           (add-after 'install 'install-doc
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let* ((out (assoc-ref outputs "out"))
> -                    (man (string-append out "/share/man/man1")))
> +                    (man (string-append out "/share/man/man1"))
> +                    (misc (string-append out "/share/borg/misc")))
>                 (and
> +                 (for-each (lambda (file)

Note that the return value of 'for-each' is not specified, so it should
not be used inside 'and'.  I would just put it before (and (zero? …) …).

> +                             (install-file file misc))
> +                           (find-files "docs/misc"
> +                                       (string-append "create_chunker-params|"
> +                                                      "internals-picture|"
> +                                                      "prune-example")))
>                   (zero? (system* "python3" "setup.py" "build_ext" "--inplace"))
>                   (zero? (system* "make" "-C" "docs" "man"))
>                   (begin
Leo Famulari - Oct. 19, 2016, 8:01 p.m.
On Tue, Oct 18, 2016 at 09:19:19AM +0200, Ricardo Wurmus wrote:
> 
> Leo Famulari <leo@famulari.name> writes:
> 
> > * gnu/packages/backup.scm (borg)[arguments]: Install more documentation
> > in 'install-doc' phase.
> > ---
> >  gnu/packages/backup.scm | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
> > index eb5e98d..b75e99b 100644
> > --- a/gnu/packages/backup.scm
> > +++ b/gnu/packages/backup.scm
> > @@ -439,8 +439,15 @@ detection, and lossless compression.")
> >           (add-after 'install 'install-doc
> >             (lambda* (#:key outputs #:allow-other-keys)
> >               (let* ((out (assoc-ref outputs "out"))
> > -                    (man (string-append out "/share/man/man1")))
> > +                    (man (string-append out "/share/man/man1"))
> > +                    (misc (string-append out "/share/borg/misc")))
> >                 (and
> > +                 (for-each (lambda (file)
> > +                             (install-file file misc))
> 
> I like “cut” from srfi-26 in simple cases like this:
> 
>     (for-each (cut install-file <> misc)
>               (find-files …))

Thanks, that is easier to read.

> > +                           (find-files "docs/misc"
> > +                                       (string-append "create_chunker-params|"
> > +                                                      "internals-picture|"
> > +                                                      "prune-example")))
> 
> I don’t think “string-append” is needed here.  You can just break the
> string and escape the line break.

I decided not to use a regex for this. It's only three files so I just
used a list.
Leo Famulari - Oct. 19, 2016, 8:01 p.m.
On Tue, Oct 18, 2016 at 07:47:53PM +0300, Alex Kost wrote:
> Leo Famulari (2016-10-17 23:03 -0400) wrote:
> 
> > * gnu/packages/backup.scm (borg)[arguments]: Install more documentation
> > in 'install-doc' phase.
> > ---
> >  gnu/packages/backup.scm | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
> > index eb5e98d..b75e99b 100644
> > --- a/gnu/packages/backup.scm
> > +++ b/gnu/packages/backup.scm
> > @@ -439,8 +439,15 @@ detection, and lossless compression.")
> >           (add-after 'install 'install-doc
> >             (lambda* (#:key outputs #:allow-other-keys)
> >               (let* ((out (assoc-ref outputs "out"))
> > -                    (man (string-append out "/share/man/man1")))
> > +                    (man (string-append out "/share/man/man1"))
> > +                    (misc (string-append out "/share/borg/misc")))
> >                 (and
> > +                 (for-each (lambda (file)
> 
> Note that the return value of 'for-each' is not specified, so it should
> not be used inside 'and'.  I would just put it before (and (zero? …) …).

Thanks, I've taken that into account.

Patch

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index eb5e98d..b75e99b 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -439,8 +439,15 @@  detection, and lossless compression.")
          (add-after 'install 'install-doc
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
-                    (man (string-append out "/share/man/man1")))
+                    (man (string-append out "/share/man/man1"))
+                    (misc (string-append out "/share/borg/misc")))
                (and
+                 (for-each (lambda (file)
+                             (install-file file misc))
+                           (find-files "docs/misc"
+                                       (string-append "create_chunker-params|"
+                                                      "internals-picture|"
+                                                      "prune-example")))
                  (zero? (system* "python3" "setup.py" "build_ext" "--inplace"))
                  (zero? (system* "make" "-C" "docs" "man"))
                  (begin