diff mbox series

bug#47540: [PATCH] gnu: Add prips.

Message ID 87h7kbrd82.fsf_-_@gnu.org
State Accepted
Headers show
Series bug#47540: [PATCH] gnu: Add prips. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job

Commit Message

Ludovic Courtès April 12, 2021, 10:47 a.m. UTC
Hi,

david larsson <david.larsson@selfhosted.xyz> skribis:

> From 85cf7b9d22801d9b3bac8956b358fce4c32dcb4c Mon Sep 17 00:00:00 2001
> From: methuselah-0 <david.larsson@selfhosted.xyz>
> Date: Thu, 8 Apr 2021 21:26:23 +0200
> Subject: [PATCH] gnu: Add prips.
>
> gnu/packages/admin.scm (prips): New variable.

[...]

> +                  (replace 'install
> +                    (lambda _
> +                      (let*
> +                          ((bin-dir  (string-append %output "/bin"))
> +                           (bin-file (string-append bin-dir "/prips")))
> +                        (mkdir-p bin-dir)
> +                        (copy-file "prips" bin-file)
> +                        (chmod bin-file #o600)))))))

That installed a non-executable file.  I fixed this with the patch
below, which also make the style more consistent.

Thanks David, and thanks Maxime for the review!

Ludo’.
diff mbox series

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index f3e8774b75..512ac320e6 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1070,13 +1070,10 @@  recursive runs on the generated subnets.  (also IPv6)
        #:phases (modify-phases %standard-phases
                   (delete 'configure)
                   (replace 'install
-                    (lambda _
-                      (let*
-                          ((bin-dir  (string-append %output "/bin"))
-                           (bin-file (string-append bin-dir "/prips")))
-                        (mkdir-p bin-dir)
-                        (copy-file "prips" bin-file)
-                        (chmod bin-file #o600)))))))
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (install-file "prips"
+                                      (string-append out "/bin"))))))))
     (native-inputs `(("perl-test-harness" ,perl-test-harness)))
     (synopsis "Tool that prints the IP addresses in a given range")
     (description "Prips can be used to print all of the IP addresses in