summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog18
-rw-r--r--debian/config21
-rw-r--r--debian/control1
-rw-r--r--debian/gbp.conf1
-rw-r--r--debian/patches/0001-Another-import-bugfix.patch27
-rw-r--r--debian/patches/0002-Abort-early-if-we-found-a-match.patch24
-rw-r--r--debian/patches/series2
-rw-r--r--debian/po/POTFILES.in1
-rw-r--r--debian/po/templates.pot42
-rw-r--r--debian/postinst47
-rw-r--r--debian/templates11
-rw-r--r--debian/tests/control3
-rwxr-xr-xdebian/tests/smoke3
13 files changed, 201 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index bc3533e..e8923f7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,21 @@
+whatmaps (0.0.8-2) unstable; urgency=medium
+
+ * [cca6b44] Add debconf question to enable automatic service restarts
+
+ -- Guido Günther <agx@sigxcpu.org> Tue, 29 Jul 2014 13:10:50 +0200
+
+whatmaps (0.0.8-1) unstable; urgency=medium
+
+ * [ac817c1] Print userfriendly message if not root (Closes: #751088)
+ * [c6168df] Add upstream-branch to gbp.conf
+ * [e1b9e7f] pkg_services: Check if a service is actually installed.
+ * [f758314] Add systemd support
+ * [d6dba76] Add simple autopkgtest
+ * [e048b5f] Abort early if we found a match. This speeds up the output and
+ avoids duplicate printouts
+
+ -- Guido Günther <agx@sigxcpu.org> Mon, 14 Jul 2014 16:58:19 +0200
+
whatmaps (0.0.7-1~bpo70+1) wheezy-backports; urgency=medium
* Rebuild for wheezy-backports.
diff --git a/debian/config b/debian/config
new file mode 100644
index 0000000..7497f7d
--- /dev/null
+++ b/debian/config
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+APT_CONF=/etc/apt/apt.conf.d/20services
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+if [ -f $APT_CONF ]; then
+ CURRENT=$(sed -ne 's,^\s*Whatmaps::Enable-Restart\s\+"\(\S\+\)"\s*;,\1,p' $APT_CONF)
+ case $CURRENT in
+ 1|true)
+ CURRENT="true"
+ ;;
+ *) CURRENT="false"
+ ;;
+ esac
+ db_set whatmaps/enable_service_restarts $CURRENT
+fi
+
+db_input medium whatmaps/enable_service_restarts || true
+db_go
diff --git a/debian/control b/debian/control
index 516e234..4711391 100644
--- a/debian/control
+++ b/debian/control
@@ -11,6 +11,7 @@ Standards-Version: 3.9.5
Homepage: https://honk.sigxcpu.org/piki/projects/whatmaps
Vcs-Git: git://honk.sigxcpu.org/git/whatmaps.git/
X-Python-Version: >= 2.7
+XS-Testsuite: autopkgtest
Package: whatmaps
Architecture: all
diff --git a/debian/gbp.conf b/debian/gbp.conf
index 0d61683..9678e28 100644
--- a/debian/gbp.conf
+++ b/debian/gbp.conf
@@ -1,3 +1,4 @@
[DEFAULT]
debian-branch = debian/master
upstream-tag = v%(version)s
+upstream-branch = master
diff --git a/debian/patches/0001-Another-import-bugfix.patch b/debian/patches/0001-Another-import-bugfix.patch
new file mode 100644
index 0000000..9cbb73e
--- /dev/null
+++ b/debian/patches/0001-Another-import-bugfix.patch
@@ -0,0 +1,27 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Fri, 11 Jul 2014 20:53:31 +0200
+Subject: Another import bugfix
+
+---
+ whatmaps/debiandistro.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py
+index 9294c9f..3a3bf16 100644
+--- a/whatmaps/debiandistro.py
++++ b/whatmaps/debiandistro.py
+@@ -31,12 +31,12 @@ import subprocess
+ import sys
+ import string
+
+-import whatmaps.distro
++from . distro import Distro
+ from . debianpkg import DebianPkg
+ from . pkg import PkgError
+ from . systemd import Systemd
+
+-class DebianDistro(whatmaps.distro.Distro):
++class DebianDistro(Distro):
+ "Debian (dpkg) based distribution"
+ id = 'Debian'
+
diff --git a/debian/patches/0002-Abort-early-if-we-found-a-match.patch b/debian/patches/0002-Abort-early-if-we-found-a-match.patch
new file mode 100644
index 0000000..3513ad6
--- /dev/null
+++ b/debian/patches/0002-Abort-early-if-we-found-a-match.patch
@@ -0,0 +1,24 @@
+From: =?utf-8?q?Guido_G=C3=BCnther?= <agx@sigxcpu.org>
+Date: Mon, 14 Jul 2014 16:12:43 +0200
+Subject: Abort early if we found a match
+
+Once we found a shared object that a process maps we don't need to
+continue with the other shared objects since one is enough to require
+a process restart.
+---
+ whatmaps/command.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/whatmaps/command.py b/whatmaps/command.py
+index 7690ef8..e649cbb 100755
+--- a/whatmaps/command.py
++++ b/whatmaps/command.py
+@@ -39,7 +39,7 @@ def check_maps(procs, shared_objects):
+ restart_procs[proc.exe] += [ proc ]
+ else:
+ restart_procs[proc.exe] = [ proc ]
+- continue
++ break
+ return restart_procs
+
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..219effd
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+0001-Another-import-bugfix.patch
+0002-Abort-early-if-we-found-a-match.patch
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..cef83a3
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] templates
diff --git a/debian/po/templates.pot b/debian/po/templates.pot
new file mode 100644
index 0000000..3c0783d
--- /dev/null
+++ b/debian/po/templates.pot
@@ -0,0 +1,42 @@
+# 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: whatmaps\n"
+"Report-Msgid-Bugs-To: whatmaps@packages.debian.org\n"
+"POT-Creation-Date: 2014-07-15 13:22+0200\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
+#: ../templates:1001
+msgid "Automatically restart services after shared library security updates?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"Services need to be restarted to benefit from updates of shared libraries "
+"they depend on. Without that they remain vulnerable to security bugs fixed "
+"in these updates."
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../templates:1001
+msgid ""
+"Automatic service restarts are only done if apt fetched the library from a "
+"source providing security updates. This also affects packages installed via "
+"unattended-upgrades."
+msgstr ""
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..9965480
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -e
+
+APT_CONF=/etc/apt/apt.conf.d/20services
+
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+case "$1" in
+ configure)
+ db_get whatmaps/enable_service_restarts || true
+ DBVAL="$RET"
+
+ # Configuration file doesn't exist but user wants updates enabled so
+ # recreate it:
+ if [ ! -f $APT_CONF ] && [ $DBVAL = "true" ]; then
+ cat << EOF > $APT_CONF
+// Set to 1 or true to enable service restarts on security updates
+Whatmaps::Enable-Restart "1";
+
+// What updates are considered security updates
+Whatmaps::Security-Update-Origins {
+ "\${distro_id} stable";
+ "\${distro_id} \${distro_codename}-security";
+};
+EOF
+ else
+ case $DBVAL in
+ "true") VAL=1;;
+ *) VAL=0;;
+ esac
+ sed -ie "s,^\(\s*Whatmaps::Enable-Restart\s\+\"\)\S\+\(\"\s*;\),\1${VAL}\2," $APT_CONF
+ fi
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/templates b/debian/templates
new file mode 100644
index 0000000..83e32c1
--- /dev/null
+++ b/debian/templates
@@ -0,0 +1,11 @@
+Template: whatmaps/enable_service_restarts
+Type: boolean
+Default: false
+_Description: Automatically restart services after shared library security updates?
+ Services need to be restarted to benefit from updates of shared libraries they
+ depend on. Without that they remain vulnerable to security bugs fixed in these
+ updates.
+ .
+ Automatic service restarts are only done if apt fetched the library from a
+ source providing security updates. This also affects packages installed
+ via unattended-upgrades.
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..2c75b73
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,3 @@
+Tests: smoke
+Restrictions: needs-root
+Depends: libvirt-bin, @
diff --git a/debian/tests/smoke b/debian/tests/smoke
new file mode 100755
index 0000000..dde8c37
--- /dev/null
+++ b/debian/tests/smoke
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+whatmaps libvirt0 | grep -qs ^libvirt-bin