ngompa / rpms / PackageKit

Forked from rpms/PackageKit 4 years ago
Clone

Blame SOURCES/PackageKit-git-fixes.patch

cc6846
commit f25455d2d48d20f6086effe47971ed439cee2cc5
cc6846
Author: Richard Hughes <richard@hughsie.com>
cc6846
Date:   Thu Jun 6 13:10:58 2013 +0100
cc6846
cc6846
    systemd-updates: Do not exit with an error for a race condition
cc6846
    
cc6846
    The daemon plugin pk-plugin-systemd-update deletes the /var/lib/PackageKit/prepared-update
cc6846
    file if any transaction is done that affects the prepared state.
cc6846
    This includes the offline-update process itself.
cc6846
    
cc6846
    If the daemon deletes the file before the pk-offline-update process tries to do
cc6846
    it a warning is shown and the systemd unit fails.
cc6846
cc6846
diff --git a/contrib/systemd-updates/pk-offline-update.c b/contrib/systemd-updates/pk-offline-update.c
cc6846
index 8678959..7b8d812 100644
cc6846
--- a/contrib/systemd-updates/pk-offline-update.c
cc6846
+++ b/contrib/systemd-updates/pk-offline-update.c
cc6846
@@ -500,16 +500,20 @@ main (int argc, char *argv[])
cc6846
 	pk_progress_bar_end (progressbar);
cc6846
 	pk_offline_update_write_results (results);
cc6846
 
cc6846
-	/* delete prepared-update file */
cc6846
+	/* delete prepared-update file if it's not already been done by the
cc6846
+	 * pk-plugin-systemd-update daemon plugin */
cc6846
 	file = g_file_new_for_path (PK_OFFLINE_PREPARED_UPDATE_FILENAME);
cc6846
 	ret = g_file_delete (file, NULL, &error);
cc6846
 	if (!ret) {
cc6846
-		retval = EXIT_FAILURE;
cc6846
-		g_warning ("failed to delete %s: %s",
cc6846
-			   PK_OFFLINE_PREPARED_UPDATE_FILENAME,
cc6846
-			   error->message);
cc6846
-		g_error_free (error);
cc6846
-		goto out;
cc6846
+		if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
cc6846
+			retval = EXIT_FAILURE;
cc6846
+			g_warning ("failed to delete %s: %s",
cc6846
+				   PK_OFFLINE_PREPARED_UPDATE_FILENAME,
cc6846
+				   error->message);
cc6846
+			g_error_free (error);
cc6846
+			goto out;
cc6846
+		}
cc6846
+		g_clear_error (&error);
cc6846
 	}
cc6846
 
cc6846
 	retval = EXIT_SUCCESS;
cc6846
commit 3eb921f2ddbe94dc5b180522b8aa5a057dd6eac2
cc6846
Author: Richard Hughes <richard@hughsie.com>
cc6846
Date:   Thu May 23 15:06:41 2013 +0100
cc6846
cc6846
    Raise the package process threshold to 5000
cc6846
    
cc6846
    TeXLive has officially jumped the shark, and it's quite plausible to have > 2500
cc6846
    updates in one transaction now.
cc6846
    
cc6846
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=894731
cc6846
cc6846
diff --git a/etc/PackageKit.conf.in b/etc/PackageKit.conf.in
cc6846
index 3440be5..c09c8d2 100644
cc6846
--- a/etc/PackageKit.conf.in
cc6846
+++ b/etc/PackageKit.conf.in
cc6846
@@ -228,8 +228,8 @@ MaximumItemsToResolve=1200
cc6846
 # Setting this lower decreases the risk of a local denial of service, but may
cc6846
 # cause errors if the desktop client is trying to do a large transaction.
cc6846
 #
cc6846
-# default=2500
cc6846
-MaximumPackagesToProcess=2500
cc6846
+# default=5000
cc6846
+MaximumPackagesToProcess=5000
cc6846
 
cc6846
 # How long the transaction is valid before it's destroyed, in seconds
cc6846
 #
cc6846
commit cac9936e0950831905039c25f4b8e25ee4db3ce1
cc6846
Author: Richard Hughes <richard@hughsie.com>
cc6846
Date:   Thu Jun 13 13:05:07 2013 +0100
cc6846
cc6846
    yum: Use yb.downloadPkgs() to download updates
cc6846
    
cc6846
    There were two bugs here:
cc6846
    
cc6846
    - Using repo.getPackage() did not check the package checksum, only the size,
cc6846
      so it was possible to download a corrupt package and then not be able to
cc6846
      apply the updates
cc6846
    
cc6846
    - By restricting to TS_UPDATE and TS_INSTALL we were ignoring any package that
cc6846
      was obsoleting another which could miss out packages.
cc6846
    
cc6846
    Many thanks to Zdenek Pavlas for all the help in finding these issues.
cc6846
    
cc6846
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=968936
cc6846
cc6846
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
cc6846
index 289f10f..49a0f7b 100755
cc6846
--- a/backends/yum/yumBackend.py
cc6846
+++ b/backends/yum/yumBackend.py
cc6846
@@ -2365,22 +2365,16 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
cc6846
             self.percentage(100)
