summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Zini <enrico@enricozini.org>2014-08-24 17:37:50 (GMT)
committerEnrico Zini <enrico@enricozini.org>2014-08-24 17:41:26 (GMT)
commit8ee50ce17b93b9f6fa0d7434526d4eb23493c10e (patch)
tree0839991e0d6b52c72a88b8d98365080d7860c9e2
parent4d52f91d166efffcbc2b9e835fe4644b196aa856 (diff)
Removed dbus support files, not needed anymore since software-center has been removed from sid and testing
-rw-r--r--data/org.debian.AptXapianIndex.conf19
-rw-r--r--data/org.debian.AptXapianIndex.service4
-rw-r--r--data/org.debian.aptxapianindex.policy24
-rw-r--r--debian/changelog2
-rw-r--r--debian/dirs3
-rw-r--r--debian/postinst2
-rwxr-xr-xdebian/postrm2
-rw-r--r--debian/preinst7
-rwxr-xr-xdebian/rules5
-rwxr-xr-xupdate-apt-xapian-index-dbus112
10 files changed, 13 insertions, 167 deletions
diff --git a/data/org.debian.AptXapianIndex.conf b/data/org.debian.AptXapianIndex.conf
deleted file mode 100644
index a702781..0000000
--- a/data/org.debian.AptXapianIndex.conf
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE busconfig PUBLIC
- "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
-<busconfig>
- <policy user="root">
- <allow own="org.debian.AptXapianIndex"/>
- </policy>
-
- <policy context="default">
- <allow send_destination="org.debian.AptXapianIndex"
- send_interface="org.debian.AptXapianIndex"/>
- <allow send_destination="org.debian.AptXapianIndex"
- send_interface="org.freedesktop.DBus.Introspectable"/>
- <allow send_destination="org.debian.AptXapianIndex"
- send_interface="org.freedesktop.DBus.Properties"/>
- </policy>
-
-</busconfig>
-
diff --git a/data/org.debian.AptXapianIndex.service b/data/org.debian.AptXapianIndex.service
deleted file mode 100644
index 3ff946d..0000000
--- a/data/org.debian.AptXapianIndex.service
+++ /dev/null
@@ -1,4 +0,0 @@
-[D-BUS Service]
-Name=org.debian.AptXapianIndex
-Exec=/usr/share/apt-xapian-index/update-apt-xapian-index-dbus
-User=root
diff --git a/data/org.debian.aptxapianindex.policy b/data/org.debian.aptxapianindex.policy
deleted file mode 100644
index 201d1e1..0000000
--- a/data/org.debian.aptxapianindex.policy
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE policyconfig PUBLIC
- "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
- "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
-<policyconfig>
- <!--
- Policy definitions for SystemService system actions.
- (C) 2010 Canonical Ltd.
- Author: Michael Vogt <mvo@ubuntu.com>
- -->
- <vendor>AptXapianIndex</vendor>
- <vendor_url>http://www.enricozini.org/sw/apt-xapian-index/</vendor_url>
-
- <action id="org.debian.aptxapianindex.update">
- <_description>Update the xapian index</_description>
- <_message>System policy prevents updating xapian index</_message>
- <defaults>
- <allow_inactive>no</allow_inactive>
- <allow_active>yes</allow_active>
- </defaults>
- </action>
-
-</policyconfig>
-
diff --git a/debian/changelog b/debian/changelog
index 0480c14..453695c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ apt-xapian-index (0.47) UNRELEASED; urgency=low
[ Enrico Zini ]
* s/UNRELEASED/unstable/ in 0.46 changelog. Closes: #719940
+ * Removed dbus support files, not needed anymore since software-center has
+ been removed from sid and testing
[ Elena Grandi ]
* Use defaults when values file is broken. Closes: #736500
diff --git a/debian/dirs b/debian/dirs
index fad9107..5b6148d 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -4,6 +4,3 @@ usr/share/doc
usr/share/apt-xapian-index
usr/share/apt-xapian-index/aliases
usr/share/apt-xapian-index/plugins
-etc/dbus-1/system.d
-usr/share/dbus-1/system-services
-usr/share/polkit-1/actions
diff --git a/debian/postinst b/debian/postinst
index 724fe47..fad3683 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -11,6 +11,8 @@ else
IONICE=""
fi
+dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.46 apt-xapian-index -- "$@"
+
case "$1" in
configure)
# Just checking the main directory with -d should prevent the indexing
diff --git a/debian/postrm b/debian/postrm
index d9ff4c6..542cecc 100755
--- a/debian/postrm
+++ b/debian/postrm
@@ -2,6 +2,8 @@
set -e
+dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.46 apt-xapian-index -- "$@"
+
if [ "$1" = "remove" -o "$1" = "purge" ]; then
echo "Removing index /var/lib/apt-xapian-index..."
rm -rf /var/lib/apt-xapian-index
diff --git a/debian/preinst b/debian/preinst
new file mode 100644
index 0000000..57eeccb
--- /dev/null
+++ b/debian/preinst
@@ -0,0 +1,7 @@
+#!/bin/sh -e
+
+#DEBHELPER#
+
+dpkg-maintscript-helper rm_conffile /etc/dbus-1/system.d/org.debian.AptXapianIndex.conf 0.46 apt-xapian-index -- "$@"
+
+exit 0
diff --git a/debian/rules b/debian/rules
index 5369e6f..a4fcc36 100755
--- a/debian/rules
+++ b/debian/rules
@@ -24,11 +24,6 @@ override_dh_auto_install:
install -o root -g root -m 755 -d $(PFX)/usr/share/apt-xapian-index/plugins
install -o root -g root -m 644 aliases/* $(PFX)/usr/share/apt-xapian-index/aliases/
install -o root -g root -m 644 plugins/*.py $(PFX)/usr/share/apt-xapian-index/plugins/
- # Install the dbus stuff
- install -o root -g root -m 755 update-apt-xapian-index-dbus $(PFX)/usr/share/apt-xapian-index
- install -o root -g root -m 644 data/org.debian.AptXapianIndex.conf $(PFX)/etc/dbus-1/system.d
- install -o root -g root -m 644 data/org.debian.AptXapianIndex.service $(PFX)/usr/share/dbus-1/system-services/org.debian.AptXapianIndex.service
- install -o root -g root -m 644 data/org.debian.aptxapianindex.policy $(PFX)/usr/share/polkit-1/actions
# Install bash completion
dh_bash-completion
diff --git a/update-apt-xapian-index-dbus b/update-apt-xapian-index-dbus
deleted file mode 100755
index bfc972b..0000000
--- a/update-apt-xapian-index-dbus
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/usr/bin/python
-
-import logging
-import os
-import string
-import subprocess
-
-try:
- import glib
- import gobject
- import dbus
- import dbus.service
- import dbus.mainloop.glib
-except ImportError, e:
- sys.stderr.write("Failed to import '%s', can not use dbus" % e)
- sys.exit(1)
-
-class PermissionDeniedError(dbus.DBusException):
- " permission denied by policy "
- pass
-
-class AptXapianIndexDBusService(dbus.service.Object):
- DBUS_INTERFACE_NAME = "org.debian.AptXapianIndex"
-
- def __init__(self):
- bus_name = dbus.service.BusName(self.DBUS_INTERFACE_NAME,
- bus=dbus.SystemBus())
- dbus.service.Object.__init__(self, bus_name, '/')
- self._active_axi = None
-
- def _authWithPolicyKit(self, sender, connection, priv):
- system_bus = dbus.SystemBus()
- obj = system_bus.get_object("org.freedesktop.PolicyKit1",
- "/org/freedesktop/PolicyKit1/Authority",
- "org.freedesktop.PolicyKit1.Authority")
- policykit = dbus.Interface(obj, "org.freedesktop.PolicyKit1.Authority")
- info = dbus.Interface(connection.get_object('org.freedesktop.DBus',
- '/org/freedesktop/DBus/Bus',
- False),
- 'org.freedesktop.DBus')
- pid = info.GetConnectionUnixProcessID(sender)
- subject = ('unix-process',
- { 'pid' : dbus.UInt32(pid, variant_level=1),
- 'start-time' : dbus.UInt64(0, variant_level=1),
- }
- )
- details = { '' : '' }
- flags = dbus.UInt32(1) # AllowUserInteraction = 0x00000001
- cancel_id = ''
- (ok, notused, details) = policykit.CheckAuthorization(
- subject, priv, details, flags, cancel_id)
- return ok
-
- @dbus.service.signal(dbus_interface=DBUS_INTERFACE_NAME,
- signature="b")
- def UpdateFinished(self, res):
- logging.debug("Emitting UpdateFinished: %s" % res)
-
- @dbus.service.signal(dbus_interface=DBUS_INTERFACE_NAME,
- signature="i")
- def UpdateProgress(self, percent):
- logging.debug("Emitting UpdateProgress: %s" % percent)
-
- def _update_apt_xapian_index(self, cmd):
- p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
- self._active_axi = p
- while True:
- while gobject.main_context_default().pending():
- gobject.main_context_default().iteration()
- res = p.poll()
- if res is not None:
- break
- line = p.stdout.readline().strip()
- if not line:
- continue
- try:
- (op, progress) = string.split(line, sep=":", maxsplit=1)
- if op == "progress":
- percent = int(progress.split("/")[0])
- self.UpdateProgress(percent)
- except ValueError:
- pass
- # axi finished
- self._active_axi = None
- # emit finish signal
- self.UpdateFinished(res == 0)
-
- @dbus.service.method(DBUS_INTERFACE_NAME,
- in_signature='bb',
- out_signature='',
- sender_keyword='sender',
- connection_keyword='conn')
- def update_async(self, force, update_only, sender=None, conn=None):
- if not self._authWithPolicyKit(sender, conn,
- "org.debian.aptxapianindex.update"):
- raise PermissionDeniedError, "Permission denied by policy"
- # do not start update-apt-xapian-index twice, the clients will
- # get the finished signal from the previous running one
- if self._active_axi:
- return
- cmd = ["/usr/sbin/update-apt-xapian-index", "--batch-mode"]
- if force:
- cmd.append("--force")
- if update_only:
- cmd.append("--update")
- glib.timeout_add(100, self._update_apt_xapian_index, cmd)
-
-if __name__ == "__main__":
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- server = AptXapianIndexDBusService()
- gobject.MainLoop().run()
-