Author: jkupec
Date: Mon Sep 29 12:08:06 2008
New Revision: 11197
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11197&view=rev
Log:
- show in 'lu' what will 'up' actually propose to install (bnc #395480)
- new --all/-a option for 'lu' to show the original raw list of
packages for which newer versions exist
Modified:
trunk/zypper/src/Zypper.cc
trunk/zypper/src/update.cc
Modified: trunk/zypper/src/Zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=11197&r1=11196&r2=11197&view=diff
==============================================================================
--- trunk/zypper/src/Zypper.cc (original)
+++ trunk/zypper/src/Zypper.cc Mon Sep 29 12:08:06 2008
@@ -1400,7 +1400,8 @@
// rug compatibility option, we have --repo
{"catalog", required_argument, 0, 'c'},
{"type", required_argument, 0, 't'},
- {"best-effort", no_argument, 0, 0 },
+ {"all", no_argument, 0, 'a'},
+ {"best-effort", no_argument, 0, 0 },
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
@@ -1413,13 +1414,16 @@
"List all available updates.\n"
"\n"
" Command options:\n"
- "-t, --type <type> Type of package (%s).\n"
- " Default: %s.\n"
- "-r, --repo List only updates from the specified repository.\n"
- " --best-effort Do a 'best effort' approach to update. Updates\n"
- " to a lower than the latest version are\n"
- " also acceptable.\n"
- ), "package, patch, pattern, product", "patch");
+ "-t, --type <type> Type of package (%s).\n"
+ " Default: %s.\n"
+ "-r, --repo List only updates from the specified repository.\n"
+ " --best-effort Do a 'best effort' approach to update. Updates\n"
+ " to a lower than the latest version are\n"
+ " also acceptable.\n"
+ "-a, --all List all packages for which newer versions are\n"
+ " available, regardless whether they are\n"
+ " installable or not.\n"
+ ), "package, patch, pattern, product", "package");
break;
}
Modified: trunk/zypper/src/update.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/update.cc?rev=11197&r1=11196&r2=11197&view=diff
==============================================================================
--- trunk/zypper/src/update.cc (original)
+++ trunk/zypper/src/update.cc Mon Sep 29 12:08:06 2008
@@ -261,10 +261,24 @@
find_updates( const ResKind & kind, Candidates & candidates )
{
const zypp::ResPool& pool = God->pool();
+ DBG << "Looking for update candidates of kind " << kind << endl;
+
+ // package updates
+ if (kind == ResKind::package && !Zypper::instance()->cOpts().count("all"))
+ {
+ God->resolver()->doUpdate();
+ ResPool::const_iterator
+ it = God->pool().begin(),
+ e = God->pool().end();
+ for (; it != e; ++it)
+ if (it->status().isToBeInstalled())
+ candidates.insert(*it);
+ return;
+ }
+
ResPool::byKind_iterator
it = pool.byKindBegin (kind),
e = pool.byKindEnd (kind);
- DBG << "Looking for update candidates of kind " << kind << endl;
for (; it != e; ++it)
{
if (it->status().isUninstalled())
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org