[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

ifupdown-extra upload to stable-proposed-updates



Dear Release Team,

I would like to make an upload to stable in order to fix some bugs in
ifupdown-extra which were not detected and fixed in time for the Squeeze
release. 

Please find attached the full patch between this new package version and the
version 0.14 currently in Squeeze with my proposed changes. A summary of them 
is:

 - fixed location of the ethtool binary which changed in the ethtool package
   from lenny to squeeze
 - fix the location of the default configuration file for routes to match
   were the scripts look for it
 - fix parsing errors in the configuration file 

Without these changes some of the script tools provided in the package are
useless (due to ethtool's location change) and/or will break.

Please let me know if these changes are suitable for stable.

Regards


Javier
diff --git a/debian/.changelog.swp b/debian/.changelog.swp
deleted file mode 100644
index a118be8..0000000
Binary files a/debian/.changelog.swp and /dev/null differ
diff --git a/debian/changelog b/debian/changelog
index d894404..840cd9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,28 @@
+ifupdown-extra (0.14.1) stable; urgency=low
+
+  [ Fold important bug fixes included in 0.15 and later ]
+  * if-up-scripts/check-duplicate-ip: 
+     - Location of ethtool has changed: adjust to the new location but fallback
+       to the old one if it is still there.
+  * if-up-scripts/check-network-cable: Location of ethtool has changed,
+    adjust to the new location but fallback to the old one if it is
+    still there.
+  * if-up-scripts/static-routes: 
+      - Fix typo that prevent the script from adding routes as it expected them
+        to have 'reject' when they shouldn't. Thanks to Mathieu Parent and
+        to Petru Ratiu for the patches. (Closes: #613632, #458395) (LP: #631533)
+  * scripts/network-test: 
+      - Fix call to mktemp to use --tmpdir so that the script does not break if
+        run in a non-writable directory (Closes: #541619)
+  * debian/ifupdown-extra.preinst: Rename the /etc/network/network-routes
+    config file to /etc/network/routes (Closes: #611982)
+  * debian/rules: 
+      - Fix installation of the network-routes sample configuration file so
+        that it is installed where it should be (/etc/network/routes instead of
+        /etc/network/network-routes) (Closes: #611982)
+
+ -- Javier Fernandez-Sanguino Pen~a <jfs@debian.org>  Sun, 12 Jun 2011 22:29:22 +0200
+
 ifupdown-extra (0.14) unstable; urgency=low
 
   * Apply a patch provided by Guillem Jover to make check-duplicate-ip work
diff --git a/debian/ifupdown-extra.preinst b/debian/ifupdown-extra.preinst
new file mode 100644
index 0000000..3752362
--- /dev/null
+++ b/debian/ifupdown-extra.preinst
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+
+case "$1" in
+  install|upgrade)
+    if [ -e /etc/network/network-routes ] ; then
+    # There was a bug in the package (<= 0.14). We need to
+    # move the file to the new location
+        mv /etc/network/network-routes /etc/network/routes
+    fi
+  ;;
+esac
+
+
+
+
+# vim:tabstop=2:expandtab:shiftwidth=2
diff --git a/debian/network-routes b/debian/network-routes
index 8c8758b..bca5fab 100644
--- a/debian/network-routes
+++ b/debian/network-routes
@@ -1,8 +1,9 @@
-# This configuration file is read by the static-routes script
-# to setup a list of gateways for a given interface.
+# This configuration file is read by the static-routes if-updown script
+# to setup a list of routes associated either with a given interface or global
+# routes.
 #
-# DO NOT configure default gateway routes here, they should be configured
-# in the /etc/network/interfaces ('gateway' option) instead
+# DO NOT configure default gateway routes for interfaces here, they should be
+# configured in the /etc/network/interfaces ('gateway' option) instead
 #
 # This file includes a list of routes for different networks following
 # the format: # Network Netmask Gateway Interface
diff --git a/debian/rules b/debian/rules
index 1488b63..0ef1726 100755
--- a/debian/rules
+++ b/debian/rules
@@ -47,7 +47,7 @@ install: build
 	dh_clean -k 
 	dh_installdirs
 	# Configuration files
-	install -m644 debian/network-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/network-routes
+	install -m644 debian/network-routes  $(CURDIR)/debian/ifupdown-extra/etc/network/routes
 	install -m644 debian/network-test-default  $(CURDIR)/debian/ifupdown-extra/etc/default/network-test
 	# Network scripts for ifupdown
 	install -m755 if-up-scripts/check-network-cable  $(CURDIR)/debian/ifupdown-extra/etc/network/if-pre-up.d/00check-network-cable
diff --git a/if-up-scripts/check-duplicate-ip b/if-up-scripts/check-duplicate-ip
index b59032b..d48eea6 100755
--- a/if-up-scripts/check-duplicate-ip
+++ b/if-up-scripts/check-duplicate-ip
@@ -37,7 +37,8 @@
 
 # Defaults
 ARPING=/usr/bin/arping
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 ARP_COUNT=${ARP_COUNT:-2}
 ARP_TIMEOUT=${ARP_TIMEOUT:-3}
 DO_SYSLOG=${DO_SYSLOG:-yes}
diff --git a/if-up-scripts/check-gateway b/if-up-scripts/check-gateway
index d5d013a..5f82697 100755
--- a/if-up-scripts/check-gateway
+++ b/if-up-scripts/check-gateway
@@ -42,7 +42,8 @@
 
 # Defaults
 ARPING=/usr/bin/arping
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 ARP_COUNT=${ARP_COUNT:-2}
 ARP_TIMEOUT=${ARP_TIMEOUT:-3}
 DO_SYSLOG=${DO_SYSLOG:-yes}
diff --git a/if-up-scripts/check-network-cable b/if-up-scripts/check-network-cable
index 86faf79..6ee981c 100755
--- a/if-up-scripts/check-network-cable
+++ b/if-up-scripts/check-network-cable
@@ -34,7 +34,8 @@
 [ -r /etc/default/network-test ] && . /etc/default/network-test
 
 # Defaults
-ETHTOOL=/usr/sbin/ethtool
+ETHTOOL=/sbin/ethtool
+[ ! -x "$ETHTOOL" ] && [ -x "/usr/sbin/ethtool" ] && ETHTOOL=/usr/sbin/ethtool
 MIITOOL=/sbin/mii-tool
 DO_SYSLOG=${DO_SYSLOG:-yes}
 ABORT_NO_LINK=i${ABORT_NO_LINK:-no}
diff --git a/if-up-scripts/static-routes b/if-up-scripts/static-routes
index 9f13ae2..af78883 100755
--- a/if-up-scripts/static-routes
+++ b/if-up-scripts/static-routes
@@ -2,6 +2,7 @@
 #
 # Script to setup a system's static routes based on the
 # /etc/network/routes definitions.
+#
 # It tries to simplify network route management and make it easier
 # to handle those as requested in bug #368228 ('Wish: Better Handling 
 # of up/down route commands'). With this script routes do not have to be 
@@ -55,11 +56,17 @@ del_static_routes() {
 	# since they will be removed nevertheless. In any case, this 
 	# piece of code only runs if you install this file in 
 	# /etc/network/if-pre-down.d/ (which you don't need to)
-	cat $ROUTEFILE | egrep "${IFACE}$" | 
+	cat $ROUTEFILE | egrep "^[^#].*${IFACE}$" | 
 	while read network netmask gateway interface ; do
-            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ "$gateway" = "reject" ] ; then
-                [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Deleting route for $network / $netmask through gateway $gateway at $interface"
+            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ -n "$gateway" ] ; then
+                if [ "$gateway" != "reject" ] ; then
+                    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Deleting route for $network / $netmask through gateway $gateway at $interface"
                     route del -net $network netmask $netmask gw $gateway dev $interface
+                else
+                    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Deleting reject route for $network / $netmask when bringing up $interface"
+                    route del -net $network netmask $netmask reject
+                fi
+
             else
                 echo "ERROR: Incorrect line for $IFACE in $ROUTEFILE: '$network $netmask $gateway $interface'"
             fi
@@ -67,11 +74,17 @@ del_static_routes() {
 }
 
 add_static_routes() {
-	cat $ROUTEFILE | egrep "${IFACE}$" | 
+	cat $ROUTEFILE | egrep "^[^#].*${IFACE}$" | 
 	while read network netmask gateway interface ; do
-            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ "$gateway" = "reject" ] ; then
-		[ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Adding route for $network / $netmask through gateway $gateway at $interface"
-		route add -net $network netmask $netmask gw $gateway dev $interface
+            if [ -n "$interface" ] && [ -n "$network" ] && [ -n "$netmask" ] && [ -n "$gateway" ] ; then
+                if [ "$gateway" != "reject" ] ; then
+		    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Adding route for $network / $netmask through gateway $gateway at $interface"
+        	    route add -net $network netmask $netmask gw $gateway dev $interface
+                else
+                    [ "$VERBOSITY" -eq 1 ] && echo "DEBUG: Adding reject route for $network / $netmask when bringing up $interface"
+                    route add -net $network netmask $netmask reject
+                fi
+
             else
                 echo "ERROR: Incorrect line for $IFACE in $ROUTEFILE: '$network $netmask $gateway $interface'"
             fi
diff --git a/scripts/network-test b/scripts/network-test
index fb3f950..bd2bb3e 100755
--- a/scripts/network-test
+++ b/scripts/network-test
@@ -414,7 +414,7 @@ check_dns () {
 	status=1
 	nsfound=0
 	nsok=0
-	tempfile=`mktemp tmptestnet.XXXXXX` || {  err "Cannot create temporary file! Aborting! " ; exit 1; }
+	tempfile=`mktemp --tmpdir tmptestnet.XXXXXX` || {  err "Cannot create temporary file! Aborting! " ; exit 1; }
 	trap " [ -f \"$tempfile\" ] && /bin/rm -f -- \"$tempfile\"" 0 1 2 3 13 15
 	cat /etc/resolv.conf | grep -v ^# | grep nameserver | 
 	awk '/nameserver/ { for (i=2;i<=NF;i++) {  print $i ; } }'  >$tempfile

Attachment: signature.asc
Description: Digital signature


Reply to: