rpms/PackageKit/devel PackageKit-0.4.6-correct-allow-cancel-duplicate-logic.patch, NONE, 1.1 PackageKit-0.4.6-fix-FakeRepository-for-unicode-paths.patch, NONE, 1.1 PackageKit.spec, 1.99, 1.100

Richard Hughes rhughes at fedoraproject.org
Thu Apr 2 10:34:45 UTC 2009


Author: rhughes

Update of /cvs/pkgs/rpms/PackageKit/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27488

Modified Files:
	PackageKit.spec 
Added Files:
	PackageKit-0.4.6-correct-allow-cancel-duplicate-logic.patch 
	PackageKit-0.4.6-fix-FakeRepository-for-unicode-paths.patch 
Log Message:
* Thu Apr 02 2009 Richard Hughes  <rhughes at redhat.com> - 0.4.6-2
- Fix installing local files with a unicode path. Fixes rh#486720
- Fix the allow cancel duplicate filtering with a patch from upstream.


PackageKit-0.4.6-correct-allow-cancel-duplicate-logic.patch:

--- NEW FILE PackageKit-0.4.6-correct-allow-cancel-duplicate-logic.patch ---
commit 826973135802ee453e014dc601168690b49af25d
Author: Richard Hughes <richard at hughsie.com>
Date:   Wed Apr 1 12:25:02 2009 +0100

    bugfix: correct the allow-cancel duplicate logic so we don't remember the state of the previous transaction

diff --git a/src/pk-backend.c b/src/pk-backend.c
index 6bedd12..d55245d 100644
--- a/src/pk-backend.c
+++ b/src/pk-backend.c
@@ -74,6 +74,13 @@
  */
 #define PK_BACKEND_FINISHED_TIMEOUT_GRACE	10 /* ms */
 
+/* a boolean with unset */
+typedef enum {
+	PK_BACKEND_TRISTATE_FALSE = FALSE,
+	PK_BACKEND_TRISTATE_TRUE = TRUE,
+	PK_BACKEND_TRISTATE_UNSET
+} PkBackendTristate;
+
 struct _PkBackendPrivate
 {
 	GModule			*handle;
@@ -101,7 +108,7 @@ struct _PkBackendPrivate
 	PkBackendFileChanged	 file_changed_func;
 	gpointer		 file_changed_data;
 	gboolean		 during_initialize;
-	gboolean		 allow_cancel;
+	PkBackendTristate	 allow_cancel;
 	gboolean		 finished;
 	guint			 last_percentage;
 	guint			 last_subpercentage;
@@ -1436,9 +1443,9 @@ pk_backend_set_allow_cancel (PkBackend *backend, gboolean allow_cancel)
 	}
 
 	/* same as last state? */
