GNU bug report logs - #68675
[PATCH] Support dhcpcd in dhcp-client-service-type

Previous Next

Package: guix-patches;

Reported by: soeren <at> soeren-tempel.net

Date: Tue, 23 Jan 2024 16:14:01 UTC

Severity: normal

Tags: patch

Done: Sören Tempel <soeren <at> soeren-tempel.net>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 68675 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: soeren <at> soeren-tempel.net
Cc: 68675 <at> debbugs.gnu.org
Subject: Re: [bug#68675] [PATCH v2] gnu: Add dhcpcd.
Date: Mon, 12 Feb 2024 22:32:52 +0100
Hi,

soeren <at> soeren-tempel.net skribis:

> From: Sören Tempel <soeren <at> soeren-tempel.net>
>
> * gnu/packages/admin.scm (dhcpcd): new procedure.
>
> Signed-off-by: Sören Tempel <soeren <at> soeren-tempel.net>

Overall LGTM modulo minor stylistic issues:

> +      #:configure-flags #~(list "--enable-ipv6"
> +                                "--enable-privsep"
> +                                "--privsepuser=dhcpcd"
> +                                (string-append "--dbdir=" "/var/db/dhcpcd")
> +                                (string-append "--rundir=" "/var/run/dhcpcd")
> +                                "CC=gcc")

Should be (string-append "CC=" #$(cc-for-target)).

> +                   (add-before 'build 'setenv
> +                     (lambda _
> +                       (setenv "HOST_SH"
> +                               (string-append #$bash-minimal "/bin/sh"))))

Rather (setenv "HOST_SH" (which "sh")).

That way users can still override the shell used by the package.

> +                   (add-after 'install 'wrap-hooks
> +                     (lambda* (#:key inputs outputs #:allow-other-keys)
> +                       (let* ((out (assoc-ref outputs "out"))
> +                              (libexec (string-append out "/libexec"))
> +                              (sed (assoc-ref inputs "sed"))
> +                              (coreutils (assoc-ref inputs "coreutils")))

Rather (search-input-file inputs "/bin/sed") and likewise for coreutils,
and then…

> +                         (wrap-program (string-append libexec
> +                                                      "/dhcpcd-run-hooks")
> +                           `("PATH" ":" suffix
> +                             (,(string-append coreutils "/bin")
> +                              ,(string-append sed "/bin"))))))))))

… use (dirname sed) and (dirname ls), say, to get their /bin directory.

This is more robust than relying on the input label.

Ludo’.




This bug report was last modified 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.