[PackageKit-commit] packagekit: Branch 'master' - 8 commits
Richard Hughes
hughsient at kemper.freedesktop.org
Fri Nov 14 08:47:14 PST 2008
backends/yum/yumBackend.py | 19 ++++++++++---------
backends/zypp/pk-backend-zypp.cpp | 15 ++++++---------
backends/zypp/zypp-utils.cpp | 27 ++++++++++++++++-----------
backends/zypp/zypp-utils.h | 7 ++++++-
configure.ac | 2 +-
lib/packagekit-glib/pk-client.c | 12 ------------
src/Makefile.am | 1 +
src/pk-backend-spawn.c | 3 +--
8 files changed, 41 insertions(+), 45 deletions(-)
New commits:
commit 2c823ee5e622b4b3f11e019d436ba0f90ebb6834
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 12:57:52 2008 +0000
trivial: don't prefix stderr with 'library warning:' as it might not be from a library
diff --git a/src/pk-backend-spawn.c b/src/pk-backend-spawn.c
index 1f63873..1450d72 100644
--- a/src/pk-backend-spawn.c
+++ b/src/pk-backend-spawn.c
@@ -510,8 +510,7 @@ pk_backend_spawn_stderr_cb (PkBackendSpawn *spawn, const gchar *line, PkBackendS
/* send warning up to session, this is never going to be pretty... */
egg_warning ("STDERR: %s", line);
- pk_backend_message (backend_spawn->priv->backend, PK_MESSAGE_ENUM_BACKEND_ERROR,
- "library warning: %s", line);
+ pk_backend_message (backend_spawn->priv->backend, PK_MESSAGE_ENUM_BACKEND_ERROR, "%s", line);
}
/**
commit 767efdf0fb3647889bd84e472ce01fd70b3aa93e
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 12:51:01 2008 +0000
trivial: same fix for RepoSetData
diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index bd46ad6..52205c2 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -3402,12 +3402,6 @@ pk_client_repo_set_data_action (PkClient *client, const gchar *repo_id,
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- /* ensure we are not trying to run without reset */
- if (client->priv->tid != NULL) {
- pk_client_error_set (error, PK_CLIENT_ERROR_FAILED, "TID already set to %s", client->priv->tid);
- return FALSE;
- }
-
/* check to see if we have a valid proxy */
if (client->priv->proxy == NULL) {
pk_client_error_set (error, PK_CLIENT_ERROR_NO_TID, "No proxy for transaction");
commit 636587097b68a4cfad3b5ef6929a7f37cf603a6d
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 12:32:59 2008 +0000
bugfix: don't check TID empty state in an action callback. Fixes removing packages using packagekit-glib
diff --git a/lib/packagekit-glib/pk-client.c b/lib/packagekit-glib/pk-client.c
index b3cce8a..bd46ad6 100644
--- a/lib/packagekit-glib/pk-client.c
+++ b/lib/packagekit-glib/pk-client.c
@@ -2475,12 +2475,6 @@ pk_client_remove_packages_action (PkClient *client, gchar **package_ids,
g_return_val_if_fail (PK_IS_CLIENT (client), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- /* ensure we are not trying to run without reset */
- if (client->priv->tid != NULL) {
- pk_client_error_set (error, PK_CLIENT_ERROR_FAILED, "TID already set to %s", client->priv->tid);
- return FALSE;
- }
-
/* check to see if we have a valid proxy */
if (client->priv->proxy == NULL) {
pk_client_error_set (error, PK_CLIENT_ERROR_NO_TID, "No proxy for transaction");
commit 24ac3ee9ce008d8f516a1ecde125b7be005252d9
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 10:29:02 2008 +0000
bugfix: create the log file directory if we are running the daemon in a prefix
diff --git a/src/Makefile.am b/src/Makefile.am
index 392145c..4073875 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -210,6 +210,7 @@ endif
install-data-hook:
if test -w $(DESTDIR)$(prefix)/; then \
mkdir -p $(DESTDIR)$(localstatedir)/cache/PackageKit/downloads; \
+ mkdir -p $(PK_LOG_DIR); \
fi
EXTRA_DIST = \
commit 388935e4d58a971c3800b40b8fb5ac4e841ea396
Merge: db315a9... 861765a...
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 09:27:10 2008 +0000
Merge branch 'master' of git+ssh://hughsie@git.packagekit.org/srv/git/PackageKit
commit db315a99f054f6c4df3bbad5ca51b77d5dab53fd
Author: Richard Hughes <richard at hughsie.com>
Date: Fri Nov 14 09:22:24 2008 +0000
yum: further fixes to repository signing
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 6c6db3d..ffc17f0 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1905,7 +1905,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.error(ERROR_REPO_NOT_FOUND, 'repo %s not found' % repoid)
def install_signature(self, sigtype, key_id, package):
- self._check_init()
+ self._check_init(repo_setup=False)
self.yumbase.conf.cache = 0 # Allow new files
self.allow_cancel(True)
self.percentage(None)
@@ -1916,11 +1916,11 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
if repo:
try:
self.yumbase.repos.doSetup(thisrepo=repoid)
- self.yumbase.getKeyForRepo(repo, callback= lambda x: True)
+ self.yumbase.getKeyForRepo(repo, callback = lambda x: True)
except yum.Errors.YumBaseError, e:
self.error(ERROR_UNKNOWN, "cannot install signature: %s" % str(e))
- except:
- self.error(ERROR_GPG_FAILURE, "Error importing GPG Key for the %s repository" % repo)
+ except Exception, e:
+ self.error(ERROR_GPG_FAILURE, "Error importing GPG Key for the %s repository: %s" % (repo, str(e)))
else: # This is a package signature
pkg, inst = self._findPackage(package)
if pkg:
@@ -1932,7 +1932,7 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
self.error(ERROR_GPG_FAILURE, "Error importing GPG Key for %s" % pkg)
- def _check_init(self, lazy_cache=False):
+ def _check_init(self, lazy_cache=False, repo_setup=True):
'''Just does the caching tweaks'''
if lazy_cache:
for repo in self.yumbase.repos.listEnabled():
@@ -1944,10 +1944,11 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
repo.mdpolicy = "group:primary"
# make sure repos are set up
- try:
- self.yumbase.repos.doSetup()
- except yum.Errors.RepoError, e:
- self.error(ERROR_NO_CACHE, _to_unicode(e))
+ if repo_setup:
+ try:
+ self.yumbase.repos.doSetup()
+ except yum.Errors.RepoError, e:
+ self.error(ERROR_NO_CACHE, _to_unicode(e))
def _refresh_yum_cache(self):
self.status(STATUS_REFRESH_CACHE)
commit 861765ad8ac0f60f83735ad5894acdf9f132948e
Author: Stefan Haas <shaas at suse.de>
Date: Fri Nov 14 09:52:22 2008 +0100
zypp: fixed restart-flag handling
diff --git a/backends/zypp/pk-backend-zypp.cpp b/backends/zypp/pk-backend-zypp.cpp
index fb5dc85..26297d4 100644
--- a/backends/zypp/pk-backend-zypp.cpp
+++ b/backends/zypp/pk-backend-zypp.cpp
@@ -895,13 +895,7 @@ backend_get_update_detail_thread (PkBackend *backend)
if (zypp::isKind<zypp::Patch>(solvable)) {
zypp::Patch::constPtr patch = zypp::asKind<zypp::Patch>(item);
- if (patch->rebootSuggested ()) {
- restart = PK_RESTART_ENUM_SYSTEM;
- } else if (patch->restartSuggested ()) {
- restart = PK_RESTART_ENUM_SESSION;
- } else if (patch->reloginSuggested()) {
- restart = PK_RESTART_ENUM_SESSION;
- }
+ zypp_get_restart (restart, patch);
// Building links like "http://www.distro-update.org/page?moo;Bugfix release for kernel;http://www.test.de/bgz;test domain"
for (zypp::Patch::ReferenceIterator it = patch->referencesBegin (); it != patch->referencesEnd (); it ++) {
@@ -975,7 +969,7 @@ backend_update_system_thread (PkBackend *backend)
PkRestartEnum restart = PK_RESTART_ENUM_NONE;
//get all Patches for Update
- std::set<zypp::PoolItem> *candidates = zypp_get_patches (restart);
+ std::set<zypp::PoolItem> *candidates = zypp_get_patches ();
//std::set<zypp::PoolItem> *candidates2 = new std::set<zypp::PoolItem> ();
if (_updating_self) {
@@ -1002,6 +996,7 @@ backend_update_system_thread (PkBackend *backend)
// set the status of the update to ToBeInstalled
zypp::ResStatus &status = ci->status ();
status.setToBeInstalled (zypp::ResStatus::USER);
+ zypp_get_restart (restart, zypp::asKind<zypp::Patch>(ci->resolvable ()));
}
if (!zypp_perform_execution (backend, UPDATE, FALSE)) {
@@ -1608,7 +1603,7 @@ backend_update_packages_thread (PkBackend *backend)
package_ids = pk_backend_get_strv (backend, "package_ids");
PkRestartEnum restart = PK_RESTART_ENUM_NONE;
- zypp_get_patches (restart); // make shure _updating_self is set
+ zypp_get_patches (); // make sure _updating_self is set
if (_updating_self) {
egg_debug ("updating self and setting restart");
@@ -1619,6 +1614,8 @@ backend_update_packages_thread (PkBackend *backend)
zypp::sat::Solvable solvable = zypp_get_package_by_id (package_ids[i]);
zypp::PoolItem item = zypp::ResPool::instance ().find (solvable);
item.status ().setToBeInstalled (zypp::ResStatus::USER);
+ zypp::Patch::constPtr patch = zypp::asKind<zypp::Patch>(item.resolvable ());
+ zypp_get_restart (restart, patch);
}
retval = zypp_perform_execution (backend, UPDATE, FALSE);
diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp
index 40c9b93..6e7839e 100644
--- a/backends/zypp/zypp-utils.cpp
+++ b/backends/zypp/zypp-utils.cpp
@@ -658,7 +658,7 @@ zypp_get_updates (std::string repo)
}
std::set<zypp::PoolItem> *
-zypp_get_patches (PkRestartEnum restart)
+zypp_get_patches ()
{
std::set<zypp::PoolItem> *patches = new std::set<zypp::PoolItem> ();
_updating_self = FALSE;
@@ -680,16 +680,6 @@ zypp_get_patches (PkRestartEnum restart)
else
patches->insert ((*it)->candidateObj ());
- // set the restart flag if a restart is needed
- if (restart != PK_RESTART_ENUM_SYSTEM && (patch->reloginSuggested () ||
- patch->restartSuggested () ||
- patch->rebootSuggested ())) {
- if(patch->reloginSuggested () || patch->restartSuggested ())
- restart = PK_RESTART_ENUM_SESSION;
- if(patch->rebootSuggested ())
- restart = PK_RESTART_ENUM_SYSTEM;
- }
-
// check if the patch updates libzypp or packageKit and show only these
if (!_updating_self && patch->restartSuggested ()) {
_updating_self = TRUE;
@@ -705,6 +695,21 @@ zypp_get_patches (PkRestartEnum restart)
}
gboolean
+zypp_get_restart (PkRestartEnum &restart, zypp::Patch::constPtr patch)
+{
+ // set the restart flag if a restart is needed
+ if (restart != PK_RESTART_ENUM_SYSTEM && (patch->reloginSuggested () ||
+ patch->restartSuggested () ||
+ patch->rebootSuggested ())) {
+ if(patch->reloginSuggested () || patch->restartSuggested ())
+ restart = PK_RESTART_ENUM_SESSION;
+ if(patch->rebootSuggested ())
+ restart = PK_RESTART_ENUM_SYSTEM;
+ }
+ return true;
+}
+
+gboolean
zypp_perform_execution (PkBackend *backend, PerformType type, gboolean force)
{
try {
diff --git a/backends/zypp/zypp-utils.h b/backends/zypp/zypp-utils.h
index d60b44b..c79a07d 100644
--- a/backends/zypp/zypp-utils.h
+++ b/backends/zypp/zypp-utils.h
@@ -173,7 +173,12 @@ std::set<zypp::PoolItem> * zypp_get_updates (std::string repo);
/**
* Returns a set of all patches the could be installed
*/
-std::set<zypp::PoolItem> * zypp_get_patches (PkRestartEnum restart = PK_RESTART_ENUM_NONE);
+std::set<zypp::PoolItem> * zypp_get_patches ();
+
+/**
+ * Sets the restart flag of a patch
+ */
+gboolean zypp_get_restart (PkRestartEnum &restart, zypp::Patch::constPtr patch);
/**
* perform changes in pool to the system
commit 278d3709b8cb444b115dc5e479dfc38e5cd26a9f
Author: Stefan Haas <shaas at suse.de>
Date: Fri Nov 14 09:48:44 2008 +0100
zypp: zypp >= 5.20.0 is needed now
diff --git a/configure.ac b/configure.ac
index 72749d9..dc0da51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -544,7 +544,7 @@ if test x$enable_poldek = xyes; then
fi
if test x$enable_zypp = xyes; then
- PKG_CHECK_MODULES(ZYPP, libzypp >= 5.4.0)
+ PKG_CHECK_MODULES(ZYPP, libzypp >= 5.20.0)
AC_SUBST(ZYPP_CFLAGS)
AC_SUBST(ZYPP_LIBS)
fi
More information about the PackageKit-commit
mailing list