Hello community,
here is the log from the commit of package zypper
checked in at Wed Sep 10 14:10:09 CEST 2008.
--------
--- zypper/zypper.changes 2008-09-02 11:46:07.000000000 +0200
+++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2008-09-10 13:43:34.000000000 +0200
@@ -1,0 +2,28 @@
+Tue Sep 9 16:29:03 CEST 2008 - jkupec@suse.cz
+
+- adapted to new installed status handling of products
+- r10974
+- 0.12.3
+
+-------------------------------------------------------------------
+Mon Sep 8 20:33:31 CEST 2008 - jkupec@suse.cz
+
+- targetos command added
+- versioncmp command added
+- r10963
+
+-------------------------------------------------------------------
+Mon Sep 8 19:40:07 CEST 2008 - jkupec@suse.cz
+
+- Product Flavor added to product-info output
+- r10961
+
+-------------------------------------------------------------------
+Mon Sep 8 19:36:42 CEST 2008 - jkupec@suse.cz
+
+- XML output added for 'ls'
+- fixed to add only repositories matching the target distribution
+ when refreshing services
+- r10920, r10935, r10941
+
+-------------------------------------------------------------------
Old:
----
zypper-0.12.2.tar.bz2
New:
----
zypper-0.12.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ zypper.spec ++++++
--- /var/tmp/diff_new_pack.k13391/_old 2008-09-10 14:08:44.000000000 +0200
+++ /var/tmp/diff_new_pack.k13391/_new 2008-09-10 14:08:44.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package zypper (Version 0.12.2)
+# spec file for package zypper (Version 0.12.3)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,7 +19,7 @@
Name: zypper
-BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel >= 5.7.0 readline-devel >= 5.1
+BuildRequires: boost-devel >= 1.33.1 gettext-devel >= 0.15 libzypp-devel >= 5.8.0 readline-devel >= 5.1
BuildRequires: cmake >= 2.4.6 gcc-c++ >= 4.1
Requires: procps
Recommends: logrotate cron
@@ -29,9 +29,9 @@
AutoReqProv: on
PreReq: permissions
Summary: Command Line Package Management Using Libzypp
-Version: 0.12.2
+Version: 0.12.3
Release: 1
-Source: zypper-0.12.2.tar.bz2
+Source: zypper-0.12.3.tar.bz2
Prefix: /usr
Url: http://en.opensuse.org/Zypper
Provides: y2pmsh
@@ -113,6 +113,22 @@
# it from being erased by rpm -e
%ghost %config(noreplace) %{_var}/log/zypper.log
%changelog
+* Tue Sep 09 2008 jkupec@suse.cz
+- adapted to new installed status handling of products
+- r10974
+- 0.12.3
+* Mon Sep 08 2008 jkupec@suse.cz
+- targetos command added
+- versioncmp command added
+- r10963
+* Mon Sep 08 2008 jkupec@suse.cz
+- Product Flavor added to product-info output
+- r10961
+* Mon Sep 08 2008 jkupec@suse.cz
+- XML output added for 'ls'
+- fixed to add only repositories matching the target distribution
+ when refreshing services
+- r10920, r10935, r10941
* Tue Aug 19 2008 dmacvicar@suse.de
- confirm unsupported packages in SLE
(fate#305057)
++++++ zypper-0.12.2.tar.bz2 -> zypper-0.12.3.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/doc/zypper.8 new/zypper-0.12.3/doc/zypper.8
--- old/zypper-0.12.2/doc/zypper.8 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/doc/zypper.8 2008-09-10 13:43:33.000000000 +0200
@@ -1,4 +1,4 @@
-.TH "zypper" "8" "0.12.1" "zypper" "System Tools"
+.TH "zypper" "8" "0.12.3" "zypper" "System Tools"
.SH "SYNTAX"
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
@@ -732,7 +732,6 @@
TODO
-
.SS Package Locks Management
Package locks server the purpose of preventing changes to the set of installed
packages on the system. The locks are stored in form of a \fIquery\fR in
@@ -767,6 +766,26 @@
.I \-r, \-\-repo
Restrict the lock to the specified repository.
+
+.SS Other Commands
+
+.TP
+.B versioncmp (vcmp) <version1> <version2>
+Compare the versions supplied as arguments and tell whether version1 is older
+or newer than version2 or the two version strings match.
+
+The default output is in human-friendly form. If \fB--terse\fR global option
+is used, the result is an integer number, negative/positive if version1 is
+older/newer than version2, zero if they match.
+
+.TP
+.B targetos (tos)
+Shows the ID string of the target operating system. The string has a form of
+\fBdistroname-arch\fR. The string is determined by libzypp, the \fBdistroname\fR
+is read from <current-rootdir>/etc/products.d/baseproduct and the architecture
+is determined from uname and CPU flags.
+
+
.SH "GLOBAL OPTIONS"
.TP
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/package/zypper.changes new/zypper-0.12.3/package/zypper.changes
--- old/zypper-0.12.2/package/zypper.changes 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/package/zypper.changes 2008-09-10 13:43:33.000000000 +0200
@@ -1,4 +1,32 @@
-------------------------------------------------------------------
+Tue Sep 9 16:29:03 CEST 2008 - jkupec@suse.cz
+
+- adapted to new installed status handling of products
+- r10974
+- 0.12.3
+
+-------------------------------------------------------------------
+Mon Sep 8 20:33:31 CEST 2008 - jkupec@suse.cz
+
+- targetos command added
+- versioncmp command added
+- r10963
+
+-------------------------------------------------------------------
+Mon Sep 8 19:40:07 CEST 2008 - jkupec@suse.cz
+
+- Product Flavor added to product-info output
+- r10961
+
+-------------------------------------------------------------------
+Mon Sep 8 19:36:42 CEST 2008 - jkupec@suse.cz
+
+- XML output added for 'ls'
+- fixed to add only repositories matching the target distribution
+ when refreshing services
+- r10920, r10935, r10941
+
+-------------------------------------------------------------------
Tue Aug 19 16:39:32 CEST 2008 - dmacvicar@suse.de
- confirm unsupported packages in SLE
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/Command.cc new/zypper-0.12.3/src/Command.cc
--- old/zypper-0.12.2/src/Command.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/Command.cc 2008-09-10 13:43:33.000000000 +0200
@@ -60,6 +60,9 @@
const ZypperCommand ZypperCommand::LIST_LOCKS(ZypperCommand::LIST_LOCKS_e);
const ZypperCommand ZypperCommand::CLEAN_LOCKS(ZypperCommand::CLEAN_LOCKS_e);
+const ZypperCommand ZypperCommand::TARGET_OS(ZypperCommand::TARGET_OS_e);
+const ZypperCommand ZypperCommand::VERSION_CMP(ZypperCommand::VERSION_CMP_e);
+
const ZypperCommand ZypperCommand::HELP(ZypperCommand::HELP_e);
const ZypperCommand ZypperCommand::SHELL(ZypperCommand::SHELL_e);
const ZypperCommand ZypperCommand::SHELL_QUIT(ZypperCommand::SHELL_QUIT_e);
@@ -127,6 +130,9 @@
_table["locks"] = _table["ll"] = _table["lock-list"] = ZypperCommand::LIST_LOCKS_e;
_table["cleanlocks"] = _table["cl"] = _table["lock-clean"] = ZypperCommand::CLEAN_LOCKS_e;
+ _table["targetos"] = _table["tos"] = ZypperCommand::TARGET_OS_e;
+ _table["versioncmp"] = _table["vcmp"] = ZypperCommand::VERSION_CMP_e;
+
_table["help"] = _table["?"] = ZypperCommand::HELP_e;
_table["shell"] = _table["sh"] = ZypperCommand::SHELL_e;
_table["quit"] = _table["exit"] = _table["\004"] = ZypperCommand::SHELL_QUIT_e;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/Command.h new/zypper-0.12.3/src/Command.h
--- old/zypper-0.12.2/src/Command.h 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/Command.h 2008-09-10 13:43:33.000000000 +0200
@@ -54,6 +54,10 @@
static const ZypperCommand REMOVE_LOCK;
static const ZypperCommand LIST_LOCKS;
static const ZypperCommand CLEAN_LOCKS;
+
+ // utils/others
+ static const ZypperCommand TARGET_OS;
+ static const ZypperCommand VERSION_CMP;
static const ZypperCommand HELP;
static const ZypperCommand SHELL;
@@ -118,6 +122,9 @@
LIST_LOCKS_e,
CLEAN_LOCKS_e,
+ TARGET_OS_e,
+ VERSION_CMP_e,
+
HELP_e,
SHELL_e,
SHELL_QUIT_e,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/info.cc new/zypper-0.12.3/src/info.cc
--- old/zypper-0.12.2/src/info.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/info.cc 2008-09-10 13:43:33.000000000 +0200
@@ -21,6 +21,7 @@
#include "misc.h"
#include "Table.h"
#include "utils/richtext.h"
+#include "utils/misc.h" // for kind_to_string_localized and string_patch_status
#include "search.h"
#include "info.h"
@@ -200,7 +201,7 @@
const PoolItem & pool_item = s.theObj();
printNVA(pool_item.resolvable());
- cout << _("Status: ") << string_ppp_status(pool_item) << endl;
+ cout << _("Status: ") << string_patch_status(pool_item) << endl;
Patch::constPtr patch = asKind<Patch>(pool_item.resolvable());
cout << _("Category: ") << patch->category() << endl;
@@ -333,11 +334,10 @@
printNVA(pool_item.resolvable());
Product::constPtr product = asKind<Product>(pool_item.resolvable());
- cout << _("Category: ") << product->type() << endl;
- cout << _("Installed: ") << (pool_item.status().isSatisfied() ? "Yes" : "No") << endl;
- cout << _("Short Name: ") << product->shortName() << endl;
- cout << _("Long Name: ") << product->longName() << endl;
-
+ cout << _("Category") << ": " << product->type() << endl;
+ cout << _("Flavor") << ": " << product->flavor() << endl;
+ cout << _("Installed") << ": " << (pool_item.status().isInstalled() ? "Yes" : "No") << endl;
+ cout << _("Short Name") << ": " << product->shortName() << endl;
printSummaryDesc(pool_item.resolvable());
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/install.cc new/zypper-0.12.3/src/install.cc
--- old/zypper-0.12.2/src/install.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/install.cc 2008-09-10 13:43:33.000000000 +0200
@@ -246,7 +246,7 @@
PoolItem theone = s.theObj();
//! \todo handle multiple installed case
bool theoneinstalled; // is the One installed ?
- if (s.kind() == ResKind::package)
+ if (!traits::isPseudoInstalled(s.kind()))
theoneinstalled = !s.installedEmpty() && theone &&
equalNVRA(*s.installedObj().resolvable(), *theone.resolvable());
else if (s.kind() == ResKind::patch)
@@ -260,7 +260,7 @@
installed = theone;
else
{
- if (s.kind() == ResKind::package)
+ if (!traits::isPseudoInstalled(s.kind()))
{
anyinstalled = s.hasInstalledObj();
installed = s.installedObj();
@@ -531,10 +531,10 @@
string provider;
for_(solvit, q.poolItemBegin(), q.poolItemEnd())
{
- if (solvit->resolvable()->isKind(ResKind::package))
- installed = solvit->status().isInstalled();
- else
+ if (traits::isPseudoInstalled(solvit->resolvable()->kind()))
installed = solvit->isSatisfied();
+ else
+ installed = solvit->status().isInstalled();
if (installed)
{
provider = solvit->resolvable()->name();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/main.cc new/zypper-0.12.3/src/main.cc
--- old/zypper-0.12.2/src/main.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/main.cc 2008-09-10 13:43:33.000000000 +0200
@@ -41,7 +41,7 @@
else*/
{
// translators: this will show up if you press ctrl+c twice outside of zypper shell
- cerr << _("OK OK! Exiting immediately...") << endl;
+ cerr << endl << _("OK OK! Exiting immediately...") << endl;
zypper.cleanup();
exit(ZYPPER_EXIT_ON_SIGNAL);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/repos.cc new/zypper-0.12.3/src/repos.cc
--- old/zypper-0.12.2/src/repos.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/repos.cc 2008-09-10 13:43:33.000000000 +0200
@@ -750,27 +750,7 @@
cout << "<repo-list>" << endl;
for (std::list<RepoInfo>::const_iterator it = repos.begin();
it != repos.end(); ++it)
- {
- string tmpstr;
- cout << "alias()) << "\"";
- cout << " name=\"" << xml_encode(it->name()) << "\"";
- cout << " type=\"" << it->type().asString() << "\"";
- cout << " enabled=\"" << it->enabled() << "\"";
- cout << " autorefresh=\"" << it->autorefresh() << "\"";
- cout << " gpgcheck=\"" << it->gpgCheck() << "\"";
- if (!(tmpstr = it->gpgKeyUrl().asString()).empty())
- cout << " gpgkey=\"" << xml_encode(tmpstr) << "\"";
- if (!(tmpstr = it->mirrorListUrl().asString()).empty())
- cout << " mirrorlist=\"" << xml_encode(tmpstr) << "\"";
- cout << ">" << endl;
-
- for (RepoInfo::urls_const_iterator urlit = it->baseUrlsBegin();
- urlit != it->baseUrlsEnd(); ++urlit)
- cout << "<url>" << xml_encode(urlit->asString()) << "</url>" << endl;
-
- cout << "</repo>" << endl;
- }
+ it->dumpAsXMLOn(cout);
cout << "</repo-list>" << endl;
}
@@ -781,7 +761,7 @@
for (std::list<RepoInfo>::const_iterator it = repos.begin();
it != repos.end(); ++it)
{
- it->dumpRepoOn(out);
+ it->dumpAsIniOn(out);
out << endl;
}
}
@@ -1787,7 +1767,8 @@
// RIS type services
for_(it, manager.serviceBegin(), manager.serviceEnd())
{
- ServiceInfo_Ptr s = new ServiceInfo(*it);
+ ServiceInfo_Ptr s;
+ s.reset(new ServiceInfo(*it));
services.insert(services.end(), s);
}
@@ -1796,7 +1777,8 @@
{
if (!it->service().empty())
continue;
- RepoInfo_Ptr r = new RepoInfo(*it);
+ RepoInfo_Ptr r;
+ r.reset(new RepoInfo(*it));
services.insert(services.end(), r);
}
}
@@ -2046,6 +2028,20 @@
}
}
+// ----------------------------------------------------------------------------
+
+static void print_xml_service_list(Zypper & zypper,
+ const list & services)
+{
+ cout << "<service-list>" << endl;
+
+ for (list::const_iterator it = services.begin();
+ it != services.end(); ++it)
+ (*it)->dumpAsXMLOn(cout);
+
+ cout << "</service-list>" << endl;
+}
+
// ---------------------------------------------------------------------------
void list_services(Zypper & zypper)
@@ -2086,8 +2082,8 @@
}
}
// print repo list as xml
- //else if (zypper.out().type() == Out::TYPE_XML)
- //print_xml_repo_list(zypper, repos);
+ else if (zypper.out().type() == Out::TYPE_XML)
+ print_xml_service_list(zypper, services);
// print repo list the rug's way
//else if (zypper.globalOpts().is_rug_compatible)
//print_rug_service_list(repos);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/search.cc new/zypper-0.12.3/src/search.cc
--- old/zypper-0.12.2/src/search.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/search.cc 2008-09-10 13:43:33.000000000 +0200
@@ -1,17 +1,19 @@
#include <iostream>
+#include "zypp/ZYpp.h" // for zypp::ResPool::instance()
+
#include "zypp/base/Logger.h"
#include "zypp/base/Algorithm.h"
#include "zypp/Patch.h"
#include "zypp/Pattern.h"
#include "zypp/Product.h"
+#include "zypp/sat/Solvable.h"
+#include "zypp/PoolItem.h"
#include "zypp/ResPoolProxy.h"
-#include "Zypper.h"
#include "main.h"
-#include "Table.h"
-
+#include "utils/misc.h" // for kind_to_string_localized and string_patch_status
#include "search.h"
@@ -21,6 +23,280 @@
extern ZYpp::Ptr God;
+FillSearchTableSolvable::FillSearchTableSolvable(
+ Table & table, zypp::TriBool inst_notinst)
+ : _table( &table )
+ , _gopts(Zypper::instance()->globalOpts())
+ , _inst_notinst(inst_notinst)
+{
+ TableHeader header;
+
+ if (_gopts.is_rug_compatible)
+ {
+ header
+ // translators: S for 'installed Status'
+ << _("S")
+ // translators: catalog (rug's word for repository) (header)
+ << _("Catalog")
+ // translators: Bundle is a term used in rug. See rug for how to translate it.
+ << _("Bundle")
+ // translators: name (general header)
+ << _("Name")
+ // translators: package version (header)
+ << _("Version")
+ // translators: package architecture (header)
+ << _("Arch");
+ }
+ else
+ {
+ header
+ // translators: S for 'installed Status'
+ << _("S")
+ // translators: name (general header)
+ << _("Name")
+ // translators: type (general header)
+ << _("Type")
+ // translators: package version (header)
+ << _("Version")
+ // translators: package architecture (header)
+ << _("Arch")
+ // translators: package's repository (header)
+ << _("Repository");
+ }
+
+ *_table << header;
+}
+
+bool FillSearchTableSolvable::operator()(const zypp::ui::Selectable::constPtr & s) const
+{
+ static bool show_installed;
+ show_installed = true;
+
+ // show available objects
+ for_(it, s->availableBegin(), s->availableEnd())
+ {
+ TableRow row;
+ zypp::PoolItem pi = *it;
+
+ // installed status
+
+ // patters
+ if (zypp::traits::isPseudoInstalled(s->kind()))
+ {
+ // patches/patterns are installed if satisfied
+ if (pi->kind() != zypp::ResKind::srcpackage && pi.isSatisfied())
+ {
+ // show only not installed
+ if (_inst_notinst == false)
+ continue;
+ row << "i";
+ }
+ else
+ {
+ // show only installed
+ if (_inst_notinst == true)
+ continue;
+ row << "";
+ }
+ }
+ else // packages/products
+ {
+ if (s->installedEmpty())
+ {
+ // show only installed
+ if (_inst_notinst == true)
+ continue;
+ row << "";
+ }
+ else
+ {
+ static bool installed;
+ installed = false;
+ for_(instit, s->installedBegin(), s->installedEnd())
+ {
+ if (equalNVRA(*instit->resolvable(), *pi.resolvable()))
+ {
+ installed = true;
+ show_installed = false;
+ break;
+ }
+ }
+
+ if (installed)
+ {
+ // show only not installed
+ if (_inst_notinst == false)
+ continue;
+ row << "i";
+ }
+ else
+ {
+ // show only installed
+ if (_inst_notinst == true)
+ continue;
+ row << "v";
+ }
+ }
+ }
+
+ if (_gopts.is_rug_compatible)
+ {
+ row
+ << pi->repository().info().name()
+ << ""
+ << pi->name()
+ << pi->edition().asString()
+ << pi->arch().asString();
+ }
+ else
+ {
+ row
+ << pi->name()
+ << kind_to_string_localized(pi->kind(), 1)
+ << pi->edition().asString()
+ << pi->arch().asString()
+ << pi->repository().info().name();
+ }
+
+ *_table << row;
+ }
+
+ if (_inst_notinst == false)
+ return true;
+
+ // show installed objects only if there is no counterpart in repos
+ if (show_installed || s->availableEmpty())
+ {
+ for_(it, s->installedBegin(), s->installedEnd())
+ {
+ TableRow row;
+ zypp::PoolItem pi = *it;
+ row << "i";
+ if (_gopts.is_rug_compatible)
+ {
+ row
+ << _("System Packages")
+ // TODO what about rug's Bundle?
+ << ""
+ << pi->name()
+ << pi->edition().asString()
+ << pi->arch().asString();
+ }
+ else
+ {
+ row
+ << pi->name()
+ << kind_to_string_localized(pi->kind(), 1)
+ << pi->edition().asString()
+ << pi->arch().asString()
+ << (string("(") + _("System Packages") + ")");
+ }
+
+ *_table << row;pi->repository().info().name();
+ }
+ }
+
+ //! \todo mainain an internal plaindir repo named "Local Packages"
+ // for plain rpms (as rug does). ?
+
+ return true;
+}
+
+
+FillSearchTableSelectable::FillSearchTableSelectable(
+ Table & table, zypp::TriBool installed_only)
+ : _table( &table )
+ , _gopts(Zypper::instance()->globalOpts())
+ , inst_notinst(installed_only)
+{
+ TableHeader header;
+ // translators: S for installed Status
+ header << _("S");
+ header << _("Name");
+ // translators: package summary (header)
+ header << _("Summary");
+ header << _("Type");
+ *_table << header;
+}
+
+bool FillSearchTableSelectable::operator()(const zypp::ui::Selectable::constPtr & s) const
+{
+ TableRow row;
+
+ bool installed;
+ if (zypp::traits::isPseudoInstalled(s->kind()))
+ installed = s->theObj().isSatisfied();
+ else
+ installed = !s->installedEmpty();
+
+ if (s->kind() != zypp::ResKind::srcpackage && installed)
+ {
+ // not-installed only
+ if (inst_notinst == false)
+ return true;
+ row << "i";
+ }
+ else
+ {
+ // installed only
+ if (inst_notinst == true)
+ return true;
+ row << "";
+ }
+ row << s->name();
+ row << s->theObj()->summary();
+ row << kind_to_string_localized(s->kind(), 1);
+ *_table << row;
+ return true;
+}
+
+
+FillPatchesTable::FillPatchesTable( Table & table, zypp::TriBool inst_notinst )
+ : _table( &table )
+ , _gopts(Zypper::instance()->globalOpts())
+ , _inst_notinst(inst_notinst)
+{
+ TableHeader header;
+
+ header
+ // translators: catalog (rug's word for repository) (header)
+ << _("Catalog")
+ << _("Name")
+ << _("Version")
+ // translators: patch category (recommended, security)
+ << _("Category")
+ // translators: patch status (installed, uninstalled, needed)
+ << _("Status");
+
+ *_table << header;
+}
+
+bool FillPatchesTable::operator()(const zypp::PoolItem & pi) const
+{
+ // only not installed
+ if (pi.isSatisfied() && _inst_notinst == false)
+ return true;
+ // only installed
+ else if (!pi.isSatisfied() && _inst_notinst == true)
+ return true;
+
+ TableRow row;
+
+ zypp::Patch::constPtr patch = zypp::asKindzypp::Patch(pi.resolvable());
+
+ row
+ << pi->repository().info().name()
+ << pi->name()
+ << pi->edition().asString()
+ << patch->category()
+ << string_patch_status(pi);
+
+ *_table << row;
+
+ return true;
+}
+
+
string selectable_search_repo_str(const ui::Selectable & s)
{
string repostr;
@@ -40,25 +316,6 @@
return repostr;
}
-string string_ppp_status(const PoolItem & pi)
-{
- // make sure this will not happen
- if (pi.isUndetermined())
- return _("Unknown");
-
- if (pi.isRelevant())
- {
- if (pi.isSatisfied())
- return _("Installed"); //! \todo make this "Applied" instead?
- if (pi.isBroken())
- return _("Needed");
- // can this ever happen?
- return "";
- }
-
- return _("Not Applicable"); //! \todo make this "Not Needed" after 11.0
-}
-
static string string_weak_status(const ResStatus & rs)
{
@@ -69,6 +326,7 @@
return "";
}
+
void list_patches(Zypper & zypper)
{
MIL
@@ -92,6 +350,7 @@
cout << tbl;
}
+
void list_patterns(Zypper & zypper)
{
MIL << "Going to list patterns." << std::endl;
@@ -232,7 +491,7 @@
Product::constPtr product = asKind<Product>(it->resolvable());
TableRow tr;
- if (it->isSatisfied())
+ if (it->status().isInstalled())
{
if (notinst_only)
continue;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/search.h new/zypper-0.12.3/src/search.h
--- old/zypper-0.12.2/src/search.h 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/search.h 2008-09-10 13:43:33.000000000 +0200
@@ -8,18 +8,12 @@
#ifndef ZYPPERSEARCH_H_
#define ZYPPERSEARCH_H_
-#include "zypp/ZYpp.h" // for zypp::ResPool::instance()
-#include "zypp/sat/Solvable.h"
-#include "zypp/PoolItem.h"
-#include "zypp/Patch.h"
#include "zypp/TriBool.h"
#include "Zypper.h"
-#include "utils/misc.h" // for kind_to_string_localized
#include "Table.h"
std::string selectable_search_repo_str(const zypp::ui::Selectable & s);
-std::string string_ppp_status(const zypp::PoolItem & pi);
/**
* Functor for filling search output table in rug style.
@@ -31,167 +25,11 @@
const GlobalOptions & _gopts;
zypp::TriBool _inst_notinst;
- FillSearchTableSolvable( Table & table, zypp::TriBool inst_notinst = zypp::indeterminate )
- : _table( &table )
- , _gopts(Zypper::instance()->globalOpts())
- , _inst_notinst(inst_notinst)
- {
- TableHeader header;
-
- if (_gopts.is_rug_compatible)
- {
- header
- // translators: S for 'installed Status'
- << _("S")
- // translators: catalog (rug's word for repository) (header)
- << _("Catalog")
- // translators: Bundle is a term used in rug. See rug for how to translate it.
- << _("Bundle")
- // translators: name (general header)
- << _("Name")
- // translators: package version (header)
- << _("Version")
- // translators: package architecture (header)
- << _("Arch");
- }
- else
- {
- header
- // translators: S for 'installed Status'
- << _("S")
- // translators: name (general header)
- << _("Name")
- // translators: type (general header)
- << _("Type")
- // translators: package version (header)
- << _("Version")
- // translators: package architecture (header)
- << _("Arch")
- // translators: package's repository (header)
- << _("Repository");
- }
-
- *_table << header;
- }
-
- bool operator()(const zypp::ui::Selectable::constPtr & s) const
- {
- static bool show_installed;
- show_installed = true;
-
- // show available objects
- for_(it, s->availableBegin(), s->availableEnd())
- {
- TableRow row;
-
- zypp::PoolItem pi = *it;
- if (!s->installedEmpty())
- {
- static bool installed;
- installed = false;
- for_(instit, s->installedBegin(), s->installedEnd())
- {
- if (equalNVRA(*instit->resolvable(), *pi.resolvable()))
- {
- installed = true;
- show_installed = false;
- break;
- }
- }
-
- if (installed)
- {
- // show only not installed
- if (_inst_notinst == false)
- continue;
- row << "i";
- }
- else
- {
- // show only installed
- if (_inst_notinst == true)
- continue;
- row << "v";
- }
- }
- // patches/patterns/products are installed if satisfied
- else if (pi->kind() != zypp::ResKind::srcpackage && pi.isSatisfied())
- {
- // show only not installed
- if (_inst_notinst == false)
- continue;
- row << "i";
- }
- else
- {
- // show only installed
- if (_inst_notinst == true)
- continue;
- row << "";
- }
-
- if (_gopts.is_rug_compatible)
- {
- row
- << pi->repository().info().name()
- << ""
- << pi->name()
- << pi->edition().asString()
- << pi->arch().asString();
- }
- else
- {
- row
- << pi->name()
- << kind_to_string_localized(pi->kind(), 1)
- << pi->edition().asString()
- << pi->arch().asString()
- << pi->repository().info().name();
- }
-
- *_table << row;
- }
-
- if (_inst_notinst == false)
- return true;
-
- // show installed objects only if there is no counterpart in repos
- if (show_installed || s->availableEmpty())
- {
- for_(it, s->installedBegin(), s->installedEnd())
- {
- TableRow row;
- zypp::PoolItem pi = *it;
- row << "i";
- if (_gopts.is_rug_compatible)
- {
- row
- << _("System Packages")
- // TODO what about rug's Bundle?
- << ""
- << pi->name()
- << pi->edition().asString()
- << pi->arch().asString();
- }
- else
- {
- row
- << pi->name()
- << kind_to_string_localized(pi->kind(), 1)
- << pi->edition().asString()
- << pi->arch().asString()
- << (string("(") + _("System Packages") + ")");
- }
-
- *_table << row;pi->repository().info().name();
- }
- }
-
- //! \todo mainain an internal plaindir repo named "Local Packages"
- // for plain rpms (as rug does). ?
-
- return true;
- }
+ FillSearchTableSolvable(
+ Table & table,
+ zypp::TriBool inst_notinst = zypp::indeterminate );
+
+ bool operator()(const zypp::ui::Selectable::constPtr & s) const;
};
struct FillSearchTableSelectable
@@ -201,46 +39,10 @@
const GlobalOptions & _gopts;
zypp::TriBool inst_notinst;
- FillSearchTableSelectable( Table & table, zypp::TriBool installed_only = zypp::indeterminate )
- : _table( &table )
- , _gopts(Zypper::instance()->globalOpts())
- , inst_notinst(installed_only)
- {
- TableHeader header;
- // translators: S for installed Status
- header << _("S");
- header << _("Name");
- // translators: package summary (header)
- header << _("Summary");
- header << _("Type");
- *_table << header;
- }
-
- bool operator()(const zypp::ui::Selectable::constPtr & s) const
- {
- TableRow row;
-
- if (s->kind() != zypp::ResKind::srcpackage &&
- (!s->installedEmpty() || s->theObj().isSatisfied()))
- {
- // not-installed only
- if (inst_notinst == false)
- return true;
- row << "i";
- }
- else
- {
- // installed only
- if (inst_notinst == true)
- return true;
- row << "";
- }
- row << s->name();
- row << s->theObj()->summary();
- row << kind_to_string_localized(s->kind(), 1);
- *_table << row;
- return true;
- }
+ FillSearchTableSelectable(
+ Table & table, zypp::TriBool installed_only = zypp::indeterminate);
+
+ bool operator()(const zypp::ui::Selectable::constPtr & s) const;
};
@@ -254,50 +56,10 @@
const GlobalOptions & _gopts;
zypp::TriBool _inst_notinst;
- FillPatchesTable( Table & table, zypp::TriBool inst_notinst = zypp::indeterminate )
- : _table( &table )
- , _gopts(Zypper::instance()->globalOpts())
- , _inst_notinst(inst_notinst)
- {
- TableHeader header;
-
- header
- // translators: catalog (rug's word for repository) (header)
- << _("Catalog")
- << _("Name")
- << _("Version")
- // translators: patch category (recommended, security)
- << _("Category")
- // translators: patch status (installed, uninstalled, needed)
- << _("Status");
-
- *_table << header;
- }
-
- bool operator()(const zypp::PoolItem & pi) const
- {
- // only not installed
- if (pi.isSatisfied() && _inst_notinst == false)
- return true;
- // only installed
- else if (!pi.isSatisfied() && _inst_notinst == true)
- return true;
-
- TableRow row;
-
- zypp::Patch::constPtr patch = zypp::asKindzypp::Patch(pi.resolvable());
-
- row
- << pi->repository().info().name()
- << pi->name()
- << pi->edition().asString()
- << patch->category()
- << string_ppp_status(pi);
-
- *_table << row;
+ FillPatchesTable( Table & table,
+ zypp::TriBool inst_notinst = zypp::indeterminate );
- return true;
- }
+ bool operator()(const zypp::PoolItem & pi) const;
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/utils/misc.cc new/zypper-0.12.3/src/utils/misc.cc
--- old/zypper-0.12.2/src/utils/misc.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/utils/misc.cc 2008-09-10 13:43:33.000000000 +0200
@@ -11,14 +11,15 @@
#include
#include
-#include "zypp/Pathname.h"
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/media/MediaManager.h"
#include "zypp/parser/xml/XmlEscape.h"
-#include "zypp/Capability.h"
+
+#include "zypp/PoolItem.h"
#include "main.h"
+#include "Zypper.h"
#include "utils/misc.h"
@@ -78,7 +79,7 @@
// ----------------------------------------------------------------------------
-string kind_to_string_localized(const Resolvable::Kind & kind, unsigned long count)
+string kind_to_string_localized(const zypp::ResKind & kind, unsigned long count)
{
if (kind == ResKind::package)
return _PL("package", "packages", count);
@@ -96,6 +97,27 @@
// ----------------------------------------------------------------------------
+string string_patch_status(const PoolItem & pi)
+{
+ // make sure this will not happen
+ if (pi.isUndetermined())
+ return _("Unknown");
+
+ if (pi.isRelevant())
+ {
+ if (pi.isSatisfied())
+ return _("Installed"); //! \todo make this "Applied" instead?
+ if (pi.isBroken())
+ return _("Needed");
+ // can this ever happen?
+ return "";
+ }
+
+ return _("Not Applicable"); //! \todo make this "Not Needed" after 11.0
+}
+
+// ----------------------------------------------------------------------------
+
bool equalNVRA(const Resolvable & lhs, const Resolvable & rhs)
{
if (lhs.name() != rhs.name())
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/utils/misc.h new/zypper-0.12.3/src/utils/misc.h
--- old/zypper-0.12.2/src/utils/misc.h 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/utils/misc.h 2008-09-10 13:43:33.000000000 +0200
@@ -10,14 +10,23 @@
#include <ostream>
#include <string>
+#include <set>
#include "zypp/Url.h"
-#include "zypp/Resolvable.h"
#include "zypp/Pathname.h"
+
+#include "zypp/Capability.h"
+#include "zypp/ResKind.h"
#include "zypp/RepoInfo.h"
-#include "zypp/ServiceInfo.h"
-#include "Zypper.h"
+class Zypper;
+
+namespace zypp
+{
+ class PoolItem;
+ class Resolvable;
+}
+
typedef std::setzypp::ResKind ResKindSet;
@@ -26,7 +35,9 @@
bool is_changeable_media(const zypp::Url & url);
std::string kind_to_string_localized(
- const zypp::Resolvable::Kind & kind, unsigned long count);
+ const zypp::ResKind & kind, unsigned long count);
+
+std::string string_patch_status(const zypp::PoolItem & pi);
bool equalNVRA(const zypp::Resolvable & lhs, const zypp::Resolvable & rhs);
@@ -74,19 +85,16 @@
class RepoInfoAliasComparator
{
public: bool operator()(const zypp::RepoInfo & a, const zypp::RepoInfo & b)
- {
- return a.alias() < b.alias();
- }
+ { return a.alias() < b.alias(); }
};
+
// comparator for Service set
class ServiceAliasComparator
{
public: bool operator()(const zypp::repo::RepoInfoBase_Ptr & a,
const zypp::repo::RepoInfoBase_Ptr & b)
- {
- return a->alias() < b->alias();
- }
+ { return a->alias() < b->alias(); }
};
@@ -95,7 +103,7 @@
*/
inline bool isRepoFile(const std::string& name)
{
- return name.find(".repo") != name.npos ;
+ return name.find(".repo") != name.npos;
}
#endif /*ZYPPER_UTILS_H*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/src/Zypper.cc new/zypper-0.12.3/src/Zypper.cc
--- old/zypper-0.12.2/src/Zypper.cc 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/src/Zypper.cc 2008-09-10 13:43:33.000000000 +0200
@@ -234,6 +234,12 @@
"\tremovelock, rl\t\tRemove a package lock.\n"
"\tlocks, ll\t\tList current package locks.\n"
);
+
+ static string help_other_commands = _("\tOther Commands:\n"
+ "\tversioncmp, vcmp\tCompare two version strings.\n"
+ "\ttargetos, tos\t\tPrint the target operating system ID string.\n"
+ );
+
static string help_usage = _(
" Usage:\n"
"\tzypper [--global-options] <command> [--command-options] [arguments]\n"
@@ -249,6 +255,7 @@
zypper.out().info(help_package_commands, Out::QUIET);
zypper.out().info(help_query_commands, Out::QUIET);
zypper.out().info(help_lock_commands, Out::QUIET);
+ zypper.out().info(help_other_commands, Out::QUIET);
print_command_help_hint(zypper);
}
@@ -390,7 +397,7 @@
{
_gopts.machine_readable = true;
_gopts.no_abbrev = true;
- out().error("--terse is not implemented, does nothing");
+ //out().error("--terse is not implemented, does nothing");
}
// ======== other global options ========
@@ -1841,6 +1848,42 @@
break;
}
+ case ZypperCommand::TARGET_OS_e:
+ {
+ static struct option options[] =
+ {
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ specific_options = options;
+ _command_help = _(
+ "targetos (tos)\n"
+ "\n"
+ "Show the ID string of the target Operating System.\n"
+ "\n"
+ "This command has no additional options.\n"
+ );
+ break;
+ }
+
+ case ZypperCommand::VERSION_CMP_e:
+ {
+ static struct option options[] =
+ {
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ specific_options = options;
+ _command_help = _(
+ "versioncmp (vcmp) <version1> <version2>\n"
+ "\n"
+ "Compare the versions supplied as arguments.\n"
+ "\n"
+ "This command has no additional options.\n"
+ );
+ break;
+ }
+
case ZypperCommand::SHELL_QUIT_e:
{
static struct option quit_options[] = {
@@ -2081,6 +2124,11 @@
return;
}
+ // needed to be able to retrieve target distribution
+ init_target(*this);
+ this->_gopts.rm_options.servicesTargetDistro =
+ God->target()->targetDistribution();
+
refresh_services(*this);
break;
@@ -2523,6 +2571,10 @@
setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);
return;
}
+ // needed to be able to retrieve target distribution
+ init_target(*this);
+ this->_gopts.rm_options.servicesTargetDistro =
+ God->target()->targetDistribution();
refresh_services(*this);
}
refresh_repos(*this);
@@ -2890,7 +2942,7 @@
}
if (t.empty())
- out().info(_("No resolvables found."), Out::QUIET);
+ out().info(_("No packages found."), Out::QUIET);
else
{
cout << endl; //! \todo out().separator()?
@@ -3417,6 +3469,76 @@
break;
}
+
+ // ----------------------------(utils/others)--------------------------------
+
+ case ZypperCommand::TARGET_OS_e:
+ {
+ if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
+
+ // needed to be able to retrieve the target distribution
+ init_target(*this);
+
+ out().info(God->target()->targetDistribution());
+
+ break;
+ }
+
+ case ZypperCommand::VERSION_CMP_e:
+ {
+ if (runningHelp()) { out().info(_command_help, Out::QUIET); return; }
+
+ if (_arguments.size() < 2)
+ {
+ report_required_arg_missing(out(), _command_help);
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+ else if (_arguments.size() > 2)
+ {
+ report_too_many_arguments(_command_help);
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+
+ Edition lhs(_arguments[0]);
+ Edition rhs(_arguments[1]);
+
+ if (lhs.empty())
+ {
+ out().info(str::form(
+ _("'%s' is not a valid version number."), _arguments[0].c_str()));
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+
+ if (rhs.empty())
+ {
+ out().info(str::form(
+ _("'%s' is not a valid version number."), _arguments[1].c_str()));
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+
+ int result = lhs.match(rhs);
+
+ // be terse when talking to machines
+ if (_gopts.machine_readable)
+ {
+ out().info(str::numstring(result));
+ break;
+ }
+
+ // tell a human
+ if (result == 0)
+ out().info(str::form(_("%s matches %s"), lhs.asString().c_str(), rhs.asString().c_str()));
+ else if (result > 0)
+ out().info(str::form(_("%s is newer than %s"), lhs.asString().c_str(), rhs.asString().c_str()));
+ else
+ out().info(str::form(_("%s is older than %s"), lhs.asString().c_str(), rhs.asString().c_str()));
+
+ break;
+ }
// -----------------------------( shell )------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/test/test-cases/refresh-services new/zypper-0.12.3/test/test-cases/refresh-services
--- old/zypper-0.12.2/test/test-cases/refresh-services 1970-01-01 01:00:00.000000000 +0100
+++ new/zypper-0.12.3/test/test-cases/refresh-services 2008-09-10 13:43:33.000000000 +0200
@@ -0,0 +1,8 @@
+- when refreshing a service
+ - if url is empty
+ -
+
+- zypper refs
+ Refresh all services (meaning also repos which don't belong to any service),
+ don't refresh services' repos.
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/VERSION.cmake new/zypper-0.12.3/VERSION.cmake
--- old/zypper-0.12.2/VERSION.cmake 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/VERSION.cmake 2008-09-10 13:43:33.000000000 +0200
@@ -18,6 +18,20 @@
# then increment VERSION_PATCH.
#
+#=======
+# - Update version according to your changes,
+# but based on 'LAST RELEASED:' below. I.e
+# there's no need to increase VERSION_PATCH
+# if it already differs from 'LAST RELEASED:'.
+#
+# - MOST IMPORTANT:
+# Before you submitt to autobuild, remember the
+# new version in 'LAST RELEASED:', and add a
+# note in the changes file.
+#
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "12")
-SET(VERSION_PATCH "2")
+SET(VERSION_PATCH "3")
+
+# LAST RELEASED: 0.12.3
+#=======
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.12.2/zypper.spec.cmake new/zypper-0.12.3/zypper.spec.cmake
--- old/zypper-0.12.2/zypper.spec.cmake 2008-09-02 11:36:46.000000000 +0200
+++ new/zypper-0.12.3/zypper.spec.cmake 2008-09-10 13:43:33.000000000 +0200
@@ -11,7 +11,7 @@
# norootforbuild
Name: @PACKAGE@
-BuildRequires: libzypp-devel >= 5.7.0 boost-devel >= 1.33.1 gettext-devel >= 0.15 readline-devel >= 5.1
+BuildRequires: libzypp-devel >= 5.8.0 boost-devel >= 1.33.1 gettext-devel >= 0.15 readline-devel >= 5.1
BuildRequires: gcc-c++ >= 4.1 cmake >= 2.4.6
Requires: procps
Recommends: logrotate cron
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org