-	if (backend->priv->allow_cancel == allow_cancel) {
+	if (backend->priv->allow_cancel == (PkBackendTristate) allow_cancel) {
 		egg_debug ("ignoring same allow-cancel state");
-		return TRUE;
+		return FALSE;
 	}
 
 	/* can we do the action? */
@@ -1456,9 +1463,16 @@ pk_backend_set_allow_cancel (PkBackend *backend, gboolean allow_cancel)
 gboolean
 pk_backend_get_allow_cancel (PkBackend *backend)
 {
+	gboolean allow_cancel = FALSE;
+
 	g_return_val_if_fail (PK_IS_BACKEND (backend), FALSE);
 	g_return_val_if_fail (backend->priv->locked != FALSE, FALSE);
-	return backend->priv->allow_cancel;
+
+	/* return FALSE if we never set state */
+	if (backend->priv->allow_cancel != PK_BACKEND_TRISTATE_UNSET)
+		allow_cancel = backend->priv->allow_cancel;
+
+	return allow_cancel;
 }
 
 /**
@@ -1952,11 +1966,11 @@ pk_backend_reset (PkBackend *backend)
 	backend->priv->set_error = FALSE;
 	backend->priv->set_signature = FALSE;
 	backend->priv->set_eula = FALSE;
-	backend->priv->allow_cancel = FALSE;
 	backend->priv->finished = FALSE;
 	backend->priv->has_sent_package = FALSE;
 	backend->priv->thread = NULL;
 	backend->priv->last_package = NULL;
+	backend->priv->allow_cancel = PK_BACKEND_TRISTATE_UNSET;
 	backend->priv->status = PK_STATUS_ENUM_UNKNOWN;
 	backend->priv->exit = PK_EXIT_ENUM_UNKNOWN;
 	backend->priv->role = PK_ROLE_ENUM_UNKNOWN;
@@ -2327,6 +2341,35 @@ pk_backend_test (EggTest *test)
 	egg_test_loop_wait (test, PK_BACKEND_FINISHED_ERROR_TIMEOUT + 400);
 	egg_test_loop_check (test);
 
+	/************************************************************
+	 ****************     CANCEL TRISTATE      ******************
+	 ************************************************************/
+	egg_test_title (test, "get allow cancel after reset");
+	pk_backend_reset (backend);
+	ret = pk_backend_get_allow_cancel (backend);
+	egg_test_assert (test, !ret);
+
+	/************************************************************/
+	egg_test_title (test, "set allow cancel TRUE");
+	ret = pk_backend_set_allow_cancel (backend, TRUE);
+	egg_test_assert (test, ret);
+
+	/************************************************************/
+	egg_test_title (test, "set allow cancel TRUE (repeat)");
+	ret = pk_backend_set_allow_cancel (backend, TRUE);
+	egg_test_assert (test, !ret);
+
+	/************************************************************/
+	egg_test_title (test, "set allow cancel FALSE");
+	ret = pk_backend_set_allow_cancel (backend, FALSE);
+	egg_test_assert (test, ret);
+
+	/************************************************************/
+	egg_test_title (test, "set allow cancel FALSE (after reset)");
+	pk_backend_reset (backend);
+	ret = pk_backend_set_allow_cancel (backend, FALSE);
+	egg_test_assert (test, ret);
+
 #ifdef PK_IS_DEVELOPER
 	egg_test_title (test, "check we enforce finished after error_code");
 	if (number_messages == 1)

PackageKit-0.4.6-fix-FakeRepository-for-unicode-paths.patch:

--- NEW FILE PackageKit-0.4.6-fix-FakeRepository-for-unicode-paths.patch ---
commit 4dfcd53103ac572e27e67e85088b6dee48b2e171
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Apr 2 11:20:55 2009 +0100

    bugfix: yum cannot handle FakeRepository.repo, unlike a normal Repository, so just handle the local case specially. Fixes rh#486720

diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index f13bd9d..aade7bd 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -2641,8 +2641,13 @@ class PackageKitCallback(RPMBaseCallback):
             # we don't know the summary text
             self.base.package(package_id, status, "")
         else:
+            # local file shouldn't put the path in the package_id
+            repo_id = _to_unicode(self.curpkg.repo.id)
+            if repo_id.find("/") != -1:
+                repo_id = 'local'
+
             pkgver = _get_package_ver(self.curpkg)
-            package_id = self.base.get_package_id(self.curpkg.name, pkgver, self.curpkg.arch, self.curpkg.repo)
+            package_id = self.base.get_package_id(self.curpkg.name, pkgver, self.curpkg.arch, repo_id)
             self.base.package(package_id, status, self.curpkg.summary)
 
     def event(self, package, action, te_current, te_total, ts_current, ts_total):


Index: PackageKit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/PackageKit/devel/PackageKit.spec,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- PackageKit.spec	30 Mar 2009 16:18:49 -0000	1.99
+++ PackageKit.spec	2 Apr 2009 10:34:15 -0000	1.100
@@ -10,7 +10,7 @@
 Name:      PackageKit
 Version:   0.4.6
 #Release:   0.3.%{?alphatag}git%{?dist}
-Release:   1%{?dist}
+Release:   2%{?dist}
 License:   GPLv2+
 Group:     System Environment/Libraries
 URL:       http://www.packagekit.org
@@ -18,11 +18,18 @@
 Source0:   http://www.packagekit.org/releases/%{name}-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-# Fedora-specific
-# Set Vendor.conf up for Fedora.
+# Fedora-specific: set Vendor.conf up for Fedora.
 Patch0:    PackageKit-0.3.8-Fedora-Vendor.conf.patch
+
+# Fedora specific: the yum backend doesn't do time estimation correctly
 Patch1:    PackageKit-0.4.4-Fedora-turn-off-time.conf.patch
 
+# Already upstream: 4dfcd53103ac572e27e67e85088b6dee48b2e171
+Patch2:    PackageKit-0.4.6-fix-FakeRepository-for-unicode-paths.patch
+
+# Already upstream: 826973135802ee453e014dc601168690b49af25d
+Patch3:    PackageKit-0.4.6-correct-allow-cancel-duplicate-logic.patch
+
 Requires: dbus >= %{dbus_version}
 Requires: dbus-glib >= %{dbus_glib_version}
 Requires: PackageKit-glib = %{version}-%{release}
@@ -223,6 +230,8 @@
 %setup -q
 %patch0 -p1 -b .fedora
 %patch1 -p1 -b .no-time
+%patch2 -p1 -b .fake-repo-unicode
+%patch3 -p1 -b .correct-allow-cancel
 
 %build
 %configure --enable-yum --enable-smart --with-default-backend=yum --disable-local --disable-ruck
@@ -417,6 +426,10 @@
 %{_includedir}/PackageKit/backend/*.h
 
 %changelog
+* Thu Apr 02 2009 Richard Hughes  <rhughes at redhat.com> - 0.4.6-2
+- Fix installing local files with a unicode path. Fixes rh#486720
+- Fix the allow cancel duplicate filtering with a patch from upstream.
+
 * Mon Mar 30 2009 Richard Hughes  <rhughes at redhat.com> - 0.4.6-1
 - New upstream version
 




More information about the fedora-extras-commits mailing list