summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2012-10-26 21:32:17 +0200
committerMichael Biebl <biebl@debian.org>2012-11-01 22:58:00 +0100
commit0d2040a2da3ff0514b32647c3015ae2452e63263 (patch)
treec1bde8ef8f10664d043a166a267d1e4b4a02010e
parent976ce3c2d5039cf3f4b2ea9133082f2415c460be (diff)
Show debconf prompt if wicd is installedwip/debconf
-rw-r--r--debian/control3
-rwxr-xr-xdebian/network-manager.config14
-rw-r--r--debian/network-manager.postinst23
-rw-r--r--debian/network-manager.postrm6
-rw-r--r--debian/network-manager.templates8
-rw-r--r--debian/po/POTFILES.in1
-rw-r--r--debian/po/templates.pot34
7 files changed, 88 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index 4216880e2..f9eed341e 100644
--- a/debian/control
+++ b/debian/control
@@ -25,7 +25,8 @@ Build-Depends:
libgirepository1.0-dev (>= 0.10.7-1~),
gobject-introspection (>= 0.9.12-4~),
gtk-doc-tools,
- libglib2.0-doc
+ libglib2.0-doc,
+ po-debconf
Standards-Version: 3.9.3
Vcs-Git: git://git.debian.org/git/pkg-utopia/network-manager.git
Vcs-Browser: http://git.debian.org/?p=pkg-utopia/network-manager.git;a=summary
diff --git a/debian/network-manager.config b/debian/network-manager.config
new file mode 100755
index 000000000..5c1650feb
--- /dev/null
+++ b/debian/network-manager.config
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+. /usr/share/debconf/confmodule
+
+# TODO: check if NM is already disabled and don't prompt in this case?
+if [ -x /usr/sbin/wicd ] ; then
+ db_set network-manager/wicd false
+ db_input high network-manager/wicd || true
+fi
+
+
+db_go || true
diff --git a/debian/network-manager.postinst b/debian/network-manager.postinst
index b2dd4353a..8679c5abf 100644
--- a/debian/network-manager.postinst
+++ b/debian/network-manager.postinst
@@ -2,6 +2,9 @@
set -e
+# Source debconf library.
+. /usr/share/debconf/confmodule
+
# This script can be called in the following ways:
#
# After the package was installed:
@@ -18,6 +21,25 @@ set -e
# If prerm fails during replacement due to conflict:
# <postinst> abort-remove in-favour <new-package> <version>
+
+# TODO: Only run this prompt on initial installation?
+db_get network-manager/wicd
+if [ "$RET" = "false" ] ; then
+ if [ -x "/etc/init.d/network-manager" ]; then
+ update-rc.d network-manager defaults >/dev/null
+ update-rc.d network-manager disable >/dev/null
+ fi
+else
+ # TODO: - disable and stop wicd?
+ # - re-enable NM if previously disabled?
+ if [ -x "/etc/init.d/network-manager" ]; then
+ update-rc.d network-manager defaults >/dev/null
+ update-rc.d network-manager enable >/dev/null
+ fi
+fi
+
+db_stop
+
case "$1" in
configure)
@@ -42,6 +64,7 @@ case "$1" in
kill `pidof /usr/sbin/nm-system-settings` 2>/dev/null || true
fi
+
if [ -z "$2" ] || dpkg --compare-versions "$2" lt-nl "0.8.1-4"; then
if [ -f /etc/network/interfaces ]; then
echo "Disabling interfaces configured with plain DHCP in /etc/network/interfaces so that NetworkManager can take them over"
diff --git a/debian/network-manager.postrm b/debian/network-manager.postrm
index 5bc3e9b4d..0dbf8a35c 100644
--- a/debian/network-manager.postrm
+++ b/debian/network-manager.postrm
@@ -25,6 +25,12 @@ case "$1" in
rm -f /var/lib/NetworkManager/timestamps
rmdir --ignore-fail-on-non-empty /var/lib/NetworkManager
fi
+ if [ -e /usr/share/debconf/confmodule ]; then
+ # Source debconf library.
+ . /usr/share/debconf/confmodule
+ # Remove my changes to the db.
+ db_purge
+ fi
;;
remove)
# Restore the ifupdown configuration that were disabled at installation
diff --git a/debian/network-manager.templates b/debian/network-manager.templates
new file mode 100644
index 000000000..dff34adad
--- /dev/null
+++ b/debian/network-manager.templates
@@ -0,0 +1,8 @@
+Template: network-manager/wicd
+Type: boolean
+_Description: Let NetworkManager manage your interfaces?
+ NetworkManager has detected that you have the WICD network
+ configuration service installed. Running both NetworkManager
+ and WICD at the same time can lead to unexpected results, as
+ both will try to manage your network.
+ It is recommended to only enable either one of them.
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 000000000..bccff12c6
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] network-manager.templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 000000000..3b06551de
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,34 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: network-manager\n"
+"Report-Msgid-Bugs-To: network-manager@packages.debian.org\n"
+"POT-Creation-Date: 2012-11-01 10:34+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../network-manager.templates:1001
+msgid "Let NetworkManager manage your interfaces?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../network-manager.templates:1001
+msgid ""
+"NetworkManager has detected that you have the WICD network configuration "
+"service installed. Running both NetworkManager and WICD at the same time can "
+"lead to unexpected results, as both will try to manage your network. It is "
+"recommended to only enable either one of them."
+msgstr ""