Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11625 - in /trunk/zypper/src: solve-commit.cc update.cc
  • From: jkupec@xxxxxxxxxxxxxxxx
  • Date: Fri, 07 Nov 2008 15:39:56 -0000
  • Message-id: <20081107153957.125B333A7C@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Fri Nov 7 16:39:56 2008
New Revision: 11625

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11625&view=rev
Log:
- fixed listing updates in xml (bnc #441485)

Modified:
trunk/zypper/src/solve-commit.cc
trunk/zypper/src/update.cc

Modified: trunk/zypper/src/solve-commit.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/solve-commit.cc?rev=11625&r1=11624&r2=11625&view=diff
==============================================================================
--- trunk/zypper/src/solve-commit.cc (original)
+++ trunk/zypper/src/solve-commit.cc Fri Nov 7 16:39:56 2008
@@ -962,7 +962,7 @@
bool commit_done = false;
do
{
- if (zypper.runtimeData().solve_before_commit) // doUpdate was called, no
need for solving
+ if (zypper.runtimeData().solve_before_commit) // e.g. doUpdate unsets this
flag, no need for solving
{
MIL << "solving..." << endl;


Modified: trunk/zypper/src/update.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/update.cc?rev=11625&r1=11624&r2=11625&view=diff
==============================================================================
--- trunk/zypper/src/update.cc (original)
+++ trunk/zypper/src/update.cc Fri Nov 7 16:39:56 2008
@@ -133,6 +133,7 @@
}
}

+ //! \todo change this from appletinfo to something general, define in
xmlout.rnc
if (patchcount == 0)
cout << "<appletinfo status=\"no-update-repositories\"/>" << endl;

@@ -141,7 +142,7 @@

// ----------------------------------------------------------------------------

-static void list_patch_updates(Zypper & zypper)
+static bool list_patch_updates(Zypper & zypper)
{
Table tbl;
Table pm_tbl; // only those that affect packagemanager (restartSuggested()),
they have priority
@@ -183,8 +184,10 @@

// those that affect the package manager go first
// (TODO: user option for this?)
+ bool affectpm = false;
if (!pm_tbl.empty ())
{
+ affectpm = true;
if (!tbl.empty ())
zypper.out().warning(
_("These are only the updates affecting the updater itself.\n"
@@ -198,6 +201,8 @@
zypper.out().info(_("No updates found."));
else
cout << tbl;
+
+ return affectpm;
}

// ----------------------------------------------------------------------------
@@ -350,38 +355,48 @@
cout << "<update-status version=\"0.6\">" << endl;
cout << "<update-list>" << endl;
}
- bool not_affects_pkgmgr = false;
+
+ // whether some of the listed patches affects package management itself
+ // false indicates that we are not checking for patches at all
+ // (no 'zypper lp' or 'zypper lu -t patch ...'), or there are no patches
+ // affecting the package management stack
+ bool affects_pkgmgr = false;

unsigned kind_size = kinds.size();
ResKindSet localkinds = kinds;
ResKindSet::iterator it;

- // patch updates
+ // patch updates first
it = localkinds.find(ResKind::patch);
if(it != localkinds.end())
{
if (zypper.out().type() == Out::TYPE_XML)
- not_affects_pkgmgr = !xml_list_patches();
+ affects_pkgmgr = xml_list_patches();
else
{
zypper.out().info(i18n_kind_updates(*it), Out::QUIET, Out::TYPE_NORMAL);
zypper.out().info("", Out::QUIET, Out::TYPE_NORMAL); // visual separator
- list_patch_updates(zypper);
+ affects_pkgmgr = list_patch_updates(zypper);
}
localkinds.erase(it);
}

- // other kinds
- //! \todo list package updates according to Resolver::doUpdate()
+ // list other kinds (only if there are no _patches_ affecting the package
manager)
+
+ // XML output here
if (zypper.out().type() == Out::TYPE_XML)
{
- if (not_affects_pkgmgr)
+ if (!affects_pkgmgr)
xml_list_updates(localkinds);
cout << "</update-list>" << endl;
cout << "</update-status>" << endl;
return;
}

+ if (affects_pkgmgr)
+ return;
+
+ // normal output here
for (it = localkinds.begin(); it != localkinds.end(); ++it)
{
Table tbl;
@@ -395,17 +410,18 @@
unsigned int name_col;
// TranslatorExplanation S stands for Status
th << _("S");
- if (!hide_repo) {
+ if (!hide_repo)
th << (zypper.globalOpts().is_rug_compatible ? _("Catalog") :
_("Repository"));
- }
- if (zypper.globalOpts().is_rug_compatible) {
+
+ if (zypper.globalOpts().is_rug_compatible)
th << _("Bundle");
- }
+
name_col = th.cols();
th << _("Name");
- if (!best_effort) { // best_effort does not know version or arch
yet
+ // best_effort does not know version or arch yet
+ if (!best_effort)
th << _("Version") << _("Arch");
- }
+
tbl << th;

unsigned int cols = th.cols();

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages