Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:12.2
PackageKit
0008-zypp-no-longer-use-the-old-and-deprecated-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0008-zypp-no-longer-use-the-old-and-deprecated-ZYppCommit.patch of Package PackageKit
From 8e010c204c348892a7dd5ee11cdb30a24ded3563 Mon Sep 17 00:00:00 2001 From: Michael Andres <ma@suse.de> Date: Fri, 6 Jul 2012 13:25:25 +0200 Subject: [PATCH 8/9] zypp: no longer use the old and deprecated ZYppCommitResult members (bnc#769764) --- backends/zypp/zypp-utils.cpp | 54 +++++++++++++----------------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/backends/zypp/zypp-utils.cpp b/backends/zypp/zypp-utils.cpp index 726b9da..55e13a3 100644 --- a/backends/zypp/zypp-utils.cpp +++ b/backends/zypp/zypp-utils.cpp @@ -956,50 +956,30 @@ zypp_perform_execution (PkBackend *backend, PerformType type, gboolean force) ZYppCommitResult result = zypp->commit (policy); - if(!result._errors.empty () || !result._remaining.empty () || !result._srcremaining.empty ()){ - - ZYppCommitResult::PoolItemList errors = result._errors; - gchar *emsg = NULL, *tmpmsg = NULL; - - for (ZYppCommitResult::PoolItemList::iterator it = errors.begin (); it != errors.end (); ++it){ - if (emsg == NULL) { - emsg = g_strdup ((*it)->name ().c_str ()); - } else { - tmpmsg = emsg; - emsg = g_strconcat (emsg, "\n", (*it)->name ().c_str (), NULL); - g_free (tmpmsg); - } - } - - ZYppCommitResult::PoolItemList remaining = result._remaining; - for (ZYppCommitResult::PoolItemList::iterator it = remaining.begin (); it != remaining.end (); ++it){ - if (emsg == NULL) { - emsg = g_strdup ((*it)->name ().c_str ()); - } else { - tmpmsg = emsg; - emsg = g_strconcat (emsg, "\n", (*it)->name ().c_str (), NULL); - g_free (tmpmsg); - } - } - - ZYppCommitResult::PoolItemList srcremaining = result._srcremaining; - for (ZYppCommitResult::PoolItemList::iterator it = srcremaining.begin (); it != srcremaining.end (); ++it){ - if (emsg == NULL) { - emsg = g_strdup ((*it)->name ().c_str ()); - } else { - tmpmsg = emsg; - emsg = g_strconcat (emsg, "\n", (*it)->name ().c_str (), NULL); - g_free (tmpmsg); + if ( ! result.allDone() ) + { + std::ostringstream todolist; + char separator = '\0'; + + // process all steps not DONE (ERROR and TODO) + const sat::Transaction & trans( result.transaction() ); + for_( it, trans.actionBegin(~sat::Transaction::STEP_DONE), trans.actionEnd() ) + { + if ( separator ) + todolist << separator << it->ident(); + else + { + todolist << it->ident(); + separator = '\n'; } } pk_backend_error_code (backend, PK_ERROR_ENUM_TRANSACTION_ERROR, "Transaction could not be completed.\n Theses packages could not be installed: %s", - emsg); + todolist.str().c_str()); - g_free (emsg); goto exit; - } + } ret = TRUE; } catch (const repo::RepoNotFoundException &ex) { -- 1.7.10.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor