[Lunar-commits] <moonbase-other> resolvconf: rewrite and fix this stupid package

v4hn me at v4hn.de
Fri Aug 24 15:37:14 CEST 2012


commit 8ba54b205f37859b54325ef8786f2373162c3cb6
Author: v4hn <me at v4hn.de>
Date: Fri, 24 Aug 2012 06:37:14 -0700
URL: https://github.com/lunar-linux/moonbase-other/commit/8ba54b205f37859b54325ef8786f2373162c3cb6

resolvconf: rewrite and fix this stupid package
---
  utils/resolvconf/BUILD                                       +20/-1    
  utils/resolvconf/POST_INSTALL                                +8/-0     
  utils/resolvconf/PRE_REMOVE                                  +10/-0    
  utils/resolvconf/tmpfiles.d/resolvconf.conf                  +3/-0     
  4 files changed, 41 insertions (+), 1 deletions (-)

--- a/utils/resolvconf/BUILD
+++ b/utils/resolvconf/BUILD
@@ -1,8 +1,27 @@
 (
 
+  # move the package to /usr
+  sedit "s@\(PATH=.*\)@\1:/usr/bin@" bin/resolvconf &&
+  sedit "s@\(PATH=/sbin:/bin\)@\1:/usr/bin@" etc/resolvconf/update.d/libc &&
+  sedit "s@\(/lib/resolvconf/list-records\)@/usr\1@" etc/resolvconf/update.d/* &&
+
   prepare_install &&
-  install -m755 bin/resolvconf bin/list-records /bin/ &&
+
+  install -Dm0755 bin/resolvconf /usr/bin/ &&
+  install -Dm0755 bin/list-records /usr/lib/resolvconf/list-records &&
+
   cp -rv etc/resolvconf /etc/ &&
+  ln -sf /run/resolvconf/ /etc/resolvconf/run &&
+
+  # backup original resolv.conf
+  if [ ! -e /etc/resolv.conf ] || [ ! -L /etc/resolv.conf ]; then
+     if [ -e /etc/resolv.conf ]; then
+        mv /etc/resolv.conf /etc/resolvconf/resolv.conf.d/original
+     fi &&
+     # /etc/resolv.conf is protected and will not be listed in install
+     ln -s /etc/resolvconf/run/resolv.conf /etc/resolv.conf
+  fi &&
+
   install -m644 man/resolvconf.8 /usr/share/man/man8/ &&
   install -m644 man/interface-order.5 /usr/share/man/man5/
 
--- /dev/null
+++ b/utils/resolvconf/POST_INSTALL
@@ -0,0 +1,8 @@
+resolvconf --create-runtime-directories &&
+resolvconf -u &&
+resolvconf --enable-updates &&
+
+# provide the old resolvconf entries until the file is regenerated
+if [ -e /etc/resolvconf/resolv.conf.d/original ]; then
+   cat /etc/resolvconf/resolv.conf.d/original >> /etc/resolv.conf
+fi
--- /dev/null
+++ b/utils/resolvconf/PRE_REMOVE
@@ -0,0 +1,10 @@
+resolvconf --wipe-runtime-directories &&
+rmdir /run/resolvconf &&
+
+if [ -L /etc/resolv.conf ] && [ "`readlink /etc/resolv.conf`" = "/etc/resolvconf/run/resolv.conf" ]; then
+   rm /etc/resolv.conf
+fi &&
+
+if [ -e /etc/resolvconf/resolv.conf.d/original ]; then
+   cp /etc/resolvconf/resolv.conf.d/original /etc/resolv.conf
+fi
--- /dev/null
+++ b/utils/resolvconf/tmpfiles.d/resolvconf.conf
@@ -0,0 +1,3 @@
+d /run/resolvconf           0755 root root
+d /run/resolvconf/interface 0755 root root
+f /run/resolvconf/enable-updates 0644 root root




More information about the Lunar-commits mailing list