Subject: bug#52009: closed (Re: bug#52009: [PATCH core-updates-frozen] openresolv: Wrap it.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 22 Nov 2021 22:40:01 +0000

Your bug report

#52009: [PATCH core-updates-frozen] openresolv: Wrap it.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
52009: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52009
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#52009: [PATCH core-updates-frozen] openresolv: Wrap it.
From: Ludovic Courtès <[email-masked]>
To: Vivien Kraus <[email-masked]>
Cc: [email-masked]
Date: Mon, 22 Nov 2021 23:39:25 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Vivien Kraus <[email-masked]> skribis:

>>>From 8b26dda4284de0c3db8aa40c5d9ddd6130ded590 Mon Sep 17 00:00:00 2001
> From: Vivien Kraus <[email-masked]>
> Date: Sat, 20 Nov 2021 23:48:17 +0100
> Subject: [PATCH] gnu: openresolv: Wrap resolvconf.
>
> * gnu/packages/dns.scm (openresolv) [phases]: Wrap resolvconf to set PATH, for
> coreutils programs mkdir and rm.
> * gnu/packages/dns.scm (openresolv) [inputs]: Add coreutils, and bash-minimal
> to run the wrapper and the wrapped script.

That was fast!  Applied without “bash-minimal” (it’s no longer needed.)

Thanks!

Ludo’.

Subject: [PATCH core-updates-frozen] openresolv: Wrap it.
From: Vivien Kraus <[email-masked]>
To: [email-masked]
Date: Sun, 21 Nov 2021 00:04:49 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Dear guix,

When I boot my system on core-updates-frozen, I get an error message:

/gnu/store/xxx-openresolv-3.12.0/sbin/resolvconf: line 824: mkdir: command not found
Failed to create needed directory /var/run/resolvconf

I didn’t experience any DNS issue, but my network is simple on that
machine. In any case, I think it would do no harm to wrap resolvconf to
set its path to the coreutils so that it can find mkdir and rm. I didn’t
find resolvconf to invoke any other program.

What do you think?

Best regards,

Vivien

From 426c613e226b5c7e041d6a8476c09abfeffe151c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <[email-masked]>
Date: Sat, 20 Nov 2021 23:48:17 +0100
Subject: [PATCH] gnu: openresolv: Wrap resolvconf.

* gnu/packages/dns.scm (openresolv) [phases]: Wrap resolvconf to set PATH, for
coreutils programs mkdir and rm.
* gnu/packages/dns.scm (openresolv) [inputs]: Add coreutils, and bash-minimal
to run the wrapper and the wrapped script.
---
 gnu/packages/dns.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm
index b289aa999e..55c6c0d82d 100644
--- a/gnu/packages/dns.scm
+++ b/gnu/packages/dns.scm
@@ -1417,7 +1417,18 @@ (define-public openresolv
        #:configure-flags
        (list (string-append "--sysconfdir=/etc"))
        #:make-flags
-       (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))))
+       (list (string-append "SYSCONFDIR=/" (assoc-ref %outputs "out") "/etc"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'wrap-program
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (coreutils (assoc-ref inputs "coreutils")))
+               (wrap-program (string-append out "/sbin/resolvconf")
+                 `("PATH" ":" = (,(string-append coreutils "/bin"))))))))))
+    (inputs
+     `(("bash-minimal" ,bash-minimal)
+       ("coreutils" ,coreutils)))
     (home-page "https://roy.marples.name/projects/openresolv/")
     (synopsis "Resolvconf POSIX compliant implementation, a middleman for resolv.conf")
     (description "openresolv is an implementation of @command{resolvconf}, the
-- 
2.34.0