New upstream release

This commit is contained in:
Richard Hughes 2015-07-13 13:06:01 +01:00
parent 5caab5a780
commit ad3dd315d3
7 changed files with 12 additions and 292 deletions

1
.gitignore vendored
View File

@ -48,3 +48,4 @@ PackageKit-0.6.7.tar.bz2
/PackageKit-1.0.4.tar.xz
/PackageKit-1.0.5.tar.xz
/PackageKit-1.0.6.tar.xz
/PackageKit-1.0.7.tar.xz

View File

@ -1,51 +0,0 @@
From dffc8f1b0d4077ef07ec17181ed6f17723ce2120 Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Thu, 14 May 2015 17:28:21 +0200
Subject: [PATCH] Revert "Make "reboot" the default action for no action file"
As a side effect, this commit inadvertently changed the default value
for the TriggerAction DBus property. This led to a fallout in the
gnome-shell shutdown dialog where the default then flipped to always
installing pending software updates on reboot / shutdown.
As for the issue that the original commit tried to address: it did so in
the wrong place. If there's a problem with the offline update process
hanging when no default is set, that should be addressed in
client/pk-offline-update.c to properly handle the UNSET state and not by
changing the default in the library.
This reverts commit 0a7b6d67b98cd06cabe03176c02db83f276dbe7b.
---
lib/packagekit-glib2/pk-offline.c | 2 +-
lib/packagekit-glib2/pk-test-private.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/packagekit-glib2/pk-offline.c b/lib/packagekit-glib2/pk-offline.c
index 60cd81f..5985ba8 100644
--- a/lib/packagekit-glib2/pk-offline.c
+++ b/lib/packagekit-glib2/pk-offline.c
@@ -240,7 +240,7 @@ pk_offline_get_action (GError **error)
/* is the trigger set? */
if (!g_file_test (PK_OFFLINE_TRIGGER_FILENAME, G_FILE_TEST_EXISTS) ||
!g_file_test (PK_OFFLINE_ACTION_FILENAME, G_FILE_TEST_EXISTS))
- return PK_OFFLINE_ACTION_REBOOT;
+ return PK_OFFLINE_ACTION_UNSET;
/* read data file */
if (!g_file_get_contents (PK_OFFLINE_ACTION_FILENAME,
diff --git a/lib/packagekit-glib2/pk-test-private.c b/lib/packagekit-glib2/pk-test-private.c
index 4a79c7c..1ac4331 100644
--- a/lib/packagekit-glib2/pk-test-private.c
+++ b/lib/packagekit-glib2/pk-test-private.c
@@ -652,7 +652,7 @@ pk_test_offline_func (void)
/* test no action set */
action = pk_offline_get_action (&error);
g_assert_no_error (error);
- g_assert_cmpint (action, ==, PK_OFFLINE_ACTION_REBOOT);
+ g_assert_cmpint (action, ==, PK_OFFLINE_ACTION_UNSET);
/* try to trigger without the fake updates set */
ret = pk_offline_auth_trigger (PK_OFFLINE_ACTION_REBOOT, &error);
--
2.4.0

View File

@ -1,53 +0,0 @@
From 7528178aaefb5e827054c32b3a8691c29294bb46 Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Fri, 29 May 2015 17:56:29 +0200
Subject: [PATCH 2/4] hif: Add missing locking when accessing sack cache
Might help with the crash reported at
https://bugzilla.redhat.com/show_bug.cgi?id=1146734
---
backends/hif/pk-backend-hif.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/backends/hif/pk-backend-hif.c b/backends/hif/pk-backend-hif.c
index 5988ab1..48d456a 100644
--- a/backends/hif/pk-backend-hif.c
+++ b/backends/hif/pk-backend-hif.c
@@ -617,19 +617,23 @@ hif_utils_create_sack_for_filters (PkBackendJob *job,
/* do we have anything in the cache */
cache_key = hif_utils_create_cache_key (flags);
- if ((create_flags & HIF_CREATE_SACK_FLAG_USE_CACHE) > 0)
+ if ((create_flags & HIF_CREATE_SACK_FLAG_USE_CACHE) > 0) {
+ g_mutex_lock (&priv->sack_mutex);
cache_item = g_hash_table_lookup (priv->sack_cache, cache_key);
- if (cache_item != NULL && cache_item->sack != NULL) {
- if (cache_item->valid) {
- ret = TRUE;
- g_debug ("using cached sack %s", cache_key);
- sack = cache_item->sack;
- goto out;
- } else {
- /* we have to do this now rather than rely on the
- * callback of the hash table */
- g_hash_table_remove (priv->sack_cache, cache_key);
+ if (cache_item != NULL && cache_item->sack != NULL) {
+ if (cache_item->valid) {
+ ret = TRUE;
+ g_debug ("using cached sack %s", cache_key);
+ sack = cache_item->sack;
+ g_mutex_unlock (&priv->sack_mutex);
+ goto out;
+ } else {
+ /* we have to do this now rather than rely on the
+ * callback of the hash table */
+ g_hash_table_remove (priv->sack_cache, cache_key);
+ }
}
+ g_mutex_unlock (&priv->sack_mutex);
}
/* update status */
--
2.4.2

View File

@ -1,40 +0,0 @@
From 982d33d04f0390f54ad783914f4dc25cf8913b49 Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Fri, 5 Jun 2015 18:49:38 +0200
Subject: [PATCH 3/4] hif: Improve depsolving for parallel kernel installs
Make sure the magic necessary for parallel kernel installs is properly
set up before depsolving an upgrade goal. This ensures that hawkey has
enough information to figure out what to do in more complicated
situations, such as the one described in
https://bugzilla.redhat.com/show_bug.cgi?id=1205649
---
backends/hif/pk-backend-hif.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/backends/hif/pk-backend-hif.c b/backends/hif/pk-backend-hif.c
index 48d456a..4d4151c 100644
--- a/backends/hif/pk-backend-hif.c
+++ b/backends/hif/pk-backend-hif.c
@@ -860,6 +860,7 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
HyQuery query = NULL;
HySack sack = NULL;
PkBackendHifJobData *job_data = pk_backend_job_get_user_data (job);
+ PkBackendHifPrivate *priv = pk_backend_get_user_data (job_data->backend);
PkBitfield filters = 0;
_cleanup_error_free_ GError *error = NULL;
_cleanup_strv_free_ gchar **search = NULL;
@@ -947,6 +948,10 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
pkglist = hif_utils_run_query_with_filters (job_data->backend, sack, query, filters);
break;
case PK_ROLE_ENUM_GET_UPDATES:
+ /* set up the sack for packages that should only ever be installed, never updated */
+ hy_sack_set_installonly (sack, hif_context_get_installonly_pkgs (priv->context));
+ hy_sack_set_installonly_limit (sack, hif_context_get_installonly_limit (priv->context));
+
job_data->goal = hy_goal_create (sack);
hy_goal_upgrade_all (job_data->goal);
ret = hif_goal_depsolve (job_data->goal, &error);
--
2.4.2

View File

@ -1,135 +0,0 @@
From 5c398820dcf2c3e72da8ce0ee921f3046a9bbaae Mon Sep 17 00:00:00 2001
From: Kalev Lember <kalevlember@gmail.com>
Date: Fri, 5 Jun 2015 18:51:04 +0200
Subject: [PATCH 4/4] hif: Include any packages marked for installation when
doing upgrades
When hawkey has depsolved an upgrade goal, make sure to not only read
back packages marked for update, but also the packages that are marked
for install. This ensures that we don't accidentally exclude a kernel
update just because hawkey has marked it for install, not update.
Also, since we're now including installable packages, this commit
removes a check that verified that all updated packages had an older
version already installed. Depending on a situation, hawkey might want
to install new packages during an update.
This is the other half needed for fixing
https://bugzilla.redhat.com/show_bug.cgi?id=1205649
---
backends/hif/pk-backend-hif.c | 63 +++++++++++--------------------------------
1 file changed, 15 insertions(+), 48 deletions(-)
diff --git a/backends/hif/pk-backend-hif.c b/backends/hif/pk-backend-hif.c
index 4d4151c..8608259 100644
--- a/backends/hif/pk-backend-hif.c
+++ b/backends/hif/pk-backend-hif.c
@@ -856,6 +856,7 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
gchar **search_tmp;
HifDb *db;
HifState *state_local;
+ HyPackageList installs = NULL;
HyPackageList pkglist = NULL;
HyQuery query = NULL;
HySack sack = NULL;
@@ -959,7 +960,18 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
pk_backend_job_error_code (job, error->code, "%s", error->message);
goto out;
}
+ /* get packages marked for upgrade */
pkglist = hy_goal_list_upgrades (job_data->goal);
+ /* add any packages marked for install */
+ installs = hy_goal_list_installs (job_data->goal);
+ if (installs != NULL) {
+ guint i;
+ HyPackage pkg;
+
+ FOR_PACKAGELIST(pkg, installs, i) {
+ hy_packagelist_push (pkglist, hy_package_link (pkg));
+ }
+ }
break;
default:
g_assert_not_reached ();
@@ -1021,6 +1033,8 @@ pk_backend_search_thread (PkBackendJob *job, GVariant *params, gpointer user_dat
goto out;
}
out:
+ if (installs != NULL)
+ hy_packagelist_free (installs);
if (pkglist != NULL)
hy_packagelist_free (pkglist);
if (query != NULL)
@@ -2550,32 +2564,6 @@ pk_backend_repo_remove (PkBackend *backend,
}
/**
- * hif_is_installed_package_id_name:
- */
-static gboolean
-hif_is_installed_package_id_name (HySack sack, const gchar *package_id)
-{
- gboolean ret;
- HyPackageList pkglist = NULL;
- HyQuery query = NULL;
- _cleanup_strv_free_ gchar **split = NULL;
-
- /* run query */
- query = hy_query_create (sack);
- split = pk_package_id_split (package_id);
- hy_query_filter (query, HY_PKG_NAME, HY_EQ, split[PK_PACKAGE_ID_NAME]);
- hy_query_filter (query, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME);
- pkglist = hy_query_run (query);
-
- /* any matches? */
- ret = hy_packagelist_count (pkglist) > 0;
-
- hy_packagelist_free (pkglist);
- hy_query_free (query);
- return ret;
-}
-
-/**
* hif_is_installed_package_id_name_arch:
*/
static gboolean
@@ -3082,8 +3070,7 @@ pk_backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer
/* set state */
ret = hif_state_set_steps (job_data->state, NULL,
- 8, /* add repos */
- 1, /* check installed */
+ 9, /* add repos */
1, /* find packages */
90, /* run transaction */
-1);
@@ -3112,26 +3099,6 @@ pk_backend_update_packages_thread (PkBackendJob *job, GVariant *params, gpointer
return;
}
- /* ensure packages are not already installed */
- for (i = 0; package_ids[i] != NULL; i++) {
- ret = hif_is_installed_package_id_name (sack, package_ids[i]);
- if (!ret) {
- gchar *printable_tmp;
- printable_tmp = pk_package_id_to_printable (package_ids[i]);
- pk_backend_job_error_code (job,
- PK_ERROR_ENUM_PACKAGE_NOT_INSTALLED,
- "cannot update: %s is not already installed",
- printable_tmp);
- g_free (printable_tmp);
- return;
- }
- }
- /* done */
- if (!hif_state_done (job_data->state, &error)) {
- pk_backend_job_error_code (job, error->code, "%s", error->message);
- return;
- }
-
/* find packages */
hash = hif_utils_find_package_ids (sack, package_ids, &error);
if (hash == NULL) {
--
2.4.2

View File

@ -6,8 +6,8 @@
Summary: Package management service
Name: PackageKit
Version: 1.0.6
Release: 7%{?dist}
Version: 1.0.7
Release: 1%{?dist}
License: GPLv2+ and LGPLv2+
URL: http://www.freedesktop.org/software/PackageKit/
Source0: http://www.freedesktop.org/software/PackageKit/releases/%{name}-%{version}.tar.xz
@ -17,11 +17,6 @@ Source1: cached-metadata.tar
# Fedora-specific: set Vendor.conf up for Fedora.
Patch0: PackageKit-0.3.8-Fedora-Vendor.conf.patch
# Backported upstream patches
Patch1: 0001-Revert-Make-reboot-the-default-action-for-no-action-.patch
Patch2: 0002-hif-Add-missing-locking-when-accessing-sack-cache.patch
Patch3: 0003-hif-Improve-depsolving-for-parallel-kernel-installs.patch
Patch4: 0004-hif-Include-any-packages-marked-for-installation-whe.patch
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
Requires: shared-mime-info
@ -178,10 +173,6 @@ using PackageKit.
%prep
%setup -q
%patch0 -p1 -b .fedora
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%build
%configure \
@ -321,6 +312,13 @@ systemctl disable packagekit-offline-update.service > /dev/null 2>&1 || :
%{_datadir}/gtk-doc/html/PackageKit
%changelog
* Mon Jul 13 2015 Richard Hughes <rhughes@redhat.com> - 1.0.7-1
- New upstream release
- Correct punctuation while applying offline updates
- Define command_not_found_handler for zsh
- Port GTK+ module to org.freedesktop.PackageKit.Modify2
- Return the correct return codes for syntax errors
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -1,2 +1,2 @@
d92ffad202f7d18e8c4ed09fecb4624c PackageKit-1.0.6.tar.xz
54d31514518f2a2fffd035d1c853501d cached-metadata.tar
5d6fc6cdd44354c5b7bab7bb434cab1f PackageKit-1.0.7.tar.xz
9f3fd67690ee31c47adb63c8b6f6cfa6 cached-metadata.tar