Bug#728647: missing dependencies on ifupdown and net-tools

2013-11-03 Thread Stefan Lippers-Hollmann
Hi

Apparently my mail client can't be convinced not to mangle the second 
patch, due to the unfuzzed gettext translations in po/*.po{,t}, 
therefore I'm now sending both patches also as attachment.

Regards
Stefan Lippers-Hollmann
From 4a0ae987068253636d39dc0c075cccf0321fd106 Mon Sep 17 00:00:00 2001
From: Stefan Lippers-Hollmann 
Date: Sun, 3 Nov 2013 16:23:48 +0100
Subject: [PATCH 1/2] add missing package dependencies on ifupdown and
 net-tools.

---
 debian/changelog | 6 ++
 debian/control   | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index d4c3578..28cc385 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pppoeconf (1.21) UNRELEASED; urgency=low
+
+  * add missing package dependencies on ifupdown and net-tools.
+
+ -- Stefan Lippers-Hollmann   Sun, 03 Nov 2013 16:23:07 +0100
+
 pppoeconf (1.20) unstable; urgency=low
 
   * Fix pppoeconf.desktop (Closes: #590202) 
diff --git a/debian/control b/debian/control
index 85e5d84..cc99e6c 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Standards-Version: 3.9.2
 
 Package: pppoeconf
 Architecture: all
-Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 0.13), sed (>= 3.95)
+Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 0.13), sed (>= 3.95), ifupdown, net-tools
 Recommends: locales
 Suggests: xdialog
 Description: configures PPPoE/ADSL connections
-- 
1.8.4.2

From 0defc27394d88e9ebcf047951cd71d8355b9ca87 Mon Sep 17 00:00:00 2001
From: Stefan Lippers-Hollmann 
Date: Sun, 3 Nov 2013 16:53:06 +0100
Subject: [PATCH 2/2] follow ifupdown and switch from net-tools' ifconfig to
 iproute2.

---
 debian/changelog |  4 +++-
 debian/control   |  2 +-
 po/de.po |  4 ++--
 po/es.po |  4 ++--
 po/fr.po |  4 ++--
 po/it.po |  4 ++--
 po/ja.po |  4 ++--
 po/old/pt.po |  4 ++--
 po/pppoeconf.pot |  2 +-
 po/pt_BR.po  |  4 ++--
 po/pt_PT.po  |  4 ++--
 po/ru.po |  4 ++--
 po/sl.po |  4 ++--
 po/zh_TW.po  |  2 +-
 pppoeconf| 15 +--
 15 files changed, 35 insertions(+), 30 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 28cc385..7200cb8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 pppoeconf (1.21) UNRELEASED; urgency=low
 
-  * add missing package dependencies on ifupdown and net-tools.
+  * add missing package dependency on ifupdown.
+  * follow ifupdown and switch from net-tools' ifconfig to iproute2, adapt
+dependencies accordingly (Closes: #728647).
 
  -- Stefan Lippers-Hollmann   Sun, 03 Nov 2013 16:23:07 +0100
 
diff --git a/debian/control b/debian/control
index cc99e6c..c12df54 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Standards-Version: 3.9.2
 
 Package: pppoeconf
 Architecture: all
-Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 0.13), sed (>= 3.95), ifupdown, net-tools
+Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 0.13), sed (>= 3.95), ifupdown (>= 0.7.44~), iproute2
 Recommends: locales
 Suggests: xdialog
 Description: configures PPPoE/ADSL connections
diff --git a/po/de.po b/po/de.po
index bc9a916..0815a5b 100644
--- a/po/de.po
+++ b/po/de.po
@@ -358,10 +358,10 @@ msgstr "VERBINDUNG GESTARTET"
 #: ../pppoeconf:464
 msgid ""
 "The DSL connection has been triggered. You can use the \"plog\" command to "
-"see the status or \"ifconfig ppp0\" for general interface info."
+"see the status or \"ip addr show ppp0\" for general interface info."
 msgstr ""
 "Die DSL-Verbindung wurde ausgelöst. Sie können den Verbindungsstatus mit dem "
-"Befehl \"plog\" beobachten, sonstige Daten mit \"ifconfig ppp0\"."
+"Befehl \"plog\" beobachten, sonstige Daten mit \"ip addr show ppp0\"."
 
 #: ../pppoeconf:476
 msgid "NO INTERFACE FOUND"
diff --git a/po/es.po b/po/es.po
index 3c1b2a6..b735b64 100644
--- a/po/es.po
+++ b/po/es.po
@@ -357,10 +357,10 @@ msgstr "CONEXI
 #: ../pppoeconf:464
 msgid ""
 "The DSL connection has been triggered. You can use the \"plog\" command to "
-"see the status or \"ifconfig ppp0\" for general interface info."
+"see the status or \"ip addr show ppp0\" for general interface info."
 msgstr ""
 "Se ha lanzado la conexión DSL. Puedes utilizar el comando «plog» para ver el "
-"estado o «ifconfig ppp0» para ver información general de la interfaz."
+"estado o «ip addr show ppp0» para ver información general de la interfaz."
 
 #: ../pppoeconf:476
 msgid "NO INTERFACE FOUND"
diff --git a/po/fr.po b/po/fr.po
index ae135c7..95bcd47 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -347,10 +347,10 @@ msgstr "Connexion établie"
 #: ../pppoeconf:

Bug#728647: missing dependencies on ifupdown and net-tools

2013-11-03 Thread Stefan Lippers-Hollmann
Package: pppoeconf
Version: 1.20
Severity: serious
Tags: patch

Hi

pppoeconf depends on ifupdown and net-tools (ifconfig) without 
declaring an explicit dependency on either of these packages. Due to
ifupdown having switched its own reliance on net-tools to iproute2,
new jessie installs are particularly prone to this problem, as ifconfig
is no longer guaranteed to be available.

Rather than just declaring net-tools as a dependency, I've ported 
pppoeconf to use iproute2 instead, thereby following ifupdown and 
reducing the dependency chain as a whole. Existing configurations will 
not be migrated to iproute2 automatically, as doing so would be a 
policy violation, but existing -upgraded- installations should still
have net-tools/ ifconfig available (and pppoeconf will adapt it when
reconfiguring an interface).

I'll follow up this bug with a, tested, 2-patch patch series (which 
also fixes the newly introduced i18n changes), once I receive the bug 
number, but the changes are basically these:

*** Please apply the two patches mailed as follow-up to this bug, ***
*** rather than this patch which is only meant for demonstrating  ***
*** the changes   ***
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Standards-Version: 3.9.2
 
 Package: pppoeconf
 Architecture: all
-Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 
2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 
0.13), sed (>= 3.95)
+Depends: ${misc:Depends}, whiptail-provider | whiptail, ppp (>= 
2.4.2+20040428-2) | pppoe (>= 3.0), ppp (>= 2.4.1.uus2-4), gettext-base (>= 
0.13), sed (>= 3.95), ifupdown (>= 0.7.44~), iproute2
 Recommends: locales
 Suggests: xdialog
 Description: configures PPPoE/ADSL connections
--- a/pppoeconf
+++ b/pppoeconf
@@ -101,7 +101,7 @@ if test "$*" ; then
list="$*"
force_manual=1
 else
-   list=$( LANG=C /sbin/ifconfig -a | grep "Ethernet" | grep -v irlan | cut 
-f1 -d" " )
+   list=$( LANG=C /bin/ip -f link -o addr list | awk 
'/^[0-9]*\:.*link\/ether/{print $2}' | grep -v irlan | cut -f1 -d: )
 fi
 
 if test "$list" ; then
@@ -189,7 +189,7 @@ Webnetix:
 fi
 
 touch $TMP/pppoe.scan
-ifconfig $iface up
+ip link set $iface up
 ($DISCOVERY_PROGRAM $mmm -A -I $iface > $TMP/$iface.pppoe ; rm 
$TMP/pppoe.scan) &
 
 ( time=0 ; while test -f $TMP/pppoe.scan ; do time=`expr $time + 
6`; echo $time; sleep 1; done ) | $DIALOG --title "$title" --gauge "$text 
$mmode" 10 60 0
@@ -253,9 +253,12 @@ Continue with configuration?')
  # interface activation code - this sucks here, pppd plugin should do 
it as needed
  #sed -i -e "s,pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf,pre-up
 /sbin/ifconfig $ifacenocomma up # line maintained by pppoeconf," $INTFILE
 # FIXME: Make sure that it gets added to correct iface stanza! (Because 
it's not always added above)
-PATTERN_PREUP_IFACE="pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
-REPLACE_PREUP_IFACE="pre-up /sbin/ifconfig $ifacenocomma up # line 
maintained by pppoeconf"
-if grep -q "$PATTERN_PREUP_IFACE" $INTFILE; then 
+PATTERN_PREUP_IFACE_LEGACY="pre-up 
/sbin/ifconfig[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
+PATTERN_PREUP_IFACE="pre-up /bin/ip link 
set[[:space:]]\+[^[:space:]]\+[[:space:]]\+up.#.line.maintained.by.pppoeconf"
+REPLACE_PREUP_IFACE="pre-up /bin/ip link set $ifacenocomma up # line 
maintained by pppoeconf"
+if grep -q "$PATTERN_PREUP_IFACE_LEGACY" $INTFILE; then
+sed -i -e "s,$PATTERN_PREUP_IFACE_LEGACY,$REPLACE_PREUP_IFACE," 
$INTFILE
+elif grep -q "$PATTERN_PREUP_IFACE" $INTFILE; then
 sed -i -e "s,$PATTERN_PREUP_IFACE,$REPLACE_PREUP_IFACE," $INTFILE
 else
 sed -i -e "s,[^#]*\(iface dsl-provider.*\),\1\n$REPLACE_PREUP_IFACE," 
$INTFILE
@@ -461,7 +464,7 @@ Note that this situation is not expected and you should 
consider submitting a bu
   cd /
   pon dsl-provider
   title=$(gettext 'CONNECTION INITIATED')
-  text=$(gettext 'The DSL connection has been triggered. You can use the 
"plog" command to see the status or "ifconfig ppp0" for general interface 
info.')
+  text=$(gettext 'The DSL connection has been triggered. You can use the 
"plog" command to see the status or "ip addr show ppp0" for general interface 
info.')
   $DIALOG --title "$title" --clear --msgbox "$text" 10 60
   ;;
 1)
*** Please apply the two patches mailed as follow-up to this bug, ***
*** rather than this patch which is only meant for demonstrating  ***
*** the changes   ***

Regards
Stefan Lippers-Hollmann

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (