[PackageKit-commit] packagekit: Branch 'master' - 25 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Mon Sep 8 08:23:07 PDT 2008
NEWS | 90
backends/Makefile.am | 4
backends/apt/aptDBUSBackend.py | 13
backends/smart/helpers/remove-packages.py | 5
backends/smart/helpers/smartBackend.py | 33
backends/smart/pk-backend-smart.c | 86
backends/yum/yumBackend.py | 30
backends/yum/yumComps.py | 1
backends/yum/yumDirect.py | 1
backends/yum/yumFilter.py | 1
backends/yum2/.gitignore | 14
backends/yum2/Makefile.am | 11
backends/yum2/helpers/.gitignore | 2
backends/yum2/helpers/Makefile.am | 21
backends/yum2/helpers/packagekit | 1
backends/yum2/helpers/testyum2.py | 96
backends/yum2/helpers/yumDBUSBackend.py | 2371 -------------------
backends/yum2/pk-backend-yum2.c | 352 --
client/pk-import-desktop.c | 46
configure.ac | 45
contrib/PackageKit.spec.in | 96
data/Makefile.am | 10
data/org.freedesktop.PackageKitYumBackend.conf.in | 11
data/org.freedesktop.PackageKitYumBackend.service.in | 5
docs/api/spec/pk-backend-dbus.xml | 2
docs/html/pk-download.html | 16
docs/html/pk-faq.html | 8
docs/html/pk-matrix.html | 38
docs/html/pk-using.html | 2
etc/PackageKit.conf.in | 14
libpackagekit/egg-obj-list.c | 56
libpackagekit/egg-obj-list.h | 4
src/Makefile.am | 1
src/pk-backend-python.c | 1221 ---------
src/pk-backend-python.h | 83
src/pk-transaction.c | 38
36 files changed, 446 insertions(+), 4382 deletions(-)
New commits:
commit 9a0ad834a5f4066d1c8ee9c34ab5feafb0e1489b
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 16:19:03 2008 +0100
Release version 0.3.2
diff --git a/NEWS b/NEWS
index c8d7fe2..18bda42 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,93 @@
+Version 0.3.2
+~~~~~~~~~~~~~~
+Released: 2008-09-08
+
+Notes:
+ - This is the first release with the dispatcher functionality that allows
+ backend reuse. This speeds up packagekitd to native speeds when doing
+ repeated similar transactions from the same session and locale.
+
+Translations:
+ - Updated Spanish translation (Domingo Becker)
+ - Updated Brazilian Portuguese translation (Igor Pires Soares)
+ - Updated Polish translation (Piotr DrÄ
g)
+ - Updated Finnish translation (Ville-Pekka Vainio)
+
+New Features:
+ - Allow the engine to reuse the backend as a dispatcher (Richard Hughes, Tim Lauridsen)
+ - Optionally auto-run pk-generate-package-list and pk-import-desktop (Richard Hughes)
+ - Unexport generic functions libpackagekit to avoid pollution (Richard Hughes)
+
+Bugfixes:
+ - Fix pkcon to treat the filters as bitfields, not enums (Richard Hughes)
+ - Check the install_files input before we process it. Fixes fd#17350 (Richard Hughes)
+ - Add another error enum for package conflicts (Richard Hughes)
+ - Add instructions for getting PackageKit on Ubuntu (Dimitris Symeonidis)
+ - Add the new status enum LOADING_CACHE (Richard Hughes)
+ - Fix pk-import-desktop so that it uses a valid bitfield, not just an enum (Richard Hughes)
+ - Spawned backends are allowed to call finished manually (Richard Hughes)
+ - Don't corrupt envp when we pass it to the new executable (Richard Hughes)
+ - Allow the backend to force the dispatcher to close after a timeout (Richard Hughes)
+ - Wait for the previous dispatcher to finish exiting before we try to launch the new one (Richard Hughes)
+ - Fix the dispatcher when called from different user sessions or locales (Richard Hughes)
+ - Remove pk-backend-python and the complicated interpretor stuff (Richard Hughes)
+ - Give a warning if a package is already installed, and a proper error if all
+ packages in the transaction are already installed. Fixes rh#459870 (Robin Norwood)
+ - Fix udev firmware rule to call the correct script (Scott Reeves)
+ - Rename the mime extension so we match service packs (Shishir Goyal)
+ - Fix the python enum converter to allow underscores in the value names (Sebastian Heinlein)
+ - Add support for distro upgrades to the dbus backend (Sebastian Heinlein)
+
+Backends:
+ - apt: Implement SearchFile (Sebastian Heinlein)
+ - apt: Implement the free filter (Sebastian Heinlein)
+ - apt: Handle the candidate origin to not break on obsolete packages (Sebastian Heinlein)
+ - apt: Add a custom cache class based on python-apt's consolidate branch (Sebastian Heinlein)
+ - apt: Import latest debfile from python-apt's consolidate branch (Sebastian Heinlein)
+ - apt: The __iter__ now uses a sorted list of the package names (Sebastian Heinlein)
+ - apt: Fix section to group mapping for non-main packages (Sebastian Heinlein)
+ - apt: Implement GetDistroUpgrades (Sebastian Heinlein)
+ - apt: Implement GetRepoList (Sebastian Heinlein)
+ - apt: Implement RepoEnable (Sebastian Heinlein)
+ - apt: Updates which succeed a security update as a security update (Sebastian Heinlein)
+ - apt: Acquire the system lock before making any invasive changes (Sebastian Heinlein)
+ - apt: Fail correctly if installing from cdrom (Sebastian Heinlein)
+ - apt: Detect a cancel in the cache refreshing correctly (Sebastian Heinlein)
+ - apt: Use the correct names if we fail to get the changelog. Fixes fd#17406 (Richard Hughes)
+ - apt: Remove the localised error descriptions (Richard Hughes)
+ - smart: Allow for multiple packages (Anders F Bjorklund)
+ - smart: Add get_packages (Anders F Bjorklund)
+ - smart: Add RPM/DEB groups (Anders F Bjorklund)
+ - smart: Add get_requires (Anders F Bjorklund)
+ - smart: Add basic status reports (Anders F Bjorklund)
+ - smart: Add more filters, graphical/development/license (Anders F Bjorklund)
+ - smart: Use filters for depends/requires (Anders F Bjorklund)
+ - smart: Make packageid work for deb/slack channels (Anders F Bjorklund)
+ - smart: Add search_file (Anders F Bjorklund)
+ - smart: Add what_provides (Anders F Bjorklund)
+ - smart: Add repo_set_data (Anders F Bjorklund)
+ - smart: Do graphical/development filtering (Anders F Bjorklund)
+ - smart: Add newest filtering (Anders F Bjorklund)
+ - smart: Fix packages/depends/requires bug with post filters (Anders F Bjorklund)
+ - smart: Allow cancel - killing backend (Anders F Bjorklund)
+ - smart: Show package for download/install (Anders F Bjorklund)
+ - smart: Don't forget the files signal in smart download (Anders F Bjorklund)
+ - smart: Don't remove essential packages (Anders F Bjorklund)
+ - smart: Avoid bombing out for smart progress updates without packages (Anders F Bjorklund)
+ - smart: Optionally allow backend to use dispatcher (Anders F Bjorklund)
+ - yum: Use inheritence insted of declaring a helper class (Tim Lauridsen)
+ - yum: Cleanup imports (Tim Lauridsen)
+ - yum: Use the sqlite3 build into python-2.5 (Tim Lauridsen)
+ - yum: Add dispatcher script for future improvement of the backend (Tim Lauridsen)
+ - yum: Let the yum backend use the new multiple command dispatcher (Tim Lauridsen)
+ - yum: Don't always prefer the first package returned from returnNewestByNameArch()
+ as this will be i386 on x64 which is wrong on multiarch (Richard Hughes)
+ - yum: Use the new PACKAGE_CONFLICTS error enum. Fixes rh#459914 (Richard Hughes)
+ - yum: Add GetDistroUpgrades support using the preupgrade package (Richard Hughes)
+ - yum: Never set self.yumbase.conf.cache = 1 to fix the dispatcher (Richard Hughes)
+ - yum2: Remove the yum2 plugin now we have a fast dispatcher (Richard Hughes)
+ - zypp: Updated pk-matrix (Stefan Haas)
+
Version 0.3.1
~~~~~~~~~~~~~~
Released: 2008-08-27
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 5631601..5611265 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -57,14 +57,25 @@ Released versions are found on
<h3>
Latest Supported Versions:
</h3>
+<p>
+These are versions which have new features for each release.
+We are also willing to break ABI and API to fix bugs and will merge new or
+modified translations as required or suggested.
+Releases are normally once every 1-2 weeks.
+</p>
<table>
<tr><td><b>Version</b></td><td> </td><td><b>Date</b></td></tr>
<tr><td>0.3.0</td><td></td><td>2008-08-18</td></tr>
<tr><td>0.3.1</td><td></td><td>2008-08-27</td></tr>
+<tr><td>0.3.2</td><td></td><td>2008-09-08</td></tr>
</table>
<h3>
ABI Stable Versions:
</h3>
+<p>
+These are versions where we will not break ABI, API or localisations.
+Releases are less frequent, usually less than once a month.
+</p>
<table>
<tr><td><b>Version</b></td><td> </td><td><b>Date</b></td></tr>
<tr><td>0.2.0</td><td></td><td>2008-05-06</td></tr>
@@ -77,6 +88,11 @@ ABI Stable Versions:
<h3>
Obsolete Versions:
</h3>
+<p>
+These are versions that used to be the ABI stable releases, but are now
+longer supported.
+There will not be any more releases of these versions.
+</p>
<table>
<tr><td><b>Version</b></td><td> </td><td><b>Date</b></td></tr>
<tr><td>0.1.0</td><td></td><td>2007-10-16</td></tr>
diff --git a/docs/html/pk-using.html b/docs/html/pk-using.html
index 4fbbb0c..6ebe10c 100644
--- a/docs/html/pk-using.html
+++ b/docs/html/pk-using.html
@@ -22,7 +22,7 @@
<h2>Using the command line</h2>
<p>
The <code>pkcon</code> text-mode program allows you to interact with
-PackageKit on the command. For example:
+PackageKit on the command line. For example:
</p>
<pre>
[hughsie at laptop ~]$ pkcon get-updates
commit 2c2fc32986e596e46faf06965a9eb0a92df2387e
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 16:14:24 2008 +0100
trivial: bump LT_CURRENT as the soname has changed in the last release
diff --git a/configure.ac b/configure.ac
index 80a5474..0bffc45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@ DEVELOPMENT_RELEASE=no
# REVISION If the API and ABI remains the same, but bugs are fixed.
# AGE If libpackagekit can be linked into executables which can be
# built with previous versions of this library. Don't use.
-LT_CURRENT=4
+LT_CURRENT=5
LT_REVISION=0
LT_AGE=0
AC_SUBST(LT_CURRENT)
commit c98ceba09e5fffd7914dc1f88b85f881c9a412cb
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 16:13:44 2008 +0100
trivial: finish removing yum2 :-)
diff --git a/configure.ac b/configure.ac
index ced6df7..80a5474 100644
--- a/configure.ac
+++ b/configure.ac
@@ -543,7 +543,6 @@ data/Makefile
data/packagekit.pc
data/org.freedesktop.PackageKit.conf
data/org.freedesktop.PackageKitTestBackend.conf
-data/org.freedesktop.PackageKitYumBackend.conf
data/org.freedesktop.PackageKitAptBackend.conf
data/tests/Makefile
libpackagekit/Makefile
commit 91dd3deb10f59af926a3e5c9da05aeae086bdb0e
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Mon Sep 8 16:17:03 2008 +0200
Remove the dbus parts of yum2
diff --git a/data/Makefile.am b/data/Makefile.am
index 23c5f0c..07dc239 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -36,7 +36,6 @@ dbusdir = ${SYSCONFDIR}/dbus-1/system.d
dist_dbus_DATA = \
org.freedesktop.PackageKit.conf \
org.freedesktop.PackageKitTestBackend.conf \
- org.freedesktop.PackageKitYumBackend.conf \
org.freedesktop.PackageKitAptBackend.conf \
$(NULL)
@@ -46,12 +45,6 @@ servicemain_DATA = $(servicemain_in_files:.service.in=.service)
$(servicemain_DATA): $(servicemain_in_files) Makefile
@sed -e "s|\@servicedir\@|$(sbindir)|" -e "s|\@PACKAGEKIT_USER\@|$(PACKAGEKIT_USER)|" $< > $@
-serviceyumdir = $(DBUS_SERVICES_DIR)
-serviceyum_in_files = org.freedesktop.PackageKitYumBackend.service.in
-serviceyum_DATA = $(serviceyum_in_files:.service.in=.service)
-$(serviceyum_DATA): $(serviceyum_in_files) Makefile
- @sed -e "s|\@servicedir\@|$(libexecdir)|" -e "s|\@PK_BACKEND_USER\@|$(PK_BACKEND_USER)|" $< > $@
-
servicetestdir = $(DBUS_SERVICES_DIR)
servicetest_in_files = org.freedesktop.PackageKitTestBackend.service.in
servicetest_DATA = $(servicetest_in_files:.service.in=.service)
@@ -80,12 +73,10 @@ EXTRA_DIST = \
packagekit-background.cron \
org.freedesktop.PackageKit.conf.in \
org.freedesktop.PackageKitTestBackend.conf.in \
- org.freedesktop.PackageKitYumBackend.conf.in \
org.freedesktop.PackageKitAptBackend.conf.in \
packagekit.pc.in \
20packagekit \
$(servicemain_in_files) \
- $(serviceyum_in_files) \
$(servicetest_in_files) \
$(serviceapt_in_files) \
$(mime_in_files) \
@@ -103,7 +94,6 @@ DISTCLEANFILES = \
$(mime_DATA) \
org.freedesktop.PackageKit.service \
org.freedesktop.PackageKitTestBackend.service \
- org.freedesktop.PackageKitYumBackend.service \
org.freedesktop.PackageKitAptBackend.service \
$(NULL)
diff --git a/data/org.freedesktop.PackageKitYumBackend.conf.in b/data/org.freedesktop.PackageKitYumBackend.conf.in
deleted file mode 100644
index 6d638c0..0000000
--- a/data/org.freedesktop.PackageKitYumBackend.conf.in
+++ /dev/null
@@ -1,11 +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="@PK_BACKEND_USER@">
- <allow own="org.freedesktop.PackageKitYumBackend"/>
- <allow send_destination="org.freedesktop.PackageKitYumBackend"/>
- <allow send_interface="org.freedesktop.PackageKitBackend"/>
- </policy>
-</busconfig>
-
diff --git a/data/org.freedesktop.PackageKitYumBackend.service.in b/data/org.freedesktop.PackageKitYumBackend.service.in
deleted file mode 100644
index 5bdaf2a..0000000
--- a/data/org.freedesktop.PackageKitYumBackend.service.in
+++ /dev/null
@@ -1,5 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.PackageKitYumBackend
-Exec=@servicedir@/yumDBUSBackend.py
-User=@PK_BACKEND_USER@
-
commit b8d7f35de0ce281302e27865e746f99c91acc278
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 12:37:34 2008 +0100
trivial: we depend on policykit 0.8 in fedora
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 41303ab..706ef03 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -1,7 +1,7 @@
%define glib2_version 2.16.1
%define dbus_version 0.90
%define dbus_glib_version 0.70
-%define policykit_version 0.7
+%define policykit_version 0.8
%define alphatag #ALPHATAG#
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
commit d7a83279d3bfda40b3b4915e84e123745910e164
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 12:13:22 2008 +0100
trivial: update the fedora spec file
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index 730821d..41303ab 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -2,7 +2,7 @@
%define dbus_version 0.90
%define dbus_glib_version 0.70
%define policykit_version 0.7
-%define alphatag #ALPHATAG#
+%define alphatag #ALPHATAG#
%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
@@ -10,7 +10,6 @@ Summary: System daemon that is a DBUS abstraction layer for package management
Name: PackageKit
Version: #VERSION#
Release: 0.#BUILD#%{?alphatag}%{?dist}
-Epoch: 1
License: GPLv2+
Group: System Environment/Libraries
URL: http://packagekit.freedesktop.org
@@ -19,10 +18,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: dbus >= %{dbus_version}
Requires: dbus-glib >= %{dbus_glib_version}
-Requires: PackageKit-libs = %{epoch}:%{version}-%{release}
-Requires: yum-packagekit = %{epoch}:%{version}-%{release}
-Requires: yum >= 3.2.6
-Requires: libarchive
+Requires: PackageKit-libs = %{version}-%{release}
+Requires: yum-packagekit = %{version}-%{release}
+Requires: PackageKit-yum = %{version}-%{release}
Requires: shared-mime-info
Requires: python-sqlite2
@@ -46,11 +44,37 @@ BuildRequires: gettext
BuildRequires: xulrunner-devel
BuildRequires: libarchive-devel
-%description
+%description
PackageKit is a D-Bus abstraction layer that allows the session user
to manage packages in a secure way using a cross-distro,
cross-architecture API.
+%package yum
+Summary: PackageKit YUM backend
+Group: System Environment/Libraries
+Requires: yum >= 3.2.6
+Requires: %{name} = %{version}-%{release}
+
+%description yum
+A backend for PackageKit to enable yum functionality.
+
+%package smart
+Summary: PackageKit SMART backend
+Group: System Environment/Libraries
+Requires: smart
+Requires: %{name} = %{version}-%{release}
+
+%description smart
+A backend for PackageKit to enable SMART functionality.
+
+%package docs
+Summary: Documentation for PackageKit
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description docs
+API docs for PackageKit.
+
%package -n udev-packagekit
Summary: Tell PackageKit to install firmware that udev requires
Group: System Environment/Base
@@ -77,7 +101,7 @@ will almost instantly update itself to reflect this.
Summary: Libraries for accessing PackageKit
Group: Development/Libraries
Requires: dbus >= %{dbus_version}
-Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: %{name} = %{version}-%{release}
%description libs
Libraries for accessing PackageKit.
@@ -86,7 +110,7 @@ Libraries for accessing PackageKit.
Summary: Cron job and related utilities for PackageKit
Group: System Environment/Base
Requires: cronie
-Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: %{name} = %{version}-%{release}
%description cron
Crontab and utilities for running PackageKit as a cron job.
@@ -94,7 +118,7 @@ Crontab and utilities for running PackageKit as a cron job.
%package devel
Summary: Libraries and headers for PackageKit
Group: Development/Libraries
-Requires: %{name} = %{epoch}:%{version}-%{release}
+Requires: %{name} = %{version}-%{release}
Requires: dbus-devel >= %{dbus_version}
Requires: pkgconfig
Requires: sqlite-devel
@@ -106,7 +130,7 @@ Headers and libraries for PackageKit.
Summary: Browser Plugin for PackageKit
Group: Development/Libraries
Requires: gtk2
-Requires: PackageKit-libs = %{epoch}:%{version}-%{release}
+Requires: PackageKit-libs = %{version}-%{release}
%description browser-plugin
The PackageKit browser plugin allows web sites to offer the ability to
@@ -117,7 +141,7 @@ using PackageKit.
%setup -q
%build
-%configure --enable-yum --with-default-backend=yum --disable-local
+%configure --enable-yum --enable-smart --with-default-backend=yum --disable-local
make %{?_smp_mflags}
@@ -131,8 +155,6 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/packagekit-backend/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/packagekit-backend/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/packagekit-plugin.a
rm -f $RPM_BUILD_ROOT%{_libdir}/mozilla/plugins/packagekit-plugin.la
-
-chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/yumDBUSBackend.py
chmod 755 $RPM_BUILD_ROOT%{_libexecdir}/PackageKitDbusTest.py
%find_lang %name
@@ -152,7 +174,7 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%files -f %{name}.lang
%defattr(-,root,root,-)
-%doc README AUTHORS NEWS COPYING
+%doc README AUTHORS NEWS COPYING
%dir %{_datadir}/PackageKit
%dir %{_datadir}/PackageKit/helpers
%dir %{_sysconfdir}/PackageKit
@@ -166,9 +188,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%config %{_sysconfdir}/bash_completion.d/pk-completion.bash
%config(noreplace) %{_sysconfdir}/PackageKit/PackageKit.conf
%config %{_sysconfdir}/dbus-1/system.d/*
-%{_datadir}/PackageKit/helpers/*
+%dir %{_datadir}/PackageKit/helpers/test_spawn
+%{_datadir}/PackageKit/helpers/test_spawn/*
%{_datadir}/man/man1/*.1.gz
-%{_datadir}/gtk-doc/html/PackageKit
%{_datadir}/PolicyKit/policy/*.policy
%{_datadir}/mime/packages/packagekit-*.xml
%{_sbindir}/packagekitd
@@ -179,43 +201,67 @@ update-mime-database %{_datadir}/mime &> /dev/null || :
%{_libexecdir}/pk-import-*
%{_libexecdir}/pk-generate-*
%exclude %{_libdir}/libpackagekit*.so.*
-%exclude %{_libdir}/packagekit-backend/*.so
+%{_libdir}/packagekit-backend/libpk_backend_dummy.so
+%{_libdir}/packagekit-backend/libpk_backend_test_*.so
%ghost %verify(not md5 size mtime) %{_localstatedir}/lib/PackageKit/transactions.db
%ghost %verify(not md5 size mtime) %{_localstatedir}/run/PackageKit/job_count.dat
%{_datadir}/dbus-1/system-services/*.service
%{_libdir}/pm-utils/sleep.d/95packagekit
%{_libexecdir}/*py*
+%files docs
+%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
+%{_datadir}/gtk-doc/html/PackageKit
+
+%files smart
+%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
+%{_libdir}/packagekit-backend/libpk_backend_smart.so
+%dir %{_datadir}/PackageKit/helpers/smart
+%{_datadir}/PackageKit/helpers/smart/*
+
+%files yum
+%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
+%{_libdir}/packagekit-backend/libpk_backend_yum.so
+%dir %{_datadir}/PackageKit/helpers/yum
+%{_datadir}/PackageKit/helpers/yum/*
+
%files -n yum-packagekit
%defattr(-, root, root)
+%doc README AUTHORS NEWS COPYING
%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-packagekit.conf
/usr/lib/yum-plugins/refresh-packagekit.*
%files -n udev-packagekit
%defattr(-, root, root)
+%doc README AUTHORS NEWS COPYING
%{_sysconfdir}/udev/rules.d/*.rules
/lib/udev/*.sh
%files libs
%defattr(-,root,root,-)
-%doc README AUTHORS NEWS COPYING
+%doc README AUTHORS NEWS COPYING
%dir %{_libdir}/packagekit-backend
%{_libdir}/*packagekit*.so.*
-%{_libdir}/packagekit-backend/*.so
%files cron
%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
%config %{_sysconfdir}/cron.daily/packagekit-background.cron
-%config %{_sysconfdir}/sysconfig/packagekit-background
-
-%files devel
-%defattr(-,root,root,-)
+%config(noreplace) %{_sysconfdir}/sysconfig/packagekit-background
%files browser-plugin
+%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
%dir %{_libdir}/mozilla
%dir %{_libdir}/mozilla/plugins
%{_libdir}/mozilla/plugins/packagekit-plugin.so
+%files devel
+%defattr(-,root,root,-)
+%doc README AUTHORS NEWS COPYING
%{_libdir}/lib*.so
%{_libdir}/pkgconfig/*
%{_includedir}/*
commit a9ee2f880003fe8df755d81c67f5547d9e40b43f
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 12:09:28 2008 +0100
yum: never set self.yumbase.conf.cache = 1 as we cannot download files after a resolve using a dispatcher
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 88c9354..26a2d9c 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -219,6 +219,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-search-name functionality
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
@@ -232,6 +233,8 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-search-details functionality
'''
self._check_init(lazy_cache=True)
+ self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
@@ -247,7 +250,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self._check_init(lazy_cache=True)
self.allow_cancel(True)
self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
- self.yumbase.conf.cache = 1 # Only look in cache.
+ self.yumbase.conf.cache = 0 # TODO: can we just look in the cache?
self.status(STATUS_QUERY)
package_list = [] #we can't do emitting as found if we are post-processing
fltlist = filters.split(';')
@@ -297,7 +300,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.status(STATUS_QUERY)
self.allow_cancel(True)
self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
- self.yumbase.conf.cache = 1 # Only look in cache.
+ self.yumbase.conf.cache = 0 # TODO: can we just look in the cache?
package_list = [] #we can't do emitting as found if we are post-processing
fltlist = filters.split(';')
@@ -322,11 +325,12 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-search-file functionality
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_QUERY)
- #self.yumbase.conf.cache = 1 # Only look in cache.
+ #self.yumbase.conf.cache = 0 # TODO: can we just look in the cache?
fltlist = filters.split(';')
pkgfilter = YumFilter(fltlist)
@@ -351,6 +355,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-what-provides functionality
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_QUERY)
@@ -377,6 +382,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-download-packages functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.status(STATUS_DOWNLOAD)
percentage = 0;
@@ -502,6 +508,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Print a list of requires for a given package
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -676,6 +683,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Print a list of depends for a given package
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -724,6 +732,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-update-system functionality
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(0)
self.status(STATUS_RUNNING)
@@ -795,7 +804,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
self.allow_cancel(True);
self.percentage(None)
self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0)# Setup Yum Config
- self.yumbase.conf.cache = 1 # Only look in cache.
+ self.yumbase.conf.cache = 0 # TODO: can we just look in the cache?
self.status(STATUS_QUERY)
fltlist = filters.split(';')
@@ -824,6 +833,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
This will only work with yum 3.2.4 or higher
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(False)
self.percentage(0)
self.status(STATUS_RUNNING)
@@ -864,6 +874,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
return
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(False)
self.percentage(0)
self.status(STATUS_RUNNING)
@@ -1023,6 +1034,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
This will only work with yum 3.2.4 or higher
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(False);
self.percentage(0)
self.status(STATUS_RUNNING)
@@ -1131,6 +1143,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Needed to be implemented in a sub class
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(False);
self.percentage(0)
self.status(STATUS_RUNNING)
@@ -1156,6 +1169,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Print a detailed details for a given package
'''
self._check_init(lazy_cache=True)
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -1179,6 +1193,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
def get_files(self,package_ids):
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -1221,6 +1236,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-get-distro-upgrades functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_QUERY)
@@ -1287,6 +1303,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
@param filters: package types to show
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -1318,6 +1335,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-repo-enable functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.status(STATUS_INFO)
try:
repo = self.yumbase.repos.getRepo(repoid)
@@ -1349,6 +1367,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-get-repo-list functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.status(STATUS_INFO)
for repo in self.yumbase.repos.repos.values():
@@ -1456,6 +1475,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-get-update_detail functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
@@ -1474,6 +1494,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
Implement the {backend}-repo-set-data functionality
'''
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
# Get the repo
repo = self.yumbase.repos.getRepo(repoid)
if repo:
@@ -1487,6 +1508,7 @@ class PackageKitYumBackend(PackageKitBaseBackend):
def install_signature(self,sigtype,key_id,package):
self._check_init()
+ self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
self.status(STATUS_INFO)
commit 9538a09ee0b77d998be4ace1cb2e663a7ea4f3f6
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 12:08:42 2008 +0100
trivial: fix a warning in rpmlint about missing file shebangs
diff --git a/backends/yum/yumComps.py b/backends/yum/yumComps.py
index c96c7e9..4d0b34a 100644
--- a/backends/yum/yumComps.py
+++ b/backends/yum/yumComps.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
diff --git a/backends/yum/yumDirect.py b/backends/yum/yumDirect.py
index 56eca84..eeb1e79 100644
--- a/backends/yum/yumDirect.py
+++ b/backends/yum/yumDirect.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
diff --git a/backends/yum/yumFilter.py b/backends/yum/yumFilter.py
index 62f7e87..2cfb67b 100644
--- a/backends/yum/yumFilter.py
+++ b/backends/yum/yumFilter.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
commit cac1ae4f3bc1ebdb50e247a355f0ef4f90d1577e
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 8 12:43:39 2008 +0200
fix typos for deb groups, borrowed from apt backend
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 6ae3597..8863128 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -451,13 +451,13 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
"electronics" : GROUP_ELECTRONICS,
"embedded" : GROUP_SYSTEM,
"games" : GROUP_GAMES,
- "GNOME" : GROUP_DESKTOP_GNOME,
+ "gnome" : GROUP_DESKTOP_GNOME,
"graphics" : GROUP_GRAPHICS,
"hamradio" : GROUP_COMMUNICATION,
"interpreters" : GROUP_PROGRAMMING,
"kde" : GROUP_DESKTOP_KDE,
"libdevel" : GROUP_PROGRAMMING,
- "lib" : GROUP_SYSTEM,
+ "libs" : GROUP_SYSTEM,
"mail" : GROUP_INTERNET,
"math" : GROUP_SCIENCE,
"misc" : GROUP_OTHER,
commit 023b83eb6ff362540f8d25aa991cd75ea4153d53
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 8 10:22:29 2008 +0100
trivial: remove the last remnants of the yum2 backend
diff --git a/contrib/PackageKit.spec.in b/contrib/PackageKit.spec.in
index b746c71..730821d 100644
--- a/contrib/PackageKit.spec.in
+++ b/contrib/PackageKit.spec.in
@@ -117,7 +117,7 @@ using PackageKit.
%setup -q
%build
-%configure --enable-yum --enable-yum2 --with-default-backend=yum --disable-local
+%configure --enable-yum --with-default-backend=yum --disable-local
make %{?_smp_mflags}
diff --git a/docs/api/spec/pk-backend-dbus.xml b/docs/api/spec/pk-backend-dbus.xml
index c5db0dc..d0f0024 100644
--- a/docs/api/spec/pk-backend-dbus.xml
+++ b/docs/api/spec/pk-backend-dbus.xml
@@ -26,7 +26,7 @@
<para>
Again, like the helper backends described above, a compiled
backend stub is needed. An example of a DBUS backend written
- in python can be found in <literal>backends/yum2</literal>,
+ in python can be found in <literal>backends/apt</literal>,
along with a compiled stub written in C.
</para>
</chapter>
diff --git a/docs/html/pk-faq.html b/docs/html/pk-faq.html
index 813c47e..4514595 100644
--- a/docs/html/pk-faq.html
+++ b/docs/html/pk-faq.html
@@ -327,14 +327,12 @@ Only released versions of Fedora have this metadata.
<hr>
<h3><a name="selinux">Why doesn't PackageKit work with SELinux?</a></h3>
<p>
-The process <code>packagekitd</code> is not recognized by SELinux in Fedora 8.
-Until the policy is fixed to handle system activation, you'll have
+The process <code>packagekitd</code> is not recognized by SELinux if you are
+using old selinux-policy rules.
+Until the policy is updated to handle system activation, you'll have
to run in permissive mode, rather than enforcing.
</p>
<p>
-Using Fedora 9 or Rawhide, <code>selinux-policy-3.0.8-62.fc8</code> will make the
-<code>yum</code> backend work correctly when enforcing.
-The future backend <code>yum2</code> will need further changes.
See <a href="https://bugzilla.redhat.com/show_bug.cgi?id=361151">Red Hat Bugzilla</a>
for further information.
</p>
diff --git a/docs/html/pk-matrix.html b/docs/html/pk-matrix.html
index 6d24e2f..6c6f518 100644
--- a/docs/html/pk-matrix.html
+++ b/docs/html/pk-matrix.html
@@ -31,7 +31,6 @@
<td><center>smart</center></td>
<td><center>urpmi</center></td>
<td><center>yum</center></td>
-<td><center>yum2</center></td>
<td><center>zypp</center></td>
</tr>
<tr>
@@ -46,7 +45,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -61,7 +59,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -76,7 +73,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -91,7 +87,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -106,7 +101,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -121,7 +115,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -136,7 +129,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[good]"/></td><!-- zypp -->
</tr>
<tr>
@@ -151,7 +143,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -166,7 +157,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -181,7 +171,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -196,7 +185,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -211,7 +199,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -226,7 +213,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -241,7 +227,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -256,7 +241,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -271,7 +255,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -286,7 +269,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -301,7 +283,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -316,7 +297,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -331,7 +311,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -346,7 +325,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -361,7 +339,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -376,7 +353,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -391,7 +367,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -406,7 +381,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -421,7 +395,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -436,7 +409,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -451,7 +423,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
</table>
@@ -470,7 +441,6 @@
<td><center>smart</center></td>
<td><center>urpmi</center></td>
<td><center>yum</center></td>
-<td><center>yum2</center></td>
<td><center>zypp</center></td>
</tr>
<tr>
@@ -485,7 +455,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
<tr>
@@ -500,7 +469,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -515,7 +483,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -530,7 +497,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -545,7 +511,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -560,7 +525,6 @@
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -575,7 +539,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum -->
-<td><img src="img/status-good.png" alt="[yes]"/></td><!-- yum2 -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- zypp -->
</tr>
<tr>
@@ -590,7 +553,6 @@
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- smart -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- urpmi -->
<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum -->
-<td><img src="img/status-bad.png" alt="[no]"/></td><!-- yum2 -->
<td><img src="img/status-good.png" alt="[yes]"/></td><!-- zypp -->
</tr>
</table>
commit a8859770b9746681230026909d9cfc04564cfe2b
Merge: f103660... 4094272...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Sun Sep 7 21:37:59 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit f103660f476ec67151deb76baf9e928043abc227
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Sun Sep 7 21:35:13 2008 +0200
rearrange to match yum
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 7290757..e47be82 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -20,7 +20,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
#include <pk-backend.h>
#include <pk-backend-spawn.h>
#include <pk-package-ids.h>
@@ -146,9 +145,9 @@ backend_download_packages (PkBackend *backend, gchar **package_ids, const gchar
static void
backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
+ gchar *filters_text;
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
pk_backend_spawn_helper (spawn, BACKEND("get-depends"), filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
g_free (filters_text);
@@ -285,21 +284,6 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
}
/**
- * pk_backend_resolve:
- */
-static void
-backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids)
-{
- gchar *filters_text;
- gchar *package_ids_temp;
- filters_text = pk_filter_bitfield_to_text (filters);
- package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, BACKEND("resolve"), filters_text, package_ids_temp, NULL);
- g_free (filters_text);
- g_free (package_ids_temp);
-}
-
-/**
* pk_backend_search_details:
*/
static void
@@ -355,7 +339,6 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
-
/* check network state */
if (!pk_backend_is_online (backend)) {
pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
@@ -379,6 +362,21 @@ backend_update_system (PkBackend *backend)
}
/**
+ * pk_backend_resolve:
+ */
+static void
+backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids)
+{
+ gchar *filters_text;
+ gchar *package_ids_temp;
+ filters_text = pk_filter_bitfield_to_text (filters);
+ package_ids_temp = pk_package_ids_to_text (package_ids, "|");
+ pk_backend_spawn_helper (spawn, BACKEND("resolve"), filters_text, package_ids_temp, NULL);
+ g_free (filters_text);
+ g_free (package_ids_temp);
+}
+
+/**
* pk_backend_get_repo_list:
*/
static void
commit 40942724531567f0d4dbeb18b6621809ef1e2b67
Merge: 81b95be... 232cdd4...
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 20:27:38 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit 232cdd4e061b1d1b72ed00554a7996a7efbcf1ff
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Sun Sep 7 21:08:01 2008 +0200
change remove-packages to match yum/dispatch_command
diff --git a/backends/smart/helpers/remove-packages.py b/backends/smart/helpers/remove-packages.py
index c673501..c1b77e4 100755
--- a/backends/smart/helpers/remove-packages.py
+++ b/backends/smart/helpers/remove-packages.py
@@ -14,8 +14,9 @@ import sys
from smartBackend import PackageKitSmartBackend
-packages = sys.argv[1:]
+allow_deps = sys.argv[1]
+packages = sys.argv[2:]
backend = PackageKitSmartBackend(sys.argv[1:])
-backend.remove_packages(packages)
+backend.remove_packages(allow_deps, packages)
sys.exit(0)
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index ffe7e90..6ae3597 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -189,7 +189,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
self.ctrl.commitTransaction(trans, confirm=False)
@needs_cache
- def remove_packages(self, packageids):
+ def remove_packages(self, allow_deps, packageids):
packages = []
for packageid in packageids:
ratio, results, suggestions = self._search_packageid(packageid)
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index ab19f5d..7290757 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -279,8 +279,8 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- /* FIXME: Use allow_deps and autoremove */
- pk_backend_spawn_helper (spawn, BACKEND("remove-packages"), package_ids_temp, NULL);
+ /* FIXME: Use autoremove */
+ pk_backend_spawn_helper (spawn, BACKEND("remove-packages"), pk_backend_bool_to_text (allow_deps), package_ids_temp, NULL);
g_free (package_ids_temp);
}
commit 81b95bea7fd74afb9a17f7f46317e9a882278b36
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 19:16:16 2008 +0100
feature: optionally run pk-generate-package-list and pk-import-desktop when refresh has finished
diff --git a/src/Makefile.am b/src/Makefile.am
index 7d519fd..19db05c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,6 +21,7 @@ INCLUDES = \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DLIBDIR=\""$(libdir)"\" \
+ -DLIBEXECDIR=\""$(libexecdir)"\" \
-DVERSION="\"$(VERSION)\"" \
-DPK_DATA=\"$(pkgdatadir)\" \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
diff --git a/src/pk-transaction.c b/src/pk-transaction.c
index 3ccd0c1..97d817e 100644
--- a/src/pk-transaction.c
+++ b/src/pk-transaction.c
@@ -67,6 +67,7 @@
#include "pk-backend-internal.h"
#include "pk-inhibit.h"
#include "pk-update-detail-list.h"
+#include "pk-conf.h"
#include "pk-cache.h"
#include "pk-notify.h"
#include "pk-security.h"
@@ -93,6 +94,7 @@ struct PkTransactionPrivate
PkBackend *backend;
PkInhibit *inhibit;
PkCache *cache;
+ PkConf *conf;
PkUpdateDetailList *update_detail_list;
PkNotify *notify;
PkSecurity *security;
@@ -473,9 +475,12 @@ pk_transaction_distro_upgrade_cb (PkBackend *backend, PkDistroUpgradeEnum type,
static void
pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *transaction)
{
+ gboolean ret;
+ GError *error = NULL;
const gchar *exit_text;
guint time;
gchar *packages;
+ gchar *command;
g_return_if_fail (PK_IS_TRANSACTION (transaction));
g_return_if_fail (transaction->priv->tid != NULL);
@@ -559,6 +564,37 @@ pk_transaction_finished_cb (PkBackend *backend, PkExitEnum exit, PkTransaction *
g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_status_changed);
g_signal_handler_disconnect (transaction->priv->backend, transaction->priv->signal_update_detail);
+ /* do some optional extra actions when we've finished refreshing the cache */
+ if (transaction->priv->role == PK_ROLE_ENUM_REFRESH_CACHE) {
+ /* asynchronously generate the package list
+ * NOTE: we can't do this in process as it uses PkClient */
+ ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheUpdatePackageList");
+ if (ret) {
+ command = g_build_filename (LIBEXECDIR, "pk-generate-package-list", NULL);
+ egg_debug ("running helper %s", command);
+ ret = g_spawn_command_line_async (command, &error);
+ if (!ret) {
+ egg_warning ("failed to execute %s: %s", command, error->message);
+ g_error_free (error);
+ }
+ g_free (command);
+ }
+
+ /* refresh the desktop icon cache
+ * NOTE: we can't do this in process as it uses PkClient */
+ ret = pk_conf_get_bool (transaction->priv->conf, "RefreshCacheScanDesktopFiles");
+ if (ret) {
+ command = g_build_filename (LIBEXECDIR, "pk-import-desktop", NULL);
+ egg_debug ("running helper %s", command);
+ ret = g_spawn_command_line_async (command, &error);
+ if (!ret) {
+ egg_warning ("failed to execute %s: %s", command, error->message);
+ g_error_free (error);
+ }
+ g_free (command);
+ }
+ }
+
/* we emit last, as other backends will be running very soon after us, and we don't want to be notified */
exit_text = pk_exit_enum_to_text (exit);
egg_debug ("emitting finished '%s', %i", exit_text, time);
@@ -3613,6 +3649,7 @@ pk_transaction_init (PkTransaction *transaction)
transaction->priv->backend = pk_backend_new ();
transaction->priv->security = pk_security_new ();
transaction->priv->cache = pk_cache_new ();
+ transaction->priv->conf = pk_conf_new ();
transaction->priv->update_detail_list = pk_update_detail_list_new ();
transaction->priv->notify = pk_notify_new ();
transaction->priv->inhibit = pk_inhibit_new ();
@@ -3657,6 +3694,7 @@ pk_transaction_finalize (GObject *object)
/* remove any inhibit, it's okay to call this function when it's not needed */
pk_inhibit_remove (transaction->priv->inhibit, transaction);
+ g_object_unref (transaction->priv->conf);
g_object_unref (transaction->priv->cache);
g_object_unref (transaction->priv->update_detail_list);
g_object_unref (transaction->priv->inhibit);
commit c653424f32933ed2420fad28ebd70be824b67fd7
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 19:13:51 2008 +0100
feature: add two new variables (default off) for auto cache refreshing
diff --git a/etc/PackageKit.conf.in b/etc/PackageKit.conf.in
index 7a98721..8e58e9a 100644
--- a/etc/PackageKit.conf.in
+++ b/etc/PackageKit.conf.in
@@ -46,3 +46,17 @@ DefaultBackend=@defaultbackend@
# ProxyHTTP=username:password at server.lan:8080
# ProxyFTP=server.lan:21
+# Scan the desktop files when we do RefreshCache
+#
+# NOTE: Don't enable this for backends that are slow doing SearchFile()
+#
+# default=false
+RefreshCacheScanDesktopFiles=false
+
+# Update the package list when we RefreshCache
+#
+# NOTE: Don't enable this for backends that are slow doing GetPackages()
+#
+# default=false
+RefreshCacheUpdatePackageList=false
+
commit d2f9b67ccf80514a2cc022a5f6e8c356a180aa0a
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Sun Sep 7 20:02:34 2008 +0200
smart: optionally allow backend to use dispatcher
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
old mode 100644
new mode 100755
index 8d71ecd..ffe7e90
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# This program is free software; you can redistribute it and/or modify
@@ -29,6 +30,7 @@ from packagekit.backend import PackageKitBaseBackend, INFO_INSTALLED, \
from packagekit.package import PackagekitPackage
from packagekit.enums import *
import re
+import sys
# Global vars
pkpackage = PackagekitPackage()
@@ -36,11 +38,14 @@ pkpackage = PackagekitPackage()
def needs_cache(func):
""" Load smart's channels, and save the cache when done. """
def cache_wrap(obj, *args, **kwargs):
- obj.status(STATUS_LOADING_CACHE)
- obj.allow_cancel(True)
- obj.ctrl.reloadChannels()
+ if not obj._cacheloaded:
+ obj.status(STATUS_LOADING_CACHE)
+ obj.allow_cancel(True)
+ obj.ctrl.reloadChannels()
result = func(obj, *args, **kwargs)
- obj.ctrl.saveSysConf()
+ if not obj._cacheloaded:
+ obj.ctrl.saveSysConf()
+ obj._cacheloaded = True
return result
return cache_wrap
@@ -113,6 +118,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
def __init__(self, args):
PackageKitBaseBackend.__init__(self, args)
+ self._cacheloaded = False
self.ctrl = smart.init()
smart.iface.object = PackageKitSmartInterface(self.ctrl, self)
@@ -888,3 +894,16 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
if FILTER_NEWEST in filterlist:
self._package_list = self._do_newest_filtering(self._package_list)
+def main():
+ backend = PackageKitSmartBackend('')
+ args = sys.argv[1:]
+ backend.dispatch_command(args[0],args[1:])
+ while True:
+ line = raw_input('')
+ if line == 'exit':
+ break
+ args = line.split(' ')
+ backend.dispatch_command(args[0],args[1:])
+
+if __name__ == "__main__":
+ main()
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 3aac55c..ab19f5d 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -27,6 +27,12 @@
static PkBackendSpawn *spawn;
+#if 0
+#define BACKEND(x) x ".py"
+#else
+#define BACKEND(x) "smartBackend.py", x
+#endif
+
/**
* backend_initialize:
* This should only be run once per backend load, i.e. not every transaction
@@ -130,7 +136,7 @@ backend_download_packages (PkBackend *backend, gchar **package_ids, const gchar
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "download-packages.py", directory, package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("download-packages"), directory, package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -144,7 +150,7 @@ backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "get-depends.py", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-depends"), filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -157,7 +163,7 @@ backend_get_details (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "get-details.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-details"), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -169,7 +175,7 @@ backend_get_files (PkBackend *backend, gchar **package_ids)
{
gchar *package_ids_temp;
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "get-files.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-files"), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -183,7 +189,7 @@ backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_id
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "get-requires.py", filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-requires"), filters_text, package_ids_temp, pk_backend_bool_to_text (recursive), NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -196,7 +202,7 @@ backend_get_updates (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "get-updates.py", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-updates"), filters_text, NULL);
g_free (filters_text);
}
@@ -208,7 +214,7 @@ backend_get_packages (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "get-packages.py", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-packages"), filters_text, NULL);
g_free (filters_text);
}
@@ -229,7 +235,7 @@ backend_install_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "install-packages.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("install-packages"), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -243,7 +249,7 @@ backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
/* send the complete list as stdin */
full_paths_temp = pk_package_ids_to_text (full_paths, "|");
- pk_backend_spawn_helper (spawn, "install-files.py", pk_backend_bool_to_text (trusted), full_paths_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("install-files"), pk_backend_bool_to_text (trusted), full_paths_temp, NULL);
g_free (full_paths_temp);
}
@@ -260,7 +266,7 @@ backend_refresh_cache (PkBackend *backend, gboolean force)
return;
}
- pk_backend_spawn_helper (spawn, "refresh-cache.py", NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("refresh-cache"), NULL);
}
/**
@@ -274,7 +280,7 @@ backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
/* FIXME: Use allow_deps and autoremove */
- pk_backend_spawn_helper (spawn, "remove-packages.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("remove-packages"), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -288,7 +294,7 @@ backend_resolve (PkBackend *backend, PkBitfield filters, gchar **package_ids)
gchar *package_ids_temp;
filters_text = pk_filter_bitfield_to_text (filters);
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "resolve.py", filters_text, package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("resolve"), filters_text, package_ids_temp, NULL);
g_free (filters_text);
g_free (package_ids_temp);
}
@@ -301,7 +307,7 @@ backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *sea
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-details.py", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("search-details"), filters_text, search, NULL);
g_free (filters_text);
}
@@ -313,7 +319,7 @@ backend_search_file (PkBackend *backend, PkBitfield filters, const gchar *search
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-file.py", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("search-file"), filters_text, search, NULL);
g_free (filters_text);
}
@@ -325,7 +331,7 @@ backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *searc
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-group.py", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("search-group"), filters_text, search, NULL);
g_free (filters_text);
}
@@ -337,7 +343,7 @@ backend_search_name (PkBackend *backend, PkBitfield filters, const gchar *search
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "search-name.py", filters_text, search, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("search-name"), filters_text, search, NULL);
g_free (filters_text);
}
@@ -359,7 +365,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
/* send the complete list as stdin */
package_ids_temp = pk_package_ids_to_text (package_ids, "|");
- pk_backend_spawn_helper (spawn, "update-packages.py", package_ids_temp, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("update-packages"), package_ids_temp, NULL);
g_free (package_ids_temp);
}
@@ -369,7 +375,7 @@ backend_update_packages (PkBackend *backend, gchar **package_ids)
static void
backend_update_system (PkBackend *backend)
{
- pk_backend_spawn_helper (spawn, "update-system.py", NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("update-system"), NULL);
}
/**
@@ -380,7 +386,7 @@ backend_get_repo_list (PkBackend *backend, PkBitfield filters)
{
gchar *filters_text;
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "get-repo-list.py", filters_text, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("get-repo-list"), filters_text, NULL);
g_free (filters_text);
}
@@ -391,9 +397,9 @@ static void
backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
{
if (enabled == TRUE) {
- pk_backend_spawn_helper (spawn, "repo-enable.py", rid, "true", NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("repo-enable"), rid, "true", NULL);
} else {
- pk_backend_spawn_helper (spawn, "repo-enable.py", rid, "false", NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("repo-enable"), rid, "false", NULL);
}
}
@@ -403,7 +409,7 @@ backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
static void
backend_repo_set_data (PkBackend *backend, const gchar *rid, const gchar *parameter, const gchar *value)
{
- pk_backend_spawn_helper (spawn, "repo-set-data.py", rid, parameter, value, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("repo-set-data"), rid, parameter, value, NULL);
}
/**
@@ -416,7 +422,7 @@ backend_what_provides (PkBackend *backend, PkBitfield filters, PkProvidesEnum pr
const gchar *provides_text;
provides_text = pk_provides_enum_to_text (provides);
filters_text = pk_filter_bitfield_to_text (filters);
- pk_backend_spawn_helper (spawn, "what-provides.py", filters_text, provides_text, search, NULL);
+ pk_backend_spawn_helper (spawn, BACKEND("what-provides"), filters_text, provides_text, search, NULL);
g_free (filters_text);
}
commit 1d0fafcc7b1e53311d191ed92dadf991194fb07c
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 18:55:10 2008 +0100
trivial: make the pk-import-desktop program more resistant to common errors
diff --git a/client/pk-import-desktop.c b/client/pk-import-desktop.c
index 197ec0b..dd81dce 100644
--- a/client/pk-import-desktop.c
+++ b/client/pk-import-desktop.c
@@ -42,6 +42,9 @@
static PkClient *client = NULL;
static PkExtra *extra = NULL;
+/**
+ * pk_desktop_get_name_for_file:
+ **/
static gchar *
pk_desktop_get_name_for_file (const gchar *filename)
{
@@ -78,7 +81,7 @@ pk_desktop_get_name_for_file (const gchar *filename)
/* get the obj */
obj = pk_package_list_get_obj (list, 0);
if (obj == NULL) {
- egg_error ("cannot get obj");
+ egg_warning ("cannot get obj");
goto out;
}
@@ -86,12 +89,14 @@ pk_desktop_get_name_for_file (const gchar *filename)
name = g_strdup (obj->id->name);
out:
- if (list != NULL) {
+ if (list != NULL)
g_object_unref (list);
- }
return name;
}
+/**
+ * pk_import_get_locale:
+ **/
static gchar *
pk_import_get_locale (const gchar *buffer)
{
@@ -99,15 +104,17 @@ pk_import_get_locale (const gchar *buffer)
gchar *locale;
gchar *result;
result = g_strrstr (buffer, "[");
- if (result == NULL) {
+ if (result == NULL)
return NULL;
- }
locale = g_strdup (result+1);
len = egg_strlen (locale, 20);
locale[len-1] = '\0';
return locale;
}
+/**
+ * pk_desktop_process_desktop:
+ **/
static void
pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
{
@@ -128,8 +135,9 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
key = g_key_file_new ();
ret = g_key_file_load_from_file (key, filename, G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
- if (ret == FALSE) {
- egg_error ("bad!!");
+ if (!ret) {
+ egg_warning ("cannot open desktop file %s", filename);
+ return;
}
/* get this specific locale list */
@@ -139,9 +147,8 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
if (g_str_has_prefix (key_array[i], "Name")) {
/* set the locale */
locale_temp = pk_import_get_locale (key_array[i]);
- if (locale_temp != NULL) {
+ if (locale_temp != NULL)
g_ptr_array_add (locale_array, g_strdup (locale_temp));
- }
}
}
g_strfreev (key_array);
@@ -169,13 +176,12 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
pk_extra_set_locale (extra, locale);
/* save in order of priority */
- if (comment != NULL) {
+ if (comment != NULL)
pk_extra_set_data_locale (extra, package_name, comment);
- } else if (genericname != NULL) {
+ else if (genericname != NULL)
pk_extra_set_data_locale (extra, package_name, genericname);
- } else {
+ else
pk_extra_set_data_locale (extra, package_name, name);
- }
g_free (comment);
g_free (genericname);
}
@@ -195,6 +201,9 @@ pk_desktop_process_desktop (const gchar *package_name, const gchar *filename)
g_key_file_free (key);
}
+/**
+ * pk_desktop_process_directory:
+ **/
static void
pk_desktop_process_directory (const gchar *directory)
{
@@ -207,7 +216,8 @@ pk_desktop_process_directory (const gchar *directory)
dir = g_dir_open (directory, 0, NULL);
if (dir == NULL) {
- egg_error ("not a valid desktop dir!");
+ egg_warning ("not a valid desktop dir!");
+ return;
}
pattern = g_pattern_spec_new ("*.desktop");
@@ -222,11 +232,10 @@ pk_desktop_process_directory (const gchar *directory)
package_name = pk_desktop_get_name_for_file (filename);
/* process the file */
- if (package_name != NULL) {
+ if (package_name != NULL)
pk_desktop_process_desktop (package_name, filename);
- } else {
+ else
g_print ("%s ignored, failed to get package name\n", filename);
- }
g_free (package_name);
g_free (filename);
}
@@ -267,9 +276,8 @@ main (int argc, char *argv[])
egg_debug_init (verbose);
/* set defaults */
- if (desktop_location == NULL) {
+ if (desktop_location == NULL)
desktop_location = PK_IMPORT_APPLICATIONSDIR;
- }
client = pk_client_new ();
pk_client_set_use_buffer (client, TRUE, NULL);
commit d690be4bd8b1779be96c2bd953a7e75a26eab3a3
Merge: a12d46c... c1c411f...
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 14:57:06 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit c1c411f921a1c5279429bcfb2b84415bcea20603
Merge: 875c296... 1e90b81...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 7 14:16:01 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit 875c296c592568075d63c607bec7e7a87968d826
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 7 14:13:13 2008 +0200
APT: Update the last acitivity time stamp in statusChange. Handle time outs correctly
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 89f4372..2cfe72d 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -98,6 +98,8 @@ os.putenv("APT_LISTCHANGES_FRONTEND", "none")
gobject.threads_init()
dbus.glib.threads_init()
+class InstallTimeOutPKError(Exception):
+ pass
class PackageKitCache(apt.cache.Cache):
"""
@@ -308,6 +310,7 @@ class PackageKitInstallProgress(apt.progress.InstallProgress):
self.start_time = None
def statusChange(self, pkg, percent, status):
+ self.last_activity = time.time()
progress = self.pstart + percent/100 * (self.pend - self.pstart)
if self.pprev < progress:
self._backend.PercentageChanged(int(progress))
@@ -337,6 +340,7 @@ class PackageKitInstallProgress(apt.progress.InstallProgress):
pklog.critical("no activity for %s time sending ctrl-c" \
% self.timeout)
os.write(self.master_fd, chr(3))
+ raise InstallTimeOutPKError
def conffile(self, current, new):
pklog.warning("Config file prompt: '%s' (sending no)" % current)
@@ -1512,6 +1516,15 @@ class PackageKitAptBackend(PackageKitBaseBackend):
self._open_cache(prange=(95,100))
self.Finished(EXIT_CANCELLED)
self._canceled.clear()
+ except InstallTimeOutPKError:
+ self._open_cache(prange=(95,100))
+ #FIXME: should provide more information
+ self.ErrorCode(ERROR_UNKNOWN,
+ "Transaction was cancelled since the installation "
+ "of a package hung.\n"
+ "This can be caused by maintainer scripts which "
+ "require input on the terminal.")
+ self.Finished(EXIT_KILLED)
except:
self._open_cache(prange=(95,100))
self.ErrorCode(ERROR_UNKNOWN, "Applying changes failed")
commit a12d46cbf583254c133883507f4b6d98c26c84e0
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 11:27:59 2008 +0100
trivial: add two new egg functions, egg_obj_list_to_string and egg_obj_list_add_list
diff --git a/libpackagekit/egg-obj-list.c b/libpackagekit/egg-obj-list.c
index 6acceb3..1768bba 100644
--- a/libpackagekit/egg-obj-list.c
+++ b/libpackagekit/egg-obj-list.c
@@ -169,6 +169,41 @@ egg_obj_list_print (EggObjList *list)
}
/**
+ * egg_obj_list_to_string:
+ * @list: a valid #EggObjList instance
+ *
+ * Converts the list to a newline delimited string
+ **/
+gchar *
+egg_obj_list_to_string (EggObjList *list)
+{
+ guint i;
+ gpointer obj;
+ GPtrArray *array;
+ gchar *text;
+ EggObjListToStringFunc func_to_string;
+ GString *string;
+
+ g_return_val_if_fail (list->priv->func_to_string != NULL, NULL);
+ g_return_val_if_fail (EGG_IS_OBJ_LIST (list), NULL);
+
+ array = list->priv->array;
+ func_to_string = list->priv->func_to_string;
+ string = g_string_new ("");
+ for (i=0; i<array->len; i++) {
+ obj = g_ptr_array_index (array, i);
+ text = func_to_string (obj);
+ g_string_append_printf (string, "%s\n", text);
+ g_free (text);
+ }
+ /* remove trailing newline */
+ if (string->len != 0)
+ g_string_set_size (string, string->len-1);
+
+ return g_string_free (string, FALSE);
+}
+
+/**
* egg_obj_list_add:
* @list: a valid #EggObjList instance
* @obj: a valid #gpointer object
@@ -191,6 +226,27 @@ egg_obj_list_add (EggObjList *list, const gpointer obj)
}
/**
+ * egg_package_list_add_list:
+ *
+ * Makes a deep copy of the list
+ **/
+void
+egg_package_list_add_list (EggObjList *list, const EggObjList *data)
+{
+ guint i;
+ gpointer obj;
+
+ g_return_if_fail (EGG_IS_OBJ_LIST (list));
+ g_return_if_fail (EGG_IS_OBJ_LIST (data));
+
+ /* add data items to list */
+ for (i=0; i < data->len; i++) {
+ obj = egg_obj_list_index (data, i);
+ egg_obj_list_add (list, obj);
+ }
+}
+
+/**
* egg_obj_list_remove:
* @list: a valid #EggObjList instance
* @obj: a valid #gpointer object
diff --git a/libpackagekit/egg-obj-list.h b/libpackagekit/egg-obj-list.h
index 79e9b76..2452203 100644
--- a/libpackagekit/egg-obj-list.h
+++ b/libpackagekit/egg-obj-list.h
@@ -68,12 +68,16 @@ void egg_obj_list_set_from_string (EggObjList *list,
EggObjListFromStringFunc func);
void egg_obj_list_clear (EggObjList *list);
void egg_obj_list_print (EggObjList *list);
+gchar *egg_obj_list_to_string (EggObjList *list)
+ G_GNUC_WARN_UNUSED_RESULT;
gboolean egg_obj_list_to_file (EggObjList *list,
const gchar *filename);
gboolean egg_obj_list_from_file (EggObjList *list,
const gchar *filename);
void egg_obj_list_add (EggObjList *list,
const gpointer data);
+void egg_obj_list_add_list (EggObjList *list,
+ const EggObjList *data);
gboolean egg_obj_list_remove (EggObjList *list,
const gpointer data);
gboolean egg_obj_list_remove_index (EggObjList *list,
commit 1e90b81d7511b9cf507d1e8ae65ef25adb27e4c1
Merge: 3187228... dab5985...
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 10:42:02 2008 +0100
Merge branch 'removebackend-python'
commit dab5985bec13ff69a394364338e4ae279b45a348
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 10:41:50 2008 +0100
remove pk-backend-python and the complicated interpretor stuff -- the IPC just isn't enough latency to justify the complexity
diff --git a/configure.ac b/configure.ac
index 668156f..f9afdc2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,13 +45,18 @@ GTK_DOC_CHECK(1.9)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+AM_PATH_PYTHON
+PYTHON_PACKAGE_DIR=${pythondir}/packagekit
+AC_SUBST(PYTHON_PACKAGE_DIR)
+
+
dnl ---------------------------------------------------------------------------
dnl - Extra verbose warning switches
dnl ---------------------------------------------------------------------------
if test "$GCC" = "yes"; then
CPPFLAGS="$CPPFLAGS -Wcast-align -Wno-uninitialized"
CPPFLAGS="$CPPFLAGS -Wall -Wformat-security -Wreturn-type"
-# CPPFLAGS="$CPPFLAGS -Wall"
+# CPPFLAGS="$CPPFLAGS -Werror"
fi
dnl ---------------------------------------------------------------------------
@@ -119,7 +124,6 @@ else
fi
AM_CONDITIONAL(HAVE_ARCHIVE_H, test x$HAVE_ARCHIVE_H = xyes)
-
dnl ---------------------------------------------------------------------------
dnl - xsltproc
dnl ---------------------------------------------------------------------------
@@ -166,33 +170,6 @@ if test "$DOCBOOK2MAN" = "no" ; then
fi
AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"])
-AM_PATH_PYTHON([2.3],[],[have_python=no])
-if test "x$PYTHON" = "x:"; then
- have_python=no
-fi
-
-PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
-PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
-PYTHON_LIBS="-lpython$PYTHON_VERSION"
-if test -d $PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION ; then
- PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config"
- PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib64/python$PYTHON_VERSION/config/Makefile"
-else
- PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
- PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
-fi
-PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
-PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
-PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
-PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
-PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
-PYTHON_PACKAGE_DIR=${pythondir}/packagekit
-AC_SUBST([PYTHON_LIBS])
-AC_SUBST([PYTHON_LIB_LOC])
-AC_SUBST([PYTHON_CFLAGS])
-AC_SUBST([PYTHON_EXTRA_LIBS])
-AC_SUBST(PYTHON_PACKAGE_DIR)
-
dnl ---------------------------------------------------------------------------
dnl - Make paths available for source files
dnl ---------------------------------------------------------------------------
diff --git a/src/pk-backend-python.c b/src/pk-backend-python.c
deleted file mode 100644
index 4e61070..0000000
--- a/src/pk-backend-python.c
+++ /dev/null
@@ -1,1221 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <time.h>
-#include <errno.h>
-
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif /* HAVE_UNISTD_H */
-
-#include <glib/gi18n.h>
-#include <glib/gprintf.h>
-#include <gmodule.h>
-
-#include <Python.h>
-
-#include <pk-common.h>
-#include <pk-package-id.h>
-#include <pk-enum.h>
-
-#include "egg-debug.h"
-#include "pk-backend-internal.h"
-#include "pk-backend-python.h"
-#include "pk-marshal.h"
-#include "pk-enum.h"
-#include "pk-time.h"
-#include "pk-inhibit.h"
-
-#define PK_BACKEND_PYTHON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), PK_TYPE_BACKEND_PYTHON, PkBackendPythonPrivate))
-
-struct PkBackendPythonPrivate
-{
- PkBackend *backend;
- PyObject *pModule;
- PyObject *pInstance;
-};
-
-G_DEFINE_TYPE (PkBackendPython, pk_backend_python, G_TYPE_OBJECT)
-static gpointer pk_backend_python_object = NULL;
-
-static PyObject *pk_backend_python_repo_detail_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_status_changed_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_percentage_changed_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_sub_percentage_changed_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_package_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_details_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_files_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_update_detail_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_finished_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_allow_cancel_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_error_code_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_require_restart_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_message_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_repo_signature_required_cb (PyObject *self, PyObject *args);
-static PyObject *pk_backend_python_eula_required_cb (PyObject *self, PyObject *args);
-
-static PyMethodDef PkBackendPythonMethods[] = {
- {"repo_detail", pk_backend_python_repo_detail_cb, METH_VARARGS, ""},
- {"status_changed", pk_backend_python_status_changed_cb, METH_VARARGS, ""},
- {"percentage_changed", pk_backend_python_percentage_changed_cb, METH_VARARGS, ""},
- {"sub_percentage_changed", pk_backend_python_sub_percentage_changed_cb, METH_VARARGS, ""},
- {"package", pk_backend_python_package_cb, METH_VARARGS, ""},
- {"details", pk_backend_python_details_cb, METH_VARARGS, ""},
- {"files", pk_backend_python_files_cb, METH_VARARGS, ""},
- {"update_detail", pk_backend_python_update_detail_cb, METH_VARARGS, ""},
- {"finished", pk_backend_python_finished_cb, METH_VARARGS, ""},
- {"allow_cancel", pk_backend_python_allow_cancel_cb, METH_VARARGS, ""},
- {"error_code", pk_backend_python_error_code_cb, METH_VARARGS, ""},
- {"require_restart", pk_backend_python_require_restart_cb, METH_VARARGS, ""},
- {"message", pk_backend_python_message_cb, METH_VARARGS, ""},
- {"repo_signature_required", pk_backend_python_repo_signature_required_cb, METH_VARARGS, ""},
- {"eula_required", pk_backend_python_eula_required_cb, METH_VARARGS, ""},
- {NULL, NULL, 0, NULL}
-};
-
-/**
- * pk_backend_python_repo_detail_cb:
- **/
-static PyObject *
-pk_backend_python_repo_detail_cb (PyObject *self, PyObject *args)
-{
- const gchar *repo_id;
- const gchar *description;
- gboolean enabled;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ssi", &repo_id, &description, &enabled);
-
- pk_backend_repo_detail (python->priv->backend, repo_id, description, enabled);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_status_changed_cb:
- **/
-static PyObject *
-pk_backend_python_status_changed_cb (PyObject *self, PyObject *args)
-{
- const gchar *status_text;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "s", &status_text);
-
- pk_backend_set_status (python->priv->backend, pk_status_enum_from_text (status_text));
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_percentage_changed_cb:
- **/
-static PyObject *
-pk_backend_python_percentage_changed_cb (PyObject *self, PyObject *args)
-{
- guint percentage;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "i", &percentage);
-
- pk_backend_set_percentage (python->priv->backend, percentage);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_sub_percentage_changed_cb:
- **/
-static PyObject *
-pk_backend_python_sub_percentage_changed_cb (PyObject *self, PyObject *args)
-{
- guint sub_percentage;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "i", &sub_percentage);
-
- pk_backend_set_sub_percentage (python->priv->backend, sub_percentage);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_package_cb:
- **/
-static PyObject *
-pk_backend_python_package_cb (PyObject *self, PyObject *args)
-{
- const gchar *info_text;
- const gchar *package_id;
- const gchar *summary;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "sss", &info_text, &package_id, &summary);
-
- pk_backend_package (python->priv->backend, pk_info_enum_from_text (info_text), package_id, summary);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_details_cb:
- **/
-static PyObject *
-pk_backend_python_details_cb (PyObject *self, PyObject *args)
-{
- const gchar *package_id;
- const gchar *license;
- const gchar *group_text;
- const gchar *detail;
- const gchar *url;
- guint64 size;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "sssssi", &package_id, &license, &group_text, &detail, &url, &size);
-
- pk_backend_details (python->priv->backend, package_id,
- license, pk_group_enum_from_text (group_text),
- detail, url, size);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_files_cb:
- **/
-static PyObject *
-pk_backend_python_files_cb (PyObject *self, PyObject *args)
-{
- const gchar *package_id;
- const gchar *file_list;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ss", &package_id, &file_list);
-
- pk_backend_files (python->priv->backend, package_id, file_list);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_update_detail_cb:
- **/
-static PyObject *
-pk_backend_python_update_detail_cb (PyObject *self, PyObject *args)
-{
- const gchar *package_id;
- const gchar *updates;
- const gchar *obsoletes;
- const gchar *vendor_url;
- const gchar *bugzilla_url;
- const gchar *cve_url;
- const gchar *restart_text;
- const gchar *update_text;
- const gchar *changelog;
- const gchar *state;
- const gchar *issued;
- const gchar *updated;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ssssssssssss", &package_id, &updates, &obsoletes,
- &vendor_url, &bugzilla_url, &cve_url, &restart_text,
- &update_text, &changelog, &state, &issued, &updated);
-
- pk_backend_update_detail (python->priv->backend, package_id, updates,
- obsoletes, vendor_url, bugzilla_url, cve_url,
- pk_restart_enum_from_text (restart_text),
- update_text, changelog,
- pk_update_state_enum_from_text (state),
- issued, updated);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_finished_cb:
- **/
-static PyObject *
-pk_backend_python_finished_cb (PyObject *self, PyObject *args)
-{
- const gchar *exit_text;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "s", &exit_text);
-
- egg_debug ("deleting python %p, exit %s", python, exit_text);
- pk_backend_finished (python->priv->backend);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_allow_cancel_cb:
- **/
-static PyObject *
-pk_backend_python_allow_cancel_cb (PyObject *self, PyObject *args)
-{
- gboolean allow_cancel;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "i", &allow_cancel);
-
- pk_backend_set_allow_cancel (python->priv->backend, allow_cancel);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_error_code_cb:
- **/
-static PyObject *
-pk_backend_python_error_code_cb (PyObject *self, PyObject *args)
-{
- const gchar *error_text;
- const gchar *details;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ss", &error_text, &details);
-
- pk_backend_error_code (python->priv->backend, pk_error_enum_from_text (error_text), details);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_require_restart_cb:
- **/
-static PyObject *
-pk_backend_python_require_restart_cb (PyObject *self, PyObject *args)
-{
- const gchar *type_text;
- const gchar *details;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ss", &type_text, &details);
-
- pk_backend_require_restart (python->priv->backend, pk_restart_enum_from_text (type_text), details);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_message_cb:
- **/
-static PyObject *
-pk_backend_python_message_cb (PyObject *self, PyObject *args)
-{
- const gchar *message_text;
- const gchar *details;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ss", &message_text, &details);
-
- pk_backend_message (python->priv->backend, pk_message_enum_from_text (message_text), details);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_repo_signature_required_cb:
- **/
-static PyObject *
-pk_backend_python_repo_signature_required_cb (PyObject *self, PyObject *args)
-{
- const gchar *package_id;
- const gchar *repository_name;
- const gchar *key_url;
- const gchar *key_userid;
- const gchar *key_id;
- const gchar *key_fingerprint;
- const gchar *key_timestamp;
- const gchar *type_text;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ssssssss", &package_id, &repository_name,
- &key_url, &key_userid, &key_id, &key_fingerprint,
- &key_timestamp, &type_text);
-
- pk_backend_repo_signature_required (python->priv->backend, package_id, repository_name,
- key_url, key_userid, key_id, key_fingerprint,
- key_timestamp, PK_SIGTYPE_ENUM_GPG);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_eula_required_cb:
- **/
-static PyObject *
-pk_backend_python_eula_required_cb (PyObject *self, PyObject *args)
-{
- const gchar *eula_id;
- const gchar *package_id;
- const gchar *vendor_name;
- const gchar *license_agreement;
- PkBackendPython *python = PK_BACKEND_PYTHON (pk_backend_python_object);
-
- egg_debug ("got signal");
- PyArg_ParseTuple (args, "ssss", &eula_id, &package_id, &vendor_name, &license_agreement);
-
- pk_backend_eula_required (python->priv->backend, eula_id, package_id,
- vendor_name, license_agreement);
- return Py_BuildValue("");
-}
-
-/**
- * pk_backend_python_import:
- **/
-static gboolean
-pk_backend_python_import (PkBackendPython *python, const char *name)
-{
- PyObject *pName;
-
- egg_debug ("importing module %s", name);
- pName = PyString_FromString (name);
- python->priv->pModule = PyImport_Import (pName);
- Py_DECREF (pName);
-
- if (python->priv->pModule == NULL) {
- PyErr_Print ();
- return FALSE;
- }
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_instance:
- **/
-static gboolean
-pk_backend_python_get_instance (PkBackendPython *python)
-{
- PyObject *pDict;
- PyObject *pClass;
-
- /* pDict is a borrowed reference */
- pDict = PyModule_GetDict (python->priv->pModule);
-
- /* Build the name of a callable class */
- pClass = PyDict_GetItemString (pDict, "PackageKitBackend");
-
- /* Create an instance of the class */
- if (!PyCallable_Check (pClass)) {
- return FALSE;
- }
-
- python->priv->pInstance = PyObject_CallObject (pClass, NULL);
- return TRUE;
-}
-
-/**
- * pk_backend_python_startup:
- **/
-gboolean
-pk_backend_python_startup (PkBackendPython *python, const gchar *filename)
-{
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
-
- /* import the file */
- pk_backend_python_import (python, filename);
- if (python->priv->pModule == NULL) {
- egg_warning ("Failed to load");
- return FALSE;
- }
-
- /* get an instance */
- pk_backend_python_get_instance (python);
- if (python->priv->pInstance == NULL) {
- egg_warning ("Failed to get instance");
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_check_method:
- **/
-gboolean
-pk_backend_python_check_method (PkBackendPython *python, const gchar *method_name)
-{
- gboolean ret = TRUE;
- PyObject *pFunc;
-
- pFunc = PyObject_GetAttrString (python->priv->pInstance, method_name);
- if (pFunc == NULL) {
- egg_warning ("function NULL");
- return FALSE;
- }
- ret = PyCallable_Check (pFunc);
- if (!ret) {
- egg_warning ("not callable");
- }
-
- if (pFunc != NULL) {
- Py_DECREF (pFunc);
- }
- return ret;
-}
-
-/**
- * pk_backend_python_cancel:
- **/
-gboolean
-pk_backend_python_cancel (PkBackendPython *python)
-{
- const gchar *method = "cancel";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, NULL);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_updates:
- **/
-gboolean
-pk_backend_python_get_updates (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *method = "get_updates";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
-
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)",
- pk_filter_enums_to_text (filters));
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_repo_list:
- **/
-gboolean
-pk_backend_python_get_repo_list (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *method = "get_repo_list";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
-
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)",
- pk_filter_enums_to_text (filters));
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_refresh_cache:
- **/
-gboolean
-pk_backend_python_refresh_cache (PkBackendPython *python)
-{
- gboolean force;
- const gchar *method = "refresh_cache";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
-
- force = pk_backend_get_bool (python->priv->backend, "force");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(i)", force);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_update_system:
- **/
-gboolean
-pk_backend_python_update_system (PkBackendPython *python)
-{
- const gchar *method = "update_system";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, NULL);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_repo_enable:
- **/
-gboolean
-pk_backend_python_repo_enable (PkBackendPython *python)
-{
- const gchar *rid;
- gboolean enabled;
- const gchar *method = "repo_enable";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
-
- rid = pk_backend_get_string (python->priv->backend, "rid");
- enabled = pk_backend_get_bool (python->priv->backend, "enabled");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(si)",
- rid, enabled);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_repo_set_data:
- **/
-gboolean
-pk_backend_python_repo_set_data (PkBackendPython *python)
-{
- const gchar *rid;
- const gchar *parameter;
- const gchar *value;
- const gchar *method = "repo_set_data";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- rid = pk_backend_get_string (python->priv->backend, "rid");
- parameter = pk_backend_get_string (python->priv->backend, "parameter");
- value = pk_backend_get_string (python->priv->backend, "value");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(sss)",
- rid, parameter, value);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_resolve:
- **/
-gboolean
-pk_backend_python_resolve (PkBackendPython *python)
-{
- PkBitfield filters;
- gchar **packages;
- const gchar *method = "resolve";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- packages = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)",
- pk_filter_enums_to_text (filters), packages);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_rollback:
- **/
-gboolean
-pk_backend_python_rollback (PkBackendPython *python)
-{
- const gchar *transaction_id;
- const gchar *method = "rollback";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- transaction_id = pk_backend_get_string (python->priv->backend, "transaction_id");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)", transaction_id);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_search_name:
- **/
-gboolean
-pk_backend_python_search_name (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *search;
- const gchar *method = "search_name";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- search = pk_backend_get_string (python->priv->backend, "search");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)",
- pk_filter_enums_to_text (filters), search);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_search_details:
- **/
-gboolean
-pk_backend_python_search_details (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *search;
- const gchar *method = "search_details";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- search = pk_backend_get_string (python->priv->backend, "search");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)",
- pk_filter_enums_to_text (filters), search);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_search_group:
- **/
-gboolean
-pk_backend_python_search_group (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *search;
- const gchar *method = "search_group";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- search = pk_backend_get_string (python->priv->backend, "search");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)",
- pk_filter_enums_to_text (filters), search);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_search_file:
- **/
-gboolean
-pk_backend_python_search_file (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *search;
- const gchar *method = "search_file";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- search = pk_backend_get_string (python->priv->backend, "search");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)",
- pk_filter_enums_to_text (filters), search);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_depends:
- **/
-gboolean
-pk_backend_python_get_depends (PkBackendPython *python)
-{
- PkBitfield filters;
- gchar **package_ids;
- gboolean recursive;
- const gchar *method = "get_depends";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- recursive = pk_backend_get_bool (python->priv->backend, "recursive");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(sssss)",
- pk_filter_enums_to_text (filters), package_ids, recursive);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_requires:
- **/
-gboolean
-pk_backend_python_get_requires (PkBackendPython *python)
-{
- PkBitfield filters;
- gchar **package_ids;
- gboolean recursive;
- const gchar *method = "get_requires";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- recursive = pk_backend_get_bool (python->priv->backend, "recursive");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(sss)",
- pk_filter_enums_to_text (filters), package_ids, recursive);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_packages:
- **/
-gboolean
-pk_backend_python_get_packages (PkBackendPython *python)
-{
- PkBitfield filters;
- const gchar *method = "get_packages";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)",
- pk_filter_enums_to_text (filters));
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_download_packages:
- **/
-gboolean
-pk_backend_python_download_packages (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *directory;
- const gchar *method = "download_packages";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- directory = pk_backend_get_string (python->priv->backend, "directory");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(ss)", package_ids, directory);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-
-/**
- * pk_backend_python_get_update_detail:
- **/
-gboolean
-pk_backend_python_get_update_detail (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *method = "get_update_detail";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)", package_ids);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_details:
- **/
-gboolean
-pk_backend_python_get_details (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *method = "get_details";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)", package_ids);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_get_files:
- **/
-gboolean
-pk_backend_python_get_files (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *method = "get_files";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)", package_ids);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_remove_packages:
- **/
-gboolean
-pk_backend_python_remove_packages (PkBackendPython *python)
-{
- gchar **package_ids;
- gboolean allow_deps;
- gboolean autoremove;
- const gchar *method = "remove_packages";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- allow_deps = pk_backend_get_bool (python->priv->backend, "allowdeps");
- autoremove = pk_backend_get_bool (python->priv->backend, "autoremove");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(sii)",
- package_ids, allow_deps, autoremove);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_install_packages:
- **/
-gboolean
-pk_backend_python_install_packages (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *method = "install_packages";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)",
- package_ids);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_update_packages:
- **/
-gboolean
-pk_backend_python_update_packages (PkBackendPython *python)
-{
- gchar **package_ids;
- const gchar *method = "update_packages";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- package_ids = pk_backend_get_strv (python->priv->backend, "package_ids");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(s)",
- package_ids);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_install_files:
- **/
-gboolean
-pk_backend_python_install_files (PkBackendPython *python)
-{
- gboolean trusted;
- gchar **full_paths;
- const gchar *method = "install_files";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- trusted = pk_backend_get_bool (python->priv->backend, "trusted");
- full_paths = pk_backend_get_strv (python->priv->backend, "paths");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(bs)",
- trusted, full_paths);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_service_pack:
- **/
-gboolean
-pk_backend_python_service_pack (PkBackendPython *python)
-{
- const gchar *location;
- gboolean enabled;
- const gchar *method = "service_pack";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- enabled = pk_backend_get_bool (python->priv->backend, "enabled");
- location = pk_backend_get_string (python->priv->backend, "location");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(is)",
- enabled, location);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_what_provides:
- **/
-gboolean
-pk_backend_python_what_provides (PkBackendPython *python)
-{
- PkBitfield filters;
- PkProvidesEnum provides;
- const gchar *search;
- const gchar *method = "what_provides";
-
- g_return_val_if_fail (PK_IS_BACKEND_PYTHON (python), FALSE);
- g_return_val_if_fail (python->priv->pInstance != NULL, FALSE);
-
- if (!pk_backend_python_check_method (python, method)) {
- pk_backend_not_implemented_yet (python->priv->backend, method);
- return FALSE;
- }
- filters = pk_backend_get_uint (python->priv->backend, "filters");
- provides = pk_backend_get_uint (python->priv->backend, "provides");
- search = pk_backend_get_string (python->priv->backend, "search");
- PyObject_CallMethod (python->priv->pInstance, (gchar*) method, "(sss)",
- pk_filter_enums_to_text (filters),
- pk_provides_enum_to_text (provides), search);
- pk_backend_finished (python->priv->backend);
-
- return TRUE;
-}
-
-/**
- * pk_backend_python_finalize:
- **/
-static void
-pk_backend_python_finalize (GObject *object)
-{
- PkBackendPython *python;
- g_return_if_fail (PK_IS_BACKEND_PYTHON (object));
-
- python = PK_BACKEND_PYTHON (object);
-
- g_object_unref (python->priv->backend);
- Py_Finalize();
-
- G_OBJECT_CLASS (pk_backend_python_parent_class)->finalize (object);
-}
-
-/**
- * pk_backend_python_class_init:
- **/
-static void
-pk_backend_python_class_init (PkBackendPythonClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = pk_backend_python_finalize;
- g_type_class_add_private (klass, sizeof (PkBackendPythonPrivate));
-}
-
-/**
- * pk_backend_python_init:
- **/
-static void
-pk_backend_python_init (PkBackendPython *python)
-{
- const gchar *path;
-
- python->priv = PK_BACKEND_PYTHON_GET_PRIVATE (python);
- python->priv->pModule = NULL;
- python->priv->pInstance = NULL;
- python->priv->backend = pk_backend_new ();
-
- setenv ("PYTHONPATH", "/home/hughsie/Code/PackageKit/backends/yum3/helpers", 1);
- path = getenv ("PYTHONPATH");
- egg_debug ("PYTHONPATH=%s", path);
-
- Py_Initialize ();
- Py_InitModule ("PackageKitBaseBackend", PkBackendPythonMethods);
-}
-
-/**
- * pk_backend_python_new:
- **/
-PkBackendPython *
-pk_backend_python_new (void)
-{
- if (pk_backend_python_object != NULL) {
- g_object_ref (pk_backend_python_object);
- } else {
- pk_backend_python_object = g_object_new (PK_TYPE_BACKEND_PYTHON, NULL);
- g_object_add_weak_pointer (pk_backend_python_object, &pk_backend_python_object);
- }
- return PK_BACKEND_PYTHON (pk_backend_python_object);
-}
-
-/***************************************************************************
- *** MAKE CHECK TESTS ***
- ***************************************************************************/
-#ifdef EGG_TEST
-#include "egg-test.h"
-
-void
-pk_backend_test_python (EggTest *test)
-{
- if (!egg_test_start (test, "PkBackendPython"))
- return;
-
- egg_test_end (test);
-}
-#endif
-
diff --git a/src/pk-backend-python.h b/src/pk-backend-python.h
deleted file mode 100644
index c9923a1..0000000
--- a/src/pk-backend-python.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2008 Richard Hughes <richard at hughsie.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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.
- */
-
-#ifndef __PK_BACKEND_PYTHON_H
-#define __PK_BACKEND_PYTHON_H
-
-#include <glib-object.h>
-#include "pk-backend.h"
-
-G_BEGIN_DECLS
-
-#define PK_TYPE_BACKEND_PYTHON (pk_backend_python_get_type ())
-#define PK_BACKEND_PYTHON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), PK_TYPE_BACKEND_PYTHON, PkBackendPython))
-#define PK_BACKEND_PYTHON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), PK_TYPE_BACKEND_PYTHON, PkBackendPythonClass))
-#define PK_IS_BACKEND_PYTHON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), PK_TYPE_BACKEND_PYTHON))
-#define PK_IS_BACKEND_PYTHON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), PK_TYPE_BACKEND_PYTHON))
-#define PK_BACKEND_PYTHON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), PK_TYPE_BACKEND_PYTHON, PkBackendPythonClass))
-
-typedef struct PkBackendPythonPrivate PkBackendPythonPrivate;
-
-typedef struct
-{
- GObject parent;
- PkBackendPythonPrivate *priv;
-} PkBackendPython;
-
-typedef struct
-{
- GObjectClass parent_class;
-} PkBackendPythonClass;
-
-GType pk_backend_python_get_type (void) G_GNUC_CONST;
-PkBackendPython *pk_backend_python_new (void);
-gboolean pk_backend_python_refresh_cache (PkBackendPython *python);
-gboolean pk_backend_python_update_system (PkBackendPython *python);
-gboolean pk_backend_python_resolve (PkBackendPython *python);
-gboolean pk_backend_python_rollback (PkBackendPython *python);
-gboolean pk_backend_python_search_name (PkBackendPython *python);
-gboolean pk_backend_python_search_details (PkBackendPython *python);
-gboolean pk_backend_python_search_group (PkBackendPython *python);
-gboolean pk_backend_python_search_file (PkBackendPython *python);
-gboolean pk_backend_python_get_packages (PkBackendPython *python);
-gboolean pk_backend_python_download_packages (PkBackendPython *python);
-gboolean pk_backend_python_get_depends (PkBackendPython *python);
-gboolean pk_backend_python_get_requires (PkBackendPython *python);
-gboolean pk_backend_python_get_update_detail (PkBackendPython *python);
-gboolean pk_backend_python_get_details (PkBackendPython *python);
-gboolean pk_backend_python_get_files (PkBackendPython *python);
-gboolean pk_backend_python_remove_packages (PkBackendPython *python);
-gboolean pk_backend_python_install_packages (PkBackendPython *python);
-gboolean pk_backend_python_update_packages (PkBackendPython *python);
-gboolean pk_backend_python_install_files (PkBackendPython *python);
-gboolean pk_backend_python_service_pack (PkBackendPython *python);
-gboolean pk_backend_python_what_provides (PkBackendPython *python);
-gboolean pk_backend_python_repo_enable (PkBackendPython *python);
-gboolean pk_backend_python_repo_set_data (PkBackendPython *python);
-gboolean pk_backend_python_get_repo_list (PkBackendPython *python);
-gboolean pk_backend_python_cancel (PkBackendPython *python);
-gboolean pk_backend_python_get_updates (PkBackendPython *python);
-gboolean pk_backend_python_startup (PkBackendPython *python,
- const gchar *filename);
-
-G_END_DECLS
-
-#endif /* __PK_BACKEND_PYTHON_H */
commit 31872287cdbc3bc46abdb556aa7f9e55f6c448d8
Author: Richard Hughes <richard at hughsie.com>
Date: Sun Sep 7 10:33:42 2008 +0100
yum2: remove the yum2 plugin now we have a dispatcher in the yum backend
diff --git a/backends/Makefile.am b/backends/Makefile.am
index c8b9744..99ee648 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -40,10 +40,6 @@ if BACKEND_TYPE_YUM
SUBDIRS += yum
endif
-if BACKEND_TYPE_YUM2
-SUBDIRS += yum2
-endif
-
if BACKEND_TYPE_PISI
SUBDIRS += pisi
endif
diff --git a/backends/yum2/.gitignore b/backends/yum2/.gitignore
deleted file mode 100644
index 996fb0d..0000000
--- a/backends/yum2/.gitignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.deps
-.libs
-Makefile
-Makefile.in
-*.la
-*.lo
-*.loT
-*.o
-*~
-*.gcov
-*.gcda
-*.gcno
-*.out
-
diff --git a/backends/yum2/Makefile.am b/backends/yum2/Makefile.am
deleted file mode 100644
index e159794..0000000
--- a/backends/yum2/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-SUBDIRS = helpers
-plugindir = $(PK_PLUGIN_DIR)
-plugin_LTLIBRARIES = libpk_backend_yum2.la
-libpk_backend_yum2_la_SOURCES = pk-backend-yum2.c
-libpk_backend_yum2_la_LIBADD = $(PK_PLUGIN_LIBS)
-libpk_backend_yum2_la_LDFLAGS = -module -avoid-version
-libpk_backend_yum2_la_CFLAGS = $(PK_PLUGIN_CFLAGS)
-
-clean-local:
- rm -f *.gcno
-
diff --git a/backends/yum2/helpers/.gitignore b/backends/yum2/helpers/.gitignore
deleted file mode 100644
index 2f78cf5..0000000
--- a/backends/yum2/helpers/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-*.pyc
-
diff --git a/backends/yum2/helpers/Makefile.am b/backends/yum2/helpers/Makefile.am
deleted file mode 100644
index 45572cd..0000000
--- a/backends/yum2/helpers/Makefile.am
+++ /dev/null
@@ -1,21 +0,0 @@
-
-helperdir = $(datadir)/PackageKit/helpers/yum2
-
-NULL =
-
-dbusinstancedir = $(LIBEXECDIR)
-dbusinstance_DATA = \
- yumDBUSBackend.py \
- $(NULL)
-
-EXTRA_DIST = \
- $(dbusinstance_DATA) \
- $(NULL)
-
-install-data-hook:
- chmod ug+rx $(DESTDIR)$(libexecdir)/*.py
-
-clean-local :
- rm -f *.pyc
- rm -f *~
-
diff --git a/backends/yum2/helpers/packagekit b/backends/yum2/helpers/packagekit
deleted file mode 120000
index 73525c9..0000000
--- a/backends/yum2/helpers/packagekit
+++ /dev/null
@@ -1 +0,0 @@
-../../../python/packagekit/
\ No newline at end of file
diff --git a/backends/yum2/helpers/testyum2.py b/backends/yum2/helpers/testyum2.py
deleted file mode 100755
index 85b47f9..0000000
--- a/backends/yum2/helpers/testyum2.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/python
-# Licensed under the GNU General Public License Version 2
-#
-# 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.
-
-# Copyright (C) 2007
-# Tim Lauridsen <timlau at fedoraproject.org>
-
-import sys
-import dbus
-from packagekit.enums import *
-
-PACKAGEKIT_DBUS_SERVICE = 'org.freedesktop.PackageKitYumBackend'
-PACKAGEKIT_DBUS_INTERFACE = 'org.freedesktop.PackageKitBackend'
-PACKAGEKIT_DBUS_PATH = '/org/freedesktop/PackageKitBackend'
-PKG_ID = 'supertux;0.3.0-3.fc8;x86_64;updates'
-
-try:
- bus = dbus.SystemBus()
-except dbus.DBusException, e:
- print "Unable to connect to dbus"
- print "%s" %(e,)
- sys.exit(1)
-
-try:
- proxy = bus.get_object(PACKAGEKIT_DBUS_SERVICE, PACKAGEKIT_DBUS_PATH)
- iface = dbus.Interface(proxy, PACKAGEKIT_DBUS_INTERFACE)
- cmd = sys.argv[1]
- if cmd == 'init' or cmd == 'all':
- print "Testing Init()"
- iface.Init()
- if cmd == 'get-updates' or cmd == 'all':
- print "Testing GetUpdate()"
- iface.GetUpdates(FILTER_NONE)
- if cmd == 'search-name' or cmd == 'all':
- print "Testing SearchName(FILTER_NONE,'yum')"
- iface.SearchName(FILTER_NONE,'yum')
- if cmd == 'search-details' or cmd == 'all':
- print "SearchDetails(FILTER_NONE,'dbus')"
- # This one is failing because of some UnicodeDecodeError in yum
- iface.SearchDetails(FILTER_NONE,'dbus')
- if cmd == 'search-group' or cmd == 'all':
- print "Testing SearchGroup(FILTER_NONE,GROUP_GAMES)"
- iface.SearchGroup(FILTER_NONE,GROUP_GAMES)
- if cmd == 'search-file' or cmd == 'all':
- print "Testing SearchFile(FILTER_NONE,'/usr/bin/yum')"
- iface.SearchFile(FILTER_NONE,'/usr/bin/yum')
- if cmd == 'get-requires' or cmd == 'all':
- print "Testing GetRequires(FILTER_NONE,PKG_ID,False)"
- iface.GetRequires(FILTER_NONE,PKG_ID,False)
- if cmd == 'get-depends' or cmd == 'all':
- print "Testing GetDepends(FILTER_NONE,PKG_ID,False)"
- iface.GetDepends(FILTER_NONE,PKG_ID,False)
- if cmd == 'refresh-cache' or cmd == 'all':
- print "Testing RefreshCache(False)"
- iface.RefreshCache(False)
- if cmd == 'resolve' or cmd == 'all':
- print "Testing Resolve(FILTER_NONE,'yum')"
- iface.Resolve(FILTER_NONE,'yum')
- if cmd == 'get-details' or cmd == 'all':
- print "Testing GetDetails(PKG_ID)"
- iface.GetDetails(PKG_ID)
- if cmd == 'get-files' or cmd == 'all':
- print "Testing GetFiles(PKG_ID)"
- iface.GetFiles(PKG_ID)
- if cmd == 'get-packages' or cmd == 'all':
- print "Testing GetPackages(FILTER_INSTALLED,'no')"
- #iface.GetPackages(FILTER_INSTALLED,'no')
- if cmd == 'get-repolist' or cmd == 'all':
- print "Testing GetRepoList()"
- iface.GetRepoList("")
- if cmd == 'get-updatedetail' or cmd == 'all':
- print "Testing GetUpdateDetail(PKG_ID)"
- iface.GetUpdateDetail(PKG_ID)
- #print "Testing "
- #iface.
- if cmd == 'exit' or cmd == 'all':
- print "Testing Exit()"
- iface.Exit()
-
-except dbus.DBusException, e:
- print "Unable to send message on dbus"
- print "%s" %(e,)
- sys.exit(1)
diff --git a/backends/yum2/helpers/yumDBUSBackend.py b/backends/yum2/helpers/yumDBUSBackend.py
deleted file mode 100755
index 33707cf..0000000
--- a/backends/yum2/helpers/yumDBUSBackend.py
+++ /dev/null
@@ -1,2371 +0,0 @@
-#!/usr/bin/python
-# Licensed under the GNU General Public License Version 2
-#
-# 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.
-
-# Copyright (C) 2007
-# Tim Lauridsen <timlau at fedoraproject.org>
-# Seth Vidal <skvidal at fedoraproject.org>
-# Luke Macken <lmacken at redhat.com>
-# James Bowes <jbowes at dangerouslyinc.com>
-# Robin Norwood <rnorwood at redhat.com>
-
-# imports
-
-import re
-
-from packagekit.daemonBackend import PackageKitBaseBackend
-from packagekit.daemonBackend import threaded, async
-from packagekit.daemonBackend import pklog
-
-# This is common between backends
-from packagekit.daemonBackend import PACKAGEKIT_DBUS_INTERFACE, PACKAGEKIT_DBUS_PATH
-
-from packagekit.enums import *
-from packagekit.daemonBackend import PackagekitProgress
-import yum
-from urlgrabber.progress import BaseMeter,format_time,format_number
-import urlgrabber
-from yum.rpmtrans import RPMBaseCallback
-from yum.constants import *
-from yum.update_md import UpdateMetadata
-from yum.callbacks import *
-from yum.misc import prco_tuple_to_string, unique, keyInstalled, procgpgkey, getgpgkeyinfo, keyIdToRPMVer
-
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-
-import rpmUtils
-import exceptions
-import types
-import signal
-import time
-import os.path
-import operator
-import threading
-import gobject
-import dbus
-import dbus.glib
-import dbus.service
-import dbus.mainloop.glib
-
-
-# Global vars
-yumbase = None
-progress = PackagekitProgress() # Progress object to store the progress
-
-groupMap = {
-'desktops;gnome-desktop' : GROUP_DESKTOP_GNOME,
-'desktops;window-managers' : GROUP_DESKTOP_OTHER,
-'desktops;kde-desktop' : GROUP_DESKTOP_KDE,
-'desktops;xfce-desktop' : GROUP_DESKTOP_XFCE,
-'apps;authoring-and-publishing' : GROUP_PUBLISHING,
-'apps;office' : GROUP_OFFICE,
-'apps;sound-and-video' : GROUP_MULTIMEDIA,
-'apps;editors' : GROUP_OFFICE,
-'apps;engineering-and-scientific' : GROUP_OTHER,
-'apps;games' : GROUP_GAMES,
-'apps;graphics' : GROUP_GRAPHICS,
-'apps;text-internet' : GROUP_INTERNET,
-'apps;graphical-internet' : GROUP_INTERNET,
-'apps;education' : GROUP_EDUCATION,
-'development;kde-software-development' : GROUP_PROGRAMMING,
-'development;gnome-software-development' : GROUP_PROGRAMMING,
-'development;development-tools' : GROUP_PROGRAMMING,
-'development;eclipse' : GROUP_PROGRAMMING,
-'development;development-libs' : GROUP_PROGRAMMING,
-'development;x-software-development' : GROUP_PROGRAMMING,
-'development;web-development' : GROUP_PROGRAMMING,
-'development;legacy-software-development' : GROUP_PROGRAMMING,
-'development;ruby' : GROUP_PROGRAMMING,
-'development;java-development' : GROUP_PROGRAMMING,
-'development;xfce-software-development' : GROUP_PROGRAMMING,
-'servers;clustering' : GROUP_SERVERS,
-'servers;dns-server' : GROUP_SERVERS,
-'servers;server-cfg' : GROUP_SERVERS,
-'servers;news-server' : GROUP_SERVERS,
-'servers;web-server' : GROUP_SERVERS,
-'servers;smb-server' : GROUP_SERVERS,
-'servers;sql-server' : GROUP_SERVERS,
-'servers;ftp-server' : GROUP_SERVERS,
-'servers;printing' : GROUP_SERVERS,
-'servers;mysql' : GROUP_SERVERS,
-'servers;mail-server' : GROUP_SERVERS,
-'servers;network-server' : GROUP_SERVERS,
-'servers;legacy-network-server' : GROUP_SERVERS,
-'base-system;java' : GROUP_SYSTEM,
-'base-system;base-x' : GROUP_SYSTEM,
-'base-system;system-tools' : GROUP_ADMIN_TOOLS,
-'base-system;fonts' : GROUP_FONTS,
-'base-system;hardware-support' : GROUP_SYSTEM,
-'base-system;dial-up' : GROUP_SYSTEM,
-'base-system;admin-tools' : GROUP_ADMIN_TOOLS,
-'base-system;legacy-software-support' : GROUP_LEGACY,
-'base-system;base' : GROUP_SYSTEM,
-'base-system;virtualization' : GROUP_VIRTUALIZATION,
-'base-system;legacy-fonts' : GROUP_FONTS,
-'language-support;khmer-support' : GROUP_LOCALIZATION,
-'language-support;persian-support' : GROUP_LOCALIZATION,
-'language-support;georgian-support' : GROUP_LOCALIZATION,
-'language-support;malay-support' : GROUP_LOCALIZATION,
-'language-support;tonga-support' : GROUP_LOCALIZATION,
-'language-support;portuguese-support' : GROUP_LOCALIZATION,
-'language-support;japanese-support' : GROUP_LOCALIZATION,
-'language-support;hungarian-support' : GROUP_LOCALIZATION,
-'language-support;somali-support' : GROUP_LOCALIZATION,
-'language-support;punjabi-support' : GROUP_LOCALIZATION,
-'language-support;bhutanese-support' : GROUP_LOCALIZATION,
-'language-support;british-support' : GROUP_LOCALIZATION,
-'language-support;korean-support' : GROUP_LOCALIZATION,
-'language-support;lao-support' : GROUP_LOCALIZATION,
-'language-support;inuktitut-support' : GROUP_LOCALIZATION,
-'language-support;german-support' : GROUP_LOCALIZATION,
-'language-support;hindi-support' : GROUP_LOCALIZATION,
-'language-support;faeroese-support' : GROUP_LOCALIZATION,
-'language-support;swedish-support' : GROUP_LOCALIZATION,
-'language-support;tsonga-support' : GROUP_LOCALIZATION,
-'language-support;russian-support' : GROUP_LOCALIZATION,
-'language-support;serbian-support' : GROUP_LOCALIZATION,
-'language-support;latvian-support' : GROUP_LOCALIZATION,
-'language-support;samoan-support' : GROUP_LOCALIZATION,
-'language-support;sinhala-support' : GROUP_LOCALIZATION,
-'language-support;catalan-support' : GROUP_LOCALIZATION,
-'language-support;lithuanian-support' : GROUP_LOCALIZATION,
-'language-support;turkish-support' : GROUP_LOCALIZATION,
-'language-support;arabic-support' : GROUP_LOCALIZATION,
-'language-support;vietnamese-support' : GROUP_LOCALIZATION,
-'language-support;mongolian-support' : GROUP_LOCALIZATION,
-'language-support;tswana-support' : GROUP_LOCALIZATION,
-'language-support;irish-support' : GROUP_LOCALIZATION,
-'language-support;italian-support' : GROUP_LOCALIZATION,
-'language-support;slovak-support' : GROUP_LOCALIZATION,
-'language-support;slovenian-support' : GROUP_LOCALIZATION,
-'language-support;belarusian-support' : GROUP_LOCALIZATION,
-'language-support;northern-sotho-support' : GROUP_LOCALIZATION,
-'language-support;kannada-support' : GROUP_LOCALIZATION,
-'language-support;malayalam-support' : GROUP_LOCALIZATION,
-'language-support;swati-support' : GROUP_LOCALIZATION,
-'language-support;breton-support' : GROUP_LOCALIZATION,
-'language-support;romanian-support' : GROUP_LOCALIZATION,
-'language-support;greek-support' : GROUP_LOCALIZATION,
-'language-support;tagalog-support' : GROUP_LOCALIZATION,
-'language-support;zulu-support' : GROUP_LOCALIZATION,
-'language-support;tibetan-support' : GROUP_LOCALIZATION,
-'language-support;danish-support' : GROUP_LOCALIZATION,
-'language-support;afrikaans-support' : GROUP_LOCALIZATION,
-'language-support;southern-sotho-support' : GROUP_LOCALIZATION,
-'language-support;bosnian-support' : GROUP_LOCALIZATION,
-'language-support;brazilian-support' : GROUP_LOCALIZATION,
-'language-support;basque-support' : GROUP_LOCALIZATION,
-'language-support;welsh-support' : GROUP_LOCALIZATION,
-'language-support;thai-support' : GROUP_LOCALIZATION,
-'language-support;telugu-support' : GROUP_LOCALIZATION,
-'language-support;low-saxon-support' : GROUP_LOCALIZATION,
-'language-support;urdu-support' : GROUP_LOCALIZATION,
-'language-support;tamil-support' : GROUP_LOCALIZATION,
-'language-support;indonesian-support' : GROUP_LOCALIZATION,
-'language-support;gujarati-support' : GROUP_LOCALIZATION,
-'language-support;xhosa-support' : GROUP_LOCALIZATION,
-'language-support;chinese-support' : GROUP_LOCALIZATION,
-'language-support;czech-support' : GROUP_LOCALIZATION,
-'language-support;venda-support' : GROUP_LOCALIZATION,
-'language-support;bulgarian-support' : GROUP_LOCALIZATION,
-'language-support;albanian-support' : GROUP_LOCALIZATION,
-'language-support;galician-support' : GROUP_LOCALIZATION,
-'language-support;armenian-support' : GROUP_LOCALIZATION,
-'language-support;dutch-support' : GROUP_LOCALIZATION,
-'language-support;oriya-support' : GROUP_LOCALIZATION,
-'language-support;maori-support' : GROUP_LOCALIZATION,
-'language-support;nepali-support' : GROUP_LOCALIZATION,
-'language-support;icelandic-support' : GROUP_LOCALIZATION,
-'language-support;ukrainian-support' : GROUP_LOCALIZATION,
-'language-support;assamese-support' : GROUP_LOCALIZATION,
-'language-support;bengali-support' : GROUP_LOCALIZATION,
-'language-support;spanish-support' : GROUP_LOCALIZATION,
-'language-support;hebrew-support' : GROUP_LOCALIZATION,
-'language-support;estonian-support' : GROUP_LOCALIZATION,
-'language-support;french-support' : GROUP_LOCALIZATION,
-'language-support;croatian-support' : GROUP_LOCALIZATION,
-'language-support;filipino-support' : GROUP_LOCALIZATION,
-'language-support;finnish-support' : GROUP_LOCALIZATION,
-'language-support;norwegian-support' : GROUP_LOCALIZATION,
-'language-support;southern-ndebele-support' : GROUP_LOCALIZATION,
-'language-support;polish-support' : GROUP_LOCALIZATION,
-'language-support;gaelic-support' : GROUP_LOCALIZATION,
-'language-support;marathi-support' : GROUP_LOCALIZATION,
-'language-support;ethiopic-support' : GROUP_LOCALIZATION
-}
-
-MetaDataMap = {
- 'repomd' : STATUS_DOWNLOAD_REPOSITORY,
- 'primary' : STATUS_DOWNLOAD_PACKAGELIST,
- 'filelists' : STATUS_DOWNLOAD_FILELIST,
- 'other' : STATUS_DOWNLOAD_CHANGELOG,
- 'comps' : STATUS_DOWNLOAD_GROUP,
- 'updateinfo' : STATUS_DOWNLOAD_UPDATEINFO
-}
-
-GUI_KEYS = re.compile(r'(qt)|(gtk)')
-
-class GPGKeyNotImported(exceptions.Exception):
- pass
-
-def sigquit(signum, frame):
- print >> sys.stderr, "Quit signal sent - exiting immediately"
- if yumbase:
- print >> sys.stderr, "unlocking Yum"
- yumbase.closeRpmDB()
- yumbase.doUnlock(YUM_PID_FILE)
- sys.exit(1)
-
-# This is specific to this backend
-PACKAGEKIT_DBUS_SERVICE = 'org.freedesktop.PackageKitYumBackend'
-
-# Setup threading support
-gobject.threads_init()
-dbus.glib.threads_init()
-
-class PackageKitYumBackend(PackageKitBaseBackend):
-
- # Packages there require a reboot
- rebootpkgs = ("kernel", "kernel-smp", "kernel-xen-hypervisor", "kernel-PAE",
- "kernel-xen0", "kernel-xenU", "kernel-xen", "kernel-xen-guest",
- "glibc", "hal", "dbus", "xen")
-
- def __init__(self, bus_name, dbus_path):
- signal.signal(signal.SIGQUIT, sigquit)
-
- print "__init__"
- self.locked = False
- self._cancelled = threading.Event()
- self._cancelled.clear()
- self._lock = threading.Lock()
-
- PackageKitBaseBackend.__init__(self,
- bus_name,
- dbus_path)
-
- print "__init__ done"
-
-#
-# Signals ( backend -> engine -> client )
-#
-
- #FIXME: _show_details and _show_package wrap Details and
- # Package so that the encoding can be fixed. This is ugly.
- # we could probably use a decorator to do it instead.
-
- def _show_package(self,pkg,status):
- '''
- send 'package' signal
- @param info: the enumerated INFO_* string
- @param id: The package ID name, e.g. openoffice-clipart;2.6.22;ppc64;fedora
- @param summary: The package Summary
- convert the summary to UTF before sending
- '''
- id = self._pkg_to_id(pkg)
- summary = self._to_unicode(pkg.summary)
- self.Package(status,id,summary)
-
- def _show_details(self,id,license,group,desc,url,bytes):
- '''
- Send 'details' signal
- @param id: The package ID name, e.g. openoffice-clipart;2.6.22;ppc64;fedora
- @param license: The license of the package
- @param group: The enumerated group
- @param desc: The multi line package description
- @param url: The upstream project homepage
- @param bytes: The size of the package, in bytes
- convert the description to UTF before sending
- '''
- desc = self._to_unicode(desc)
- self.Details(id,license,group,desc,url,bytes)
-
- def _show_update_detail(self,pkg,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc):
- '''
- Send the 'UpdateDetail' signal
- convert the description to UTF before sending
- '''
- id = self._pkg_to_id(pkg)
- desc = self._to_unicode(desc)
- self.UpdateDetail(id,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc)
-
-#
-# Utility methods for Signals
-#
-
- def _to_unicode(self, txt, encoding='utf-8'):
- if isinstance(txt, basestring):
- if not isinstance(txt, unicode):
- txt = unicode(txt, encoding, errors='replace')
- return txt
-
- def _pkg_to_id(self,pkg):
- pkgver = self._get_package_ver(pkg)
- id = self._get_package_id(pkg.name, pkgver, pkg.arch, pkg.repo)
- return id
-
-#
-# Methods ( client -> engine -> backend )
-#
-
- @threaded
- @async
- def doInit(self):
- print "Now in doInit()"
- # yumbase is defined outside of this class so the sigquit handler can close the DB.
- yumbase = PackageKitYumBase(self)
- self.yumbase = yumbase
- print "new yumbase object"
- self._setup_yum()
- print "yum set up"
-
- @threaded
- @async
- def doExit(self):
- if self.locked:
- self._unlock_yum()
-
- def _lock_yum(self):
- ''' Lock Yum'''
- retries = 0
- while not self.locked:
- try: # Try to lock yum
- self.yumbase.doLock( YUM_PID_FILE )
- self.locked = True
- except:
- time.sleep(2)
- retries += 1
- if retries > 20:
- self.ErrorCode(ERROR_CANNOT_GET_LOCK,'Yum is locked by another application')
- self.Finished(EXIT_FAILED)
- self.loop.quit()
-
- def _unlock_yum(self):
- ''' Unlock Yum'''
- if self.locked:
- self.yumbase.closeRpmDB()
- self.yumbase.doUnlock(YUM_PID_FILE)
-
- def doCancel(self):
- pklog.info("Canceling current action")
- self.StatusChanged(STATUS_CANCEL)
- self._cancelled.set()
- self._cancelled.wait()
-
- def _cancel_check(self, msg):
- if self._cancelled.isSet():
- self._unlock_yum()
- self.ErrorCode(ERROR_TRANSACTION_CANCELLED, msg)
- self.Finished(EXIT_KILL)
- self._cancelled.clear()
- return True
- return False
-
- @threaded
- @async
- def doSearchName(self, filters, search):
- '''
- Implement the {backend}-search-name functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
-
- searchlist = ['name']
- self.StatusChanged(STATUS_QUERY)
-
- successful = self._do_search(searchlist, filters, search)
- if not successful:
- # _do_search unlocks yum, sets errors, and calls Finished() if it fails.
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doSearchDetails(self,filters,key):
- '''
- Implement the {backend}-search-details functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
-
- searchlist = ['name', 'summary', 'description', 'group']
- self.StatusChanged(STATUS_QUERY)
-
- successful = self._do_search(searchlist, filters, key)
- if not successful:
- # _do_search unlocks yum, sets errors, and calls Finished() if it fails.
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doSearchGroup(self,filters,key):
- '''
- Implement the {backend}-search-group functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_QUERY)
- package_list = [] #we can't do emitting as found if we are post-processing
-
- try:
- pkgGroupDict = self._buildGroupDict()
- fltlist = filters.split(';')
- installed_nevra = [] # yum returns packages as available even when installed
-
- if not FILTER_NOT_INSTALLED in fltlist:
- # Check installed for group
- for pkg in self.yumbase.rpmdb:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- group = GROUP_OTHER # Default Group
- if pkgGroupDict.has_key(pkg.name): # check if pkg name exist in package / group dictinary
- cg = pkgGroupDict[pkg.name]
- if groupMap.has_key(cg):
- group = groupMap[cg] # use the pk group name, instead of yum 'category/group'
- if group == key:
- if self._do_extra_filtering(pkg, fltlist):
- package_list.append((pkg,INFO_INSTALLED))
- installed_nevra.append(self._get_nevra(pkg))
-
- if not FILTER_INSTALLED in fltlist:
- # Check available for group
- for pkg in self.yumbase.pkgSack:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- nevra = self._get_nevra(pkg)
- if nevra not in installed_nevra:
- group = GROUP_OTHER
- if pkgGroupDict.has_key(pkg.name):
- cg = pkgGroupDict[pkg.name]
- if groupMap.has_key(cg):
- group = groupMap[cg]
- if group == key:
- if self._do_extra_filtering(pkg, fltlist):
- package_list.append((pkg,INFO_AVAILABLE))
-
- except yum.Errors.GroupsError,e:
- self._unlock_yum()
- self.ErrorCode(ERROR_GROUP_NOT_FOUND, str(e))
- self.Finished(EXIT_FAILED)
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return
-
- # basename filter if specified
- if FILTER_BASENAME in fltlist:
- for (pkg,status) in self._basename_filter(package_list):
- self._show_package(pkg,status)
- else:
- for (pkg,status) in package_list:
- self._show_package(pkg,status)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doSearchFile(self,filters,key):
- '''
- Implement the {backend}-search-file functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_QUERY)
-
- try:
- fltlist = filters.split(';')
- found = {}
- if not FILTER_NOT_INSTALLED in fltlist:
- # Check installed for file
- matches = self.yumbase.rpmdb.searchFiles(key)
- for pkg in matches:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- if not found.has_key(str(pkg)):
- if self._do_extra_filtering(pkg, fltlist):
- self._show_package(pkg, INFO_INSTALLED)
- found[str(pkg)] = 1
- if not FILTER_INSTALLED in fltlist:
- # Check available for file
- self.yumbase.repos.populateSack(mdtype='filelists')
- matches = self.yumbase.pkgSack.searchFiles(key)
- for pkg in matches:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- if found.has_key(str(pkg)):
- if self._do_extra_filtering(pkg, fltlist):
- self._show_package(pkg, INFO_AVAILABLE)
- found[str(pkg)] = 1
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetRequires(self,filters,package,recursive):
- '''
- Print a list of requires for a given package
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
- pkg,inst = self._findPackage(package)
-
- if not pkg:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
- self.Finished(EXIT_FAILED)
- return
-
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- fltlist = filters.split(';')
-
- if not FILTER_NOT_INSTALLED in fltlist:
- results = self.yumbase.pkgSack.searchRequires(pkg.name)
- for result in results:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- self._show_package(result,INFO_AVAILABLE)
-
- if not FILTER_INSTALLED in fltlist:
- results = self.yumbase.rpmdb.searchRequires(pkg.name)
- for result in results:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- self._show_package(result,INFO_INSTALLED)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetDepends(self,filters,package,recursive):
- '''
- Print a list of depends for a given package
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_INFO)
-
- name = package.split(';')[0]
- pkg,inst = self._findPackage(package)
- results = {}
-
- if not pkg:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
- self.Finished(EXIT_FAILED)
- return
-
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- (dep_resolution_errors, deps) = self._get_best_dependencies(pkg)
-
- if len(dep_resolution_errors) > 0:
- self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,
- "Could not resolve dependencies: (" +
- ", ".join(dep_resolution_errors) +
- ")")
-
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
- return
-
- for pkg in deps:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if pkg.name != name:
- pkgver = self._get_package_ver(pkg)
- id = self._get_package_id(pkg.name, pkgver, pkg.arch, pkg.repoid)
-
- if self._is_inst(pkg):
- self._show_package(pkg, INFO_INSTALLED)
- else:
- if self._installable(pkg):
- self._show_package(pkg, INFO_AVAILABLE)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doUpdateSystem(self):
- '''
- Implement the {backend}-update-system functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_RUNNING)
- old_throttle = self.yumbase.conf.throttle
- self.yumbase.conf.throttle = "60%" # Set bandwidth throttle to 60%
- # to avoid taking all the system's bandwidth.
- old_skip_broken = self.yumbase.conf.skip_broken
- self.yumbase.conf.skip_broken = 1
- self.yumbase.skipped_packages = []
-
- txmbr = self.yumbase.update() # Add all updates to Transaction
- if txmbr:
- successful = self._runYumTransaction()
- skipped_packages = self.yumbase.skipped_packages
- self.yumbase.skipped_packages = []
- if not successful:
- self.yumbase.conf.throttle = old_throttle
- self.yumbase.conf.skip_broken = old_skip_broken
- # _runYumTransaction() sets the error code and calls Finished()
- return
- # Transaction successful, but maybe some packages were skipped.
- for package in skipped_packages:
- self._show_package(package, INFO_BLOCKED)
- else:
- self.yumbase.conf.throttle = old_throttle
- self.yumbase.conf.skip_broken = old_skip_broken
- self._unlock_yum()
- self.ErrorCode(ERROR_NO_PACKAGES_TO_UPDATE,"Nothing to do")
- self.Finished(EXIT_FAILED)
- return
-
- self.yumbase.conf.throttle = old_throttle
- self.yumbase.conf.skip_broken = old_skip_broken
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doRefreshCache(self, force):
- '''
- Implement the {backend}-refresh_cache functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_REFRESH_CACHE)
-
- old_cache_setting = self.yumbase.conf.cache
- self.yumbase.conf.cache = 0
- self.yumbase.repos.setCache(0)
-
- pct = 0
- try:
- if len(self.yumbase.repos.listEnabled()) == 0:
- self.PercentageChanged(100)
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
- return
-
- #work out the slice for each one
- bump = (95/len(self.yumbase.repos.listEnabled()))/2
-
- for repo in self.yumbase.repos.listEnabled():
- repo.metadata_expire = 0
- self.yumbase.repos.populateSack(which=[repo.id], mdtype='metadata', cacheonly=1)
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- pct+=bump
- self.PercentageChanged(pct)
- self.yumbase.repos.populateSack(which=[repo.id], mdtype='filelists', cacheonly=1)
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- pct+=bump
- self.PercentageChanged(pct)
- self.yumbase.repos.populateSack(which=[repo.id], mdtype='otherdata', cacheonly=1)
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- pct+=bump
- self.PercentageChanged(pct)
-
- self.PercentageChanged(95)
- # Setup categories/groups
- self.yumbase.doGroupSetup()
- #we might have a rounding error
- self.PercentageChanged(100)
-
- except yum.Errors.RepoError,e:
- self._unlock_yum()
- self.ErrorCode(ERROR_REPO_CONFIGURATION_ERROR,str(e))
- self.Finished(EXIT_FAILED)
- self.Exit()
- except yum.Errors.YumBaseError, e:
- self._unlock_yum()
- # This should be a better-defined error, but I'm not sure
- # what the exceptions yum is likely to throw here are.
- self.ErrorCode(ERROR_UNKNOWN,str(e))
- self.Finished(EXIT_FAILED)
- self.Exit()
-
- self.yumbase.conf.cache = old_cache_setting
- self.yumbase.repos.setCache(old_cache_setting)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doResolve(self, filters, name):
- '''
- Implement the {backend}-resolve functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_QUERY)
-
- fltlist = filters.split(';')
- try:
- # Get installed packages
- installedByKey = self.yumbase.rpmdb.searchNevra(name=name)
- if FILTER_NOT_INSTALLED not in fltlist:
- for pkg in installedByKey:
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- self._show_package(pkg,INFO_INSTALLED)
- # Get available packages
- if FILTER_INSTALLED not in fltlist:
- for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
- if self._cancel_check("Search cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
- if pkg.name == name:
- show = True
- for instpo in installedByKey:
- # Check if package have a smaller & equal EVR to a inst pkg
- if pkg.EVR < instpo.EVR or pkg.EVR == instpo.EVR:
- show = False
- if show:
- self._show_package(pkg,INFO_AVAILABLE)
- break
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doInstallPackages(self, packages):
- '''
- Implement the {backend}-install functionality
- This will only work with yum 3.2.4 or higher
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_RUNNING)
-
- txmbrs = []
- already_warned = False
- for package in packages:
- pkg,inst = self._findPackage(package)
- if pkg and not inst:
- repo = self.yumbase.repos.getRepo(pkg.repoid)
- if not already_warned and not repo.gpgcheck:
- self.message(MESSAGE_UNTRUSTED_PACKAGE,"The untrusted package %s will be installed from %s." % (pkg.name, repo))
- already_warned = True
- txmbr = self.yumbase.install(po=pkg)
- txmbrs.extend(txmbr)
- if inst:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,"The package %s is already installed", pkg.name)
- self.Finished(EXIT_FAILED)
- return
- if txmbrs:
- try:
- successful = self._runYumTransaction()
- if not successful:
- # _runYumTransaction unlocked yum, set the error code, and called Finished.
- return
- except yum.Errors.InstallError,e:
- msgs = '\n'.join(e)
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
- self.Finished(EXIT_FAILED)
- return
- else:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,"The packages failed to be installed")
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doInstallFiles (self, inst_files):
- '''
- Implement the {backend}-install_files functionality
- Install the package containing the inst_file file
- Needed to be implemented in a sub class
- '''
- if inst_file.endswith('.src.rpm'):
- self._unlock_yum()
- self.ErrorCode(ERROR_CANNOT_INSTALL_SOURCE_PACKAGE,'Backend will not install a src rpm file')
- self.Finished(EXIT_FAILED)
- return
-
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_QUERY)
-
- pkgs_to_inst = []
- self.yumbase.conf.gpgcheck=0
- txmbr = self.yumbase.installLocal(inst_file)
- self._checkForNewer(txmbr[0].po)
- po = txmbr[0].po
- self.AllowCancel(False)
- self.StatusChanged(STATUS_INSTALL)
-
- try:
- if po.arch == 'src':
- # Special case for source package - don't resolve deps
- rpmDisplay = PackageKitCallback(self)
- callback = ProcessTransPackageKitCallback(self)
- self.yumbase._doTransaction(callback,
- display=rpmDisplay)
- else:
- # Added the package to the transaction set
- if len(self.yumbase.tsInfo) > 0:
- successful = self._runYumTransaction()
- if not successful:
- return
- else:
- self.StatusChanged(STATUS_CLEANUP)
- except yum.Errors.InstallError,e:
- msgs = '\n'.join(e)
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,msgs)
- self.Finished(EXIT_FAILED)
- return
- except yum.Errors.YumBaseError, ye:
- self._unlock_yum()
- self.ErrorCode(ERROR_TRANSACTION_ERROR,self._format_msgs(ye.value))
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doUpdatePackages(self, packages):
- '''
- Implement the {backend}-update functionality
- This will only work with yum 3.2.4 or higher
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_RUNNING)
-
- for package_id in packages:
- pkg,inst = self._findPackage(package_id)
-
- if not pkg:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND, "%s could not be found." % package_id)
- self.Finished(EXIT_FAILED)
- return
-
- if inst:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED, "%s is already installed." % package_id)
- self.Finished(EXIT_FAILED)
- return
-
- txmbr = self.yumbase.update(po=pkg)
-
- if not txmbr:
- self._unlock_yum()
- self.ErrorCode(ERROR_TRANSACTION_ERROR,
- "Package %s could not be added to the transaction." % package_id)
- self.Finished(EXIT_FAILED)
- return
-
- successful = self._runYumTransaction()
-
- if not successful:
- # _runYumTransaction() sets the error code and calls Finished()
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doRemovePackages(self, packages, allowdep, autoremove):
- '''
- Implement the {backend}-remove functionality
- '''
- self.last_action_time = time.time()
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_RUNNING)
-
- txmbrs = []
- for package in packages:
- pkg,inst = self._findPackage(package)
- if pkg and inst:
- txmbr = self.yumbase.remove(po=pkg)
- txmbrs.extend(txmbr)
- if not inst:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_INSTALLED,"The package %s is not installed", pkg.name)
- self.Finished(EXIT_FAILED)
- return
- if txmbrs:
- try:
- if allowdep:
- successful = self._runYumTransaction(removedeps=True)
- else:
- successful = self._runYumTransaction(removedeps=False)
- if not successful:
- # _runYumTransaction unlocked yum, set the error code, and called Finished.
- return
- except yum.Errors.RemoveError,e:
- msgs = '\n'.join(e)
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_INSTALLED,msgs)
- self.Finished(EXIT_FAILED)
- return
- else:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_ALREADY_INSTALLED,"The packages failed to be removed")
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
- return
-
- @threaded
- @async
- def doGetDetails(self, package):
- '''
- Print a detailed details for a given package
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- pkg,inst = self._findPackage(package)
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if pkg:
- self._show_package_details(pkg)
- else:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetFiles(self, package):
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- pkg,inst = self._findPackage(package)
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if pkg:
- files = pkg.returnFileEntries('dir')
- files.extend(pkg.returnFileEntries()) # regular files
-
- file_list = ";".join(files)
-
- self.Files(package, file_list)
- else:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetUpdates(self, filters):
- '''
- Implement the {backend}-get-updates functionality
- @param filters: package types to show
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- fltlist = filters.split(';')
-
- try:
- ygl = self.yumbase.doPackageLists(pkgnarrow='updates')
- md = self.updateMetadata
- for pkg in ygl.updates:
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if self._do_extra_filtering(pkg, fltlist):
- # Get info about package in updates info
- notice = md.get_notice((pkg.name, pkg.version, pkg.release))
- if notice:
- status = self._get_status(notice)
- self._show_package(pkg,status)
- else:
- self._show_package(pkg,INFO_NORMAL)
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetPackages(self,filters,showdesc='no'):
- '''
- Search for yum packages
- @param searchlist: The yum package fields to search in
- @param filters: package types to search (all,installed,available)
- @param key: key to seach for
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_QUERY)
-
- showDesc = (showdesc == 'yes' or showdesc == 'only' )
- showPkg = (showdesc != 'only')
- try:
- fltlist = filters.split(';')
- available = []
- count = 1
- if FILTER_NOT_INSTALLED not in fltlist:
- for pkg in self.yumbase.rpmdb:
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if self._do_extra_filtering(pkg,fltlist):
- if showPkg:
- self._show_package(pkg, INFO_INSTALLED)
- if showDesc:
- self._show_package_details(pkg)
-
-
- # Now show available packages.
- if FILTER_INSTALLED not in fltlist:
- for pkg in self.yumbase.pkgSack.returnNewestByNameArch():
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if self._do_extra_filtering(pkg,fltlist):
- if showPkg:
- self._show_package(pkg, INFO_AVAILABLE)
- if showDesc:
- self._show_package_details(pkg)
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doRepoEnable(self, repoid, enable):
- '''
- Implement the {backend}-repo-enable functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_SETUP)
-
- try:
- repo = self.yumbase.repos.getRepo(repoid)
- if enable:
- if not repo.isEnabled():
- repo.enablePersistent()
- repo.metadata_expire = 60 * 60 * 1.5 # 1.5 hours, the default
- repo.mdpolicy = "group:all"
- else:
- if repo.isEnabled():
- repo.disablePersistent()
-
- except yum.Errors.RepoError,e:
- self._unlock_yum()
- self.ErrorCode(ERROR_REPO_NOT_FOUND, "repo %s is not found" % repoid)
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetRepoList(self, filters):
- '''
- Implement the {backend}-get-repo-list functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- for repo in self.yumbase.repos.repos.values():
- if filters != FILTER_NOT_DEVELOPMENT or not self._is_development_repo(repo.id):
- if repo.isEnabled():
- self.RepoDetail(repo.id,repo.name,True)
- else:
- self.RepoDetail(repo.id,repo.name,False)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doGetUpdateDetail(self,package):
- '''
- Implement the {backend}-get-update_detail functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- pkg,inst = self._findPackage(package)
-
- if not pkg:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_NOT_FOUND,'Package was not found')
- self.Finished(EXIT_FAILED)
- return
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- update = self._get_updated(pkg)
- obsolete = self._get_obsoleted(pkg.name)
- desc,urls,reboot = self._get_update_extras(pkg)
- cve_url = self._format_list(urls['cve'])
- bz_url = self._format_list(urls['bugzilla'])
- vendor_url = self._format_list(urls['vendor'])
-
- self._show_update_detail(pkg,update,obsolete,vendor_url,bz_url,cve_url,reboot,desc)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doRepoSetData(self, repoid, parameter, value):
- '''
- Implement the {backend}-repo-set-data functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(False)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_SETUP)
-
- # Get the repo
- repo = self.yumbase.repos.getRepo(repoid)
- if repo:
- repo.cfg.set(repoid, parameter, value)
- try:
- repo.cfg.write(file(repo.repofile, 'w'))
- except IOError, e:
- self._unlock_yum()
- self.ErrorCode(ERROR_CANNOT_WRITE_REPO_CONFIG,str(e))
- self.Finished(EXIT_FAILED)
- return
- else:
- self._unlock_yum()
- self.ErrorCode(ERROR_REPO_NOT_FOUND,'repo %s not found' % repoid)
- self.Finished(EXIT_FAILED)
- return
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doInstallPublicKey(self, keyurl):
- '''
- Implement the {backend}-install-public-key functionality
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.PercentageChanged(0)
- self.StatusChanged(STATUS_RUNNING)
-
- # Go get the GPG key from the given URL
- try:
- rawkey = urlgrabber.urlread(keyurl, limit=9999)
- except urlgrabber.grabber.URLGrabError, e:
- self.ErrorCode(ERROR_GPG_FAILURE, 'GPG key retrieval failed: ' +
- str(e))
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
- return
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- self.PercentageChanged(50)
-
- keyinfo = {}
- # Parse the key
- try:
- keyinfo = getgpgkeyinfo(rawkey)
- except ValueError, e:
- raise Errors.YumBaseError, \
- 'GPG key parsing failed: ' + str(e)
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- keyinfo['keyurl'] = keyurl
- keyinfo['hexkeyid'] = keyIdToRPMVer(keyinfo['keyid']).upper()
-
- ts = rpmUtils.transaction.TransactionWrapper(self.yumbase.conf.installroot)
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- # Check if key is already installed
- if keyInstalled(ts, keyinfo['keyid'], keyinfo['timestamp']) >= 0:
- self.ErrorCode(ERROR_GPG_FAILURE, "GPG key at %s (0x%s) is already installed" %
- (keyinfo['keyurl'], keyinfo['hexkeyid']))
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
- return
-
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- self.AllowCancel(False)
-
- self.PercentageChanged(75)
-
- # Import the key
- result = ts.pgpImportPubkey(procgpgkey(rawkey))
- if result != 0:
- self.ErrorCode(ERROR_GPG_FAILURE, 'GPG key import failed (code %d)' % result)
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
- return
-
- self.PercentageChanged(100)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
- @threaded
- @async
- def doWhatProvides(self, filters, provides_type, search):
- '''
- Provide a list of packages that satisfy a given requirement.
-
- The yum backend ignores the provides_type - the search string
- should always be a standard rpm provides.
- '''
- self._check_init()
- self._lock_yum()
- self.AllowCancel(True)
- self.NoPercentageUpdates()
- self.StatusChanged(STATUS_INFO)
-
- fltlist = filters.split(';')
-
- if not FILTER_NOT_INSTALLED in fltlist:
- results = self.yumbase.pkgSack.searchProvides(search)
- for result in results:
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if self._do_extra_filtering(result, fltlist):
- self._show_package(result,INFO_AVAILABLE)
-
- if not FILTER_INSTALLED in fltlist:
- results = self.yumbase.rpmdb.searchProvides(search)
- for result in results:
- if self._cancel_check("Action cancelled."):
- # _cancel_check() sets the error message, unlocks yum, and calls Finished()
- return
-
- if self._do_extra_filtering(result, fltlist):
- self._show_package(result,INFO_INSTALLED)
-
- self._unlock_yum()
- self.Finished(EXIT_SUCCESS)
-
-#
-# Utility methods for Methods
-#
-
- def _do_search(self,searchlist,filters,key):
- '''
- Search for yum packages
- @param searchlist: The yum package fields to search in
- @param filters: package types to search (all,installed,available)
- @param key: key to seach for
- '''
- try:
- res = self.yumbase.searchGenerator(searchlist, [key])
- fltlist = filters.split(';')
-
- seen_nevra = [] # yum returns packages as available even when installed
- pkg_list = [] # only do the second iteration on not installed pkgs
- package_list = [] #we can't do emitting as found if we are post-processing
-
- for (pkg,values) in res:
- if self._cancel_check("Search cancelled."):
- return False
- # are we installed?
- if pkg.repo.id == 'installed':
- if self._do_extra_filtering(pkg,fltlist):
- package_list.append((pkg,INFO_INSTALLED))
- seen_nevra.append(self._get_nevra(pkg))
- else:
- pkg_list.append(pkg)
-
- for pkg in pkg_list:
- if self._cancel_check("Search cancelled."):
- return False
-
- nevra = self._get_nevra(pkg)
- if nevra not in seen_nevra:
- if self._do_extra_filtering(pkg,fltlist):
- package_list.append((pkg,INFO_AVAILABLE))
- seen_nevra.append(self._get_nevra(pkg))
- except yum.Errors.RepoError,e:
- self.Message(MESSAGE_CACHE_BEING_REBUILT, "The package cache is invalid and is being rebuilt.")
- self._refresh_yum_cache()
- self._unlock_yum()
- self.Finished(EXIT_FAILED)
-
- return False
-
- # basename filter if specified
- if FILTER_BASENAME in fltlist:
- for (pkg,status) in self._basename_filter(package_list):
- self._show_package(pkg,status)
- else:
- for (pkg,status) in package_list:
- self._show_package(pkg,status)
-
- return True
-
- def _do_extra_filtering(self,pkg,filterList):
- ''' do extra filtering (gui,devel etc) '''
- for filter in filterList:
- if filter in (FILTER_INSTALLED, FILTER_NOT_INSTALLED):
- if not self._do_installed_filtering(filter,pkg):
- return False
- elif filter in (FILTER_GUI, FILTER_NOT_GUI):
- if not self._do_gui_filtering(filter, pkg):
- return False
- elif filter in (FILTER_DEVELOPMENT, FILTER_NOT_DEVELOPMENT):
- if not self._do_devel_filtering(filter, pkg):
- return False
- elif filter in (FILTER_FREE, FILTER_NOT_FREE):
- if not self._do_free_filtering(filter, pkg):
- return False
- return True
-
- def _do_installed_filtering(self,flt,pkg):
- isInstalled = False
- if flt == FILTER_INSTALLED:
- wantInstalled = True
- else:
- wantInstalled = False
- isInstalled = pkg.repo.id == 'installed'
- return isInstalled == wantInstalled
-
- def _do_gui_filtering(self,flt,pkg):
- isGUI = False
- if flt == FILTER_GUI:
- wantGUI = True
- else:
- wantGUI = False
- isGUI = self._check_for_gui(pkg)
- return isGUI == wantGUI
-
- def _check_for_gui(self,pkg):
- ''' Check if the GUI_KEYS regex matches any package requirements'''
- for req in pkg.requires:
- reqname = req[0]
- if GUI_KEYS.search(reqname):
- return True
- return False
-
- def _do_devel_filtering(self,flt,pkg):
- isDevel = False
- if flt == FILTER_DEVELOPMENT:
- wantDevel = True
- else:
- wantDevel = False
- regex = re.compile(r'(-devel)|(-dgb)|(-static)')
- if regex.search(pkg.name):
- isDevel = True
- return isDevel == wantDevel
-
- def _do_free_filtering(self,flt,pkg):
- isFree = False
- if flt == FILTER_FREE:
- wantFree = True
- else:
- wantFree = False
-
- isFree = self.check_license_field(pkg.license)
-
- return isFree == wantFree
-
-
-
- def _is_development_repo(self, repo):
- if repo.endswith('-debuginfo'):
- return True
- if repo.endswith('-testing'):
- return True
- if repo.endswith('-debug'):
- return True
- if repo.endswith('-development'):
- return True
- if repo.endswith('-source'):
- return True
- return False
-
- def _buildGroupDict(self):
- pkgGroups= {}
- cats = self.yumbase.comps.categories
- for cat in cats:
- grps = map( lambda x: self.yumbase.comps.return_group( x ),
- filter( lambda x: self.yumbase.comps.has_group( x ), cat.groups ) )
- grplist = []
- for group in grps:
- for pkg in group.mandatory_packages.keys():
- pkgGroups[pkg] = "%s;%s" % (cat.categoryid,group.groupid)
- for pkg in group.default_packages.keys():
- pkgGroups[pkg] = "%s;%s" % (cat.categoryid,group.groupid)
- for pkg in group.optional_packages.keys():
- pkgGroups[pkg] = "%s;%s" % (cat.categoryid,group.groupid)
- for pkg in group.conditional_packages.keys():
- pkgGroups[pkg] = "%s;%s" % (cat.categoryid,group.groupid)
- return pkgGroups
-
- def _show_package_details(self,pkg):
- pkgver = self._get_package_ver(pkg)
- id = self._get_package_id(pkg.name, pkgver, pkg.arch, pkg.repo)
- desc = pkg.description
- desc = desc.replace('\n\n','__PARAGRAPH_SEPARATOR__')
- desc = desc.replace('\n',' ')
- desc = desc.replace('__PARAGRAPH_SEPARATOR__','\n')
-
- # this takes oodles of time
- pkgGroupDict = self._buildGroupDict()
- group = GROUP_OTHER
- if pkgGroupDict.has_key(pkg.name):
- cg = pkgGroupDict[pkg.name]
- if groupMap.has_key(cg):
- # use PK group name
- group = groupMap[cg]
-
- self._show_details(id, pkg.license, group, desc, pkg.url, pkg.size)
-
- def _getEVR(self,idver):
- '''
- get the e,v,r from the package id version
- '''
- cpos = idver.find(':')
- if cpos != -1:
- epoch = idver[:cpos]
- idver = idver[cpos+1:]
- else:
- epoch = '0'
- (version,release) = tuple(idver.split('-'))
- return epoch,version,release
-
- def _checkForNewer(self,po):
- '''
- Check if there is a newer version available
- '''
- pkgs = self.yumbase.pkgSack.returnNewestByName(name=po.name)
- if pkgs:
- newest = pkgs[0]
- if newest.EVR > po.EVR:
- #TODO Add code to send a message here
- self.Message(MESSAGE_NEWER_PACKAGE_EXISTS,"Newer version of %s, exist in the repositories " % po.name)
-
-
-
- def _findPackage(self,id):
- '''
- find a package based on a package id (name;version;arch;repoid)
- '''
- # is this an real id or just an name
- if len(id.split(';')) > 1:
- # Split up the id
- (n,idver,a,d) = self.get_package_from_id(id)
- # get e,v,r from package id version
- e,v,r = self._getEVR(idver)
- else:
- n = id
- e = v = r = a = None
- # search the rpmdb for the nevra
- pkgs = self.yumbase.rpmdb.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
- # if the package is found, then return it (do not have to match the repo_id)
- if len(pkgs) != 0:
- return pkgs[0],True
- # search the pkgSack for the nevra
- try:
- pkgs = self.yumbase.pkgSack.searchNevra(name=n,epoch=e,ver=v,rel=r,arch=a)
- except yum.Errors.RepoError,e:
- self.error(ERROR_REPO_NOT_AVAILABLE,str(e))
- # nothing found
- if len(pkgs) == 0:
- return None,False
- # one NEVRA in a single repo
- if len(pkgs) == 1:
- return pkgs[0],False
- # we might have the same NEVRA in multiple repos, match by repo name
- for pkg in pkgs:
- if d == pkg.repoid:
- return pkg,False
- # repo id did not match
- return None,False
-
- def _is_inst(self,pkg):
- return self.yumbase.rpmdb.installed(po=pkg)
-
- def _installable(self, pkg, ematch=False):
-
- """check if the package is reasonably installable, true/false"""
-
- exactarchlist = self.yumbase.conf.exactarchlist
- # we look through each returned possibility and rule out the
- # ones that we obviously can't use
-
- if self._is_inst(pkg):
- return False
-
- # everything installed that matches the name
- installedByKey = self.yumbase.rpmdb.searchNevra(name=pkg.name,arch=pkg.arch)
- comparable = []
- for instpo in installedByKey:
- if rpmUtils.arch.isMultiLibArch(instpo.arch) == rpmUtils.arch.isMultiLibArch(pkg.arch):
- comparable.append(instpo)
- else:
- continue
-
- # go through each package
- if len(comparable) > 0:
- for instpo in comparable:
- if pkg.EVR > instpo.EVR: # we're newer - this is an update, pass to them
- if instpo.name in exactarchlist:
- if pkg.arch == instpo.arch:
- return True
- else:
- return True
-
- elif pkg.EVR == instpo.EVR: # same, ignore
- return False
-
- elif pkg.EVR < instpo.EVR: # lesser, check if the pkgtup is an exactmatch
- # if so then add it to be installed
- # if it can be multiply installed
- # this is where we could handle setting
- # it to be an 'oldpackage' revert.
-
- if ematch and self.yumbase.allowedMultipleInstalls(pkg):
- return True
-
- else: # we've not got any installed that match n or n+a
- return True
-
- return False
-
- def _get_best_dependencies(self,po):
- ''' find the most recent packages that provides the dependencies for a package
- @param po: yum package object to find deps for
- @return: a list for yum package object providing the dependencies
- '''
- results = self.yumbase.findDeps([po])
- pkg = results.keys()[0]
- bestdeps=[]
- dep_resolution_errors=[]
- if len(results[pkg].keys()) == 0: # No dependencies for this package ?
- return bestdeps
- for req in results[pkg].keys():
- reqlist = results[pkg][req]
- if not reqlist: # Unsatisfied dependency
- dep_resolution_errors.append(prco_tuple_to_string(req))
- continue
- best = None
- for po in reqlist:
- if best:
- if po.EVR > best.EVR:
- best=po
- else:
- best= po
- bestdeps.append(best)
-
- return (dep_resolution_errors, unique(bestdeps))
-
- def _check_for_reboot(self):
- md = self.updateMetadata
- for txmbr in self.yumbase.tsInfo:
- pkg = txmbr.po
- # check if package is in reboot list or flagged with reboot_suggested
- # in the update metadata and is installed/updated etc
- notice = md.get_notice((pkg.name, pkg.version, pkg.release))
- if (pkg.name in self.rebootpkgs \
- or (notice and notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']))\
- and txmbr.ts_state in TS_INSTALL_STATES:
- self.require_restart(RESTART_SYSTEM,"")
- break
-
- def _truncate(text,length,etc='...'):
- if len(text) < length:
- return text
- else:
- return text[:length] + etc
-
- def _format_msgs(self,msgs):
- if isinstance(msgs,basestring):
- msgs = msgs.split('\n')
- text = ";".join(msgs)
- text = self._truncate(text, 1024);
- text = text.replace("Missing Dependency: ","")
- text = text.replace(" (installed)","")
- return text
-
- def _runYumTransaction(self,removedeps=None):
- '''
- Run the yum Transaction
- This will only work with yum 3.2.4 or higher
- Returns True on success, False on failure
- '''
-
- rc,msgs = self.yumbase.buildTransaction()
- if rc !=2:
- self._unlock_yum()
- self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,self._format_msgs(msgs))
- self.Finished(EXIT_FAILED)
- return False
-
- self._check_for_reboot()
-
- if removedeps == False and len(self.yumbase.tsInfo) > 1:
- self._unlock_yum()
- self.ErrorCode(ERROR_DEP_RESOLUTION_FAILED,self._format_msgs(msgs))
- self.Finished(EXIT_FAILED)
- return False
-
- try:
- rpmDisplay = PackageKitCallback(self)
- callback = ProcessTransPackageKitCallback(self)
- self.yumbase.processTransaction(callback=callback,
- rpmDisplay=rpmDisplay)
- except yum.Errors.YumDownloadError, ye:
- self._unlock_yum()
- self.ErrorCode(ERROR_PACKAGE_DOWNLOAD_FAILED,self._format_msgs(ye.value))
- self.Finished(EXIT_FAILED)
- return False
- except yum.Errors.YumGPGCheckError, ye:
- self._unlock_yum()
- self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,self._format_msgs(ye.value))
- self.Finished(EXIT_FAILED)
- return False
- except GPGKeyNotImported, e:
- keyData = self.yumbase.missingGPGKey
- if not keyData:
- self._unlock_yum()
- self.ErrorCode(ERROR_BAD_GPG_SIGNATURE,
- "GPG key not imported, but no GPG information received from Yum.")
- self.Finished(EXIT_FAILED)
- return False
- id = self._pkg_to_id(keyData['po'])
- self.RepoSignatureRequired(id,
- keyData['po'].repoid,
- keyData['keyurl'].replace("file://",""),
- keyData['userid'],
- keyData['hexkeyid'],
- keyData['fingerprint'],
- time.ctime(keyData['timestamp']),
- SIGTYPE_GPG)
- self._unlock_yum()
- self.ErrorCode(ERROR_GPG_FAILURE,"GPG key not imported.")
- self.Finished(EXIT_FAILED)
- return False
- except yum.Errors.YumBaseError, ye:
- self._unlock_yum()
- self.ErrorCode(ERROR_TRANSACTION_ERROR,self._format_msgs(ye.value))
- self.Finished(EXIT_FAILED)
- return False
-
- return True
-
- def _get_status(self,notice):
- ut = notice['type']
- if ut == 'security':
- return INFO_SECURITY
- elif ut == 'bugfix':
- return INFO_BUGFIX
- elif ut == 'enhancement':
- return INFO_ENHANCEMENT
- else:
- return INFO_UNKNOWN
- def _is_main_package(self,repo):
- if repo.endswith('-debuginfo'):
- return False
- if repo.endswith('-devel'):
- return False
- if repo.endswith('-libs'):
- return False
- return True
-
- def _basename_filter(self,package_list):
- '''
- Filter the list so that the number of packages are reduced.
- This is done by only displaying gtk2 rather than gtk2-devel, gtk2-debuginfo, etc.
- This imlementation is done by comparing the SRPM name, and if not falling back
- to the first entry.
- We have to fall back else we don't emit packages where the SRPM does not produce a
- RPM with the same name, for instance, mono produces mono-core, mono-data and mono-winforms.
- @package_list: a (pkg,status) list of packages
- A new list is returned that has been filtered
- '''
- base_list = []
- output_list = []
- base_list_already_got = []
-
- #find out the srpm name and add to a new array of compound data
- for (pkg,status) in package_list:
- if pkg.sourcerpm:
- base = rpmUtils.miscutils.splitFilename(pkg.sourcerpm)[0]
- base_list.append ((pkg,status,base,pkg.version));
- else:
- base_list.append ((pkg,status,'nosrpm',pkg.version));
-
- #find all the packages that match thier basename name (done seporately so we get the "best" match)
- for (pkg,status,base,version) in base_list:
- if base == pkg.name and (base,version) not in base_list_already_got:
- output_list.append((pkg,status))
- base_list_already_got.append ((base,version))
-
- #for all the ones not yet got, can we match against a non devel match?
- for (pkg,status,base,version) in base_list:
- if (base,version) not in base_list_already_got:
- if self._is_main_package(pkg.name):
- output_list.append((pkg,status))
- base_list_already_got.append ((base,version))
-
- #add the remainder of the packages, which should just be the single debuginfo's
- for (pkg,status,base,version) in base_list:
- if (base,version) not in base_list_already_got:
- output_list.append((pkg,status))
- base_list_already_got.append ((base,version))
- return output_list
-
- def _get_obsoleted(self,name):
- obsoletes = self.yumbase.up.getObsoletesTuples( newest=1 )
- for ( obsoleting, installed ) in obsoletes:
- if obsoleting[0] == name:
- pkg = self.yumbase.rpmdb.searchPkgTuple( installed )[0]
- return self._pkg_to_id(pkg)
- return ""
-
- def _get_updated(self,pkg):
- updated = None
- pkgs = self.yumbase.rpmdb.searchNevra(name=pkg.name,arch=pkg.arch)
- if pkgs:
- return self._pkg_to_id(pkgs[0])
- else:
- return ""
-
- def _get_update_metadata(self):
- if not self._updateMetadata:
- self._updateMetadata = UpdateMetadata()
- for repo in self.yumbase.repos.listEnabled():
- try:
- self._updateMetadata.add(repo)
- except:
- pass # No updateinfo.xml.gz in repo
- return self._updateMetadata
-
- _updateMetadata = None
- updateMetadata = property(fget=_get_update_metadata)
-
- def _format_list(self,lst):
- """
- Convert a list to a multiline string
- """
- if lst:
- return "\n".join(lst)
- else:
- return ""
-
- def _get_update_extras(self,pkg):
- urls = {'bugzilla': [], 'cve': [], 'vendor': []}
- notice = self.updateMetadata.get_notice((pkg.name, pkg.version, pkg.release))
- if notice:
- # Update Details
- desc = notice['description']
-
- # Update References (Bugzilla,CVE ...)
- for ref in notice['references']:
- type_ = ref['type']
- href = ref['href']
- title = ref['title'] or ""
-
- # Description can sometimes have ';' in them, and we use that as the delimiter
- title = title.replace(";",",")
-
- if href:
- if type_ in ('bugzilla', 'cve'):
- urls[type_].append("%s;%s" % (href, title))
- else:
- urls['vendor'].append("%s;%s" % (href, title))
-
- # Reboot flag
- if notice.get_metadata().has_key('reboot_suggested') and notice['reboot_suggested']:
- reboot = 'system'
- else:
- reboot = 'none'
- return desc,urls,reboot
- else:
- return "",urls,"none"
-
-#
-# Other utility methods
-#
-
- def _customTracebackHandler(self,exctype):
- '''
- Handle special not catched Tracebacks
- '''
- # Handle misc errors with loading repository metadata
- if (issubclass(exctype, yum.Errors.RepoError) or
- issubclass(exctype, IOError)):
- self.ErrorCode(ERROR_NO_NETWORK, "Problem with loading repository metadata, this can be caused by network problems or repository misconfigurations")
- self.Finished(EXIT_FAILED)
- return True
- else:
- return False
-
- def _check_init(self):
- ''' Check if yum has setup, else call init '''
- if hasattr(self,'yumbase'):
- self.dnlCallback.reset()
- else:
- self.doInit()
-
- def _get_package_ver(self,po):
- ''' return the a ver as epoch:version-release or version-release, if epoch=0'''
- if po.epoch != '0':
- ver = "%s:%s-%s" % (po.epoch,po.version,po.release)
- else:
- ver = "%s-%s" % (po.version,po.release)
- return ver
-
- def _get_nevra(self,pkg):
- ''' gets the NEVRA for a pkg '''
- return "%s-%s:%s-%s.%s" % (pkg.name,pkg.epoch,pkg.version,pkg.release,pkg.arch);
-
- def _refresh_yum_cache(self):
- self.StatusChanged(STATUS_REFRESH_CACHE)
- old_cache_setting = self.yumbase.conf.cache
- self.yumbase.conf.cache = 0
- self.yumbase.repos.setCache(0)
-
- self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
- self.yumbase.repos.populateSack(mdtype='filelists', cacheonly=1)
- self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
-
- self.yumbase.conf.cache = old_cache_setting
- self.yumbase.repos.setCache(old_cache_setting)
-
- def _setup_yum(self):
- self.yumbase.doConfigSetup(errorlevel=0,debuglevel=0) # Setup Yum Config
-
- # Setup caching strategy for all repos.
- for repo in self.yumbase.repos.listEnabled():
- repo.metadata_expire = 60 * 60 * 1.5 # 1.5 hours, the default
- repo.mdpolicy = "group:all"
-
- self.yumbase.conf.throttle = "90%" # Set bandwidth throttle to 90%
- self.dnlCallback = DownloadCallback(self,showNames=True) # Download callback
- self.yumbase.repos.setProgressBar( self.dnlCallback ) # Setup the download callback class
-
-class DownloadCallback( BaseMeter ):
- """ Customized version of urlgrabber.progress.BaseMeter class """
- def __init__(self,base,showNames = False):
- BaseMeter.__init__( self )
- self.totSize = ""
- self.base = base
- self.showNames = showNames
- self.reset()
-
- def reset(self):
- '''Reset download callback for a new transaction.'''
- self.oldName = None
- self.lastPct = 0
- self.totalPct = 0
- self.pkgs = None
- self.numPkgs = 0
- self.bump = 0.0
-
- def setPackages(self,pkgs,startPct,numPct):
- self.pkgs = pkgs
- self.numPkgs = float(len(self.pkgs))
- self.bump = numPct/self.numPkgs
- self.totalPct = startPct
-
- def _getPackage(self,name):
- if self.pkgs:
- for pkg in self.pkgs:
- rpmfn = os.path.basename(pkg.remote_path) # get the rpm filename of the package
- if rpmfn == name:
- return pkg
- return None
-
- def update( self, amount_read, now=None ):
- BaseMeter.update( self, amount_read, now )
-
- def _do_start( self, now=None ):
- name = self._getName()
- self.updateProgress(name,0.0,"","")
- if not self.size is None:
- self.totSize = format_number( self.size )
-
- def _do_update( self, amount_read, now=None ):
- fread = format_number( amount_read )
- name = self._getName()
- if self.size is None:
- # Elapsed time
- etime = self.re.elapsed_time()
- fetime = format_time( etime )
- frac = 0.0
- self.updateProgress(name,frac,fread,fetime)
- else:
- # Remaining time
- rtime = self.re.remaining_time()
- frtime = format_time( rtime )
- frac = self.re.fraction_read()
- self.updateProgress(name,frac,fread,frtime)
-
- def _do_end( self, amount_read, now=None ):
- total_time = format_time( self.re.elapsed_time() )
- total_size = format_number( amount_read )
- name = self._getName()
- self.updateProgress(name,1.0,total_size,total_time)
-
- def _getName(self):
- '''
- Get the name of the package being downloaded
- '''
- if self.text and type( self.text ) == type( "" ):
- name = self.text
- else:
- name = self.basename
- return name
-
- def updateProgress(self,name,frac,fread,ftime):
- '''
- Update the progressbar (Overload in child class)
- @param name: filename
- @param frac: Progress fracment (0 -> 1)
- @param fread: formated string containing BytesRead
- @param ftime : formated string containing remaining or elapsed time
- '''
- pct = int( frac*100 )
- if name != self.oldName: # If this a new package
- if self.oldName:
- self.base.SubPercentageChanged(100)
- self.oldName = name
- if self.bump > 0.0: # Bump the total download percentage
- self.totalPct += self.bump
- self.lastPct = 0
- self.base.PercentageChanged(int(self.totalPct))
- if self.showNames:
- pkg = self._getPackage(name)
- if pkg: # show package to download
- self.base._show_package(pkg,INFO_DOWNLOADING)
- else:
- typ = STATUS_DOWNLOAD_REPOSITORY
- for key in MetaDataMap.keys():
- if key in name:
- typ = MetaDataMap[key]
- break
- self.base.StatusChanged(typ)
- self.base.SubPercentageChanged(0)
- else:
- if self.lastPct != pct and pct != 0 and pct != 100:
- self.lastPct = pct
- # bump the sub percentage for this package
- self.base.SubPercentageChanged(pct)
-
-class PackageKitCallback(RPMBaseCallback):
- def __init__(self,base):
- RPMBaseCallback.__init__(self)
- self.base = base
- self.pct = 0
- self.curpkg = None
- self.startPct = 50
- self.numPct = 50
-
- # this isn't defined in yum as it's only used in the rollback plugin
- TS_REPACKAGING = 'repackaging'
-
- # Map yum transactions with pk info enums
- self.info_actions = { TS_UPDATE : INFO_UPDATING,
- TS_ERASE: INFO_REMOVING,
- TS_INSTALL: INFO_INSTALLING,
- TS_TRUEINSTALL : INFO_INSTALLING,
- TS_OBSOLETED: INFO_OBSOLETING,
- TS_OBSOLETING: INFO_INSTALLING,
- TS_UPDATED: INFO_CLEANUP}
-
- # Map yum transactions with pk state enums
- self.state_actions = { TS_UPDATE : STATUS_UPDATE,
- TS_ERASE: STATUS_REMOVE,
- TS_INSTALL: STATUS_INSTALL,
- TS_TRUEINSTALL : STATUS_INSTALL,
- TS_OBSOLETED: STATUS_OBSOLETE,
- TS_OBSOLETING: STATUS_INSTALL,
- TS_UPDATED: STATUS_CLEANUP,
- TS_REPACKAGING: STATUS_REPACKAGING}
-
- def _calcTotalPct(self,ts_current,ts_total):
- bump = float(self.numPct)/ts_total
- pct = int(self.startPct + (ts_current * bump))
- return pct
-
- def _showName(self,status):
- if type(self.curpkg) in types.StringTypes:
- id = self.base._get_package_id(self.curpkg,'','','')
- else:
- pkgver = self.base._get_package_ver(self.curpkg)
- id = self.base._get_package_id(self.curpkg.name, pkgver, self.curpkg.arch, self.curpkg.repo)
- self.base.Package(status, id, "")
-
- def event(self, package, action, te_current, te_total, ts_current, ts_total):
- if self.base._cancel_check("Action cancelled."):
- sys.exit(0)
-
- if str(package) != str(self.curpkg):
- self.curpkg = package
- try:
- self.base.StatusChanged(self.state_actions[action])
- self._showName(self.info_actions[action])
- except exceptions.KeyError,e:
- self.base.Message(MESSAGE_BACKEND_ERROR,"The constant '%s' was unknown, please report" % action)
- pct = self._calcTotalPct(ts_current, ts_total)
- self.base.PercentageChanged(pct)
- val = (ts_current*100L)/ts_total
- if val != self.pct:
- self.pct = val
- self.base.SubPercentageChanged(val)
-
- def errorlog(self, msg):
- # grrrrrrrr
- pass
-
-class ProcessTransPackageKitCallback:
- def __init__(self,base):
- self.base = base
-
- def event(self,state,data=None):
- if state == PT_DOWNLOAD: # Start Downloading
- self.base.AllowCancel(True)
- self.base.PercentageChanged(10)
- self.base.StatusChanged(STATUS_DOWNLOAD)
- if state == PT_DOWNLOAD_PKGS: # Packages to download
- self.base.dnlCallback.setPackages(data,10,30)
- elif state == PT_GPGCHECK:
- self.base.PercentageChanged(40)
- self.base.StatusChanged(STATUS_SIG_CHECK)
- pass
- elif state == PT_TEST_TRANS:
- self.base.AllowCancel(False)
- self.base.PercentageChanged(45)
- self.base.StatusChanged(STATUS_TEST_COMMIT)
- pass
- elif state == PT_TRANSACTION:
- self.base.AllowCancel(False)
- self.base.PercentageChanged(50)
- pass
-
-
-class DepSolveCallback(object):
-
- # XXX takes a PackageKitBackend so we can call StatusChanged on it.
- # That's kind of hurky.
- def __init__(self, backend):
- self.started = False
- self.backend = backend
-
- def start(self):
- if not self.started:
- self.backend.StatusChanged(STATUS_DEP_RESOLVE)
- self.backend.NoPercentageUpdates()
-
- # Be lazy and not define the others explicitly
- def _do_nothing(self, *args, **kwargs):
- pass
-
- def __getattr__(self, x):
- return self._do_nothing
-
-
-class PackageKitYumBase(yum.YumBase):
- """
- Subclass of YumBase. Needed so we can overload _checkSignatures
- and nab the gpg sig data
- """
-
- def __init__(self, backend):
- yum.YumBase.__init__(self)
- self.missingGPGKey = None
- self.skipped_packages = []
- self.dsCallback = DepSolveCallback(backend)
-
- # Modified searchGenerator to make sure that
- # non unicode strings read from rpmdb is converted to unicode
- # FIXME: Remove this when fixed and released in upstream
- def searchGenerator(self, fields, criteria, showdups=True):
- """Generator method to lighten memory load for some searches.
- This is the preferred search function to use."""
- sql_fields = []
- for f in fields:
- if RPM_TO_SQLITE.has_key(f):
- sql_fields.append(RPM_TO_SQLITE[f])
- else:
- sql_fields.append(f)
-
- matched_values = {}
-
- # yield the results in order of most terms matched first
- sorted_lists = {}
- tmpres = []
- real_crit = []
- for s in criteria:
- if s.find('%') == -1:
- real_crit.append(s)
- real_crit_lower = [] # Take the s.lower()'s out of the loop
- for s in criteria:
- if s.find('%') == -1:
- real_crit_lower.append(s.lower())
-
- for sack in self.pkgSack.sacks.values():
- tmpres.extend(sack.searchPrimaryFieldsMultipleStrings(sql_fields, real_crit))
-
- for (po, count) in tmpres:
- # check the pkg for sanity
- # pop it into the sorted lists
- tmpvalues = []
- if count not in sorted_lists: sorted_lists[count] = []
- for s in real_crit_lower:
- for field in fields:
- value = getattr(po, field)
- if value and value.lower().find(s) != -1:
- tmpvalues.append(value)
-
- if len(tmpvalues) > 0:
- sorted_lists[count].append((po, tmpvalues))
-
-
-
- for po in self.rpmdb:
- tmpvalues = []
- criteria_matched = 0
- for s in real_crit_lower:
- matched_s = False
- for field in fields:
- value = getattr(po, field)
- # make sure that string are in unicode
- if isinstance(value, str):
- value = unicode(value,'unicode-escape')
- if value and value.lower().find(s) != -1:
- if not matched_s:
- criteria_matched += 1
- matched_s = True
-
- tmpvalues.append(value)
-
-
- if len(tmpvalues) > 0:
- if criteria_matched not in sorted_lists: sorted_lists[criteria_matched] = []
- sorted_lists[criteria_matched].append((po, tmpvalues))
-
-
- # close our rpmdb connection so we can ctrl-c, kthxbai
- self.closeRpmDB()
-
- yielded = {}
- for val in reversed(sorted(sorted_lists)):
- for (po, matched) in sorted(sorted_lists[val], key=operator.itemgetter(0)):
- if (po.name, po.arch) not in yielded:
- yield (po, matched)
- if not showdups:
- yielded[(po.name, po.arch)] = 1
-
-
- def _checkSignatures(self,pkgs,callback):
- ''' The the signatures of the downloaded packages '''
- # This can be overloaded by a subclass.
-
- for po in pkgs:
- result, errmsg = self.sigCheckPkg(po)
- if result == 0:
- # Verified ok, or verify not req'd
- continue
- elif result == 1:
- self.getKeyForPackage(po, fullaskcb=self._fullAskForGPGKeyImport)
- else:
- raise yum.Errors.YumGPGCheckError, errmsg
-
- return 0
-
- def _fullAskForGPGKeyImport(self, data):
- self.missingGPGKey = data
-
- raise GPGKeyNotImported()
-
- def _askForGPGKeyImport(self, po, userid, hexkeyid):
- '''
- Ask for GPGKeyImport
- '''
- return False
-
- def _removePoFromTransaction(self,po):
- '''
- Overridden so we can keep track of the package objects as they
- are removed from a transaction when skip_broken is used.
- '''
- skipped = yum.YumBase._removePoFromTransaction(self, po)
- self.skipped_packages.extend(skipped)
-
- return skipped
-
-if __name__ == '__main__':
- loop = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
- bus = dbus.SystemBus(mainloop=loop)
- bus_name = dbus.service.BusName(PACKAGEKIT_DBUS_SERVICE, bus=bus)
- manager = PackageKitYumBackend(bus_name, PACKAGEKIT_DBUS_PATH)
-
diff --git a/backends/yum2/pk-backend-yum2.c b/backends/yum2/pk-backend-yum2.c
deleted file mode 100644
index d934b14..0000000
--- a/backends/yum2/pk-backend-yum2.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2007-2008 Richard Hughes <richard at hughsie.com>
- *
- * Licensed under the GNU General Public License Version 2
- *
- * 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.
- */
-
-#include <pk-backend.h>
-#include <pk-backend-dbus.h>
-
-static PkBackendDbus *dbus;
-
-#define PK_DBUS_BACKEND_SERVICE_YUM "org.freedesktop.PackageKitYumBackend"
-
-/**
- * backend_initialize:
- * This should only be run once per backend load, i.e. not every transaction
- */
-static void
-backend_initialize (PkBackend *backend)
-{
- egg_debug ("backend: initialize");
- dbus = pk_backend_dbus_new ();
- pk_backend_dbus_set_name (dbus, PK_DBUS_BACKEND_SERVICE_YUM);
-}
-
-/**
- * backend_destroy:
- * This should only be run once per backend load, i.e. not every transaction
- */
-static void
-backend_destroy (PkBackend *backend)
-{
- egg_debug ("backend: destroy");
- pk_backend_dbus_kill (dbus);
- g_object_unref (dbus);
-}
-
-/**
- * backend_get_groups:
- */
-static PkBitfield
-backend_get_groups (PkBackend *backend)
-{
- return pk_bitfield_from_enums (
- PK_GROUP_ENUM_ADMIN_TOOLS,
- PK_GROUP_ENUM_DESKTOP_GNOME,
- PK_GROUP_ENUM_DESKTOP_KDE,
- PK_GROUP_ENUM_DESKTOP_XFCE,
- PK_GROUP_ENUM_DESKTOP_OTHER,
- PK_GROUP_ENUM_EDUCATION,
- PK_GROUP_ENUM_FONTS,
- PK_GROUP_ENUM_GAMES,
- PK_GROUP_ENUM_GRAPHICS,
- PK_GROUP_ENUM_INTERNET,
- PK_GROUP_ENUM_LEGACY,
- PK_GROUP_ENUM_LOCALIZATION,
- PK_GROUP_ENUM_MULTIMEDIA,
- PK_GROUP_ENUM_OFFICE,
- PK_GROUP_ENUM_OTHER,
- PK_GROUP_ENUM_PROGRAMMING,
- PK_GROUP_ENUM_PUBLISHING,
- PK_GROUP_ENUM_SERVERS,
- PK_GROUP_ENUM_SYSTEM,
- PK_GROUP_ENUM_VIRTUALIZATION,
- -1);
-}
-
-/**
- * backend_get_filters:
- */
-static PkBitfield
-backend_get_filters (PkBackend *backend)
-{
- return pk_bitfield_from_enums (
- PK_FILTER_ENUM_GUI,
- PK_FILTER_ENUM_INSTALLED,
- PK_FILTER_ENUM_DEVELOPMENT,
- PK_FILTER_ENUM_FREE,
- -1);
-}
-
-/**
- * pk_backend_cancel:
- */
-static void
-backend_cancel (PkBackend *backend)
-{
- pk_backend_dbus_cancel (dbus);
-}
-
-/**
- * backend_get_depends:
- */
-static void
-backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
-{
- pk_backend_dbus_get_depends (dbus, filters, package_ids, recursive);
-}
-
-/**
- * backend_get_details:
- */
-static void
-backend_get_details (PkBackend *backend, gchar **package_ids)
-{
- pk_backend_dbus_get_details (dbus, package_ids);
-}
-
-/**
- * backend_get_files:
- */
-static void
-backend_get_files (PkBackend *backend, gchar **package_ids)
-{
- pk_backend_dbus_get_files (dbus, package_ids);
-}
-
-/**
- * backend_get_requires:
- */
-static void
-backend_get_requires (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
-{
- pk_backend_dbus_get_requires (dbus, filters, package_ids, recursive);
-}
-
-/**
- * backend_get_updates:
- */
-static void
-backend_get_updates (PkBackend *backend, PkBitfield filters)
-{
- pk_backend_dbus_get_updates (dbus, filters);
-}
-
-/**
- * backend_get_update_detail:
- */
-static void
-backend_get_update_detail (PkBackend *backend, gchar **package_ids)
-{
- pk_backend_dbus_get_update_detail (dbus, package_ids);
-}
-
-/**
- * backend_install_packages:
- */
-static void
-backend_install_packages (PkBackend *backend, gchar **package_ids)
-{
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
- pk_backend_finished (backend);
- return;
- }
-
- pk_backend_dbus_install_packages (dbus, package_ids);
-}
-
-/**
- * backend_install_files:
- */
-static void
-backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
-{
- pk_backend_dbus_install_files (dbus, trusted, full_paths);
-}
-
-/**
- * backend_refresh_cache:
- */
-static void
-backend_refresh_cache (PkBackend *backend, gboolean force)
-{
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot refresh cache whilst offline");
- pk_backend_finished (backend);
- return;
- }
-
- pk_backend_dbus_refresh_cache (dbus, force);
-}
-
-/**
- * pk_backend_remove_packages:
- */
-static void
-backend_remove_packages (PkBackend *backend, gchar **package_ids, gboolean allow_deps, gboolean autoremove)
-{
- pk_backend_dbus_remove_packages (dbus, package_ids, allow_deps, autoremove);
-}
-
-/**
- * pk_backend_search_details:
- */
-static void
-backend_search_details (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- pk_backend_dbus_search_details (dbus, filters, search);
-}
-
-/**
- * pk_backend_search_file:
- */
-static void
-backend_search_file (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- pk_backend_dbus_search_file (dbus, filters, search);
-}
-
-/**
- * pk_backend_search_group:
- */
-static void
-backend_search_group (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- pk_backend_dbus_search_group (dbus, filters, search);
-}
-
-/**
- * pk_backend_search_name:
- */
-static void
-backend_search_name (PkBackend *backend, PkBitfield filters, const gchar *search)
-{
- pk_backend_dbus_search_name (dbus, filters, search);
-}
-
-/**
- * pk_backend_update_packages:
- */
-static void
-backend_update_packages (PkBackend *backend, gchar **package_ids)
-{
- /* check network state */
- if (!pk_backend_is_online (backend)) {
- pk_backend_error_code (backend, PK_ERROR_ENUM_NO_NETWORK, "Cannot install when offline");
- pk_backend_finished (backend);
- return;
- }
-
- pk_backend_dbus_update_packages (dbus, package_ids);
-}
-
-/**
- * pk_backend_update_system:
- */
-static void
-backend_update_system (PkBackend *backend)
-{
- pk_backend_dbus_update_system (dbus);
-}
-
-/**
- * pk_backend_resolve:
- */
-static void
-backend_resolve (PkBackend *backend, PkBitfield filters, gchar **packages)
-{
- pk_backend_dbus_resolve (dbus, filters, packages);
-}
-
-/**
- * pk_backend_get_repo_list:
- */
-static void
-backend_get_repo_list (PkBackend *backend, PkBitfield filters)
-{
- pk_backend_dbus_get_repo_list (dbus, filters);
-}
-
-/**
- * pk_backend_repo_enable:
- */
-static void
-backend_repo_enable (PkBackend *backend, const gchar *rid, gboolean enabled)
-{
- pk_backend_dbus_repo_enable (dbus, rid, enabled);
-}
-
-/**
- * pk_backend_repo_set_data:
- */
-static void
-backend_repo_set_data (PkBackend *backend, const gchar *rid, const gchar *parameter, const gchar *value)
-{
- pk_backend_dbus_repo_set_data (dbus, rid, parameter, value);
-}
-
-/**
- * pk_backend_what_provides:
- */
-static void
-backend_what_provides (PkBackend *backend, PkBitfield filters, PkProvidesEnum provides, const gchar *search)
-{
- pk_backend_dbus_what_provides (dbus, filters, provides, search);
-}
-
-PK_BACKEND_OPTIONS (
- "YUM-DBUS", /* description */
- "Tim Lauridsen <timlau at fedoraproject.org>", /* author */
- backend_initialize, /* initalize */
- backend_destroy, /* destroy */
- backend_get_groups, /* get_groups */
- backend_get_filters, /* get_filters */
- backend_cancel, /* cancel */
- NULL, /* download_packages */
- backend_get_depends, /* get_depends */
- backend_get_details, /* get_details */
- NULL, /* get_distro_upgrades */
- backend_get_files, /* get_files */
- NULL, /* get_packages */
- backend_get_repo_list, /* get_repo_list */
- backend_get_requires, /* get_requires */
- backend_get_update_detail, /* get_update_detail */
- backend_get_updates, /* get_updates */
- backend_install_files, /* install_files */
- backend_install_packages, /* install_packages */
- NULL, /* install_signature */
- backend_refresh_cache, /* refresh_cache */
- backend_remove_packages, /* remove_packages */
- backend_repo_enable, /* repo_enable */
- backend_repo_set_data, /* repo_set_data */
- backend_resolve, /* resolve */
- NULL, /* rollback */
- backend_search_details, /* search_details */
- backend_search_file, /* search_file */
- backend_search_group, /* search_group */
- backend_search_name, /* search_name */
- NULL, /* service_pack */
- backend_update_packages, /* update_packages */
- backend_update_system, /* update_system */
- backend_what_provides /* what_provides */
-);
-
diff --git a/configure.ac b/configure.ac
index 668156f..9b46cd1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -304,7 +304,6 @@ AC_ARG_ENABLE(razor, AS_HELP_STRING([--enable-razor],[use the razor backend]),en
AC_ARG_ENABLE(smart, AS_HELP_STRING([--enable-smart],[use the SMART backend]),enable_smart=$enableval,enable_smart=no)
AC_ARG_ENABLE(urpmi, AS_HELP_STRING([--enable-urpmi],[use the URPMI backend]),enable_urpmi=$enableval,enable_urpmi=no)
AC_ARG_ENABLE(yum, AS_HELP_STRING([--enable-yum],[use the YUM backend]),enable_yum=$enableval,enable_yum=no)
-AC_ARG_ENABLE(yum2, AS_HELP_STRING([--enable-yum2],[use the YUM DBUS backend]),enable_yum2=$enableval,enable_yum2=no)
AC_ARG_ENABLE(zypp, AS_HELP_STRING([--enable-zypp],[use the Zypp backend]),enable_zypp=$enableval,enable_zypp=no)
# export to Makefile.am's
@@ -320,7 +319,6 @@ AM_CONDITIONAL(BACKEND_TYPE_RAZOR, [test x$enable_razor = xyes], [using Razor ba
AM_CONDITIONAL(BACKEND_TYPE_SMART, [test x$enable_smart = xyes], [using SMART backend])
AM_CONDITIONAL(BACKEND_TYPE_URPMI, [test x$enable_urpmi = xyes], [using URPMI backend])
AM_CONDITIONAL(BACKEND_TYPE_YUM, [test x$enable_yum = xyes], [using YUM backend])
-AM_CONDITIONAL(BACKEND_TYPE_YUM2, [test x$enable_yum2 = xyes], [using YUM DBUS backend])
AM_CONDITIONAL(BACKEND_TYPE_ZYPP, [test x$enable_zypp = xyes], [using Zypp backend])
if test x$enable_gcov = xyes; then
@@ -560,8 +558,6 @@ backends/urpmi/helpers/perl_packagekit/Makefile
backends/urpmi/helpers/urpmi_backend/Makefile
backends/razor/Makefile
backends/yum/Makefile
-backends/yum2/Makefile
-backends/yum2/helpers/Makefile
backends/pisi/Makefile
backends/pisi/helpers/Makefile
backends/poldek/Makefile
@@ -599,7 +595,7 @@ echo "
Security framework: ${with_security_framework}
Networking stack: ${with_networking_stack}
GIO support: ${with_gio}
- Browser Plugin: ${build_browser_plugin}
+ Browser plugin: ${build_browser_plugin}
Backends:
ALPM backend: ${enable_alpm}
@@ -614,7 +610,6 @@ echo "
SMART backend: ${enable_smart}
URPMI backend: ${enable_urpmi}
YUM backend: ${enable_yum}
- YUM2 backend: ${enable_yum2}
Zypp backend: ${enable_zypp}
Default backend: ${with_default_backend}
"
More information about the PackageKit-commit
mailing list