[PackageKit-commit] packagekit: Branch 'master' - 7 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Thu Jan 8 06:27:19 PST 2009
backends/yum/yumBackend.py | 19 ++++++++++++++++++-
data/pk-upgrade-distro.sh | 12 ++++++++++--
lib/packagekit-glib/pk-enum.c | 1 +
lib/packagekit-glib/pk-enum.h | 1 +
lib/python/packagekit/client.py | 4 ++--
src/pk-backend.c | 26 +++++++++++++++++++++++++-
6 files changed, 57 insertions(+), 6 deletions(-)
New commits:
commit 742a0ac7640bcf85cccefd7df4660579db990713
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 13:56:44 2009 +0000
bugfix: fix the python client library for SearchDetails and SearchFile. Fixes fd#19426
diff --git a/lib/python/packagekit/client.py b/lib/python/packagekit/client.py
index a740592..ddaada0 100644
--- a/lib/python/packagekit/client.py
+++ b/lib/python/packagekit/client.py
@@ -250,12 +250,12 @@ class PackageKitClient:
def search_details(self, search, filters=FILTER_NONE, exit_handler=None):
'''Search for packages by their details'''
- return self._run_transaction("SearchDetails", [filters],
+ return self._run_transaction("SearchDetails", [filters, search],
exit_handler)
def search_file(self, search, filters=FILTER_NONE, exit_handler=None):
'''Search for packages by their files'''
- return self._run_transaction("SearchFile", [filters],
+ return self._run_transaction("SearchFile", [filters, search],
exit_handler)
def install_packages(self, packages, exit_handler=None):
commit e3d6ba4c21a7c21a4eafb1c16c537dc7cbb2ea68
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 12:26:27 2009 +0000
trivial: add a 'no-space-on-device' error enum and use it in the yum backend
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index faeeeed..267bbdb 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -412,7 +412,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
except exceptions.IOError, e:
- self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
+ self.error(ERROR_NO_SPACE_ON_DEVICE, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
@@ -2004,7 +2004,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
except exceptions.IOError, e:
- self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
+ self.error(ERROR_NO_SPACE_ON_DEVICE, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
md = self.updateMetadata
@@ -2252,7 +2252,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
except yum.Errors.RepoError, e:
self.error(ERROR_NO_CACHE, _to_unicode(e))
except exceptions.IOError, e:
- self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
+ self.error(ERROR_NO_SPACE_ON_DEVICE, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
@@ -2272,7 +2272,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
except exceptions.IOError, e:
- self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
+ self.error(ERROR_NO_SPACE_ON_DEVICE, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
diff --git a/lib/packagekit-glib/pk-enum.c b/lib/packagekit-glib/pk-enum.c
index 31b8763..3e99948 100644
--- a/lib/packagekit-glib/pk-enum.c
+++ b/lib/packagekit-glib/pk-enum.c
@@ -168,6 +168,7 @@ static const PkEnumMatch enum_error[] = {
{PK_ERROR_ENUM_NO_MORE_MIRRORS_TO_TRY, "no-more-mirrors-to-try"},
{PK_ERROR_ENUM_NO_DISTRO_UPGRADE_DATA, "no-distro-upgrade-data"},
{PK_ERROR_ENUM_INCOMPATIBLE_ARCHITECTURE, "incompatible-architecture"},
+ {PK_ERROR_ENUM_NO_SPACE_ON_DEVICE, "no-space-on-device"},
{0, NULL}
};
diff --git a/lib/packagekit-glib/pk-enum.h b/lib/packagekit-glib/pk-enum.h
index 2659873..ac22d07 100644
--- a/lib/packagekit-glib/pk-enum.h
+++ b/lib/packagekit-glib/pk-enum.h
@@ -281,6 +281,7 @@ typedef enum {
PK_ERROR_ENUM_NO_MORE_MIRRORS_TO_TRY,
PK_ERROR_ENUM_NO_DISTRO_UPGRADE_DATA,
PK_ERROR_ENUM_INCOMPATIBLE_ARCHITECTURE,
+ PK_ERROR_ENUM_NO_SPACE_ON_DEVICE,
PK_ERROR_ENUM_UNKNOWN
} PkErrorCodeEnum;
commit 3fb28f0b5580e02a04eb996b1793e61cfd15f850
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 12:12:52 2009 +0000
yum: catch IOError and handle out of disk space. Fixes RH#478377
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 6b9cfbb..faeeeed 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -411,6 +411,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
pkgs.extend(ygl.recent)
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
+ except exceptions.IOError, e:
+ self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
@@ -2001,6 +2003,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
pkgs.extend(ygl.obsoletes)
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
+ except exceptions.IOError, e:
+ self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
md = self.updateMetadata
@@ -2247,6 +2251,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.yumbase.repos.doSetup()
except yum.Errors.RepoError, e:
self.error(ERROR_NO_CACHE, _to_unicode(e))
+ except exceptions.IOError, e:
+ self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
@@ -2265,6 +2271,8 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.yumbase.repos.populateSack(mdtype='otherdata', cacheonly=1)
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_AVAILABLE, _to_unicode(e))
+ except exceptions.IOError, e:
+ self.error(ERROR_NOT_SUPPORTED, _to_unicode(e))
except Exception, e:
self.error(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
commit 44e532df0756d0409813d2c72a97d365676b961f
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 12:03:56 2009 +0000
yum: issue a warning when the user enables a rawhide repo
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index fbf353d..6b9cfbb 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -2032,7 +2032,16 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
else:
if not repo.isEnabled():
repo.enablePersistent()
-
+ if repoid.find ("rawhide") != -1:
+ warning = "These packages are untested and still under development." \
+ "This repository is used for development of new releases.\n\n" \
+ "This repository can see significant daily turnover and major " \
+ "functionality changes which cause unexpected problems with " \
+ "other development packages.\n" \
+ "Please use these packages if you want to work with the " \
+ "Fedora developers by testing these new development packages.\n\n" \
+ "If this is not correct, please disable the %s software source." % repoid
+ self.message(MESSAGE_BACKEND_ERROR, warning.replace("\n", ";"))
except yum.Errors.RepoError, e:
self.error(ERROR_REPO_NOT_FOUND, _to_unicode(e))
except Exception, e:
commit 90cad6fd9447c1d56d4b466b52690fb339111f42
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 11:00:22 2009 +0000
trivial: add another self check to excercise the backend duplicate package codepath
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 11c4119..7119428 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -1919,6 +1919,7 @@ pk_backend_new (void)
#include <glib/gstdio.h>
static guint number_messages = 0;
+static guint number_packages = 0;
/**
* pk_backend_test_message_cb:
@@ -1953,6 +1954,9 @@ static gboolean
pk_backend_test_func_true (PkBackend *backend)
{
g_usleep (1000*1000);
+ /* trigger duplicate test */
+ pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE, "vips-doc;7.12.4-2.fc8;noarch;linva", "The vips documentation package.");
+ pk_backend_package (backend, PK_INFO_ENUM_AVAILABLE, "vips-doc;7.12.4-2.fc8;noarch;linva", "The vips documentation package.");
pk_backend_finished (backend);
return TRUE;
}
@@ -1964,6 +1968,16 @@ pk_backend_test_func_immediate_false (PkBackend *backend)
return FALSE;
}
+/**
+ * pk_backend_test_package_cb:
+ **/
+static void
+pk_backend_test_package_cb (PkBackend *backend, const PkPackageObj *obj, EggTest *test)
+{
+ egg_debug ("package:%s", obj->id->name);
+ number_packages++;
+}
+
void
pk_backend_test (EggTest *test)
{
@@ -1983,6 +1997,10 @@ pk_backend_test (EggTest *test)
else
egg_test_failed (test, NULL);
+ /* connect */
+ g_signal_connect (backend, "package",
+ G_CALLBACK (pk_backend_test_package_cb), test);
+
/************************************************************/
egg_test_title (test, "create a config file");
filename = "/tmp/dave";
@@ -2164,6 +2182,13 @@ pk_backend_test (EggTest *test)
egg_test_loop_wait (test, 2000);
egg_test_loop_check (test);
+ /************************************************************/
+ egg_test_title (test, "check duplicate filter");
+ if (number_packages == 1)
+ egg_test_success (test, NULL);
+ else
+ egg_test_failed (test, "wrong number of pacakges: %s", number_packages);
+
/* reset */
pk_backend_reset (backend);
commit 548f4327e125483314e5ae94f5daff225af2c396
Author: Richard Hughes <richard at hughsie.com>
Date: Thu Jan 8 10:49:59 2009 +0000
bugfix: don't attempt to free the package object twice if we skip it due to duplicate filtering
diff --git a/src/pk-backend.c b/src/pk-backend.c
index 97f49b1..11c4119 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -804,7 +804,6 @@ pk_backend_package (PkBackend *backend, PkInfoEnum info, const gchar *package_id
obj = pk_package_obj_new (info, id, summary_safe);
ret = pk_package_obj_equal (obj, backend->priv->last_package);
if (ret) {
- pk_package_obj_free (obj);
egg_debug ("skipping duplicate %s", package_id);
ret = FALSE;
goto out;
commit 523231f7d1dc85e5edc9ce34f5be3daca5e55b7b
Author: Thomas Goettlicher <tgoettlicher at d1.suse.de>
Date: Wed Jan 7 16:30:18 2009 +0100
adapted pk-upgrade-distro.sh for suse
diff --git a/data/pk-upgrade-distro.sh b/data/pk-upgrade-distro.sh
index b1e090a..b173c43 100755
--- a/data/pk-upgrade-distro.sh
+++ b/data/pk-upgrade-distro.sh
@@ -29,9 +29,17 @@ elif [ "$DISTRO" = "Ubuntu" ]; then
else
xdg-open http://www.ubuntu.com/getubuntu
fi
+elif [ -e /etc/SuSE-release ] && [ -x /usr/sbin/wagon ]; then
+ xdg-su -c /usr/sbin/wagon
else
+ TITLE="System is not recognised"
+ TEXT="Your distribution was not recognised by the upgrade script.\nPlease file a but in your distribution bug tracker under the component PackageKit."
# do not dep on zenity in build scripts
- zenity --warning --title "System is not recognised" \
- --text "Your distribution was not recognised by the upgrade script.\nPlease file a but in your distribution bug tracker under the component PackageKit."
+ which zenity 2> /dev/null > /dev/null
+ if [ "$?" -eq 0 ]; then
+ zenity --warning --title $TITLE --text $TEXT
+ else
+ xmessage $TEXT
+ fi
fi
More information about the PackageKit-commit
mailing list