[PackageKit-commit] packagekit: Branch 'master' - 49 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Tue Sep 16 01:16:42 PDT 2008
backends/apt/aptDBUSBackend.py | 193 ++++++++++++++--------------
backends/apt/pk-backend-apt.c | 2
backends/dummy/pk-backend-dummy.c | 29 +++-
backends/smart/helpers/smartBackend.py | 84 +++++++++++-
backends/smart/pk-backend-smart.c | 6
backends/urpmi/helpers/get-depends.pl | 13 +
backends/urpmi/helpers/get-details.pl | 4
backends/urpmi/helpers/get-files.pl | 4
backends/urpmi/helpers/get-update-detail.pl | 4
backends/urpmi/helpers/install-packages.pl | 11 +
backends/yum/yumBackend.py | 5
backends/zypp/zypp-utils.cpp | 2
docs/html/pk-download.html | 6
libpackagekit/pk-extra.c | 103 ++++++++------
14 files changed, 303 insertions(+), 163 deletions(-)
New commits:
commit 575d0077871a9b9812d1ca6f36fcd6473702620b
Author: Richard Hughes <richard at hughsie.com>
Date: Tue Sep 16 09:12:56 2008 +0100
bugfix: PkExtra is a singleton, so if we try to set the database with the same filename as before, don't error out, instead silently return true
diff --git a/libpackagekit/pk-extra.c b/libpackagekit/pk-extra.c
index 321f0bc..5f33919 100644
--- a/libpackagekit/pk-extra.c
+++ b/libpackagekit/pk-extra.c
@@ -161,11 +161,10 @@ pk_extra_populate_locale_cache_callback (void *data, gint argc, gchar **argv, gc
col = col_name[i];
value = argv[i];
/* save the package name, and use it is the key */
- if (egg_strequal (col, "package") && value != NULL) {
+ if (egg_strequal (col, "package") && value != NULL)
package = g_strdup (argv[i]);
- } else if (egg_strequal (col, "summary") && value != NULL) {
+ else if (egg_strequal (col, "summary") && value != NULL)
summary = g_strdup (argv[i]);
- }
}
/* sanity check */
@@ -530,7 +529,7 @@ pk_extra_set_data_package (PkExtra *extra, const gchar *package, const gchar *ic
/**
* pk_extra_set_database:
* @extra: a valid #PkExtra instance
- * @filename: a valid database
+ * @filename: a valid database, or NULL to use the default or previously set value
*
* Return value: %TRUE if set correctly
**/
@@ -544,15 +543,27 @@ pk_extra_set_database (PkExtra *extra, const gchar *filename)
g_return_val_if_fail (PK_IS_EXTRA (extra), FALSE);
+ /* already set? */
if (extra->priv->database != NULL) {
- egg_warning ("cannot assign extra than once");
+ /* we don't care, just use the default */
+ if (filename == NULL) {
+ egg_debug ("continuing to use old database as we don't care");
+ return TRUE;
+ }
+ /* we care, but it's the same as last time */
+ if (egg_strequal (extra->priv->database, filename)) {
+ egg_debug ("continuing to use old database as same as before");
+ return TRUE;
+ }
+ /* bad */
+ egg_warning ("Using same PkExtra object with different databases: %s and %s",
+ filename, extra->priv->database);
return FALSE;
}
/* if this is NULL, then assume default */
- if (filename == NULL) {
+ if (filename == NULL)
filename = PK_EXTRA_DEFAULT_DATABASE_INTERNAL;
- }
/* save for later */
extra->priv->database = g_strdup (filename);
@@ -717,25 +728,41 @@ pk_extra_test (EggTest *test)
/************************************************************/
egg_test_title (test, "set database");
ret = pk_extra_set_database (extra, "extra.db");
- if (ret) {
+ if (ret)
egg_test_success (test, "%ims", egg_test_elapsed (test));
- } else
+ else
egg_test_failed (test, NULL);
/************************************************************/
egg_test_title (test, "set database (again)");
ret = pk_extra_set_database (extra, "angry.db");
- if (ret == FALSE) {
+ if (ret == FALSE)
egg_test_success (test, "%ims", egg_test_elapsed (test));
- } else
+ else
+ egg_test_failed (test, NULL);
+
+ /************************************************************/
+ egg_test_title (test, "set database (same as original)");
+ ret = pk_extra_set_database (extra, "extra.db");
+ if (ret)
+ egg_test_success (test, NULL);
+ else
+ egg_test_failed (test, NULL);
+
+ /************************************************************/
+ egg_test_title (test, "set database (don't care)");
+ ret = pk_extra_set_database (extra, NULL);
+ if (ret)
+ egg_test_success (test, NULL);
+ else
egg_test_failed (test, NULL);
/************************************************************/
egg_test_title (test, "set locale explicit en");
ret = pk_extra_set_locale (extra, "en");
- if (ret) {
+ if (ret)
egg_test_success (test, "%ims", egg_test_elapsed (test));
- } else
+ else
egg_test_failed (test, NULL);
/************************************************************/
@@ -750,27 +777,25 @@ pk_extra_test (EggTest *test)
text = pk_extra_get_locale (extra);
if (egg_strequal (text, "en"))
egg_test_success (test, NULL);
- else {
+ else
egg_test_failed (test, "locale was %s", text);
- }
/************************************************************/
egg_test_title (test, "insert localised data");
ret = pk_extra_set_data_locale (extra, "gnome-power-manager", "Power manager for the GNOME's desktop");
if (ret)
egg_test_success (test, NULL);
- else {
+ else
egg_test_failed (test, "failed!");
- }
+
/************************************************************/
egg_test_title (test, "retrieve localised data");
summary = pk_extra_get_summary (extra, "gnome-power-manager");
- if (summary != NULL) {
+ if (summary != NULL)
egg_test_success (test, "%s", summary);
- } else {
+ else
egg_test_failed (test, "failed!");
- }
/************************************************************/
egg_test_title (test, "set locale implicit en_GB");
@@ -790,80 +815,70 @@ pk_extra_test (EggTest *test)
/************************************************************/
egg_test_title (test, "retrieve localised data2");
summary = pk_extra_get_summary (extra, "gnome-power-manager");
- if (summary != NULL) {
+ if (summary != NULL)
egg_test_success (test, "%s", summary);
- } else {
+ else
egg_test_failed (test, "failed!");
- }
/************************************************************/
egg_test_title (test, "insert package data");
ret = pk_extra_set_data_package (extra, "gnome-power-manager", "gpm-main.png", "gnome-power-manager");
if (ret)
egg_test_success (test, NULL);
- else {
+ else
egg_test_failed (test, "failed!");
- }
/************************************************************/
egg_test_title (test, "retrieve package data");
icon = pk_extra_get_icon_name (extra, "gnome-power-manager");
exec = pk_extra_get_exec (extra, "gnome-power-manager");
- if (egg_strequal (icon, "gpm-main.png")) {
+ if (egg_strequal (icon, "gpm-main.png"))
egg_test_success (test, "%s:%s", icon, exec);
- } else {
+ else
egg_test_failed (test, "%s:%s", icon, exec);
- }
/************************************************************/
egg_test_title (test, "insert new package data");
ret = pk_extra_set_data_package (extra, "gnome-power-manager", "gpm-prefs.png", "gnome-power-preferences");
if (ret)
egg_test_success (test, NULL);
- else {
+ else
egg_test_failed (test, "failed!");
- }
/************************************************************/
egg_test_title (test, "retrieve new package data");
icon = pk_extra_get_icon_name (extra, "gnome-power-manager");
exec = pk_extra_get_exec (extra, "gnome-power-manager");
if (egg_strequal (icon, "gpm-prefs.png") &&
- egg_strequal (exec, "gnome-power-preferences")) {
+ egg_strequal (exec, "gnome-power-preferences"))
egg_test_success (test, "%s:%s", icon, exec);
- } else {
+ else
egg_test_failed (test, "%s:%s", icon, exec);
- }
/************************************************************/
egg_test_title (test, "retrieve missing package data");
icon = pk_extra_get_icon_name (extra, "gnome-moo-manager");
exec = pk_extra_get_exec (extra, "gnome-moo-manager");
- if (icon == NULL && exec == NULL) {
+ if (icon == NULL && exec == NULL)
egg_test_success (test, "passed");
- } else {
+ else
egg_test_failed (test, "%s:%s", icon, exec);
- }
/************************************************************/
egg_test_title (test, "do lots of loops");
for (i=0;i<250;i++) {
summary = pk_extra_get_summary (extra, "gnome-power-manager");
- if (summary == NULL) {
+ if (summary == NULL)
egg_test_failed (test, "failed to get good!");
- }
summary = pk_extra_get_summary (extra, "gnome-moo-manager");
- if (summary != NULL) {
+ if (summary != NULL)
egg_test_failed (test, "failed to not get bad 2!");
- }
summary = pk_extra_get_summary (extra, "gnome-moo-manager");
- if (summary != NULL) {
+ if (summary != NULL)
egg_test_failed (test, "failed to not get bad 3!");
- }
summary = pk_extra_get_summary (extra, "gnome-moo-manager");
- if (summary != NULL) {
+ if (summary != NULL)
egg_test_failed (test, "failed to not get bad 4!");
- }
}
egg_test_success (test, "%i get_summary loops completed in %ims", i*5, egg_test_elapsed (test));
commit cb4e7837cd20a73d0efdec5d17f6d4cc4431599b
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 19:12:15 2008 +0200
trivial: remove duplicate mapping
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 21fe964..a84e3f7 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -499,7 +499,6 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Productivity/Security' : GROUP_SECURITY,
'Productivity/Telephony' : GROUP_COMMUNICATION,
'Productivity/Text' : GROUP_PUBLISHING,
- 'System' : GROUP_SYSTEM,
'System/Base' : GROUP_SYSTEM,
'System/Daemons' : GROUP_SYSTEM,
'System/Emulators' : GROUP_VIRTUALIZATION,
commit 0cb8214fd8d993965ab1a123fb9fde601129b9cf
Merge: 8f43116... 828d444...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 19:03:39 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit 828d444666a1820d91fd372134f8f5644dca517e
Author: Scott Reeves <sreeves at novell.com>
Date: Mon Sep 15 11:09:34 2008 -0600
zypp - update the repo location
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index 42ad74e..9462747 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -41,7 +41,7 @@ easier to install.
install</a> the packages <code>packagekit</code> and <code>packagekit-gnome</code>.
</li>
<li>
- openSUSE 11: Yes, add <a href="http://download.opensuse.org/distribution/SL-OSS-factory/inst-source">this</a>
+ openSUSE 11: Yes, add <a href="http://download.opensuse.org/distribution/11.0/repo/oss/">this</a>
repository file and run: <code>zypper install PackageKit gnome-packagekit</code> (as root)
</li>
<li>
commit 8f43116705d5328c7afc59a0b672b90147dba826
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 19:03:14 2008 +0200
only bother with filtering desktops if we're actually looking for one
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 947bc43..21fe964 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -381,11 +381,12 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
def search_group(self, filters, searchstring):
self.status(STATUS_QUERY)
self.allow_cancel(True)
+ filter_desktops = searchstring.find("desktop") != -1
packages = self.ctrl.getCache().getPackages()
for package in packages:
if self._package_passes_filters(package, filters):
info = package.loaders.keys()[0].getInfo(package)
- group = self._get_group(info)
+ group = self._get_group(info, filter_desktops)
if searchstring in group:
self._add_package(package)
self._post_process_package_list(filters)
@@ -973,7 +974,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
return True
return False
- def _get_group(self, info):
+ def _get_group(self, info, filter_desktops=True):
group = info.getGroup()
if group in self.GROUPS:
package = info.getPackage().name
@@ -981,7 +982,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
return GROUP_FONTS
if group == 'Applications/Productivity' and package.find('-langpack') != -1:
return GROUP_LOCALIZATION
- if group == 'User Interface/Desktops':
+ if group == 'User Interface/Desktops' and filter_desktops:
if self._package_in_requires(package, "^gnome-desktop") \
or self._package_in_requires(package, "^gnome-desktop-optional"):
return GROUP_DESKTOP_GNOME
commit 5d7f18d28a8b07890632a42da83e3567d8f088d3
Merge: 6762c40... 269e8a4...
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:48:56 2008 +0200
Merge branch 'master' of git+ssh://alk@git.packagekit.org/srv/git/PackageKit
commit 6762c403230c6dfcdd0ae4f52e9e8a1f8a729322
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:44:50 2008 +0200
urpmi: get-update-detail: multiple pkg args are now treated as separated by spaces
diff --git a/backends/urpmi/helpers/get-update-detail.pl b/backends/urpmi/helpers/get-update-detail.pl
index 3b072fe..248928a 100755
--- a/backends/urpmi/helpers/get-update-detail.pl
+++ b/backends/urpmi/helpers/get-update-detail.pl
@@ -30,12 +30,12 @@ use perl_packagekit::prints;
use MDK::Common;
# One argument (package ids)
-$#ARGV == 0 or exit 1;
+$#ARGV > -1 or exit 1;
my $urpm = urpm->new_parse_cmdline;
urpm::media::configure($urpm);
-my @pkgids = split(/\|/, $ARGV[0]);
+my @pkgids = @ARGV;
foreach (@pkgids) {
print_package_update_details($urpm, $_);
commit 88d186575da0b424a8e4a9c36d22478887360c4c
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:38:13 2008 +0200
urpmi: get-depends: multiple pkg args are now treated as separated by spaces
diff --git a/backends/urpmi/helpers/get-depends.pl b/backends/urpmi/helpers/get-depends.pl
index 766c50e..fc7950e 100755
--- a/backends/urpmi/helpers/get-depends.pl
+++ b/backends/urpmi/helpers/get-depends.pl
@@ -31,12 +31,14 @@ use urpmi_backend::tools;
use perl_packagekit::enums;
use perl_packagekit::prints;
-# 3 arguments (filter, package id, recursive)
-$#ARGV == 2 or exit 1;
+# At least 3 arguments (filter, package ids, recursive)
+$#ARGV > 1 or exit 1;
my @filters = split(/;/, $ARGV[0]);
-my @pkgids = split(/\|/, $ARGV[1]);
-my $recursive_option = 0;
+shift @ARGV;
+my $recursive_text = pop(@ARGV);
+my $recursive_option = $recursive_text eq "yes" ? 1 : 0;
+my @pkgids = @ARGV;
# We force the recursive option
$recursive_option = 1;
@@ -51,8 +53,7 @@ foreach (@pkgids) {
my @pkgid = split(/;/, $_);
push(@pkgnames, $pkgid[0]);
}
-print join(" ", @pkgnames);
-print "\n";
+
my %requested;
my $results = urpm::select::search_packages($urpm, \%requested, \@pkgnames,
fuzzy => 0,
commit 269e8a41575ed54ce547abddb9f80a0480858b28
Merge: c92412c... 33ad5a5...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 18:35:36 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit c92412cdc4719fa476fcc6dd409c4a0ae05d3b3a
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 18:35:18 2008 +0200
add more rpm groups from opensuse
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 90d0c35..947bc43 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -476,21 +476,31 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Virtual/Languages' : GROUP_COLLECTIONS,
'Virtual/Servers' : GROUP_COLLECTIONS,
# RPM (novell)
+ 'Amusements/Teaching' : GROUP_EDUCATION,
+ 'Amusements/Toys' : GROUP_GAMES,
+ 'Hardware' : GROUP_SYSTEM,
'Productivity/Archiving' : GROUP_OTHER, ### FIXME
+ 'Productivity/Clustering' : GROUP_OTHER, ### FIXME
'Productivity/Databases' : GROUP_OTHER, ### FIXME
'Productivity/Editors' : GROUP_PUBLISHING,
'Productivity/File utilities' : GROUP_OTHER, ### FIXME
'Productivity/Graphics' : GROUP_GRAPHICS,
+ 'Productivity/Hamradio' : GROUP_COMMUNICATION,
'Productivity/Multimedia' : GROUP_MULTIMEDIA,
'Productivity/Networking' : GROUP_NETWORK,
+ 'Productivity/Networking/Email' : GROUP_INTERNET,
+ 'Productivity/Networking/News' : GROUP_INTERNET,
+ 'Productivity/Networking/Web' : GROUP_INTERNET,
'Productivity/Office' : GROUP_OFFICE,
'Productivity/Other' : GROUP_OTHER,
'Productivity/Publishing' : GROUP_PUBLISHING,
'Productivity/Scientific' : GROUP_SCIENCE,
'Productivity/Security' : GROUP_SECURITY,
+ 'Productivity/Telephony' : GROUP_COMMUNICATION,
'Productivity/Text' : GROUP_PUBLISHING,
+ 'System' : GROUP_SYSTEM,
'System/Base' : GROUP_SYSTEM,
- 'System/Boot' : GROUP_SYSTEM,
+ 'System/Daemons' : GROUP_SYSTEM,
'System/Emulators' : GROUP_VIRTUALIZATION,
'System/Kernel' : GROUP_SYSTEM,
'System/Libraries' : GROUP_SYSTEM,
@@ -499,6 +509,10 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'System/GUI/KDE' : GROUP_DESKTOP_KDE,
'System/GUI/Other' : GROUP_DESKTOP_OTHER,
'System/GUI/XFCE' : GROUP_DESKTOP_XFCE,
+ 'System/I18n' : GROUP_LOCALIZATION,
+ 'System/Localization' : GROUP_LOCALIZATION,
+ 'System/X11' : GROUP_DESKTOP_OTHER,
+ 'System/X11/Fonts' : GROUP_FONTS,
# YaST2
# 'Virtual' : GROUP_COLLECTIONS,
'Virtual/Base Technologies' : GROUP_COLLECTIONS,
commit a52fdee1050834c5436b461183f8125d391facf8
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:30:37 2008 +0200
urpmi: get-files: multiple pkg args are now treated as separated by spaces
diff --git a/backends/urpmi/helpers/get-files.pl b/backends/urpmi/helpers/get-files.pl
index 57edede..ba6aa27 100755
--- a/backends/urpmi/helpers/get-files.pl
+++ b/backends/urpmi/helpers/get-files.pl
@@ -28,12 +28,12 @@ use MDK::Common;
use perl_packagekit::prints;
# One argument (package ids)
-$#ARGV == 0 or exit 1;
+$#ARGV > -1 or exit 1;
my $urpm = urpm->new_parse_cmdline;
urpm::media::configure($urpm);
-my @pkgids = split(/\|/,$ARGV[0]);
+my @pkgids = @ARGV;
foreach (@pkgids) {
print_package_files($urpm, $_);
commit 642a917f1a30d06b00c314141c0c1d8382096fa0
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:28:48 2008 +0200
urpmi: get-details: multiple pkg args are now treated as separated by space
diff --git a/backends/urpmi/helpers/get-details.pl b/backends/urpmi/helpers/get-details.pl
index 5de7181..ec2964e 100755
--- a/backends/urpmi/helpers/get-details.pl
+++ b/backends/urpmi/helpers/get-details.pl
@@ -28,12 +28,12 @@ use MDK::Common;
use perl_packagekit::prints;
# One argument (package ids)
-$#ARGV == 0 or exit 1;
+$#ARGV > -1 or exit 1;
my $urpm = urpm->new_parse_cmdline;
urpm::media::configure($urpm);
-my @pkgids = split(/\|/, $ARGV[0]);
+my @pkgids = @ARGV;
foreach (@pkgids) {
print_package_details($urpm, $_);
commit 6d8497f14ea4837ba87d8e4244d26f40ebcbd77b
Merge: e7a01be... 8a49e50...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 18:17:57 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit 33ad5a5e7ddf0db551badacd138582cfc3efc06e
Merge: 85df325... 6d8497f...
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 15 17:17:37 2008 +0100
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit e7a01be62522de7c8b33a6d3af31b24a8166567a
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 18:17:32 2008 +0200
smart: move emulators to virtualization
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index e6d5110..90d0c35 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -444,7 +444,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Applications/Communications' : GROUP_COMMUNICATION,
'Applications/Databases' : GROUP_OTHER, ### FIXME
'Applications/Editors' : GROUP_PUBLISHING,
- 'Applications/Emulators' : GROUP_OTHER, ### FIXME
+ 'Applications/Emulators' : GROUP_VIRTUALIZATION,
'Applications/Engineering' : GROUP_OTHER, ### FIXME
'Applications/File' : GROUP_OTHER, ### FIXME
'Applications/Internet' : GROUP_INTERNET,
@@ -491,6 +491,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Productivity/Text' : GROUP_PUBLISHING,
'System/Base' : GROUP_SYSTEM,
'System/Boot' : GROUP_SYSTEM,
+ 'System/Emulators' : GROUP_VIRTUALIZATION,
'System/Kernel' : GROUP_SYSTEM,
'System/Libraries' : GROUP_SYSTEM,
'System/Shells' : GROUP_SYSTEM,
@@ -516,7 +517,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Development' : GROUP_PROGRAMMING,
'Editors' : GROUP_PUBLISHING,
'Education' : GROUP_EDUCATION,
- 'Emulators' : GROUP_OTHER, ### FIXME
+ 'Emulators' : GROUP_VIRTUALIZATION,
'File tools' : GROUP_OTHER, ### FIXME
'Games' : GROUP_GAMES,
'Graphical desktop' : GROUP_DESKTOP_OTHER,
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index 99a0926..95367f9 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -90,6 +90,7 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_SCIENCE,
PK_GROUP_ENUM_SECURITY,
PK_GROUP_ENUM_SYSTEM,
+ PK_GROUP_ENUM_VIRTUALIZATION,
-1);
}
commit 85df32530898593c23b2abf810a3d67222f8b1e7
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 15 17:17:16 2008 +0100
dummy: make install_files and get_depends a little smarter
diff --git a/backends/dummy/pk-backend-dummy.c b/backends/dummy/pk-backend-dummy.c
index 1b00355..061a9cf 100644
--- a/backends/dummy/pk-backend-dummy.c
+++ b/backends/dummy/pk-backend-dummy.c
@@ -123,10 +123,16 @@ static void
backend_get_depends (PkBackend *backend, PkBitfield filters, gchar **package_ids, gboolean recursive)
{
pk_backend_set_status (backend, PK_STATUS_ENUM_QUERY);
- pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
- "glib2;2.14.0;i386;fedora", "The GLib library");
- pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
- "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
+
+ if (egg_strequal (package_ids[0], "scribus;1.3.4-1.fc8;i386;fedora")) {
+ pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE,
+ "scribus-clipart;1.3.4-1.fc8;i386;fedora", "Clipart for scribus");
+ } else {
+ pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
+ "glib2;2.14.0;i386;fedora", "The GLib library");
+ pk_backend_package (backend, PK_INFO_ENUM_INSTALLED,
+ "gtk2;gtk2-2.11.6-6.fc8;i386;fedora", "GTK+ Libraries for GIMP");
+ }
pk_backend_finished (backend);
}
@@ -419,12 +425,25 @@ backend_install_signature (PkBackend *backend, PkSigTypeEnum type,
}
/**
+ * backend_refresh_cache_timeout:
+ */
+static gboolean
+backend_install_files_timeout (gpointer data)
+{
+ PkBackend *backend = (PkBackend *) data;
+ pk_backend_finished (backend);
+ return FALSE;
+}
+
+/**
* backend_install_files:
*/
static void
backend_install_files (PkBackend *backend, gboolean trusted, gchar **full_paths)
{
- pk_backend_finished (backend);
+ pk_backend_set_status (backend, PK_STATUS_ENUM_INSTALL);
+ pk_backend_set_percentage (backend, 101);
+ _signal_timeout = g_timeout_add (2000, backend_install_files_timeout, backend);
}
/**
commit 8a49e5049e66135cdd5d1e65050207705983914f
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 18:16:10 2008 +0200
urpmi: multiple pkg args are now treated as separated by spaces
diff --git a/backends/urpmi/helpers/install-packages.pl b/backends/urpmi/helpers/install-packages.pl
index a0dfa33..1bf5f0c 100755
--- a/backends/urpmi/helpers/install-packages.pl
+++ b/backends/urpmi/helpers/install-packages.pl
@@ -32,12 +32,12 @@ use urpmi_backend::tools;
# One or more arguments (Package ids)
exit if($#ARGV < 0);
-my @packageidstab = split(/\|/, $ARGV[0]);
+my @pkgids = @ARGV;
my @names;
-foreach(@packageidstab) {
- my @pkg_id = (split(/;/, $_));
- push @names, $pkg_id[0];
+foreach(@pkgids) {
+ my @pkgid = (split(/;/, $_));
+ push @names, $pkgid[0];
}
my $urpm = urpm->new_parse_cmdline;
commit d2b598d605c64b4783204a677d7c2c5ffedb4050
Merge: d535601... 2aabf5d...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 16:22:06 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit d5356014f83e3a14c6b5e8908f2167cc43debf31
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 16:21:48 2008 +0200
trivial: add Mandriva install instructions
diff --git a/docs/html/pk-download.html b/docs/html/pk-download.html
index fa71b6c..42ad74e 100644
--- a/docs/html/pk-download.html
+++ b/docs/html/pk-download.html
@@ -45,6 +45,10 @@ easier to install.
repository file and run: <code>zypper install PackageKit gnome-packagekit</code> (as root)
</li>
<li>
+ Mandriva 2009: Yes, add the <a href="http://wiki.mandriva.com/en/Development"><tt>cooker</tt></a>
+ repository and run: <code>urpmi packagekit gnome-packagekit</code> (as root)
+ </li>
+ <li>
Others: Probably not, although you can compile from source. See below for more details.
</li>
</ul>
commit 2aabf5d76ccd47418978e4b25b05bc382f01f19e
Merge: d2d8bd7... 7f35629...
Author: Stefan Haas <shaas at suse.de>
Date: Mon Sep 15 16:21:07 2008 +0200
Merge branch 'master' of git+ssh://shaas@git.packagekit.org/srv/git/PackageKit
commit d2d8bd77c1280845f5c3a3a7315e731aac958a10
Author: Stefan Haas <shaas at suse.de>
Date: Mon Sep 15 16:20:47 2008 +0200
zypp: reset force flag also if something fails
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 94f4c54..e699768 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -737,6 +737,7 @@ zypp_perform_execution (PkBackend *backend, PerformType type, gboolean force)
pk_backend_error_code (backend, PK_ERROR_ENUM_DEP_RESOLUTION_FAILED, emsg);
g_free (emsg);
+ zypp->resolver ()->setForceResolve (FALSE);
return FALSE;
}
@@ -823,6 +824,7 @@ zypp_perform_execution (PkBackend *backend, PerformType type, gboolean force)
emsg);
g_free (emsg);
+ zypp->resolver ()->setForceResolve (FALSE);
return FALSE;
}
commit 7f3562963573fb78cfb35bee3faeb066600428dd
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 15:51:38 2008 +0200
sync smart groups with urpmi groups somewhat
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index f09df11..e6d5110 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -524,8 +524,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Graphical desktop/KDE' : GROUP_DESKTOP_KDE,
'Graphical desktop/Xfce' : GROUP_DESKTOP_XFCE,
'Graphics' : GROUP_GRAPHICS,
- 'Monitoring' : GROUP_OTHER, ### FIXME
- 'Networking' : GROUP_NETWORK,
+ 'Monitoring' : GROUP_NETWORK,
+ 'Networking' : GROUP_INTERNET,
'Office' : GROUP_OFFICE,
'Publishing' : GROUP_PUBLISHING,
'Sciences' : GROUP_SCIENCE,
@@ -535,8 +535,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'System/Fonts' : GROUP_FONTS,
'System/Internationalization' : GROUP_LOCALIZATION,
'Terminals' : GROUP_SYSTEM,
- 'Text tools' : GROUP_SYSTEM,
- 'Toys' : GROUP_OTHER, ### FIXME
+ 'Text tools' : GROUP_ACCESSORIES,
+ 'Toys' : GROUP_GAMES,
'Video' : GROUP_MULTIMEDIA,
# DEB
"admin" : GROUP_ADMIN_TOOLS,
commit bb6f47a3aa1c0e4e19b0a450fdd4e51fd3e1c02c
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 13:03:43 2008 +0200
smart: filter out gnome/kde/xfce from other desktops group
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 6a84ae1..f09df11 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -947,6 +947,17 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
self.package(pkpackage.get_package_id(name, version, arch, data),
status, summary)
+ def _package_in_requires(self, packagename, groupname):
+ groups = self.ctrl.getCache().getPackages(groupname)
+ if groups:
+ group = groups[0]
+ for required in group.requires:
+ for provider in required.providedby:
+ for package in provider.packages:
+ if package.name == packagename:
+ return True
+ return False
+
def _get_group(self, info):
group = info.getGroup()
if group in self.GROUPS:
@@ -955,7 +966,16 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
return GROUP_FONTS
if group == 'Applications/Productivity' and package.find('-langpack') != -1:
return GROUP_LOCALIZATION
- # FIXME: filter out gnome/xfce/kde from "System Environment" etc
+ if group == 'User Interface/Desktops':
+ if self._package_in_requires(package, "^gnome-desktop") \
+ or self._package_in_requires(package, "^gnome-desktop-optional"):
+ return GROUP_DESKTOP_GNOME
+ if self._package_in_requires(package, "^kde-desktop") \
+ or self._package_in_requires(package, "^kde-desktop-optional"):
+ return GROUP_DESKTOP_KDE
+ if self._package_in_requires(package, "^xfce-desktop") \
+ or self._package_in_requires(package, "^xfce-desktop-optional"):
+ return GROUP_DESKTOP_XFCE
group = self.GROUPS[group]
else:
while group.find('/') != -1:
commit fdeeeb29b4e707fff755ddf1501b5a7021d6f329
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 11:38:26 2008 +0200
smart: filter out langpack from office group
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index d3f239a..6a84ae1 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -953,6 +953,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
package = info.getPackage().name
if group == 'User Interface/X' and package.find('-fonts') != -1:
return GROUP_FONTS
+ if group == 'Applications/Productivity' and package.find('-langpack') != -1:
+ return GROUP_LOCALIZATION
# FIXME: filter out gnome/xfce/kde from "System Environment" etc
group = self.GROUPS[group]
else:
commit a4e0c571bb3846c2612b11a2f49555d50f7366f5
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 11:23:29 2008 +0200
smart: add apt metapackages to collections group
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 6cbee38..d3f239a 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -575,6 +575,8 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
"unknown" : GROUP_UNKNOWN,
"alien" : GROUP_UNKNOWN,
"translations" : GROUP_LOCALIZATION,
+ # APT
+ "metapackages" : GROUP_COLLECTIONS,
# Slack
"Slackware" : GROUP_UNKNOWN
}
commit 1e8b9cd4cdc8065d26303361bb014174c23efaf3
Merge: 8f1a7fa... eaba591...
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 10:47:38 2008 +0200
Merge branch 'master' of git+ssh://alk@git.packagekit.org/srv/git/PackageKit
commit 8f1a7fa9d5c81beb09367d3d88cfa8d7cc757651
Author: Aurelien Lefebvre <alefebvre at mandriva.com>
Date: Mon Sep 15 10:47:12 2008 +0200
urpmi: trivial perl fix in install-packages
diff --git a/backends/urpmi/helpers/install-packages.pl b/backends/urpmi/helpers/install-packages.pl
index fe80b1f..a0dfa33 100755
--- a/backends/urpmi/helpers/install-packages.pl
+++ b/backends/urpmi/helpers/install-packages.pl
@@ -23,6 +23,9 @@ use urpm;
use urpm::media;
use urpm::select;
+use perl_packagekit::enums;
+use perl_packagekit::prints;
+
use urpmi_backend::actions;
use urpmi_backend::tools;
commit eaba5919745ba773915ab78eaea38b1cb19d631f
Merge: ea936d5... 4d543fe...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 10:41:44 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit ea936d594ebd558dd415e2471de3df8de9a42449
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 10:40:37 2008 +0200
smart: filter out fonts from rpm group
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 6df1051..6cbee38 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -948,6 +948,10 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
def _get_group(self, info):
group = info.getGroup()
if group in self.GROUPS:
+ package = info.getPackage().name
+ if group == 'User Interface/X' and package.find('-fonts') != -1:
+ return GROUP_FONTS
+ # FIXME: filter out gnome/xfce/kde from "System Environment" etc
group = self.GROUPS[group]
else:
while group.find('/') != -1:
commit 1e9c15ec98f06ea91f667677e68c638471910894
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 10:27:06 2008 +0200
if it has openoffice.org, it must be office
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index f9df8d0..6df1051 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -449,7 +449,7 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Applications/File' : GROUP_OTHER, ### FIXME
'Applications/Internet' : GROUP_INTERNET,
'Applications/Multimedia' : GROUP_MULTIMEDIA,
- 'Applications/Productivity' : GROUP_OTHER, ### FIXME
+ 'Applications/Productivity' : GROUP_OFFICE,
'Applications/Publishing' : GROUP_PUBLISHING,
'Applications/System' : GROUP_SYSTEM,
'Applications/Text' : GROUP_PUBLISHING,
commit 4d543fe3b79d56398435cc42d544df48ecb77419
Merge: ba57095... a90125e...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Mon Sep 15 10:23:29 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit a90125e98e13bdfdad036895421bd2e7bb8126de
Merge: 6b70e07... af71feb...
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 10:19:28 2008 +0200
Merge branch 'master' of git+ssh://afb@git.packagekit.org/srv/git/PackageKit
commit 6b70e07ebcc1e1b7398bef5b7288f20a4006c458
Author: Anders F Bjorklund <afb at users.sourceforge.net>
Date: Mon Sep 15 10:13:54 2008 +0200
smart: add mandriva rpm groups
diff --git a/backends/smart/helpers/smartBackend.py b/backends/smart/helpers/smartBackend.py
index 3228318..f9df8d0 100755
--- a/backends/smart/helpers/smartBackend.py
+++ b/backends/smart/helpers/smartBackend.py
@@ -507,6 +507,37 @@ class PackageKitSmartBackend(PackageKitBaseBackend):
'Virtual/Graphical Environments' : GROUP_COLLECTIONS,
'Virtual/KDE Desktop' : GROUP_COLLECTIONS,
'Virtual/Server Functions' : GROUP_COLLECTIONS,
+ # RPM (mandriva)
+ 'Accessibility' : GROUP_ACCESSIBILITY,
+ 'Archiving' : GROUP_OTHER, ### FIXME
+ 'Books' : GROUP_DOCUMENTATION,
+ 'Communications' : GROUP_COMMUNICATION,
+ 'Databases' : GROUP_OTHER, ### FIXME
+ 'Development' : GROUP_PROGRAMMING,
+ 'Editors' : GROUP_PUBLISHING,
+ 'Education' : GROUP_EDUCATION,
+ 'Emulators' : GROUP_OTHER, ### FIXME
+ 'File tools' : GROUP_OTHER, ### FIXME
+ 'Games' : GROUP_GAMES,
+ 'Graphical desktop' : GROUP_DESKTOP_OTHER,
+ 'Graphical desktop/GNOME' : GROUP_DESKTOP_GNOME,
+ 'Graphical desktop/KDE' : GROUP_DESKTOP_KDE,
+ 'Graphical desktop/Xfce' : GROUP_DESKTOP_XFCE,
+ 'Graphics' : GROUP_GRAPHICS,
+ 'Monitoring' : GROUP_OTHER, ### FIXME
+ 'Networking' : GROUP_NETWORK,
+ 'Office' : GROUP_OFFICE,
+ 'Publishing' : GROUP_PUBLISHING,
+ 'Sciences' : GROUP_SCIENCE,
+ 'Shells' : GROUP_SYSTEM,
+ 'Sound' : GROUP_MULTIMEDIA,
+ 'System' : GROUP_SYSTEM,
+ 'System/Fonts' : GROUP_FONTS,
+ 'System/Internationalization' : GROUP_LOCALIZATION,
+ 'Terminals' : GROUP_SYSTEM,
+ 'Text tools' : GROUP_SYSTEM,
+ 'Toys' : GROUP_OTHER, ### FIXME
+ 'Video' : GROUP_MULTIMEDIA,
# DEB
"admin" : GROUP_ADMIN_TOOLS,
"base" : GROUP_SYSTEM,
diff --git a/backends/smart/pk-backend-smart.c b/backends/smart/pk-backend-smart.c
index a63a43d..99a0926 100644
--- a/backends/smart/pk-backend-smart.c
+++ b/backends/smart/pk-backend-smart.c
@@ -64,6 +64,7 @@ backend_get_groups (PkBackend *backend)
return pk_bitfield_from_enums (
PK_GROUP_ENUM_COLLECTIONS,
/* FIXME: These depend on the Smart backends: */
+ PK_GROUP_ENUM_ACCESSIBILITY,
PK_GROUP_ENUM_ACCESSORIES,
PK_GROUP_ENUM_ADMIN_TOOLS,
PK_GROUP_ENUM_COMMUNICATION,
@@ -72,7 +73,9 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_DESKTOP_OTHER,
PK_GROUP_ENUM_DESKTOP_XFCE,
PK_GROUP_ENUM_DOCUMENTATION,
+ PK_GROUP_ENUM_EDUCATION,
PK_GROUP_ENUM_ELECTRONICS,
+ PK_GROUP_ENUM_FONTS,
PK_GROUP_ENUM_GAMES,
PK_GROUP_ENUM_GRAPHICS,
PK_GROUP_ENUM_INTERNET,
@@ -80,10 +83,12 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_LOCALIZATION,
PK_GROUP_ENUM_MULTIMEDIA,
PK_GROUP_ENUM_NETWORK,
+ PK_GROUP_ENUM_OFFICE,
PK_GROUP_ENUM_OTHER,
PK_GROUP_ENUM_PROGRAMMING,
PK_GROUP_ENUM_PUBLISHING,
PK_GROUP_ENUM_SCIENCE,
+ PK_GROUP_ENUM_SECURITY,
PK_GROUP_ENUM_SYSTEM,
-1);
}
commit ba5709532397d2228eb8927855b890be9ad0bf69
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Mon Sep 15 09:53:24 2008 +0200
APT: Trivial. Make use of _emit_visible_package in further situations to improve readability
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 1fef532..5971e80 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -98,6 +98,7 @@ os.putenv("APT_LISTCHANGES_FRONTEND", "none")
gobject.threads_init()
dbus.glib.threads_init()
+# Map Debian sections to the PackageKit group name space
SECTION_GROUP_MAP = {
"admin" : GROUP_ADMIN_TOOLS,
"base" : GROUP_SYSTEM,
@@ -481,8 +482,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
if self._check_canceled(): return False
for installed_file in self._get_installed_files(pkg):
if filename in installed_file:
- if self._is_package_visible(pkg, filters):
- self._emit_package(pkg)
+ self._emit_visible_package(filters, pkg)
continue
self.Finished(EXIT_SUCCESS)
@@ -499,9 +499,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
for pkg in self._cache:
if self._check_canceled(): return False
- elif self._get_package_group(pkg) == group and \
- self._is_package_visible(pkg, filters):
- self._emit_package(pkg)
+ elif self._get_package_group(pkg) == group:
+ self._emit_visible_package(filters, pkg)
self.Finished(EXIT_SUCCESS)
@threaded
@@ -517,8 +516,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
for pkg in self._cache:
if self._check_canceled(): return False
- elif search in pkg.name and self._is_package_visible(pkg, filters):
- self._emit_package(pkg)
+ elif search in pkg.name:
+ self._emit_visible_package(filters, pkg)
self.Finished(EXIT_SUCCESS)
@threaded
@@ -561,8 +560,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
for r in results:
if self._check_canceled(): return
- if self._is_package_visible(r, filters) == True:
- self._emit_package(r)
+ self._emit_visible_package(filters, r)
self.Finished(EXIT_SUCCESS)
commit 5095f58f95157d61324d2b904981fa0e239f0403
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Mon Sep 15 09:44:35 2008 +0200
APT: Make sure that we are can lock the pkg system before installing local packages
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 08db007..1fef532 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1187,6 +1187,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
return
if not self._commit_changes((10,25), (25,50)): return False
# Install the Debian package files
+ if not self._acquire_lock(): return
for deb in packages:
try:
res = deb.install(PackageKitDpkgInstallProgress(self))
commit 222bcc3afab68e61f39d769a3125bc9de3849e8c
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Mon Sep 15 09:37:42 2008 +0200
APT: Use a dictonary instead of endless elif statements for the section to group mapping
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 48715c4..08db007 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -98,6 +98,45 @@ os.putenv("APT_LISTCHANGES_FRONTEND", "none")
gobject.threads_init()
dbus.glib.threads_init()
+SECTION_GROUP_MAP = {
+ "admin" : GROUP_ADMIN_TOOLS,
+ "base" : GROUP_SYSTEM,
+ "comm" : GROUP_COMMUNICATION,
+ "devel" : GROUP_PROGRAMMING,
+ "doc" : GROUP_DOCUMENTATION,
+ "editors" : GROUP_PUBLISHING,
+ "electronics" : GROUP_ELECTRONICS,
+ "embedded" : GROUP_SYSTEM,
+ "games" : GROUP_GAMES,
+ "gnome" : GROUP_DESKTOP_GNOME,
+ "graphics" : GROUP_GRAPHICS,
+ "hamradio" : GROUP_COMMUNICATION,
+ "interpreters" : GROUP_PROGRAMMING,
+ "kde" : GROUP_DESKTOP_KDE,
+ "libdevel" : GROUP_PROGRAMMING,
+ "libs" : GROUP_SYSTEM,
+ "mail" : GROUP_INTERNET,
+ "math" : GROUP_SCIENCE,
+ "misc" : GROUP_OTHER,
+ "net" : GROUP_NETWORK,
+ "news" : GROUP_INTERNET,
+ "oldlibs" : GROUP_LEGACY,
+ "otherosfs" : GROUP_SYSTEM,
+ "perl" : GROUP_PROGRAMMING,
+ "python" : GROUP_PROGRAMMING,
+ "science" : GROUP_SCIENCE,
+ "shells" : GROUP_SYSTEM,
+ "sound" : GROUP_MULTIMEDIA,
+ "tex" : GROUP_PUBLISHING,
+ "text" : GROUP_PUBLISHING,
+ "utils" : GROUP_ACCESSORIES,
+ "web" : GROUP_INTERNET,
+ "x11" : GROUP_DESKTOP_OTHER,
+ "unknown" : GROUP_UNKNOWN,
+ "alien" : GROUP_UNKNOWN,
+ "translations" : GROUP_LOCALIZATION,
+ "metapackages" : GROUP_COLLECTIONS }
+
class InstallTimeOutPKError(Exception):
pass
@@ -1894,80 +1933,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
Return the packagekit group corresponding to the package's section
"""
section = pkg.section.split("/")[-1]
- if section == "admin":
- return GROUP_ADMIN_TOOLS
- elif section == "base":
- return GROUP_SYSTEM
- elif section == "comm":
- return GROUP_COMMUNICATION
- elif section == "devel":
- return GROUP_PROGRAMMING
- elif section == "doc":
- return GROUP_DOCUMENTATION
- elif section == "editors":
- return GROUP_PUBLISHING
- elif section == "electronics":
- return GROUP_ELECTRONICS
- elif section == "embedded":
- return GROUP_SYSTEM
- elif section == "games":
- return GROUP_GAMES
- elif section == "gnome":
- return GROUP_DESKTOP_GNOME
- elif section == "graphics":
- return GROUP_GRAPHICS
- elif section == "hamradio":
- return GROUP_COMMUNICATION
- elif section == "interpreters":
- return GROUP_PROGRAMMING
- elif section == "kde":
- return GROUP_DESKTOP_KDE
- elif section == "libdevel":
- return GROUP_PROGRAMMING
- elif section == "libs":
- return GROUP_SYSTEM
- elif section == "mail":
- return GROUP_INTERNET
- elif section == "math":
- return GROUP_SCIENCE
- elif section == "misc":
- return GROUP_OTHER
- elif section == "net":
- return GROUP_NETWORK
- elif section == "news":
- return GROUP_INTERNET
- elif section == "oldlibs":
- return GROUP_LEGACY
- elif section == "otherosfs":
- return GROUP_SYSTEM
- elif section == "perl":
- return GROUP_PROGRAMMING
- elif section == "python":
- return GROUP_PROGRAMMING
- elif section == "science":
- return GROUP_SCIENCE
- elif section == "shells":
- return GROUP_SYSTEM
- elif section == "sound":
- return GROUP_MULTIMEDIA
- elif section == "tex":
- return GROUP_PUBLISHING
- elif section == "text":
- return GROUP_PUBLISHING
- elif section == "utils":
- return GROUP_ACCESSORIES
- elif section == "web":
- return GROUP_INTERNET
- elif section == "x11":
- return GROUP_DESKTOP_OTHER
- elif section == "unknown":
- return GROUP_UNKNOWN
- elif section == "alien":
- return GROUP_UNKNOWN
- elif section == "translations":
- return GROUP_LOCALIZATION
- elif section == "metapackages":
- return GROUP_COLLECTIONS
+ if SECTION_GROUP_MAP.has_key(section):
+ return SECTION_GROUP_MAP[section]
else:
pklog.debug("Unkown package section %s of %s" % (pkg.section,
pkg.name))
commit af71febb5404be17578e5aa5de861e6661929a5c
Author: Richard Hughes <richard at hughsie.com>
Date: Mon Sep 15 08:29:15 2008 +0100
yum: handle the collections filter like we do all the other filters
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index a909715..6de0e55 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -204,9 +204,12 @@ class PackageKitYumBackend(PackageKitBaseBackend,PackagekitPackage):
installed = []
available = []
- if FILTER_COLLECTIONS in fltlist:
+ if FILTER_NOT_COLLECTIONS not in fltlist:
self._do_meta_package_search(fltlist,key)
+ if FILTER_COLLECTIONS in fltlist:
+ return
+
for (pkg,values) in res:
if pkg.repo.id == 'installed':
installed.append(pkg)
commit 381f1ea4ed27480a635834a03b5a9f043baf8b0c
Merge: 18eb4b6... 6390edc...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 14 16:07:00 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit 18eb4b671660b0fb4c583f13708d130612333a5c
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 14 16:06:09 2008 +0200
APT: Add support for collections. Currently based on the metapackages section, but this could be extended using tasks
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 7ecd8e3..48715c4 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -1609,11 +1609,18 @@ class PackageKitAptBackend(PackageKitBaseBackend):
Send the Package signal for a given apt package
'''
id = self.get_id_from_package(pkg, force_candidate)
+ section = pkg.section.split("/")[-1]
if info == None:
if pkg.isInstalled:
- info = INFO_INSTALLED
+ if section == "metapackages":
+ info = INFO_COLLECTION_INSTALLED
+ else:
+ info = INFO_INSTALLED
else:
- info = INFO_AVAILABLE
+ if section == "metapackages":
+ info = INFO_COLLECTION_AVAILABLE
+ else:
+ info = INFO_AVAILABLE
summary = pkg.summary
self.Package(info, id, summary)
@@ -1661,7 +1668,11 @@ class PackageKitAptBackend(PackageKitBaseBackend):
not self._is_package_not_free(pkg)) or \
(filter == FILTER_GUI and not self._has_package_gui(pkg)) or \
(filter == FILTER_NOT_GUI and self._has_package_gui(pkg)) or \
- (filter == FILTER_DEVELOPMENT and not \
+ (filter == FILTER_COLLECTIONS and not \
+ self._is_package_collection(pkg)) or \
+ (filter == FILTER_NOT_COLLECTIONS and \
+ self._is_package_collection(pkg)) or\
+ (filter == FILTER_DEVELOPMENT and not \
self._is_package_devel(pkg)) or \
(filter == FILTER_NOT_DEVELOPMENT and \
self._is_package_devel(pkg)):
@@ -1681,6 +1692,13 @@ class PackageKitAptBackend(PackageKitBaseBackend):
candidate[0].component in ["contrib", "non-free"])) and \
candidate[0].trusted == True
+ def _is_package_collection(self, pkg):
+ """
+ Return True if the package is a metapackge
+ """
+ section = pkg.section.split("/")[-1]
+ return section == "metapackages"
+
def _is_package_free(self, pkg):
"""
Return True if we can be sure that the package has got a free license
@@ -1948,6 +1966,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
return GROUP_UNKNOWN
elif section == "translations":
return GROUP_LOCALIZATION
+ elif section == "metapackages":
+ return GROUP_COLLECTIONS
else:
pklog.debug("Unkown package section %s of %s" % (pkg.section,
pkg.name))
diff --git a/backends/apt/pk-backend-apt.c b/backends/apt/pk-backend-apt.c
index 7f51e65..d3b5ed2 100644
--- a/backends/apt/pk-backend-apt.c
+++ b/backends/apt/pk-backend-apt.c
@@ -79,6 +79,7 @@ backend_get_groups (PkBackend *backend)
PK_GROUP_ENUM_SCIENCE,
PK_GROUP_ENUM_SYSTEM,
PK_GROUP_ENUM_UNKNOWN,
+ PK_GROUP_ENUM_COLLECTIONS,
-1);
}
@@ -94,6 +95,7 @@ backend_get_filters (PkBackend *backend)
PK_FILTER_ENUM_DEVELOPMENT,
PK_FILTER_ENUM_SUPPORTED,
PK_FILTER_ENUM_FREE,
+ PK_FILTER_ENUM_COLLECTIONS,
-1);
}
commit 05943de2e22014f8fa7e840d554aec114f3feaac
Merge: 9a4a8c7... 6da3787...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 14 15:29:08 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit 9a4a8c7dc26dd06daf1b6c79fafcc338561f09e0
Merge: de0044d... 6620767...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sun Sep 14 10:00:38 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit de0044db09e1a2bcb02ba804400abf53ba09b2d8
Merge: f1dc41c... 31e5628...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Sat Sep 13 19:56:46 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit f1dc41cd1d462ae4182fbbe07a77cc93dcfcf422
Merge: 8df798f... 701441d...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Sep 12 20:19:59 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
Conflicts:
backends/apt/aptDBUSBackend.py
commit 8df798f9f686d63a0d3b780a6b051b8df60cf8f3
Merge: b5b895e... 3f72e00...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Sep 12 16:41:11 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit b5b895e062b76100d620409972685f23c250c3d8
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Sep 12 16:40:03 2008 +0200
APT: Check the cache at first in doUpdatePackages
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index c3e3532..3c1d69a 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -956,6 +956,7 @@ class PackageKitAptBackend(PackageKitBaseBackend):
self.StatusChanged(STATUS_UPDATE)
self.AllowCancel(False)
self.PercentageChanged(0)
+ self._check_init(prange=(0,10))
pkgs=[]
for id in ids:
pkg = self._find_package_by_id(id)
commit e8400412c1e668e824640d36ed9834e8533b64b4
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Fri Sep 12 05:54:01 2008 +0200
APT: Add missing support for cdrom sources
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index e3dcd53..c3e3532 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -825,6 +825,17 @@ class PackageKitAptBackend(PackageKitBaseBackend):
enabled = repos.get_comp_child_state(template)[0]
if not FILTER_DEVELOPMENT in filter_list:
self.RepoDetail(repo_id, description, enabled)
+ # Emit distro's cdrom sources
+ for source in repos.get_cdrom_sources():
+ if FILTER_NOT_DEVELOPMENT in filter_list and \
+ source.type in ("deb-src", "rpm-src"):
+ continue
+ enabled = not source.disabled
+ # Remove markups from the description
+ description = re.sub(r"</?b>", "", repos.render_source(source))
+ repo_id = "cdrom_%s_%s" % (source.uri, source.dist)
+ repo_id.join(map(lambda c: "_%s" % c, source.comps))
+ self.RepoDetail(repo_id, description, enabled)
# Emit distro's virtual source code repositoriy
if not FILTER_NOT_DEVELOPMENT in filter_list:
repo_id = "%s_source" % repos.distro.id
@@ -836,7 +847,6 @@ class PackageKitAptBackend(PackageKitBaseBackend):
self.RepoDetail(repo_id, description, enabled)
# Emit third party repositories
for source in repos.get_isv_sources():
- #FIXME: There isn't any inconsistent state in PackageKit
if FILTER_NOT_DEVELOPMENT in filter_list and \
source.type in ("deb-src", "rpm-src"):
continue
@@ -902,6 +912,19 @@ class PackageKitAptBackend(PackageKitBaseBackend):
repos.disable_child_source(template)
found = True
break
+ # Check if the repo_id matches a cdrom repository
+ elif repo_id.startswith("cdrom_"):
+ for source in repos.get_isv_sources():
+ source_id = "cdrom_%s_%s" % (source.uri, source.dist)
+ source_id.join(map(lambda c: "_%s" % c, source.comps))
+ if repo_id == source_id:
+ if source.disabled == enable:
+ source.disabled = not enable
+ repos.save_sourceslist()
+ else:
+ pklog.debug("Repository is already enabled")
+ found = True
+ break
# Check if the repo_id matches an isv repository
elif repo_id.startswith("isv_"):
for source in repos.get_isv_sources():
commit e33f815e8e4851ee0122e27ec8bf6cc925e6b235
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Thu Sep 11 07:40:04 2008 +0200
APT: Disable the sources list repository if it is inconsistent. Thanks to James Westby for spotting
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index cb5043f..e3dcd53 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -828,7 +828,8 @@ class PackageKitAptBackend(PackageKitBaseBackend):
# Emit distro's virtual source code repositoriy
if not FILTER_NOT_DEVELOPMENT in filter_list:
repo_id = "%s_source" % repos.distro.id
- enabled = repos.get_source_code_state()
+ #FIXME: should inconsistent state be disabled?
+ enabled = repos.get_source_code_state() or False
#FIXME: no translation :(
description = "%s %s - Source code" % (repos.distro.id,
repos.distro.release)
commit ff87c3a453fe7806b92ac2f9ac39660a1dce9980
Merge: d945106... 328e0ed...
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Wed Sep 10 22:14:44 2008 +0200
Merge branch 'master' of git+ssh://glatzor@git.packagekit.org/srv/git/PackageKit
commit d94510617d9bafefd40667ff6a17334e73a558bd
Author: Sebastian Heinlein <devel at glatzor.de>
Date: Tue Sep 9 12:23:53 2008 +0200
APT: Only define the enhanced softwareproperties class if the corresponding module can be imported
diff --git a/backends/apt/aptDBUSBackend.py b/backends/apt/aptDBUSBackend.py
index 2cfe72d..cb5043f 100755
--- a/backends/apt/aptDBUSBackend.py
+++ b/backends/apt/aptDBUSBackend.py
@@ -382,12 +382,13 @@ class PackageKitDpkgInstallProgress(DpkgInstallProgress,
os.write(self.master_fd, chr(3))
-class PackageKitSoftwareProperties(softwareproperties.SoftwareProperties.SoftwareProperties):
- """
- Helper class to fix a siily bug in python-software-properties
- """
- def set_modified_sourceslist(self):
- self.save_sourceslist()
+if REPOS_SUPPORT == True:
+ class PackageKitSoftwareProperties(softwareproperties.SoftwareProperties.SoftwareProperties):
+ """
+ Helper class to fix a siily bug in python-software-properties
+ """
+ def set_modified_sourceslist(self):
+ self.save_sourceslist()
class PackageKitAptBackend(PackageKitBaseBackend):
More information about the PackageKit-commit
mailing list