Bug#773195: unblock macchanger/1.7.0-4

2014-12-15 Thread Hans-Christoph Steiner
Package: release.debian.org
User: release.debian@packages.debian.org
Usertags: unblock
Severity: normal

unblock macchanger/1.7.0-4

The new behavior of this package to automatically enable itself surprised some
users, and broke one's custom wifi setup.  So this update adds a debconf
question to prompt the user whether to run it automatically or not.


$ debdiff /tmp/macchanger_1.7.0-3.2.dsc macchanger_1.7.0-4.dsc
diff -Nru macchanger-1.7.0/debian/changelog macchanger-1.7.0/debian/changelog
--- macchanger-1.7.0/debian/changelog   2014-11-29 13:50:42.0 +0100
+++ macchanger-1.7.0/debian/changelog   2014-12-15 14:11:01.0 +0100
@@ -1,3 +1,9 @@
+macchanger (1.7.0-4) unstable; urgency=low
+
+  * add debconf option to prompt whether to automatically run (Closes: #768189)
+
+ -- Hans-Christoph Steiner h...@eds.org  Mon, 15 Dec 2014 12:07:44 +0100
+
 macchanger (1.7.0-3.2) unstable; urgency=medium

   * Non-maintainer upload.
diff -Nru macchanger-1.7.0/debian/config macchanger-1.7.0/debian/config
--- macchanger-1.7.0/debian/config  1970-01-01 01:00:00.0 +0100
+++ macchanger-1.7.0/debian/config  2014-12-15 14:07:56.0 +0100
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
+
+if [ -f /etc/default/macchanger ]; then
+ENABLE_ON_POST_UP_DOWN=false
+. /etc/default/macchanger
+
+if [ $ENABLE_ON_POST_UP_DOWN = true ]; then
+db_set macchanger/automatically_run true
+else
+db_set macchanger/automatically_run false
+fi
+fi
+
+db_input high macchanger/automatically_run || true
+db_go
+
+#DEBHELPER#
+
+exit 0
diff -Nru macchanger-1.7.0/debian/default macchanger-1.7.0/debian/default
--- macchanger-1.7.0/debian/default 1970-01-01 01:00:00.0 +0100
+++ macchanger-1.7.0/debian/default 2014-12-15 14:11:01.0 +0100
@@ -0,0 +1,11 @@
+# before bringing up any network interface, run macchanger. Careful, this is
+# not guaranteed to prevent leaking your real MAC address before the new one
+# gets assigned!
+#
+ENABLE_ON_POST_UP_DOWN=false
+
+
+# by default, macchanger runs on all network interfaces but loopback (lo).  If
+# you only want it to run on specific network interfaces, set them here:
+#
+#ENABLE_INTERFACES=wlan0
diff -Nru macchanger-1.7.0/debian/if-pre-up.d/macchanger
macchanger-1.7.0/debian/if-pre-up.d/macchanger
--- macchanger-1.7.0/debian/if-pre-up.d/macchanger  2014-11-29
13:50:42.0 +0100
+++ macchanger-1.7.0/debian/if-pre-up.d/macchanger  1970-01-01
01:00:00.0 +0100
@@ -1,32 +0,0 @@
-#!/bin/sh
-#
-# randomize MAC address before connecting to wifi or ethernet
-#
-# This script should always be run in if-pre-up.d, but unfortunately
-# NetworkManager does not run if-pre-up.d scripts before it sets up a network
-# connection (https://bugzilla.gnome.org/show_bug.cgi?id=387832).
-# if-post-down.d scripts are run, so there is a symlink to this script
-# there. That means when running network config from the terminal, macchanger
-# will be run twice, but it'll only be run in if-post-down.d when using
-# NetworkManager.
-
-package=macchanger
-
-. /etc/default/${package}
-
-LOGFILE=/var/log/${package}.log
-
-if [ $ENABLE_ON_POST_DOWN != yes ]; then
-echo disabled in /etc/default/${package}  $LOGFILE
-exit
-fi
-
-echo IFACE = $IFACE  $LOGFILE
-
-# quit if we're called for the loopback
-if [ $IFACE = lo ]; then
-echo ignoring loopback  $LOGFILE
-   exit 0
-fi
-
-/usr/bin/${package} -e $IFACE  $LOGFILE 21
diff -Nru macchanger-1.7.0/debian/ifupdown.sh 
macchanger-1.7.0/debian/ifupdown.sh
--- macchanger-1.7.0/debian/ifupdown.sh 1970-01-01 01:00:00.0 +0100
+++ macchanger-1.7.0/debian/ifupdown.sh 2014-12-15 14:07:56.0 +0100
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# randomize MAC address before connecting to wifi or ethernet
+#
+# This script should always be run in if-pre-up.d, but unfortunately
+# NetworkManager does not run if-pre-up.d scripts before it sets up a network
+# connection (https://bugzilla.gnome.org/show_bug.cgi?id=387832).
+# if-post-down.d scripts are run, so there is a symlink to this script
+# there. That means when running network config from the terminal, macchanger
+# will be run twice, but it'll only be run in if-post-down.d when using
+# NetworkManager.
+
+package=macchanger
+
+. /etc/default/${package}
+
+LOGFILE=/var/log/${package}.log
+
+if [ $ENABLE_ON_POST_UP_DOWN != true ]; then
+echo disabled in /etc/default/${package}  $LOGFILE
+exit
+fi
+
+echo IFACE = $IFACE  $LOGFILE
+
+# quit if we're called for the loopback
+if [ $IFACE = lo ]; then
+echo ignoring loopback  $LOGFILE
+exit 0
+fi
+
+/usr/bin/${package} -e $IFACE  $LOGFILE 21
diff -Nru macchanger-1.7.0/debian/install macchanger-1.7.0/debian/install
--- macchanger-1.7.0/debian/install 2014-11-29 13:50:42.0 +0100
+++ macchanger-1.7.0/debian/install 2014-12-15 11:44:29.0 +0100
@@ -1,2 +1,2 @@
-debian/if-pre-up.d/macchanger 

Bug#768189: Bug#773195: unblock macchanger/1.7.0-4

2014-12-15 Thread Holger Levsen
Hi,

adding debian-l10n-engl...@lists.debian.org to cc: to get feedback and advice.

On Montag, 15. Dezember 2014, Hans-Christoph Steiner wrote:
 diff -Nru macchanger-1.7.0/debian/po/templates.pot
 macchanger-1.7.0/debian/po/templates.pot
 --- macchanger-1.7.0/debian/po/templates.pot  1970-01-01 01:00:00.0
 +0100 +++ macchanger-1.7.0/debian/po/templates.pot2014-12-15
[...]
 +msgid Would you like your MAC automatically changed?
 [...]+ This then gives you a new MAC every time you plug...

I believe addressing users directly like this is frowned upon and not 
recommended, (at least it's not done in d-i, TTBOMK).

AFAIK it's better to use wordings like Should the MAC address automatically 
get changed? instead of the first msgid above.


cheers,
Holger



signature.asc
Description: This is a digitally signed message part.


Bug#768189: Bug#773195: unblock macchanger/1.7.0-4

2014-12-15 Thread Justin B Rye
Holger Levsen wrote:
 adding debian-l10n-engl...@lists.debian.org to cc: to get feedback and advice.
 
 On Montag, 15. Dezember 2014, Hans-Christoph Steiner wrote:
 diff -Nru macchanger-1.7.0/debian/po/templates.pot
 macchanger-1.7.0/debian/po/templates.pot

Is this only in the git version or something?  Oh, okay, found it.

 --- macchanger-1.7.0/debian/po/templates.pot 1970-01-01 01:00:00.0
 +0100 +++ macchanger-1.7.0/debian/po/templates.pot   2014-12-15
 [...]
 +msgid Would you like your MAC automatically changed?
 [...]+ This then gives you a new MAC every time you plug...
 
 I believe addressing users directly like this is frowned upon and not 
 recommended, (at least it's not done in d-i, TTBOMK).
 
 AFAIK it's better to use wordings like Should the MAC address automatically 
 get changed? instead of the first msgid above.

Indeed, in the short description line it shouldn't even be a full
sentence.  It ought to be something like this (and it should have come
through d-l-e for review before it went to translators):

 Template: macchanger/automatically_run
 Type: boolean
 Default: false
 _Description: Change MAC automatically?
  Please specify whether macchanger should be set up to run automatically
  every time a network device is brought up or down. This gives a new MAC
  address whenever you attach or detach an ethernet cable, or enable/disable
  wifi.

But wait, how can it give a new MAC address for a DEconfigured network
interface?  Shouldn't it be just:

 Template: macchanger/automatically_run
 Type: boolean
 Default: false
 _Description: Change MAC automatically?
  Please specify whether macchanger should be set up to run automatically
  every time a network device is brought up or down. This gives a new MAC
  address whenever you reattach an ethernet cable or reenable wifi.

-- 
JBR with qualifications in linguistics, experience as a Debian
sysadmin, and probably no clue about this particular package
--- templates.orig	2014-12-15 14:18:20.308009214 +
+++ templates	2014-12-15 14:20:27.212552090 +
@@ -1,7 +1,7 @@
 Template: macchanger/automatically_run
 Type: boolean
 Default: false
-_Description: Would you like your MAC automatically changed?
- macchanger can be set up to automatically run everytime a network device
- is brought up or down.  This then gives you a new MAC every time you plug
- or unplug an ethernet cable, or enable/disable wifi.
+_Description: Change MAC automatically?
+ Please specify whether macchanger should be set up to run automatically
+ every time a network device is brought up or down. This gives a new MAC
+ address whenever you reattach an ethernet cable or reenable wifi.
Template: macchanger/automatically_run
Type: boolean
Default: false
_Description: Change MAC automatically?
 Please specify whether macchanger should be set up to run automatically
 every time a network device is brought up or down. This gives a new MAC
 address whenever you reattach an ethernet cable or reenable wifi.


Bug#768189: Bug#773195: unblock macchanger/1.7.0-4

2014-12-15 Thread Holger Levsen
Hi Justin,

On Montag, 15. Dezember 2014, Justin B Rye wrote:
 But wait, how can it give a new MAC address for a DEconfigured network
 interface?  Shouldn't it be just:
 
  Template: macchanger/automatically_run
  Type: boolean
  Default: false
  _Description: Change MAC automatically?
   Please specify whether macchanger should be set up to run automatically
   every time a network device is brought up or down. This gives a new MAC
   address whenever you reattach an ethernet cable or reenable wifi.

wow, neat, IMHO much better! Thanks a lot, also for replying so fast!


cheers,
Holger




signature.asc
Description: This is a digitally signed message part.