r25019 - in /packages/unstable/system-config-printer/debian: gpk-install-package-name install patches/0007-Use-our-custom-cpk-install-package-name.patch patches/series
agx at users.alioth.debian.org
agx at users.alioth.debian.org
Tue Aug 24 13:31:27 UTC 2010
Author: agx
Date: Tue Aug 24 13:31:26 2010
New Revision: 25019
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=25019
Log:
Add simple gpk-install-package-name implementation
Added:
packages/unstable/system-config-printer/debian/gpk-install-package-name (with props)
packages/unstable/system-config-printer/debian/patches/0007-Use-our-custom-cpk-install-package-name.patch
Modified:
packages/unstable/system-config-printer/debian/install
packages/unstable/system-config-printer/debian/patches/series
Added: packages/unstable/system-config-printer/debian/gpk-install-package-name
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/system-config-printer/debian/gpk-install-package-name?rev=25019&op=file
==============================================================================
--- packages/unstable/system-config-printer/debian/gpk-install-package-name (added)
+++ packages/unstable/system-config-printer/debian/gpk-install-package-name [utf-8] Tue Aug 24 13:31:26 2010
@@ -1,0 +1,49 @@
+#!/usr/bin/python -u
+# vim: set fileencoding=utf-8 :
+#
+# (C) 2010 Guido Guenther <agx at sigxcpu.org>
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+"""Emulate gpk-install-package-name"""
+
+import sys
+import dbus
+
+def main(argv):
+ pkgs = argv[1:]
+ if not pkgs:
+ print >>sys.stderr, "no packages given"
+ return 1
+
+ bus = dbus.SessionBus()
+ pk = bus.get_object('org.freedesktop.PackageKit',
+ '/org/freedesktop/PackageKit');
+
+ pk_iface = dbus.Interface(pk, dbus_interface='org.freedesktop.PackageKit.Modify')
+
+ try:
+ ret = pk_iface.InstallPackageNames(0, pkgs, "hide-finished,hide-warnings", timeout=300000)
+ if ret:
+ print >>sys.stderr, "Error installing packages"
+ return 1
+ except dbus.exceptions.DBusException, cause:
+ print sys.stderr, cause
+ return 1
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
Propchange: packages/unstable/system-config-printer/debian/gpk-install-package-name
------------------------------------------------------------------------------
svn:executable = *
Modified: packages/unstable/system-config-printer/debian/install
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/system-config-printer/debian/install?rev=25019&op=diff
==============================================================================
--- packages/unstable/system-config-printer/debian/install [utf-8] (original)
+++ packages/unstable/system-config-printer/debian/install [utf-8] Tue Aug 24 13:31:26 2010
@@ -5,3 +5,4 @@
debian/tmp/usr/share/man
debian/tmp/usr/share/system-config-printer/system-config-printer.py /usr/bin
debian/tmp/usr/share/system-config-printer/*/
+debian/gpk-install-package-name /usr/share/system-config-printer/
Added: packages/unstable/system-config-printer/debian/patches/0007-Use-our-custom-cpk-install-package-name.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/system-config-printer/debian/patches/0007-Use-our-custom-cpk-install-package-name.patch?rev=25019&op=file
==============================================================================
--- packages/unstable/system-config-printer/debian/patches/0007-Use-our-custom-cpk-install-package-name.patch (added)
+++ packages/unstable/system-config-printer/debian/patches/0007-Use-our-custom-cpk-install-package-name.patch [utf-8] Tue Aug 24 13:31:26 2010
@@ -1,0 +1,32 @@
+From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx at sigxcpu.org>
+Date: Wed, 28 Jul 2010 17:29:05 +0200
+Subject: [PATCH] Use our custom cpk-install-package-name
+
+---
+ installpackage.py | 10 +++-------
+ 1 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/installpackage.py b/installpackage.py
+index baedc60..b956997 100644
+--- a/installpackage.py
++++ b/installpackage.py
+@@ -22,15 +22,11 @@
+ import os
+ import glib
+
++GPK_INSTALL_PACKAGE_NAME='/usr/share/system-config-printer/gpk-install-package-name'
++
+ class PackageKit:
+ def __init__ (self):
+- for dir in os.environ.get ("PATH", "").split (":"):
+- path = dir + os.path.sep + "gpk-install-package-name"
+- if os.access (path, os.X_OK):
+- self.gpk_install_package_name = path
+- return
+-
+- raise RuntimeError, "No gpk-install-package-name program available"
++ self.gpk_install_package_name = GPK_INSTALL_PACKAGE_NAME
+
+ def InstallPackageName (self, xid, timestamp, name):
+ glib.spawn_async ([self.gpk_install_package_name, name])
+--
Modified: packages/unstable/system-config-printer/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/system-config-printer/debian/patches/series?rev=25019&op=diff
==============================================================================
--- packages/unstable/system-config-printer/debian/patches/series [utf-8] (original)
+++ packages/unstable/system-config-printer/debian/patches/series [utf-8] Tue Aug 24 13:31:26 2010
@@ -4,3 +4,4 @@
0004-Fix-blacklist-name.patch
0005-Revert-to-the-correct-menu-category.patch
0006-Don-t-blindly-listen-to-any-signal.patch
+0007-Use-our-custom-cpk-install-package-name.patch
More information about the pkg-gnome-commits
mailing list