Bug#604064: unblock: network-manager/0.8.1-4
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: freeze-exception
Please unblock package network-manager
It contains an RC bug fix for #530024 which is important to get into
squeeze.
Changelog:
network-manager (0.8.1-4) unstable; urgency=low
[ Raphaël Hertzog ]
* Integrate debian/ifblacklist_migrate.sh from Ubuntu and install
it in /usr/lib/NetworkManager. Improve it to disable the interfaces
with a #NetworkManager# prefix and re-enable them when the package is
removed. (Closes: #530024)
-- Michael Biebl <biebl@debian.org> Wed, 17 Nov 2010 23:28:19 +0100
debdiff is attached.
Michael
unblock network-manager/0.8.1-4
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.32-5-686 (SMP w/1 CPU core)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Index: debian/network-manager.postinst
===================================================================
--- debian/network-manager.postinst (Revision 3741)
+++ debian/network-manager.postinst (Revision 3772)
@@ -66,6 +66,11 @@
if dpkg --compare-versions "$2" lt "0.8.1-2"; then
mv_conffile "/etc/NetworkManager/nm-system-settings.conf" "/etc/NetworkManager/NetworkManager.conf"
fi
+
+ if [ -z "$2" ] || dpkg --compare-versions "$2" lt-nl "0.8.1-4"; then
+ echo "Disabling interfaces configured with plain DHCP in /etc/network/interfaces so that NetworkManager can take them over"
+ /usr/lib/NetworkManager/ifblacklist_migrate.sh
+ fi
;;
abort-upgrade|abort-deconfigure|abort-remove)
@@ -78,5 +83,4 @@
esac
#DEBHELPER#
-exit 0
Index: debian/network-manager.preinst
===================================================================
--- debian/network-manager.preinst (Revision 3741)
+++ debian/network-manager.preinst (Revision 3772)
@@ -100,4 +100,3 @@
esac
#DEBHELPER#
-exit 0
Index: debian/network-manager.postrm
===================================================================
--- debian/network-manager.postrm (Revision 3741)
+++ debian/network-manager.postrm (Revision 3772)
@@ -24,8 +24,16 @@
rmdir --ignore-fail-on-non-empty /var/lib/NetworkManager
fi
;;
- remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ remove)
+ # Restore the ifupdown configuration that were disabled at installation
+ backup_suffix=0
+ while test -e /etc/network/interfaces.bak-${backup_suffix}; do
+ backup_suffix=$(($backup_suffix + 1))
+ done
+ sed -i.bak-${backup_suffix} -e "s/^#NetworkManager#//g" /etc/network/interfaces
;;
+ upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ ;;
*)
echo "postrm called with unknown argument \`$1'" >&2
@@ -34,5 +42,3 @@
esac
#DEBHELPER#
-
-exit 0
Index: debian/changelog
===================================================================
--- debian/changelog (Revision 3741)
+++ debian/changelog (Revision 3772)
@@ -1,3 +1,13 @@
+network-manager (0.8.1-4) unstable; urgency=low
+
+ [ Raphaël Hertzog ]
+ * Integrate debian/ifblacklist_migrate.sh from Ubuntu and install
+ it in /usr/lib/NetworkManager. Improve it to disable the interfaces
+ with a #NetworkManager# prefix and re-enable them when the package is
+ removed. (Closes: #530024)
+
+ -- Michael Biebl <biebl@debian.org> Wed, 17 Nov 2010 23:28:19 +0100
+
network-manager (0.8.1-3) unstable; urgency=low
* debian/control
Index: debian/rules
===================================================================
--- debian/rules (Revision 3741)
+++ debian/rules (Revision 3772)
@@ -29,3 +29,5 @@
binary-install/network-manager::
install -m 755 debian/network-manager-dispatcher.script \
debian/network-manager/etc/NetworkManager/dispatcher.d/01ifupdown
+ install -m 755 debian/ifblacklist_migrate.sh \
+ debian/network-manager/usr/lib/NetworkManager
Index: debian/ifblacklist_migrate.sh
===================================================================
--- debian/ifblacklist_migrate.sh (Revision 0)
+++ debian/ifblacklist_migrate.sh (Revision 3772)
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+# (C) 2007 Canonical Ltd.
+# Author: Alexander Sack <asac@jwsdot.com>
+# License: GNU General Public License, version 2 or any later version
+
+if test x$NIF_FILE = x; then
+ NIF_FILE=/etc/network/interfaces
+fi
+
+auto_ifs=$(cat $NIF_FILE | \
+ egrep "^auto|^allow-" | \
+ sed -e 's/auto//' | \
+ sed -e 's/allow-[^ ].* //')
+
+ifaces_to_disable=""
+
+echo Auto interfaces found: $auto_ifs
+
+# iterate over all auto interfaces
+for i in $auto_ifs; do
+ IFS_old=$IFS; IFS=""
+
+ NIF_FILE_content=$(cat $NIF_FILE | \
+ sed -e 's/^[ \t]*auto.*$//' | \
+ sed -e 's/^[ \t]*allow-.*$//' | \
+ sed -e 's/^[ \t]*#.*$//' | grep -v ^$)
+
+ # '--' is inserted by grep -A1 if there are multiple iface blocks
+ lines=$(echo $NIF_FILE_content | grep -A1 "^iface.*$i.*dhcp" | grep -v '\--')
+ IFS="
+"
+
+ # if there is no iface line for that interface, we would still get a line
+ # count of 1 ... so use word_count 0 below to exclude ifaces that have no
+ # configuration at all.
+ word_count=$(echo $lines | wc -w)
+ line_count=0
+ for line in $lines; do
+ nulled_line=$(echo "$line" | sed -e 's/[# ]//' | grep -v ^iface)
+ if test x$nulled_line != x; then
+ line_count=$(expr $line_count + 1)
+ fi
+ done
+
+ if test $line_count -eq 0 -a $word_count -gt 0; then
+ ifaces_to_disable="$ifaces_to_disable $i"
+ echo iface to disable = $i
+ fi
+ IFS=$IFS_old
+done
+
+backup_suffix=0
+while test -e ${NIF_FILE}.bak-${backup_suffix}; do
+ backup_suffix=$(expr $backup_suffix + 1)
+done
+
+if [ -n "$ifaces_to_disable" ]; then
+ cp $NIF_FILE "$NIF_FILE.bak-${backup_suffix}"
+ for i in $ifaces_to_disable; do
+ echo -n "Disabling interface: $i ... "
+ sed -i -e "s/^\([ \t]*iface.*$i.*\)$/#NetworkManager#\1/" $NIF_FILE
+ echo done.
+ done
+fi
+
Reply to: