[pkg-dhcp-commits] [SCM] ISC DHCP packaging for Debian branch, master, updated. debian/4.1.1-P1-16.1-36-gaf308ef

Andrew Pollock apollock at debian.org
Sat Aug 27 21:09:29 UTC 2011


The following commit has been merged in the master branch:
commit af308ef23b6c39245c16443406e7f059904adcef
Author: Andrew Pollock <apollock at debian.org>
Date:   Sat Aug 27 14:09:04 2011 -0700

    factor-out hostname setting
    
    Use a separate function to set the hostname in order to allow admins
    to override hostname setting in hook scripts.
    This way admins can set their policy as they need.

diff --git a/debian/changelog b/debian/changelog
index 8ac492c..51e8ca6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -35,8 +35,10 @@ isc-dhcp (4.2.2-1) unstable; urgency=low
     to fix metric calculation (closes: #629632)
   * debian/dhclient-script.linux: apply patches from Peter Marschall to support
     IPv6 link-local resolvers
+  * debian/dhclient-script.{linux,kfreebsd}: applied patch from Peter Marschall
+    to factor out the hostname setting to a separate function
 
- -- Andrew Pollock <apollock at debian.org>  Sat, 27 Aug 2011 14:02:57 -0700
+ -- Andrew Pollock <apollock at debian.org>  Sat, 27 Aug 2011 14:08:00 -0700
 
 isc-dhcp (4.1.1-P1-18) unstable; urgency=low
 
diff --git a/debian/dhclient-script.kfreebsd b/debian/dhclient-script.kfreebsd
index f3f93bd..95976a7 100644
--- a/debian/dhclient-script.kfreebsd
+++ b/debian/dhclient-script.kfreebsd
@@ -38,6 +38,13 @@ make_resolv_conf() {
     fi
 }
 
+# set host name
+set_hostname() {
+    if [-n "$old_host_name" ] && [ -n "$new_host_name" ]; then
+        hostname "$new_host_name"
+    fi
+}
+
 # run given script
 run_hook() {
     local script
@@ -138,10 +145,7 @@ case "$reason" in
         ;;
 
     BOUND|RENEW|REBIND|REBOOT)
-        if [ -n "$old_host_name" ] && [ -n "$new_host_name" ] &&
-           [ "$old_host_name" != "$new_host_name" ]; then
-            hostname "$new_host_name"
-        fi
+        set_hostname
 
         if [ -n "$old_ip_address" ] && [ -n "$alias_ip_address" ] &&
            [ "$alias_ip_address" != "$old_ip_address" ]; then
diff --git a/debian/dhclient-script.kfreebsd.udeb b/debian/dhclient-script.kfreebsd.udeb
index 335ba28..645ec03 100644
--- a/debian/dhclient-script.kfreebsd.udeb
+++ b/debian/dhclient-script.kfreebsd.udeb
@@ -30,6 +30,7 @@ make_resolv_conf() {
     fi
 }
 
+# set host name
 set_hostname() {
     local current_hostname
     current_hostname=$(hostname)
diff --git a/debian/dhclient-script.linux b/debian/dhclient-script.linux
index ae99cc0..409be60 100644
--- a/debian/dhclient-script.linux
+++ b/debian/dhclient-script.linux
@@ -83,6 +83,13 @@ make_resolv_conf() {
     fi
 }
 
+# set host name
+set_hostname() {
+    if [-n "$old_host_name" ] && [ -n "$new_host_name" ]; then
+        hostname "$new_host_name"
+    fi
+}
+
 # run given script
 run_hook() {
     local script
@@ -189,11 +196,7 @@ case "$reason" in
         ;;
 
     BOUND|RENEW|REBIND|REBOOT)
-        if [ -n "$old_host_name" ] && [ -n "$new_host_name" ] &&
-           [ "$old_host_name" != "$new_host_name" ]; then
-            # hostname changed => set it
-            hostname "$new_host_name"
-        fi
+        set_hostname
 
         if [ -n "$old_ip_address" ] && [ -n "$alias_ip_address" ] &&
            [ "$alias_ip_address" != "$old_ip_address" ]; then
diff --git a/debian/dhclient-script.linux.udeb b/debian/dhclient-script.linux.udeb
index 505b035..cef67fc 100644
--- a/debian/dhclient-script.linux.udeb
+++ b/debian/dhclient-script.linux.udeb
@@ -30,6 +30,7 @@ make_resolv_conf() {
     fi
 }
 
+# set host name
 set_hostname() {
     local current_hostname
     current_hostname=$(cat /proc/sys/kernel/hostname)

-- 
ISC DHCP packaging for Debian



More information about the pkg-dhcp-commits mailing list