Switches to non-interactive mode. In this mode zypper doesn't ask user to type answers to various prompts, but uses default answers automatically.
.TP
.I \-\-no\-gpg\-checks
-Ignore gpg check failures and continue.
+Ignore GPG check failures and continue. If a GPG issue occurs when using this option zypper prints and logs a warning and automatically continues without interrupting the operation. Use this option with causion, as you can easily overlook security problems by using it.
.TP
.I \-R, \-\-root <dir>
Operates on a different root directory.
//template<typename Action>
//Action ...
int read_action_ari (int default_action) {
- // TranslatorExplanation don't translate letters in parentheses!!
+ // TranslatorExplanation don't translate letters in parentheses!! (yet)
cout << _("(A)bort, (R)etry, (I)gnore?") << " ";
// choose abort if no default has been specified
#include <string>
#include <zypp/Resolvable.h>
+#include "zypper.h"
+
/*
enum Error {
NO_ERROR,
void display_error (Error error, const std::string& reason) {
if (error != 0 /*NO_ERROR*/) {
static const char * error_s[] = {
- "", "Not found", "I/O error", "Invalid object"
+ // TranslatorExplanation These are reasons for various failures.
+ "", _("Not found"), _("I/O error"), _("Invalid object")
};
ostream& stm = std::cerr;
stm << error_s[error];
#include <iostream>
+#include <boost/format.hpp>
+
#include <zypp/ZYpp.h>
#include <zypp/base/Algorithm.h>
#include <zypp/Patch.h>
using namespace std;
using namespace zypp;
+using boost::format;
extern ZYpp::Ptr God;
extern Settings gSettings;
);
if (!installer.item) {
- cout << "\n" << kind.asString() << " " << *nameit << _(" not found.") << endl;
+ // TranslatorExplanation E.g. "package zypper not found."
+ cout << "\n" << format(_("%s %s not found.")) % kind.asString() % *nameit
+ << endl;
}
else {
// print info
- cout << endl << _("Information for ") << kind.asString() << " " << *nameit << ":\n\n";
+ // TranslatorExplanation E.g. "Information for package zypper:"
+ cout << endl << format(_("Information for %s %s:")) % kind.asString() % *nameit;
+
+ cout << endl << endl;
if (command == ZypperCommand::INFO)
printPkgInfo(installer.item,installed);
*
*/
void printPatchInfo(const PoolItem & pool_item, const PoolItem & ins_pool_item) {
- cout << "Name: " << pool_item.resolvable()->name() << endl;
- cout << "Version: " << pool_item.resolvable()->edition().asString() << endl;
- cout << "Arch: " << pool_item.resolvable()->arch().asString() << endl;
+ cout << _("Name: ") << pool_item.resolvable()->name() << endl;
+ cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
+ cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
- cout << "Status: "; // TODO debug
+ cout << _("Status: "); // TODO debug
bool i = ins_pool_item ? true : false;
if (pool_item.status().isUndetermined ())
- cout << (i ? "Installed": "Uninstalled");
+ cout << (i ? _("Installed"): _("Uninstalled"));
else if (pool_item.status().isEstablishedUneeded ())
- cout << (i ? "No Longer Applicable": "Not Applicable");
+ cout << (i ? _("No Longer Applicable"): _("Not Applicable"));
else if (pool_item.status().isEstablishedSatisfied ())
- cout << (i ? "Applied": "Not Needed");
+ cout << (i ? _("Applied"): _("Not Needed"));
else if (pool_item.status().isEstablishedIncomplete ())
- cout << (i ? "Broken": "Needed");
+ cout << (i ? _("Broken"): _("Needed"));
cout << endl;
Patch::constPtr patch = asKind<Patch>(pool_item.resolvable());
- cout << "Category: " << patch->category() << endl;
- cout << "Created On: " << patch->timestamp().asString() << endl;
- cout << "Reboot Required: " << (patch->reboot_needed() ? "Yes" : "No") << endl;
-
+ cout << _("Category: ") << patch->category() << endl;
+ cout << _("Created On: ") << patch->timestamp().asString() << endl;
+ cout << _("Reboot Required: ") << (patch->reboot_needed() ? _("Yes") : _("No")) << endl;
+
if (!gSettings.is_rug_compatible)
- cout << "Package Manager ";
- cout << "Restart Required: ";
- cout << (patch->affects_pkg_manager() ? "Yes" : "No") << endl;
-
- cout << "Interactive: " << (patch->interactive() ? "Yes" : "No") << endl;
- cout << "Summary: " << pool_item.resolvable()->summary() << endl;
- cout << "Description: " << pool_item.resolvable()->description() << endl;
+ cout << _("Package Manager Restart Required");
+ else
+ cout << _("Restart Required: ");
+ cout << (patch->affects_pkg_manager() ? _("Yes") : _("No")) << endl;
+
+ cout << _("Interactive: ") << (patch->interactive() ? _("Yes") : _("No")) << endl;
+ cout << _("Summary: ") << pool_item.resolvable()->summary() << endl;
+ cout << _("Description: ") << pool_item.resolvable()->description() << endl;
- cout << "Provides:" << endl;
+ cout << _("Provides:") << endl;
CapSet capSet = pool_item.resolvable()->dep(zypp::Dep::PROVIDES);
for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
cout << it->refers().asString() << ": " << it->asString() << endl;
}
- cout << endl << "Requires:" << endl;
+ cout << endl << _("Requires:") << endl;
capSet = pool_item.resolvable()->dep(zypp::Dep::REQUIRES);
for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it) {
cout << it->refers().asString() << ": " << it->asString() << endl;
ee = solutions.end (),
ii;
for (n = 1, ii = bb; ii != ee; ++n, ++ii) {
- stm << format (_(" Solution %s: ")) % n << (*ii)->description () << endl;
+ // TranslatorExplanation %d is the solution number
+ stm << format (_(" Solution %d: ")) % n << (*ii)->description () << endl;
det = (*ii)->details ();
if (!det.empty ())
stm << " " << det << endl;
Table tbl;
TableHeader th;
- th << _("Catalog") << _("Name") << _("Version") << _("Category") << _("Status");
+ th << (gSettings.is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+ << _("Name") << _("Version") << _("Category") << _("Status");
tbl << th;
ResPool::byKind_iterator
void xml_list_patches ()
{
- const zypp::ResPool& pool = God->pool();
+ const zypp::ResPool& pool = God->pool();
ResPool::byKind_iterator
it = pool.byKindBegin<Patch> (),
e = pool.byKindEnd<Patch> ();
for (; it != e; ++it )
{
ResObject::constPtr res = it->resolvable();
- if ( it->status().isNeeded() ) {
+ if ( it->status().isNeeded() )
+ {
Patch::constPtr patch = asKind<Patch>(res);
- cout << " <update ";
- cout << "name=\"" << res->name () << "\" " ;
- cout << "edition=\"" << res->edition ().asString() << "\" ";
- cout << "category=\"" << patch->category() << "\" ";
- cout << "pkgmanager=\"" << ((patch->affects_pkg_manager()) ? "true" : "false") << "\" ";
- cout << "restart=\"" << ((patch->reboot_needed()) ? "true" : "false") << "\" ";
- cout << "interactive=\"" << ((patch->interactive()) ? "true" : "false") << "\" ";
- cout << "resolvabletype=\"" << "patch" << "\" ";
- cout << ">" << endl;
- cout << " <summary>" << xml_escape(patch->summary()) << " </summary>" << endl;
- cout << " <description>" << xml_escape(patch->description()) << "</description>" << endl;
- cout << " <license>" << xml_escape(patch->licenseToConfirm()) << "</license>" << endl;
-
-
-
- if ( patch->repository() != Repository::noRepository )
- {
- cout << " <source url=\"" << *(patch->repository().info().baseUrlsBegin());
- cout << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << endl;
- }
+ cout << " <update ";
+ cout << "name=\"" << res->name () << "\" " ;
+ cout << "edition=\"" << res->edition ().asString() << "\" ";
+ cout << "category=\"" << patch->category() << "\" ";
+ cout << "pkgmanager=\"" << ((patch->affects_pkg_manager()) ? "true" : "false") << "\" ";
+ cout << "restart=\"" << ((patch->reboot_needed()) ? "true" : "false") << "\" ";
+ cout << "interactive=\"" << ((patch->interactive()) ? "true" : "false") << "\" ";
+ cout << "resolvabletype=\"" << "patch" << "\" ";
+ cout << ">" << endl;
+ cout << " <summary>" << xml_escape(patch->summary()) << " </summary>" << endl;
+ cout << " <description>" << xml_escape(patch->description()) << "</description>" << endl;
+ cout << " <license>" << xml_escape(patch->licenseToConfirm()) << "</license>" << endl;
+
+
+ if ( patch->repository() != Repository::noRepository )
+ {
+ cout << " <source url=\"" << *(patch->repository().info().baseUrlsBegin());
+ cout << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << endl;
+ }
cout << " </update>" << endl;
}
TableHeader th;
unsigned cols;
- th << _("Catalog") << _("Name") << _("Version") << _("Category") << _("Status");
+ th << (gSettings.is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+ << _("Name") << _("Version") << _("Category") << _("Status");
cols = 5;
tbl << th;
pm_tbl << th;
// header
TableHeader th;
unsigned cols = 5;
- th << _("S") << _("Catalog"); // for translators: S stands for Status
+ // TranslatorExplanation S stands for Status
+ th << _("S");
+ th << (gSettings.is_rug_compatible ? _("Catalog: ") : _("Repository: "));
if (gSettings.is_rug_compatible) {
- th << "Bundle";
+ th << _("Bundle");
++cols;
}
th << _("Name") << _("Version") << _("Arch");
void xml_list_updates()
{
- Candidates candidates;
- find_updates (ResTraits<Package>::kind, candidates);
-
- Candidates::iterator cb = candidates.begin (), ce = candidates.end (), ci;
- for (ci = cb; ci != ce; ++ci) {
- ResObject::constPtr res = ci->resolvable();
-
- cout << " <update ";
- cout << "name=\"" << res->name () << "\" " ;
- cout << "edition=\"" << res->edition ().asString() << "\" ";
- cout << "resolvabletype=\"" << "package" << "\" ";
- cout << ">" << endl;
- cout << " <summary>" << xml_escape(res->summary()) << " </summary>" << endl;
- cout << " <description>" << xml_escape(res->description()) << "</description>" << endl;
- cout << " <license>" << xml_escape(res->licenseToConfirm()) << "</license>" << endl;
-
- if ( res->repository() != Repository::noRepository )
- {
- cout << " <source url=\"" << *(res->repository().info().baseUrlsBegin());
- cout << "\" alias=\"" << res->repository().info().alias() << "\"/>" << endl;
- }
-
- cout << " </update>" << endl;
+ Candidates candidates;
+ find_updates (ResTraits<Package>::kind, candidates);
+
+ Candidates::iterator cb = candidates.begin (), ce = candidates.end (), ci;
+ for (ci = cb; ci != ce; ++ci) {
+ ResObject::constPtr res = ci->resolvable();
+
+ cout << " <update ";
+ cout << "name=\"" << res->name () << "\" " ;
+ cout << "edition=\"" << res->edition ().asString() << "\" ";
+ cout << "resolvabletype=\"" << "package" << "\" ";
+ cout << ">" << endl;
+ cout << " <summary>" << xml_escape(res->summary()) << " </summary>" << endl;
+ cout << " <description>" << xml_escape(res->description()) << "</description>" << endl;
+ cout << " <license>" << xml_escape(res->licenseToConfirm()) << "</license>" << endl;
+
+ if ( res->repository() != Repository::noRepository )
+ {
+ cout << " <source url=\"" << *(res->repository().info().baseUrlsBegin());
+ cout << "\" alias=\"" << res->repository().info().alias() << "\"/>" << endl;
}
-}
+ cout << " </update>" << endl;
+ }
+}
// ----------------------------------------------------------------------------
cerr << level;
display_error (error, "");
if (level < RPM_NODEPS_FORCE) {
- cerr_v << "Will retry more aggressively" << endl;
+ cerr_v << _("Will retry more aggressively.") << endl;
return ABORT;
}
return (Action) read_action_ari (ABORT);
_table(&table), _icache(&icache) {
TableHeader header;
- header << "S" << "Catalog";
+ // TranslatorExplanation S as Status
+ header << _("S");
if (gSettings.is_rug_compatible)
- header << "Bundle";
+ header << _("Catalog");
else
- header << "Type";
+ header << _("Repository");
- header << "Name" << "Version" << "Arch";
+ if (gSettings.is_rug_compatible)
+ // TranslatorExplanation This is Bundle in as used in rug.
+ header << _("Bundle");
+ else
+ header << _("Type");
+
+ header << _("Name") << _("Version") << _("Arch");
*_table << header;
}
"\tinstall, in\t\tInstall packages or resolvables\n"
"\tremove, rm\t\tRemove packages or resolvables\n"
"\tsearch, se\t\tSearch for packages matching a pattern\n"
- "\trepos, lr\tList all defined repositories.\n"
+ "\trepos, lr\t\tList all defined repositories.\n"
"\taddrepo, ar\t\tAdd a new repository\n"
- "\tremoverepo, rr\tRemove specified repository\n"
- "\trenamerepo, nr\tRename specified repository\n"
- "\tmodifyrepo, mr\tModify specified repository\n"
+ "\tremoverepo, rr\t\tRemove specified repository\n"
+ "\trenamerepo, nr\t\tRename specified repository\n"
+ "\tmodifyrepo, mr\t\tModify specified repository\n"
"\trefresh, ref\t\tRefresh all repositories\n"
"\tpatch-check, pchk\tCheck for patches\n"
"\tpatches, pch\t\tList patches\n"
"\tlist-updates, lu\tList updates\n"
- "\txml-updates, xu\tList updates and patches in xml format\n"
+ "\txml-updates, xu\t\tList updates and patches in xml format\n"
"\tupdate, up\t\tUpdate installed resolvables with newer versions.\n"
"\tinfo, if\t\tShow full information for packages\n"
"\tpatch-info\t\tShow full information for patches\n"
"\t--terse, -t\t\tTerse output for machine consumption.\n"
"\t--table-style, -s\tTable style (integer).\n"
"\t--rug-compatible, -r\tTurn on rug compatibility.\n"
- "\t--non-interactive\tDon't ask anything, use default answers automatically. (under development).\n"
+ "\t--non-interactive\tDon't ask anything, use default answers automatically.\n"
+ "\t--no-gpg-checks\t\tIgnore GPG check failures and continue.\n"
"\t--root, -R <dir>\tOperate on a different root directory.\n");
;
if (gopts.count("verbose")) {
gSettings.verbosity += gopts["verbose"].size();
- cout << _("Verbosity ") << gSettings.verbosity << endl;
+ cout << format(_("Verbosity: %d")) % gSettings.verbosity << endl;
DBG << "Verbosity " << gSettings.verbosity << endl;
}
if (gopts.count("non-interactive")) {
gSettings.non_interactive = true;
+ cout_n << _("Entering non-interactive mode.");
MIL << "Entering non-interactive mode" << endl;
}
if (gopts.count("no-gpg-checks")) {
gSettings.no_gpg_checks = true;
+ cout_n << _("Entering no-gpg-checks mode.");
MIL << "Entering no-gpg-checks mode" << endl;
}
else if (gopts.count("version"))
cout << PACKAGE << endl;
else
- cerr << _("Try -h for help") << endl;
+ cerr << _("Try -h for help.") << endl;
}
//cerr_vv << "COMMAND: " << command << endl;
string specific_help;
string help_global_source_options = _(
- " Source options:\n"
- "\t--disable-system-sources, -D\t\tDo not read the system sources\n"
- "\t--source, -S\t\tRead additional source\n"
+ " Repository options:\n"
+ "\t--disable-repositories, -D\t\tDo not read data from defined repositories.\n"
+ "\t--repo <URI|.repo>\t\tRead additional repository\n"
);
+//! \todo preserve for rug comp. "\t--disable-system-sources, -D\t\tDo not read the system sources\n"
+//! \todo preserve for rug comp. "\t--source, -S\t\tRead additional source\n"
string help_global_target_options = _(" Target options:\n"
"\t--disable-system-resolvables, -T\t\tDo not read system installed resolvables\n"
WAR << "Ignoring --terse (provided only for rug compatibility)" << endl;
}
- if (gopts.count("disable-system-sources"))
+ if (gopts.count("disable-repositories") ||
+ gopts.count("disable-system-sources"))
{
- MIL << "System sources disabled" << endl;
+ MIL << "Repositories disabled, using target only." << endl;
+ cout_n <<
+ _("Repositories disabled, using database of installed packages only.")
+ << endl;
gSettings.disable_system_sources = true;
}
else
gSettings.additional_sources.push_back(url);
}
}
-
+
// here come commands that need the lock
try {
if (command == ZypperCommand::LIST_REPOS)
catch (Exception & excpt_r) {
ZYPP_CAUGHT (excpt_r);
ERR << "A ZYpp transaction is already in progress." << endl;
- cerr << _("A ZYpp transaction is already in progress.") << endl;
+ cerr << _("A ZYpp transaction is already in progress."
+ "This means, there is another application using libzypp library for"
+ "package management running. All such applications must be closed before"
+ "using this command.") << endl;
return ZYPPER_EXIT_ERR_ZYPP;
}
{
if (ghelp) { cout << specific_help << endl; return !ghelp; }
- cout_n << " \\\\\\\\\\\n \\\\\\\\\\\\\\__o\n__\\\\\\\\\\\\\\'/_" << endl;
+ // TranslatorExplanation this is a hedgehog, paint another animal, if you want
+ cout_n << _(" \\\\\\\\\\\n \\\\\\\\\\\\\\__o\n__\\\\\\\\\\\\\\'/_") << endl;
return ZYPPER_EXIT_OK;
}
string skind = copts.count("type")? copts["type"].front() : "package";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << _("Unknown resolvable type ") << skind << endl;
+ cerr << format(_("Unknown resolvable type: %s")) % skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
search.doSearch(FillTable(t, search.installedCache()));
if (t.empty())
- cout_n << "No packages found." << endl;
+ cout_n << _("No resolvables found.") << endl;
else {
if (copts.count("sort-by-catalog")) t.sort(1);
else t.sort(3); // sort by name
gSettings.is_rug_compatible? "package" : "patch";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << _("Unknown resolvable type ") << skind << endl;
+ cerr << format(_("Unknown resolvable type: %s")) % skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}
init_repos ();
cond_load_resolvables();
establish ();
-
- cout << "<?xml version='1.0'?>" << endl;
- cout << "<update-status version=\"0.4\">" << endl;
- cout << "<update-list>" << endl;
- xml_list_patches ();
- xml_list_updates ();
- cout << "</update-list>" << endl;
- cout << "</update-status>" << endl;
+
+ cout << "<?xml version='1.0'?>" << endl;
+ cout << "<update-status version=\"0.4\">" << endl;
+ cout << "<update-list>" << endl;
+ xml_list_patches ();
+ xml_list_updates ();
+ cout << "</update-list>" << endl;
+ cout << "</update-status>" << endl;
return ZYPPER_EXIT_OK;
- }
+ }
// -----------------------------( update )----------------------------------
gSettings.is_rug_compatible? "package" : "patch";
kind = string_to_kind (skind);
if (kind == ResObject::Kind ()) {
- cerr << _("Unknown resolvable type ") << skind << endl;
+ cerr << format(_("Unknown resolvable type: %s")) % skind << endl;
return ZYPPER_EXIT_ERR_INVALID_ARGS;
}