Mailinglist Archive: zypp-commit (301 mails)
| < Previous | Next > |
[zypp-commit] r7479 - in /branches/SuSE-Linux-10_3-Branch/zypper: ./ doc/ package/ src/
- From: jkupec@xxxxxxxxxxxxxxxx
- Date: Wed, 10 Oct 2007 12:20:42 -0000
- Message-id: <20071010122042.BFD8A28EF7@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Wed Oct 10 14:20:42 2007
New Revision: 7479
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7479&view=rev
Log:
Merged revisions 7357-7372,7378-7427,7429-7449,7452-7457,7460,7462-7465,7472-7478 via svnmerge from
http://svn.opensuse.org/svn/zypp/trunk/zypper
........
r7389 | jkupec | 2007-09-26 16:22:38 +0200 (Wed, 26 Sep 2007) | 2 lines
- locks doc update
........
r7391 | jkupec | 2007-09-27 09:11:22 +0200 (Thu, 27 Sep 2007) | 2 lines
- --capability short option fixed
........
r7397 | mlandres | 2007-09-27 13:49:02 +0200 (Thu, 27 Sep 2007) | 1 line
fixed comparison between signed and unsigned int
........
r7398 | mlandres | 2007-09-27 13:53:27 +0200 (Thu, 27 Sep 2007) | 1 line
fixed control reaches end of non-void function
........
r7420 | mvidner | 2007-10-02 10:01:21 +0200 (Tue, 02 Oct 2007) | 2 lines
Fixed misalignment in localized tables (#328918).
........
r7449 | jkupec | 2007-10-06 12:16:31 +0200 (Sat, 06 Oct 2007) | 1 line
- don't check if to refresh cd/dvd repos even on user request unless forced
........
r7460 | jkupec | 2007-10-06 18:19:23 +0200 (Sat, 06 Oct 2007) | 2 lines
- correctly translate the command list (#327487)
........
r7465 | jkupec | 2007-10-08 14:34:03 +0200 (Mon, 08 Oct 2007) | 1 line
- missing -y option added to the update command (#331632)
........
Modified:
branches/SuSE-Linux-10_3-Branch/zypper/ (props changed)
branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake
branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8
branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc
Modified: branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake Wed Oct 10 14:20:42 2007
@@ -20,4 +20,4 @@
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "8")
-SET(VERSION_PATCH "24")
+SET(VERSION_PATCH "25")
Modified: branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8 (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8 Wed Oct 10 14:20:42 2007
@@ -1,4 +1,4 @@
-.TH "zypper" "8" "0.7.0" "zypper" "System Tools"
+.TH "zypper" "8" "0.8.25" "zypper" "System Tools"
.SH "SYNTAX"
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
@@ -79,7 +79,7 @@
.I \-f, \-\-force
Install even if the item is already installed (reinstall)
.TP
-.I \-n, \-\-capability
+.I \-C, \-\-capability
Select resolvables by capabilities.
.TP
.I \-l, \-\-auto\-agree\-with\-licenses
@@ -129,7 +129,7 @@
.I \-n, \-\-name
Select resolvables by their name (default).
.TP
-.I \-n, \-\-capability
+.I \-C, \-\-capability
Select resolvables by capabilities.
.TP
.I \-\-debug\-solver
@@ -383,8 +383,10 @@
.LP
The file
.B /etc/zypp/locks
-can contain a list of packages to be locked. These will not be updated
-or removed by the solver.
+can contain a list of packages to be locked. Installed packages which match one
+of the items in this list will not be updated or removed by the solver.
+Similarly, those matching packages which have not yet been installed, will not be
+considered for installation.
Empty lines and lines beginning with \fB#\fR are ignored. Each line is of the form
"\fIPATTERN \fR[ \fIOP EDITION \fR]"
Modified: branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes Wed Oct 10 14:20:42 2007
@@ -1,7 +1,13 @@
-------------------------------------------------------------------
-Wed Oct 10 13:48:33 CEST 2007 - jkupec@xxxxxxx
-
+Tue Sep 25 17:59:22 CEST 2007 - jkupec@xxxxxxx
+- missing -y option added to the update command (#331632)
+- Fixed misalignment in localized tables (#328918) (mvidner).
+- correctly translate the command list (#327487)
+- don't check if to refresh cd/dvd repos even on user request unless forced
+- man page updated
- translations update
+- r7479
+- 0.8.25
-------------------------------------------------------------------
Fri Sep 28 15:10:35 CEST 2007 - ma@xxxxxxx
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc Wed Oct 10 14:20:42 2007
@@ -190,7 +190,7 @@
// transform to NAME[ OP <EDITION>] (add spaces)
string new_capstr = capstr;
cout_vv << "capstr: " << capstr << endl;
- int op_pos = capstr.find_first_of("<>=");
+ string::size_type op_pos = capstr.find_first_of("<>=");
if (op_pos != string::npos)
{
new_capstr.insert(op_pos, " ");
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc Wed Oct 10 14:20:42 2007
@@ -130,7 +130,7 @@
return true; // error
}
- return false; // no error
+ return false; // no error
}
// ---------------------------------------------------------------------------
@@ -206,7 +206,7 @@
RepoManager manager;
string specific_repo = copts.count("repo") ? copts["repo"].front() : "";
-
+
// rug compatibility
//! \todo support repo #
if (specific_repo.empty())
@@ -243,7 +243,7 @@
MIL << "checking if to refresh " << repo.name() << endl;
//! \todo honor command line options/commands
- bool do_refresh = repo.enabled() && repo.autorefresh();
+ bool do_refresh = repo.enabled() && repo.autorefresh();
if (do_refresh)
{
@@ -268,7 +268,7 @@
try { manager.refreshMetadata(repo, RepoManager::RefreshIfNeeded); }
// any exception thrown means zypp attempted to refresh the repo
// i.e. it is out-of-date. Thus, just display refresh hint for non-root
- // user
+ // user
catch (const Exception & ex)
{
cout << format(_(
@@ -277,7 +277,7 @@
<< endl;
string nonroot =
- "We're running as non-root, skipping refresh of " + repo.name();
+ "We're running as non-root, skipping refresh of " + repo.name();
MIL << nonroot << endl;
cout_vv << nonroot << endl;
}
@@ -293,7 +293,7 @@
int init_repos()
{
static bool done = false;
- //! \todo this has to be done so that it works in zypper shell
+ //! \todo this has to be done so that it works in zypper shell
if (done)
return ZYPPER_EXIT_OK;
@@ -303,6 +303,7 @@
}
done = true;
+ return ZYPPER_EXIT_OK;
}
// ----------------------------------------------------------------------------
@@ -366,7 +367,7 @@
{
RepoInfo repo = *it;
TableRow tr (gSettings.verbosity > VERBOSITY_NORMAL ? 6 : 7);
-
+
// number
tr << str::numstring (i);
// enabled?
@@ -509,7 +510,7 @@
if (argc)
{
bool specified_found = false;
-
+
// search for the repo alias among arguments
for (vector<string>::iterator it = arguments.begin();
it != arguments.end(); ++it)
@@ -519,7 +520,7 @@
arguments.erase(it);
break;
}
-
+
// search for the repo number among arguments
if (!specified_found)
for (vector<string>::iterator it = arguments.begin();
@@ -527,7 +528,7 @@
{
unsigned tmp = 0;
safe_lexical_cast (*it, tmp);
- if (tmp == repo_number)
+ if (tmp == repo_number)
{
specified_found = true;
arguments.erase(it);
@@ -559,22 +560,35 @@
continue;
}
+
// do the refresh
+
+ // raw metadata refresh
bool error = false;
if (!copts.count("build-only"))
{
bool force_download =
copts.count("force") || copts.count("force-download");
+ // without this a cd is required to be present in the drive on each refresh
+ // (or more 'refresh needed' check)
+ bool is_cd = is_changeable_media(*repo.baseUrlsBegin());
+ if (!force_download && is_cd)
+ {
+ MIL << "Skipping refresh of a changeable read-only media." << endl;
+ continue;
+ }
+
MIL << "calling refreshMetadata" << (force_download ? ", forced" : "")
<< endl;
error = refresh_raw_metadata(repo, force_download);
}
+ // db rebuild
if (!(error || copts.count("download-only")))
{
- bool force_build =
+ bool force_build =
copts.count("force") || copts.count("force-build");
MIL << "calling buildCache" << (force_build ? ", forced" : "") << endl;
@@ -656,7 +670,6 @@
// ----------------------------------------------------------------------------
-//! \todo handle zypp exceptions
static
int add_repo(RepoInfo & repo)
{
@@ -672,7 +685,7 @@
}
if (is_cd)
{
- cout_v << _("This is a changeable read-only media (CD/DVD), disabling autorefresh.") << endl;
+ cout_v << _("This is a changeable read-only media (CD/DVD), disabling autorefresh.") << endl;
repo.setAutorefresh(false);
}
@@ -735,7 +748,7 @@
else
{
// TranslatorExplanation used as e.g. "Enabled: Yes"
- cout_n << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl;
+ cout_n << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl;
// TranslatorExplanation used as e.g. "Autorefresh: Yes"
cout_n << _("Autorefresh") << ": " << (repo.autorefresh() ? _("Yes") : _("No")) << endl;
cout_n << "URL: " << *repo.baseUrlsBegin() << endl;
@@ -933,7 +946,7 @@
catch (const RepoNotFoundException & ex)
{
cerr << format(_("Repository %s not found.")) % alias << endl;
- ERR << "Repo " << alias << " not found" << endl;
+ ERR << "Repo " << alias << " not found" << endl;
}
catch (const Exception & ex)
{
@@ -965,7 +978,7 @@
if (enable)
{
cerr << format(msg_contradition) % "--enable" % "--disable" << endl;
-
+
enable = indeterminate;
}
else
@@ -1010,7 +1023,7 @@
catch (const RepoNotFoundException & ex)
{
cerr << format(_("Repository %s not found.")) % alias << endl;
- ERR << "Repo " << alias << " not found" << endl;
+ ERR << "Repo " << alias << " not found" << endl;
}
catch (const Exception & ex)
{
@@ -1025,7 +1038,7 @@
// ---------------------------------------------------------------------------
void cond_load_resolvables(bool to_pool)
-{
+{
load_repo_resolvables(to_pool);
if (!gSettings.disable_system_resolvables && to_pool)
load_target_resolvables();
@@ -1046,7 +1059,7 @@
if (! it->enabled())
continue; // #217297
- try
+ try
{
bool error = false;
// if there is no metadata locally
@@ -1101,7 +1114,7 @@
cout_n << _("Reading RPM database...");
MIL << "Going to read RPM database" << endl;
- ResStore tgt_resolvables(God->target()->resolvables());
+ ResStore tgt_resolvables(God->target()->resolvables());
if (!gSettings.machine_readable)
{
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc Wed Oct 10 14:20:42 2007
@@ -1,6 +1,7 @@
#include <iostream>
#include "zypper-tabulator.h"
using namespace std;
+#include <wchar.h>
TableStyle Table::defaultStyle = Ascii;
@@ -19,6 +20,50 @@
{ "\xE2\x95\x91", "\xE2\x94\x80", "\xE2\x95\xAB"}, ///< v double, h light
};
+// A non-ASCII string has 3 different lengths:
+// - bytes
+// - characters (non-ASCII ones have multiple bytes in UTF-8)
+// - columns (Chinese characters are 2 columns wide)
+// In #328918 see how confusing these leads to misalignment.
+
+// return the number of columns in str, or -1 if there's an error
+static
+int string_to_columns_e (const string& str) {
+ // from smpppd.src.rpm/format.cc, thanks arvin
+
+ const char* ptr = str.c_str ();
+ size_t s_bytes = str.length ();
+ int s_cols = 0;
+
+ mbstate_t shift_state;
+ memset (&shift_state, 0, sizeof (shift_state));
+
+ wchar_t wc;
+ size_t c_bytes;
+
+ // mbrtowc produces one wide character from a multibyte string
+ while ((c_bytes = mbrtowc (&wc, ptr, s_bytes, &shift_state)) > 0) {
+ if (c_bytes >= (size_t) -2) // incomplete (-2) or invalid (-1) sequence
+ return -1;
+
+ s_cols += wcwidth (wc);
+
+ s_bytes -= c_bytes;
+ ptr += c_bytes;
+ }
+
+ return s_cols;
+}
+
+static
+unsigned string_to_columns (const string& str) {
+ int c = string_to_columns_e (str);
+ if (c < 0)
+ return str.length(); // fallback if there was an error
+ else
+ return (unsigned) c;
+}
+
void TableRow::add (const string& s) {
_columns.push_back (s);
}
@@ -58,8 +103,10 @@
}
seen_first = true;
- stream.width (widths[c]);
+// stream.width (widths[c]);// that does not work with multibyte chars
stream << *i;
+ stream.width (widths[c] - string_to_columns (*i));
+ stream << "";
}
stream << endl;
}
@@ -86,8 +133,8 @@
_max_width.resize (_max_col + 1);
unsigned &max = _max_width[c];
- // FIXME: i18n: screen columns
- unsigned cur = i->length();
+ unsigned cur = string_to_columns (*i);
+
if (max < cur)
max = cur;
}
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc Wed Oct 10 14:20:42 2007
@@ -52,9 +52,21 @@
bool is_changeable_media(const zypp::Url & url)
{
- media::MediaManager mm; media::MediaAccessId id = mm.open(url);
- bool is_cd = mm.isChangeable(id);
- mm.close(id);
+ MIL << "Checking if this is a changeable medium" << endl;
+ bool is_cd = false;
+ try
+ {
+ media::MediaManager mm;
+ media::MediaAccessId id = mm.open(url);
+ is_cd = mm.isChangeable(id);
+ mm.close(id);
+ }
+ catch (const media::MediaException & e)
+ {
+ ZYPP_CAUGHT(e);
+ WAR << "Could not determine if the URL points to a changeable medium" << endl;
+ }
+
return is_cd;
}
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc Wed Oct 10 14:20:42 2007
@@ -80,29 +80,6 @@
}
bool ghelp = false;
- static string help_commands = _(
- " Commands:\n"
- "\thelp, ?\t\t\tHelp\n"
- "\tshell, sh\t\tAccept multiple commands at once\n"
- "\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\t\tList all defined repositories.\n"
- "\taddrepo, ar\t\tAdd a new 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\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"
- "\tsource-install, si\tInstall a source package\n"
- "");
-
/*
* parses global options, returns the command
@@ -201,8 +178,30 @@
cout << endl;
}
- // get command
+ static string help_commands = _(
+ " Commands:\n"
+ "\thelp, ?\t\t\tHelp\n"
+ "\tshell, sh\t\tAccept multiple commands at once\n"
+ "\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\t\tList all defined repositories.\n"
+ "\taddrepo, ar\t\tAdd a new 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\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"
+ "\tsource-install, si\tInstall a source package\n"
+ "");
+ // get command
try
{
if (optind < argc)
@@ -267,7 +266,8 @@
if (command == ZypperCommand::HELP)
{
- cout << help_commands;
+ cout << _("Type 'zypper help' to get a list of global options and commands.") << endl;
+ cout << _("Type 'zypper help <command>' to get a command-specific help.") << endl;
}
else if (command == ZypperCommand::INSTALL) {
static struct option install_options[] = {
@@ -504,6 +504,9 @@
// rug compatibility option, we have --repo
{"catalog", required_argument, 0, 'c'},
{"type", required_argument, 0, 't'},
+ // rug compatibility option, we have global --non-interactive
+ // note: rug used this uption only to auto-answer the 'continue with install?' prompt.
+ {"no-confirm", no_argument, 0, 'y'},
{"skip-interactive", no_argument, 0, 0},
{"auto-agree-with-licenses", no_argument, 0, 'l'},
// rug compatibility, we have --auto-agree-with-licenses
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
Date: Wed Oct 10 14:20:42 2007
New Revision: 7479
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7479&view=rev
Log:
Merged revisions 7357-7372,7378-7427,7429-7449,7452-7457,7460,7462-7465,7472-7478 via svnmerge from
http://svn.opensuse.org/svn/zypp/trunk/zypper
........
r7389 | jkupec | 2007-09-26 16:22:38 +0200 (Wed, 26 Sep 2007) | 2 lines
- locks doc update
........
r7391 | jkupec | 2007-09-27 09:11:22 +0200 (Thu, 27 Sep 2007) | 2 lines
- --capability short option fixed
........
r7397 | mlandres | 2007-09-27 13:49:02 +0200 (Thu, 27 Sep 2007) | 1 line
fixed comparison between signed and unsigned int
........
r7398 | mlandres | 2007-09-27 13:53:27 +0200 (Thu, 27 Sep 2007) | 1 line
fixed control reaches end of non-void function
........
r7420 | mvidner | 2007-10-02 10:01:21 +0200 (Tue, 02 Oct 2007) | 2 lines
Fixed misalignment in localized tables (#328918).
........
r7449 | jkupec | 2007-10-06 12:16:31 +0200 (Sat, 06 Oct 2007) | 1 line
- don't check if to refresh cd/dvd repos even on user request unless forced
........
r7460 | jkupec | 2007-10-06 18:19:23 +0200 (Sat, 06 Oct 2007) | 2 lines
- correctly translate the command list (#327487)
........
r7465 | jkupec | 2007-10-08 14:34:03 +0200 (Mon, 08 Oct 2007) | 1 line
- missing -y option added to the update command (#331632)
........
Modified:
branches/SuSE-Linux-10_3-Branch/zypper/ (props changed)
branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake
branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8
branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc
branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc
Modified: branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/VERSION.cmake Wed Oct 10 14:20:42 2007
@@ -20,4 +20,4 @@
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "8")
-SET(VERSION_PATCH "24")
+SET(VERSION_PATCH "25")
Modified: branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8 (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/doc/zypper.8 Wed Oct 10 14:20:42 2007
@@ -1,4 +1,4 @@
-.TH "zypper" "8" "0.7.0" "zypper" "System Tools"
+.TH "zypper" "8" "0.8.25" "zypper" "System Tools"
.SH "SYNTAX"
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
@@ -79,7 +79,7 @@
.I \-f, \-\-force
Install even if the item is already installed (reinstall)
.TP
-.I \-n, \-\-capability
+.I \-C, \-\-capability
Select resolvables by capabilities.
.TP
.I \-l, \-\-auto\-agree\-with\-licenses
@@ -129,7 +129,7 @@
.I \-n, \-\-name
Select resolvables by their name (default).
.TP
-.I \-n, \-\-capability
+.I \-C, \-\-capability
Select resolvables by capabilities.
.TP
.I \-\-debug\-solver
@@ -383,8 +383,10 @@
.LP
The file
.B /etc/zypp/locks
-can contain a list of packages to be locked. These will not be updated
-or removed by the solver.
+can contain a list of packages to be locked. Installed packages which match one
+of the items in this list will not be updated or removed by the solver.
+Similarly, those matching packages which have not yet been installed, will not be
+considered for installation.
Empty lines and lines beginning with \fB#\fR are ignored. Each line is of the form
"\fIPATTERN \fR[ \fIOP EDITION \fR]"
Modified: branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/package/zypper.changes Wed Oct 10 14:20:42 2007
@@ -1,7 +1,13 @@
-------------------------------------------------------------------
-Wed Oct 10 13:48:33 CEST 2007 - jkupec@xxxxxxx
-
+Tue Sep 25 17:59:22 CEST 2007 - jkupec@xxxxxxx
+- missing -y option added to the update command (#331632)
+- Fixed misalignment in localized tables (#328918) (mvidner).
+- correctly translate the command list (#327487)
+- don't check if to refresh cd/dvd repos even on user request unless forced
+- man page updated
- translations update
+- r7479
+- 0.8.25
-------------------------------------------------------------------
Fri Sep 28 15:10:35 CEST 2007 - ma@xxxxxxx
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-misc.cc Wed Oct 10 14:20:42 2007
@@ -190,7 +190,7 @@
// transform to NAME[ OP <EDITION>] (add spaces)
string new_capstr = capstr;
cout_vv << "capstr: " << capstr << endl;
- int op_pos = capstr.find_first_of("<>=");
+ string::size_type op_pos = capstr.find_first_of("<>=");
if (op_pos != string::npos)
{
new_capstr.insert(op_pos, " ");
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-sources.cc Wed Oct 10 14:20:42 2007
@@ -130,7 +130,7 @@
return true; // error
}
- return false; // no error
+ return false; // no error
}
// ---------------------------------------------------------------------------
@@ -206,7 +206,7 @@
RepoManager manager;
string specific_repo = copts.count("repo") ? copts["repo"].front() : "";
-
+
// rug compatibility
//! \todo support repo #
if (specific_repo.empty())
@@ -243,7 +243,7 @@
MIL << "checking if to refresh " << repo.name() << endl;
//! \todo honor command line options/commands
- bool do_refresh = repo.enabled() && repo.autorefresh();
+ bool do_refresh = repo.enabled() && repo.autorefresh();
if (do_refresh)
{
@@ -268,7 +268,7 @@
try { manager.refreshMetadata(repo, RepoManager::RefreshIfNeeded); }
// any exception thrown means zypp attempted to refresh the repo
// i.e. it is out-of-date. Thus, just display refresh hint for non-root
- // user
+ // user
catch (const Exception & ex)
{
cout << format(_(
@@ -277,7 +277,7 @@
<< endl;
string nonroot =
- "We're running as non-root, skipping refresh of " + repo.name();
+ "We're running as non-root, skipping refresh of " + repo.name();
MIL << nonroot << endl;
cout_vv << nonroot << endl;
}
@@ -293,7 +293,7 @@
int init_repos()
{
static bool done = false;
- //! \todo this has to be done so that it works in zypper shell
+ //! \todo this has to be done so that it works in zypper shell
if (done)
return ZYPPER_EXIT_OK;
@@ -303,6 +303,7 @@
}
done = true;
+ return ZYPPER_EXIT_OK;
}
// ----------------------------------------------------------------------------
@@ -366,7 +367,7 @@
{
RepoInfo repo = *it;
TableRow tr (gSettings.verbosity > VERBOSITY_NORMAL ? 6 : 7);
-
+
// number
tr << str::numstring (i);
// enabled?
@@ -509,7 +510,7 @@
if (argc)
{
bool specified_found = false;
-
+
// search for the repo alias among arguments
for (vector<string>::iterator it = arguments.begin();
it != arguments.end(); ++it)
@@ -519,7 +520,7 @@
arguments.erase(it);
break;
}
-
+
// search for the repo number among arguments
if (!specified_found)
for (vector<string>::iterator it = arguments.begin();
@@ -527,7 +528,7 @@
{
unsigned tmp = 0;
safe_lexical_cast (*it, tmp);
- if (tmp == repo_number)
+ if (tmp == repo_number)
{
specified_found = true;
arguments.erase(it);
@@ -559,22 +560,35 @@
continue;
}
+
// do the refresh
+
+ // raw metadata refresh
bool error = false;
if (!copts.count("build-only"))
{
bool force_download =
copts.count("force") || copts.count("force-download");
+ // without this a cd is required to be present in the drive on each refresh
+ // (or more 'refresh needed' check)
+ bool is_cd = is_changeable_media(*repo.baseUrlsBegin());
+ if (!force_download && is_cd)
+ {
+ MIL << "Skipping refresh of a changeable read-only media." << endl;
+ continue;
+ }
+
MIL << "calling refreshMetadata" << (force_download ? ", forced" : "")
<< endl;
error = refresh_raw_metadata(repo, force_download);
}
+ // db rebuild
if (!(error || copts.count("download-only")))
{
- bool force_build =
+ bool force_build =
copts.count("force") || copts.count("force-build");
MIL << "calling buildCache" << (force_build ? ", forced" : "") << endl;
@@ -656,7 +670,6 @@
// ----------------------------------------------------------------------------
-//! \todo handle zypp exceptions
static
int add_repo(RepoInfo & repo)
{
@@ -672,7 +685,7 @@
}
if (is_cd)
{
- cout_v << _("This is a changeable read-only media (CD/DVD), disabling autorefresh.") << endl;
+ cout_v << _("This is a changeable read-only media (CD/DVD), disabling autorefresh.") << endl;
repo.setAutorefresh(false);
}
@@ -735,7 +748,7 @@
else
{
// TranslatorExplanation used as e.g. "Enabled: Yes"
- cout_n << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl;
+ cout_n << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl;
// TranslatorExplanation used as e.g. "Autorefresh: Yes"
cout_n << _("Autorefresh") << ": " << (repo.autorefresh() ? _("Yes") : _("No")) << endl;
cout_n << "URL: " << *repo.baseUrlsBegin() << endl;
@@ -933,7 +946,7 @@
catch (const RepoNotFoundException & ex)
{
cerr << format(_("Repository %s not found.")) % alias << endl;
- ERR << "Repo " << alias << " not found" << endl;
+ ERR << "Repo " << alias << " not found" << endl;
}
catch (const Exception & ex)
{
@@ -965,7 +978,7 @@
if (enable)
{
cerr << format(msg_contradition) % "--enable" % "--disable" << endl;
-
+
enable = indeterminate;
}
else
@@ -1010,7 +1023,7 @@
catch (const RepoNotFoundException & ex)
{
cerr << format(_("Repository %s not found.")) % alias << endl;
- ERR << "Repo " << alias << " not found" << endl;
+ ERR << "Repo " << alias << " not found" << endl;
}
catch (const Exception & ex)
{
@@ -1025,7 +1038,7 @@
// ---------------------------------------------------------------------------
void cond_load_resolvables(bool to_pool)
-{
+{
load_repo_resolvables(to_pool);
if (!gSettings.disable_system_resolvables && to_pool)
load_target_resolvables();
@@ -1046,7 +1059,7 @@
if (! it->enabled())
continue; // #217297
- try
+ try
{
bool error = false;
// if there is no metadata locally
@@ -1101,7 +1114,7 @@
cout_n << _("Reading RPM database...");
MIL << "Going to read RPM database" << endl;
- ResStore tgt_resolvables(God->target()->resolvables());
+ ResStore tgt_resolvables(God->target()->resolvables());
if (!gSettings.machine_readable)
{
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-tabulator.cc Wed Oct 10 14:20:42 2007
@@ -1,6 +1,7 @@
#include <iostream>
#include "zypper-tabulator.h"
using namespace std;
+#include <wchar.h>
TableStyle Table::defaultStyle = Ascii;
@@ -19,6 +20,50 @@
{ "\xE2\x95\x91", "\xE2\x94\x80", "\xE2\x95\xAB"}, ///< v double, h light
};
+// A non-ASCII string has 3 different lengths:
+// - bytes
+// - characters (non-ASCII ones have multiple bytes in UTF-8)
+// - columns (Chinese characters are 2 columns wide)
+// In #328918 see how confusing these leads to misalignment.
+
+// return the number of columns in str, or -1 if there's an error
+static
+int string_to_columns_e (const string& str) {
+ // from smpppd.src.rpm/format.cc, thanks arvin
+
+ const char* ptr = str.c_str ();
+ size_t s_bytes = str.length ();
+ int s_cols = 0;
+
+ mbstate_t shift_state;
+ memset (&shift_state, 0, sizeof (shift_state));
+
+ wchar_t wc;
+ size_t c_bytes;
+
+ // mbrtowc produces one wide character from a multibyte string
+ while ((c_bytes = mbrtowc (&wc, ptr, s_bytes, &shift_state)) > 0) {
+ if (c_bytes >= (size_t) -2) // incomplete (-2) or invalid (-1) sequence
+ return -1;
+
+ s_cols += wcwidth (wc);
+
+ s_bytes -= c_bytes;
+ ptr += c_bytes;
+ }
+
+ return s_cols;
+}
+
+static
+unsigned string_to_columns (const string& str) {
+ int c = string_to_columns_e (str);
+ if (c < 0)
+ return str.length(); // fallback if there was an error
+ else
+ return (unsigned) c;
+}
+
void TableRow::add (const string& s) {
_columns.push_back (s);
}
@@ -58,8 +103,10 @@
}
seen_first = true;
- stream.width (widths[c]);
+// stream.width (widths[c]);// that does not work with multibyte chars
stream << *i;
+ stream.width (widths[c] - string_to_columns (*i));
+ stream << "";
}
stream << endl;
}
@@ -86,8 +133,8 @@
_max_width.resize (_max_col + 1);
unsigned &max = _max_width[c];
- // FIXME: i18n: screen columns
- unsigned cur = i->length();
+ unsigned cur = string_to_columns (*i);
+
if (max < cur)
max = cur;
}
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper-utils.cc Wed Oct 10 14:20:42 2007
@@ -52,9 +52,21 @@
bool is_changeable_media(const zypp::Url & url)
{
- media::MediaManager mm; media::MediaAccessId id = mm.open(url);
- bool is_cd = mm.isChangeable(id);
- mm.close(id);
+ MIL << "Checking if this is a changeable medium" << endl;
+ bool is_cd = false;
+ try
+ {
+ media::MediaManager mm;
+ media::MediaAccessId id = mm.open(url);
+ is_cd = mm.isChangeable(id);
+ mm.close(id);
+ }
+ catch (const media::MediaException & e)
+ {
+ ZYPP_CAUGHT(e);
+ WAR << "Could not determine if the URL points to a changeable medium" << endl;
+ }
+
return is_cd;
}
Modified: branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc?rev=7479&r1=7478&r2=7479&view=diff
==============================================================================
--- branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc (original)
+++ branches/SuSE-Linux-10_3-Branch/zypper/src/zypper.cc Wed Oct 10 14:20:42 2007
@@ -80,29 +80,6 @@
}
bool ghelp = false;
- static string help_commands = _(
- " Commands:\n"
- "\thelp, ?\t\t\tHelp\n"
- "\tshell, sh\t\tAccept multiple commands at once\n"
- "\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\t\tList all defined repositories.\n"
- "\taddrepo, ar\t\tAdd a new 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\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"
- "\tsource-install, si\tInstall a source package\n"
- "");
-
/*
* parses global options, returns the command
@@ -201,8 +178,30 @@
cout << endl;
}
- // get command
+ static string help_commands = _(
+ " Commands:\n"
+ "\thelp, ?\t\t\tHelp\n"
+ "\tshell, sh\t\tAccept multiple commands at once\n"
+ "\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\t\tList all defined repositories.\n"
+ "\taddrepo, ar\t\tAdd a new 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\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"
+ "\tsource-install, si\tInstall a source package\n"
+ "");
+ // get command
try
{
if (optind < argc)
@@ -267,7 +266,8 @@
if (command == ZypperCommand::HELP)
{
- cout << help_commands;
+ cout << _("Type 'zypper help' to get a list of global options and commands.") << endl;
+ cout << _("Type 'zypper help <command>' to get a command-specific help.") << endl;
}
else if (command == ZypperCommand::INSTALL) {
static struct option install_options[] = {
@@ -504,6 +504,9 @@
// rug compatibility option, we have --repo
{"catalog", required_argument, 0, 'c'},
{"type", required_argument, 0, 't'},
+ // rug compatibility option, we have global --non-interactive
+ // note: rug used this uption only to auto-answer the 'continue with install?' prompt.
+ {"no-confirm", no_argument, 0, 'y'},
{"skip-interactive", no_argument, 0, 0},
{"auto-agree-with-licenses", no_argument, 0, 'l'},
// rug compatibility, we have --auto-agree-with-licenses
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
| < Previous | Next > |