Mailinglist Archive: zypp-commit (171 mails)

< Previous Next >
[zypp-commit] <zypper> master : Show also repo and arch in products table.
  • From: Ján Kupec <jkupec@xxxxxxx>
  • Date: Sun, 7 Jun 2009 15:55:09 +0200
  • Message-id: <E1MDcA6-0007BW-2D@xxxxxxxxxxxxxxxx>
ref: refs/heads/master
commit ae78f1a7d705f08e806ed47b47c5e3f926310c19
Author: Ján Kupec <jkupec@xxxxxxx>
Date: Sun Jun 7 15:55:09 2009 +0200

Show also repo and arch in products table.
---
src/search.cc | 69 +++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 48 insertions(+), 21 deletions(-)

diff --git a/src/search.cc b/src/search.cc
index 89649d9..f634c90 100644
--- a/src/search.cc
+++ b/src/search.cc
@@ -535,6 +535,8 @@ static void list_product_table(Zypper & zypper)

// translators: S for installed Status
th << _("S");
+ if (!zypper.globalOpts().is_rug_compatible)
+ th << _("Repository");
th << _("Name");
th << _("Version");
if (zypper.globalOpts().is_rug_compatible)
@@ -542,37 +544,62 @@ static void list_product_table(Zypper & zypper)
th << _("Category");
else
th << _("Is Base");
+ th << _("Arch");
tbl << th;

bool installed_only = zypper.cOpts().count("installed-only");
bool notinst_only = zypper.cOpts().count("uninstalled-only");

- ResPool::byKind_iterator
- it = God->pool().byKindBegin(ResKind::product),
- e = God->pool().byKindEnd(ResKind::product);
+ ResPoolProxy::const_iterator
+ it = God->pool().proxy().byKindBegin(ResKind::product),
+ e = God->pool().proxy().byKindEnd(ResKind::product);
for (; it != e; ++it )
{
- Product::constPtr product = asKind<Product>(it->resolvable());
+ ui::Selectable::constPtr s = *it;

- TableRow tr;
- if (it->status().isInstalled())
- {
- if (notinst_only)
- continue;
- tr << "i";
- }
- else
+ // get the first installed object
+ PoolItem installed;
+ if (!s->installedEmpty())
+ installed = s->installedObj();
+
+ // show available objects
+ for_(it, s->availableBegin(), s->availableEnd())
{
- if (installed_only)
- continue;
- tr << "";
+ Product::constPtr product = asKind<Product>(it->resolvable());
+ TableRow tr;
+ zypp::PoolItem pi = *it;
+ string repo = product->repoInfo().name();
+
+ if (installed)
+ {
+ if (notinst_only)
+ continue;
+ if (equalNVRA(*installed.resolvable(), *pi.resolvable()))
+ {
+ tr << "i";
+ // this is needed, other isTargetDistribution would not return
+ // true for the installed base product
+ product = asKind<Product>(installed);
+ }
+ else
+ tr << "v";
+ }
+ else
+ {
+ if (installed_only)
+ continue;
+ tr << "";
+ }
+ if (!zypper.globalOpts().is_rug_compatible)
+ tr << repo;
+ tr << product->name () << product->edition().asString();
+ if (zypper.globalOpts().is_rug_compatible)
+ tr << (product->isTargetDistribution() ? "base" : "");
+ else
+ tr << (product->isTargetDistribution() ? _("Yes") : _("No"));
+ tr << product->arch().asString();
+ tbl << tr;
}
- tr << product->name () << product->edition().asString();
- if (zypper.globalOpts().is_rug_compatible)
- tr << (product->isTargetDistribution() ? "base" : "");
- else
- tr << (product->isTargetDistribution() ? _("Yes") : _("No"));
- tbl << tr;
}
tbl.sort(1); // Name

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

< Previous Next >
This Thread
  • No further messages