cc6846
             return
cc6846
 
cc6846
+        # just download packages ready for the actual transaction
cc6846
         if TRANSACTION_FLAG_ONLY_DOWNLOAD in transaction_flags:
cc6846
-            package_list = []
cc6846
             for txmbr in self.yumbase.tsInfo:
cc6846
-                if txmbr.output_state in (TS_UPDATE, TS_INSTALL):
cc6846
-                    self._show_package(txmbr.po, INFO_DOWNLOADING)
cc6846
-                    repo = self.yumbase.repos.getRepo(txmbr.po.repoid)
cc6846
+                if txmbr.output_state in TS_INSTALL_STATES:
cc6846
                     try:
cc6846
-                        path = repo.getPackage(txmbr.po)
cc6846
-                    except yum.Errors.RepoError, e:
cc6846
-                        self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, "Cannot download file: %s" % _to_unicode(e), exit=False)
cc6846
-                        return
cc6846
-                    except IOError, e:
cc6846
-                        self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, "Cannot write to file: %s" % _to_unicode(e), exit=False)
cc6846
-                        return
cc6846
+                        self._show_package(txmbr.po, INFO_DOWNLOADING)
cc6846
+                        self.yumbase.downloadPkgs([txmbr.po])
cc6846
                     except Exception, e:
cc6846
-                        raise PkError(ERROR_INTERNAL_ERROR, _format_str(traceback.format_exc()))
cc6846
+                        self.error(ERROR_PACKAGE_DOWNLOAD_FAILED, "Cannot download packages: %s" % _to_unicode(e), exit=False)
cc6846
+                        return
cc6846
             self.percentage(100)
cc6846
             return
cc6846
 
cc6846
From b78af414daf2176aac74540039b341a3e4e49412 Mon Sep 17 00:00:00 2001
cc6846
From: Richard Hughes <richard@hughsie.com>
cc6846
Date: Tue, 28 May 2013 14:34:59 +0100
cc6846
Subject: [PATCH] Allow local active users in the wheel group to install signed
cc6846
 packages without a password
cc6846
cc6846
---
cc6846
 contrib/PackageKit.spec.in                  | 1 +
cc6846
 policy/Makefile.am                          | 5 +++++
cc6846
 policy/org.freedesktop.packagekit.policy.in | 2 +-
cc6846
 policy/org.freedesktop.packagekit.rules     | 7 +++++++
cc6846
 4 files changed, 14 insertions(+), 1 deletion(-)
cc6846
 create mode 100644 policy/org.freedesktop.packagekit.rules
cc6846
cc6846
diff --git a/policy/Makefile.am b/policy/Makefile.am
cc6846
index ebb7808..6babe33 100644
cc6846
--- a/policy/Makefile.am
cc6846
+++ b/policy/Makefile.am
cc6846
@@ -2,6 +2,11 @@
cc6846
 NULL =
cc6846
 
cc6846
 if SECURITY_TYPE_POLKIT
cc6846
+polkit_rulesdir = $(datadir)/polkit-1/rules.d
cc6846
+dist_polkit_rules_DATA =					\
cc6846
+	org.freedesktop.packagekit.rules			\
cc6846
+	$(NULL)
cc6846
+
cc6846
 polkit_policydir = $(datadir)/polkit-1/actions
cc6846
 dist_polkit_policy_DATA =					\
cc6846
 	org.freedesktop.packagekit.policy			\
cc6846
diff --git a/policy/org.freedesktop.packagekit.policy.in b/policy/org.freedesktop.packagekit.policy.in
cc6846
index 28ab3b1..19cdd20 100644
cc6846
--- a/policy/org.freedesktop.packagekit.policy.in
cc6846
+++ b/policy/org.freedesktop.packagekit.policy.in
cc6846
@@ -42,7 +42,7 @@
cc6846
     <defaults>
cc6846
       <allow_any>no</allow_any>
cc6846
       <allow_inactive>no</allow_inactive>
cc6846
-      <allow_active>yes</allow_active>
cc6846
+      <allow_active>auth_admin_keep</allow_active>
cc6846
     </defaults>
cc6846
   </action>
cc6846
 
cc6846
diff --git a/policy/org.freedesktop.packagekit.rules b/policy/org.freedesktop.packagekit.rules
cc6846
new file mode 100644
cc6846
index 0000000..6a1c8a7
cc6846
--- /dev/null
cc6846
+++ b/policy/org.freedesktop.packagekit.rules
cc6846
@@ -0,0 +1,7 @@
cc6846
+polkit.addRule(function(action, subject) {
cc6846
+    if (action.id == "org.freedesktop.packagekit.package-install" &&
cc6846
+        subject.active == true && subject.local == true &&
cc6846
+        subject.isInGroup("wheel")) {
cc6846
+            return polkit.Result.YES;
cc6846
+    }
cc6846
+});
cc6846
-- 
cc6846
1.8.2.1
cc6846