[zypp-commit] r5804 - in /trunk/zypper/src: zypper-command.cc zypper-command.h zypper-misc.cc zypper-misc.h zypper.cc
Author: jkupec
Date: Wed Jun 20 10:04:23 2007
New Revision: 5804
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5804&view=rev
Log:
list-updates and patch-check command reviewed
Modified:
trunk/zypper/src/zypper-command.cc
trunk/zypper/src/zypper-command.h
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-misc.h
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper-command.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.cc?rev=5804&r1=5803&r2=5804&view=diff
==============================================================================
--- trunk/zypper/src/zypper-command.cc (original)
+++ trunk/zypper/src/zypper-command.cc Wed Jun 20 10:04:23 2007
@@ -20,12 +20,15 @@
const ZypperCommand ZypperCommand::REMOVE_REPO(ZypperCommand::REMOVE_REPO_e);
const ZypperCommand ZypperCommand::LIST_REPOS(ZypperCommand::LIST_REPOS_e);
const ZypperCommand ZypperCommand::REFRESH(ZypperCommand::REFRESH_e);
-const ZypperCommand ZypperCommand::SEARCH(ZypperCommand::SEARCH_e);
+
const ZypperCommand ZypperCommand::INSTALL(ZypperCommand::INSTALL_e);
const ZypperCommand ZypperCommand::REMOVE(ZypperCommand::REMOVE_e);
const ZypperCommand ZypperCommand::UPDATE(ZypperCommand::UPDATE_e);
+const ZypperCommand ZypperCommand::SEARCH(ZypperCommand::SEARCH_e);
const ZypperCommand ZypperCommand::INFO(ZypperCommand::INFO_e);
+const ZypperCommand ZypperCommand::LIST_UPDATES(ZypperCommand::LIST_UPDATES_e);
+const ZypperCommand ZypperCommand::PATCH_CHECK(ZypperCommand::PATCH_CHECK_e);
const ZypperCommand ZypperCommand::HELP(ZypperCommand::HELP_e);
const ZypperCommand ZypperCommand::SHELL(ZypperCommand::SHELL_e);
@@ -50,12 +53,15 @@
_table["rmrepo"] = _table["service-delete"] = _table["sd"] = ZypperCommand::REMOVE_REPO_e;
_table["listrepos"] = _table["service-list"] = _table["sl"] = ZypperCommand::LIST_REPOS_e;
_table["refresh"] = _table["ref"] = ZypperCommand::REFRESH_e;
- _table["search"] = _table["se"] = ZypperCommand::SEARCH_e;
+
_table["install"] = _table["in"] = ZypperCommand::INSTALL_e;
_table["remove"] = _table["rm"] = ZypperCommand::REMOVE_e;
_table["update"] = _table["up"] = ZypperCommand::UPDATE_e;
+ _table["search"] = _table["se"] = ZypperCommand::SEARCH_e;
_table["info"] = _table["if"] = ZypperCommand::INFO_e;
+ _table["list-updates"] = _table["lu"] = ZypperCommand::LIST_UPDATES_e;
+ _table["patch-check"] = _table["pchk"] = ZypperCommand::PATCH_CHECK_e;
_table["help"] = ZypperCommand::HELP_e;
_table["shell"] = _table["sh"] = ZypperCommand::SHELL_e;
Modified: trunk/zypper/src/zypper-command.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-command.h?rev=5804&r1=5803&r2=5804&view=diff
==============================================================================
--- trunk/zypper/src/zypper-command.h (original)
+++ trunk/zypper/src/zypper-command.h Wed Jun 20 10:04:23 2007
@@ -22,6 +22,7 @@
static const ZypperCommand SEARCH;
static const ZypperCommand INFO;
static const ZypperCommand LIST_UPDATES;
+ static const ZypperCommand PATCH_CHECK;
static const ZypperCommand HELP;
static const ZypperCommand SHELL;
@@ -50,7 +51,8 @@
SEARCH_e,
INFO_e,
LIST_UPDATES_e,
-
+ PATCH_CHECK_e,
+
HELP_e,
SHELL_e,
SHELL_QUIT_e,
@@ -58,7 +60,7 @@
NONE_e,
- RUG_PATCH_INFO_e
+ RUG_PATCH_INFO_e,
};
ZypperCommand(Command command) : _command(command) {}
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=5804&r1=5803&r2=5804&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Wed Jun 20 10:04:23 2007
@@ -469,10 +469,9 @@
return God->resolver()->resolvePool();
}
-//! are there applicable patches?
void patch_check ()
{
- cerr_vv << "patch check" << endl;
+ cout_vv << "patch check" << endl;
gData.patches_count = gData.security_patches_count = 0;
ResPool::byKind_iterator
@@ -491,7 +490,9 @@
}
}
- cout << gData.patches_count << _(" patches needed") << ". ( " << gData.security_patches_count << _(" security patches") << " )" << std::endl;
+ cout << format(_("%d patches needed (%d security patches)"))
+ % gData.patches_count % gData.security_patches_count
+ << std::endl;
}
string string_status (const ResStatus& rs)
@@ -562,6 +563,8 @@
cout << tbl;
}
+// ----------------------------------------------------------------------------
+
void list_patch_updates ()
{
Table tbl;
@@ -611,9 +614,15 @@
}
tbl.sort (1); // Name
- cout << tbl;
+
+ if (tbl.empty())
+ cout << _("No updates found.") << endl;
+ else
+ cout << tbl;
}
+// ----------------------------------------------------------------------------
+
// collect items, select best edition.
class LookForArchUpdate : public zypp::resfilter::PoolItemFilterFunctor
{
@@ -633,6 +642,8 @@
}
};
+// ----------------------------------------------------------------------------
+
// Find best (according to edition) uninstalled item
// with same kind/name/arch as item.
// Similar to zypp::solver::detail::Helper::findUpdateItem
@@ -659,6 +670,8 @@
return info.uninstalled;
}
+// ----------------------------------------------------------------------------
+
typedef set
participants (1)
-
jkupec@svn.opensuse.org