unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob e4fd8f649e1aa935595ee9b2dbc09f8161addc72 2362 bytes (raw)
name: gnu/packages/patches/dhclient-script-resolvconf-support.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
 
Implement resolvconf support

Due to the potential for multiple sources contenting for /etc/resol.conf
control, this patch replaces direct file munging with resolvconf indirection.

--- a/client/scripts/linux	1970-01-01 09:00:01.000000000 +0900
+++ b/client/scripts/linux	1970-01-01 09:00:01.000000000 +0900
@@ -36,11 +36,11 @@
 # This updated version mostly follows Debian script by Andrew Pollock et al.
 make_resolv_conf() {
     local new_resolv_conf
+    new_resolv_conf=$(mktemp)
 
     # DHCPv4
     if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] ||
-       [ -n "$new_domain_name_servers" ]; then
-        new_resolv_conf=/etc/resolv.conf.dhclient-new
+        [ -n "$new_domain_name_servers" ]; then
         rm -f $new_resolv_conf
 
         if [ -n "$new_domain_name" ]; then
@@ -70,17 +70,12 @@
                 echo nameserver $nameserver >>$new_resolv_conf
             done
         else # keep 'old' nameservers
-            sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
+            resolvconf -l "$interface.dhcp" | sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf
         fi
 
-	if [ -f /etc/resolv.conf ]; then
-	    chown --reference=/etc/resolv.conf $new_resolv_conf
-	    chmod --reference=/etc/resolv.conf $new_resolv_conf
-	fi
-        mv -f $new_resolv_conf /etc/resolv.conf
+        resolvconf -a "$interface.dhpc" <"$new_resolv_conf"
     # DHCPv6
     elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then
-        new_resolv_conf=/etc/resolv.conf.dhclient-new
         rm -f $new_resolv_conf
 
         if [ -n "$new_dhcp6_domain_search" ]; then
@@ -97,14 +92,10 @@
                 echo nameserver $nameserver >>$new_resolv_conf
             done
         else # keep 'old' nameservers
-            sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf
+            resolvconf -l "$interface.dhcp6" | sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf
         fi
 
-	if [ -f /etc/resolv.conf ]; then
-            chown --reference=/etc/resolv.conf $new_resolv_conf
-            chmod --reference=/etc/resolv.conf $new_resolv_conf
-	fi
-        mv -f $new_resolv_conf /etc/resolv.conf
+        resolvconf -a "$interface.dhpc6" <"$new_resolv_conf"
     fi
 }
 

debug log:

solving e4fd8f649e ...
found e4fd8f649e in https://yhetil.org/guix-patches/0085c46d51165168bc28ae8c10affab7@wilsonb.com/ ||
	https://yhetil.org/guix-patches/2PLKK1GND1Y65.3DPU3DJOTRHJH@wilsonb.com/

applying [1/1] https://yhetil.org/guix-patches/0085c46d51165168bc28ae8c10affab7@wilsonb.com/
diff --git a/gnu/packages/patches/dhclient-script-resolvconf-support.patch b/gnu/packages/patches/dhclient-script-resolvconf-support.patch
new file mode 100644
index 0000000000..e4fd8f649e

1:19: trailing whitespace.
 
1:26: trailing whitespace.
 
1:35: trailing whitespace.
 
1:46: trailing whitespace.
 
1:55: trailing whitespace.
 
Checking patch gnu/packages/patches/dhclient-script-resolvconf-support.patch...
Applied patch gnu/packages/patches/dhclient-script-resolvconf-support.patch cleanly.
warning: squelched 2 whitespace errors
warning: 7 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/2PLKK1GND1Y65.3DPU3DJOTRHJH@wilsonb.com/ for e4fd8f649e
index at:
100644 e4fd8f649e1aa935595ee9b2dbc09f8161addc72	gnu/packages/patches/dhclient-script-resolvconf-support.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).