Hello community,
here is the log from the commit of package zypper
checked in at Wed Dec 12 21:30:34 CET 2007.
--------
--- zypper/zypper.changes 2007-12-03 18:26:50.000000000 +0100
+++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2007-12-12 13:42:44.000000000 +0100
@@ -1,0 +2,46 @@
+Tue Dec 11 17:45:41 CET 2007 - jkupec@suse.cz
+
+- product and pattern (#266896) support added to the info command
+- product-info and pattern-info command aliases added for rug
+ compatibility
+- added Vendor to the info output
+- r8107
+- 0.9.4
+
+-------------------------------------------------------------------
+Sun Dec 9 18:21:50 CET 2007 - jkupec@suse.cz
+
+- --type added for the 'info' command
+- 'quit' command help added
+- r8084
+
+-------------------------------------------------------------------
+Sun Dec 9 14:02:10 CET 2007 - jkupec@suse.cz
+
+- fixed the install command in the shell (#345004)
+- r8080
+
+-------------------------------------------------------------------
+Sun Dec 9 11:54:08 CET 2007 - jkupec@suse.cz
+
+- fixed addrepo command (#346797)
+- show help by default if no option or command was specified (#346507)
+- show help if --help is specified :O)
+- r8077
+
+-------------------------------------------------------------------
+Wed Dec 5 13:36:48 CET 2007 - jkupec@suse.cz
+
+- reset user selections after install/remove in the zypper shell
+ (#288740)
+- r8028
+- forgotten changelog for 0.9.3 r8008 - sync pool after commit when
+ in shell (re-read installed resolvables)
+
+-------------------------------------------------------------------
+Tue Dec 4 11:39:29 CET 2007 - jkupec@suse.cz
+
+- removed some unnecessary boost dependencies (dmueller) (#344941)
+- fixed crashing if couldn't acquire ZYpp lock
+
+-------------------------------------------------------------------
Old:
----
zypper-0.9.3.tar.bz2
New:
----
zypper-0.9.4.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ zypper.spec ++++++
--- /var/tmp/diff_new_pack.Lcx474/_old 2007-12-12 21:30:17.000000000 +0100
+++ /var/tmp/diff_new_pack.Lcx474/_new 2007-12-12 21:30:17.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package zypper (Version 0.9.3)
+# spec file for package zypper (Version 0.9.4)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -20,9 +20,9 @@
AutoReqProv: on
PreReq: permissions
Summary: Command Line Package Management Using Libzypp
-Version: 0.9.3
+Version: 0.9.4
Release: 1
-Source: zypper-0.9.3.tar.bz2
+Source: zypper-0.9.4.tar.bz2
Prefix: /usr
Url: http://en.opensuse.org/Zypper
Provides: y2pmsh
@@ -96,6 +96,34 @@
# it from being erased by rpm -e
%ghost %config(noreplace) %{_var}/log/zypper.log
%changelog
+* Tue Dec 11 2007 - jkupec@suse.cz
+- product and pattern (#266896) support added to the info command
+- product-info and pattern-info command aliases added for rug
+ compatibility
+- added Vendor to the info output
+- r8107
+- 0.9.4
+* Sun Dec 09 2007 - jkupec@suse.cz
+- --type added for the 'info' command
+- 'quit' command help added
+- r8084
+* Sun Dec 09 2007 - jkupec@suse.cz
+- fixed the install command in the shell (#345004)
+- r8080
+* Sun Dec 09 2007 - jkupec@suse.cz
+- fixed addrepo command (#346797)
+- show help by default if no option or command was specified (#346507)
+- show help if --help is specified :O)
+- r8077
+* Wed Dec 05 2007 - jkupec@suse.cz
+- reset user selections after install/remove in the zypper shell
+ (#288740)
+- r8028
+- forgotten changelog for 0.9.3 r8008 - sync pool after commit when
+ in shell (re-read installed resolvables)
+* Tue Dec 04 2007 - jkupec@suse.cz
+- removed some unnecessary boost dependencies (dmueller) (#344941)
+- fixed crashing if couldn't acquire ZYpp lock
* Mon Dec 03 2007 - jkupec@suse.cz
- new defaults for the force-resolution solver mode:
'on' by default in the interactive mode,
++++++ zypper-0.9.3.tar.bz2 -> zypper-0.9.4.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/doc/TODO new/zypper-0.9.4/doc/TODO
--- old/zypper-0.9.3/doc/TODO 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/doc/TODO 2007-12-12 13:42:43.000000000 +0100
@@ -1,9 +1,10 @@
-0.9.0
-
-- implement all rug commands (where it has sense)
-- clean up and improve output, add --silent mode, sort normal, verbose
- and debug output.
-- refresh - show progress on default output, verbose progress with -v
+0.9.x
+- move -vv output to zypper.log, leave only normal and verbose output levels
+- xml output for all (or most of the) commands
+- xml input (feed a xml with operation specification to zypper)
+- implement all rug commands (where it makes sense)
+- system consistency verification command
+- install plain local or remote .rpm files
NOT SCHEDULED
@@ -28,15 +29,10 @@
Packages
-- upgrade
- = Resolver::doUpgrade
- install
--force-install option
- just download, not install. compare to YOU: do not delete after installing
-Patterns
-
-- zypper pattern-info
Cool Stuff
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/doc/zypper.8 new/zypper-0.9.4/doc/zypper.8
--- old/zypper-0.9.3/doc/zypper.8 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/doc/zypper.8 2007-12-12 13:42:43.000000000 +0100
@@ -1,4 +1,4 @@
-.TH "zypper" "8" "0.9.3" "zypper" "System Tools"
+.TH "zypper" "8" "0.9.4" "zypper" "System Tools"
.SH "SYNTAX"
.LP
zypper [\fI\-\-global\-options\fR] <\fBcommand\fR> [\fI\-\-command\-options\fR] [\fBcommand-arguments\fR]
@@ -46,7 +46,15 @@
.TP
.B info (if) <name> ...
-Displays full info for the specified packages.
+Displays full info for the specified packages or other resolvables.
+
+.TP
+.I \-r, \-\-repo <alias>
+Work only with the repository specified by the alias.
+.TP
+.I \-t, \-\-type <type>
+Type of resolvable (default: package). Currently supported resolvable types for
+the info command are: package, patch, pattern, product.
.TP
.B install (in) [options] <name> ...
@@ -273,13 +281,6 @@
.I \-r, \-\-repo <alias>
Check for patches only in the repository specified by the alias.
-.TP
-.B patch-info <name> ...
-Displays full info for the specified patches.
-.TP
-.I \-r, \-\-repo <alias>
-Work only with the repository specified by the alias.
-
.SS Repository Management
.PP
@@ -622,6 +623,23 @@
Sort resolvables by catalog, not by name. This option is an alias to zypper's
\-\-sort\-by\-repo option.
+.SS Patch Management Commands
+
+.TP
+.I rug patch-info
+zypper info -t patch
+
+.SS Pattern Management Commands
+
+.TP
+.I rug pattern-info
+zypper info -t pattern
+
+.SS Product Management Commands
+
+.TP
+.I rug product-info
+zypper info -t product
.SS Other Compatibility Notes
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/package/zypper.changes new/zypper-0.9.4/package/zypper.changes
--- old/zypper-0.9.3/package/zypper.changes 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/package/zypper.changes 2007-12-12 13:42:43.000000000 +0100
@@ -1,4 +1,50 @@
-------------------------------------------------------------------
+Tue Dec 11 17:45:41 CET 2007 - jkupec@suse.cz
+
+- product and pattern (#266896) support added to the info command
+- product-info and pattern-info command aliases added for rug
+ compatibility
+- added Vendor to the info output
+- r8107
+- 0.9.4
+
+-------------------------------------------------------------------
+Sun Dec 9 18:21:50 CET 2007 - jkupec@suse.cz
+
+- --type added for the 'info' command
+- 'quit' command help added
+- r8084
+
+-------------------------------------------------------------------
+Sun Dec 9 14:02:10 CET 2007 - jkupec@suse.cz
+
+- fixed the install command in the shell (#345004)
+- r8080
+
+-------------------------------------------------------------------
+Sun Dec 9 11:54:08 CET 2007 - jkupec@suse.cz
+
+- fixed addrepo command (#346797)
+- show help by default if no option or command was specified (#346507)
+- show help if --help is specified :O)
+- r8077
+
+-------------------------------------------------------------------
+Wed Dec 5 13:36:48 CET 2007 - jkupec@suse.cz
+
+- reset user selections after install/remove in the zypper shell
+ (#288740)
+- r8028
+- forgotten changelog for 0.9.3 r8008 - sync pool after commit when
+ in shell (re-read installed resolvables)
+
+-------------------------------------------------------------------
+Tue Dec 4 11:39:29 CET 2007 - jkupec@suse.cz
+
+- removed some unnecessary boost dependencies (dmueller) (#344941)
+- fixed crashing if couldn't acquire ZYpp lock
+
+-------------------------------------------------------------------
Mon Dec 3 18:19:21 CET 2007 - jkupec@suse.cz
- new defaults for the force-resolution solver mode:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/CMakeLists.txt new/zypper-0.9.4/src/CMakeLists.txt
--- old/zypper-0.9.3/src/CMakeLists.txt 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/CMakeLists.txt 2007-12-12 13:42:43.000000000 +0100
@@ -39,7 +39,7 @@
ADD_EXECUTABLE( zypper ${zypper_SRCS} )
-TARGET_LINK_LIBRARIES( zypper ${ZYPP_LIBRARY} ${READLINE_LIBRARY} boost_regex )
+TARGET_LINK_LIBRARIES( zypper ${ZYPP_LIBRARY} ${READLINE_LIBRARY} )
INSTALL(
TARGETS zypper
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper.cc new/zypper-0.9.4/src/zypper.cc
--- old/zypper-0.9.3/src/zypper.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper.cc 2007-12-12 13:42:43.000000000 +0100
@@ -54,7 +54,7 @@
Zypper::Zypper()
: _argc(0), _argv(NULL),
_command(ZypperCommand::NONE),
- _exiting(false), _exit_code(ZYPPER_EXIT_OK),
+ _exit_code(ZYPPER_EXIT_OK),
_running_shell(false), _running_help(false),
_sh_argc(0), _sh_argv(NULL)
{
@@ -84,9 +84,12 @@
_argv = argv;
// parse global options and the command
- processGlobalOptions();
- if (this->exiting())
+ try { processGlobalOptions(); }
+ catch (const ExitRequestException & e)
+ {
+ MIL << "Caught exit request:" << endl << e.msg() << endl;
return exitCode();
+ }
switch(command().toEnum())
{
@@ -148,12 +151,18 @@
"\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"
+ "\tdist-upgrade, dup\tPerform a distribution upgrade\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"
"");
+
+ static string help_usage = _(
+ " Usage:\n"
+ "\tzypper [--global-options] <command> [--command-options] [arguments]\n"
+ );
- cout << help_global_options << endl << help_commands;
+ cout << help_usage << endl << help_global_options << endl << help_commands;
}
void Zypper::print_unknown_command_hint()
@@ -334,17 +343,18 @@
}
// get command
- try
- {
- if (optind < _argc)
- setCommand(ZypperCommand(_argv[optind++]));
- }
- // exception from command parsing
- catch (Exception & e)
+ if (optind < _argc)
{
- cerr << e.asUserString() << endl;
- setCommand(ZypperCommand::NONE);
+ try { setCommand(ZypperCommand(_argv[optind++])); }
+ // exception from command parsing
+ catch (Exception & e)
+ {
+ cerr << e.asUserString() << endl;
+ //setCommand(ZypperCommand::NONE);
+ }
}
+ else
+ setRunningHelp();
if (command() == ZypperCommand::HELP)
{
@@ -359,19 +369,21 @@
{
cout << e.asUserString() << endl;
print_unknown_command_hint();
- this->exit();
+ ZYPP_THROW(ExitRequestException("help provided"));
}
}
}
else
{
print_main_help();
- this->exit();
+ ZYPP_THROW(ExitRequestException("help provided"));
}
}
else if (command() == ZypperCommand::NONE)
{
- if (gopts.count("version"))
+ if (runningHelp())
+ print_main_help();
+ else if (gopts.count("version"))
cout << PACKAGE " " VERSION << endl;
else
{
@@ -428,6 +440,8 @@
break;
else if (command() == ZypperCommand::SHELL)
cout << _("You already are running zypper's shell.") << endl;
+ else if (command() == ZypperCommand::NONE)
+ print_unknown_command_hint();
else
safeDoCommand();
}
@@ -436,7 +450,7 @@
cerr << e.msg() << endl;
print_unknown_command_hint();
}
-
+
shellCleanup();
}
@@ -449,6 +463,20 @@
void Zypper::shellCleanup()
{
+ MIL << "Cleaning up for the next command." << endl;
+
+ switch(command().toEnum())
+ {
+ case ZypperCommand::INSTALL_e:
+ case ZypperCommand::REMOVE_e:
+ //case Zyppercommand::UPDATE_e: TODO once the update will take arguments
+ {
+ remove_selections(*this);
+ break;
+ }
+ default:;
+ }
+
// clear any previous arguments
_arguments.clear();
// clear command options
@@ -463,9 +491,8 @@
_command_help.clear();
// reset help flag
setRunningHelp(false);
- // reset the exitting flag
- exit(false);
- // ... and the exit code does not matter in the shell
+ // ... and the exit code
+ setExitCode(ZYPPER_EXIT_OK);
// gData
gData.current_repo = RepoInfo();
@@ -485,10 +512,9 @@
try
{
processCommandOptions();
- if (exiting())
+ if (command() == ZypperCommand::NONE)
return;
doCommand();
- setCommand(ZypperCommand::NONE);
}
catch (const AbortRequestException & ex)
{
@@ -499,7 +525,7 @@
}
catch (const ExitRequestException & e)
{
- cout_vv << "Caught exit request:" << endl << e.msg() << endl;
+ MIL << "Caught exit request:" << endl << e.msg() << endl;
}
catch (const Exception & ex)
{
@@ -861,16 +887,17 @@
{0, 0, 0, 0}
};
specific_options = update_options;
- _command_help = _(
- // TranslatorExplanation don't translate the resolvable types
- // (see the install command comment)
+ _command_help = boost::str(format(_(
+ // TranslatorExplanation the first %s = "package, patch, pattern, product"
+ // and the second %s = "patch"
"update (up) [options]\n"
"\n"
"Update all installed resolvables with newer versions, where applicable.\n"
"\n"
" Command options:\n"
"\n"
- "-t, --type <type> Type of resolvable (package, patch, pattern, product) (default: patch)\n"
+ "-t, --type <type> Type of resolvable (%s)\n"
+ " Default: %s\n"
"-r, --repo <alias> Limit updates to the repository specified by the alias.\n"
" --skip-interactive Skip interactive updates\n"
"-l, --auto-agree-with-licenses Automatically say 'yes' to third party license confirmation prompt.\n"
@@ -878,7 +905,7 @@
" --best-effort Do a 'best effort' approach to update, updates to a lower than latest-and-greatest version are also acceptable\n"
" --debug-solver Create solver test case for debugging\n"
"-R, --force-resolution Force the solver to find a solution (even agressive)\n"
- );
+ )) % "package, patch, pattern, product" % "patch");
break;
}
@@ -1005,6 +1032,7 @@
case ZypperCommand::INFO_e:
{
static struct option info_options[] = {
+ {"type", required_argument, 0, 't'},
{"repo", required_argument, 0, 'r'},
// rug compatibility option, we have --repo
{"catalog", required_argument, 0, 'c'},
@@ -1012,16 +1040,18 @@
{0, 0, 0, 0}
};
specific_options = info_options;
- //! \todo -t option is missing (10.3+)
- _command_help = _(
- "info <name> ...\n"
- "\n"
- "Show full information for packages\n"
- "\n"
- " Command options:\n"
- "\n"
- "-r, --repo <alias> Work only with the repository specified by the alias.\n"
- );
+ _command_help =
+ string(
+ _("info <name> ...\n"
+ "\n"
+ "Show full information for packages")) + "\n"
+ "\n" +
+ _(" Command options:") + "\n" +
+ _("-r, --repo <alias> Work only with the repository specified by the alias.") + "\n" +
+ boost::str(format(
+ _("-t, --type <type> Type of resolvable (%s)\n"
+ " Default: %s")) % "package, patch, pattern, product" % "package") + "\n";
+
break;
}
@@ -1044,6 +1074,44 @@
break;
}
+ // rug compatibility command, we have zypper info [-t ]
+ case ZypperCommand::RUG_PATTERN_INFO_e:
+ {
+ static struct option options[] = {
+ {"catalog", required_argument, 0, 'c'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ specific_options = options;
+ _command_help = _(
+ "pattern-info ...\n"
+ "\n"
+ "Show detailed information for patterns\n"
+ "\n"
+ "This is a rug compatibility alias for 'zypper info -t pattern'\n"
+ );
+ break;
+ }
+
+ // rug compatibility command, we have zypper info [-t ]
+ case ZypperCommand::RUG_PRODUCT_INFO_e:
+ {
+ static struct option options[] = {
+ {"catalog", required_argument, 0, 'c'},
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ specific_options = options;
+ _command_help = _(
+ "product-info ...\n"
+ "\n"
+ "Show detailed information for products\n"
+ "\n"
+ "This is a rug compatibility alias for 'zypper info -t product'\n"
+ );
+ break;
+ }
+
case ZypperCommand::MOO_e:
{
static struct option moo_options[] = {
@@ -1080,10 +1148,27 @@
break;
}
+ case ZypperCommand::SHELL_QUIT_e:
+ {
+ static struct option quit_options[] = {
+ {"help", no_argument, 0, 'h'},
+ {0, 0, 0, 0}
+ };
+ specific_options = quit_options;
+ _command_help = _(
+ "quit (exit, ^D)\n"
+ "\n"
+ "Quit the current zypper shell.\n"
+ "\n"
+ "This command has no additional options.\n"
+ );
+ break;
+ }
+
default:
{
ERR << "Unknown or unexpected command" << endl;
- //report_problem("Unexpected program flow.","");
+ cerr << _("Unexpected program flow") << "." << endl;
report_a_bug(cerr);
}
}
@@ -1134,9 +1219,9 @@
cout << "" << msg << "</message>" << endl;
else
cerr << msg << endl;
-
+
setExitCode(ZYPPER_EXIT_ERR_ZYPP);
- return;
+ throw (ExitRequestException("ZYpp locked"));
}
}
@@ -1146,6 +1231,7 @@
/// process one command from the OS shell or the zypper shell
void Zypper::doCommand()
{
+ MIL << "Going to process command " << command().toEnum() << endl;
ResObject::Kind kind;
@@ -1180,21 +1266,23 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);return;
+ return;
}
// check root user
if (geteuid() != 0)
{
cerr << _("Root privileges are required for modifying system repositories.") << endl;
- setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);return;
+ setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);
+ return;
}
// too many arguments
if (_arguments.size() > 2)
{
report_too_many_arguments(_command_help);
- setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);return;
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
}
// indeterminate indicates the user has not specified the values
@@ -1211,7 +1299,7 @@
// add repository specified in .repo file
if (copts.count("repo"))
{
- setExitCode(add_repo_from_file(*this,copts["repo"].front(), enabled, refresh));
+ add_repo_from_file(*this,copts["repo"].front(), enabled, refresh);
return;
}
@@ -1224,12 +1312,16 @@
cerr << _("Too few arguments. At least URL and alias are required.") << endl;
ERR << "Too few arguments. At least URL and alias are required." << endl;
cout_n << _command_help;
- setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);return;
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
}
Url url = make_url (_arguments[0]);
if (!url.isValid())
- setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);return;
+ {
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
// by default, enable the repo and set autorefresh
if (indeterminate(enabled)) enabled = true;
@@ -1240,9 +1332,8 @@
// load gpg keys
cond_init_target(*this);
- setExitCode(add_repo_by_url(*this,
- url, _arguments[1]/*alias*/, type, enabled, refresh));
- return;
+ add_repo_by_url(
+ *this, url, _arguments[1]/*alias*/, type, enabled, refresh);
}
catch (const repo::RepoUnknownTypeException & e)
{
@@ -1251,8 +1342,9 @@
_("Specified type is not a valid repository type:"),
_("See 'zypper -h addrepo' or man zypper to get a list of known repository types."));
setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
- return;
}
+
+ return;
}
// --------------------------( delete repo )--------------------------------
@@ -1262,14 +1354,15 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);return;
+ return;
}
// check root user
if (geteuid() != 0)
{
cerr << _("Root privileges are required for modifying system repositories.") << endl;
- setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);return;
+ setExitCode(ZYPPER_EXIT_ERR_PRIVILEGES);
+ return;
}
if (_arguments.size() < 1)
@@ -1278,7 +1371,8 @@
ERR << "Required argument missing." << endl;
cout_n << _("Usage") << ':' << endl;
cout_n << _command_help;
- setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);return;
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
}
// too many arguments
@@ -1286,17 +1380,15 @@
else if (_arguments.size() > 1)
{
report_too_many_arguments(_command_help);
- setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);return;
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
}
warn_if_zmd ();
bool found = remove_repo(*this, _arguments[0]);
if (found)
- {
- setExitCode(ZYPPER_EXIT_OK);
return;
- }
MIL << "Repository not found by alias, trying delete by URL" << endl;
cout_v << _("Repository not found by alias, trying delete by URL...") << endl;
@@ -1335,7 +1427,6 @@
cerr << _("Repository not found by given alias or URL.") << endl;
}
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1346,7 +1437,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1387,7 +1477,6 @@
return;
}
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1398,7 +1487,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1436,7 +1524,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1460,7 +1547,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1562,7 +1648,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1594,7 +1679,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1684,7 +1768,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1722,7 +1805,7 @@
setExitCode(ZYPPER_EXIT_INF_UPDATE_NEEDED);
return;
}
- setExitCode(ZYPPER_EXIT_OK);
+
return;
}
@@ -1732,7 +1815,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1761,7 +1843,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1799,7 +1880,6 @@
list_updates(*this, kind, best_effort );
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1810,7 +1890,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1828,7 +1907,6 @@
cout << "</update-list>" << endl;
cout << "</update-status>" << endl;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1838,7 +1916,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1920,7 +1997,6 @@
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1974,11 +2050,12 @@
// -----------------------------( info )------------------------------------
else if (command() == ZypperCommand::INFO ||
- command() == ZypperCommand::RUG_PATCH_INFO) {
+ command() == ZypperCommand::RUG_PATCH_INFO ||
+ command() == ZypperCommand::RUG_PATTERN_INFO ||
+ command() == ZypperCommand::RUG_PRODUCT_INFO) {
if (runningHelp())
{
cout << _command_help;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
@@ -1992,6 +2069,29 @@
return;
}
+ switch (command().toEnum())
+ {
+ case ZypperCommand::RUG_PATCH_INFO_e:
+ kind = ResTraits<Patch>::kind;
+ break;
+ case ZypperCommand::RUG_PATTERN_INFO_e:
+ kind = ResTraits<Pattern>::kind;
+ break;
+ case ZypperCommand::RUG_PRODUCT_INFO_e:
+ kind = ResTraits<Product>::kind;
+ break;
+ default:
+ case ZypperCommand::INFO_e:
+ // read resolvable type
+ string skind = copts.count("type")? copts["type"].front() : "package";
+ kind = string_to_kind (skind);
+ if (kind == ResObject::Kind ()) {
+ cerr << format(_("Unknown resolvable type: %s")) % skind << endl;
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+ }
+
cond_init_target(*this);
init_repos(*this);
if (exitCode() != ZYPPER_EXIT_OK)
@@ -1999,9 +2099,20 @@
cond_load_resolvables(*this);
establish ();
- printInfo(*this);
+ printInfo(*this, kind);
+
+ return;
+ }
+
+ else if (command() == ZypperCommand::SHELL_QUIT)
+ {
+ if (runningHelp())
+ cout << _command_help;
+ else if (!runningShell())
+ cout << _("This command only makes sense in the zypper shell.") << endl;
+ else
+ cout << "oops, you wanted to quit, didn't you?" << endl;
- setExitCode(ZYPPER_EXIT_OK);
return;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-command.cc new/zypper-0.9.4/src/zypper-command.cc
--- old/zypper-0.9.3/src/zypper-command.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-command.cc 2007-12-12 13:42:43.000000000 +0100
@@ -44,6 +44,8 @@
const ZypperCommand ZypperCommand::RUG_PATCH_INFO(ZypperCommand::RUG_PATCH_INFO_e);
+const ZypperCommand ZypperCommand::RUG_PATTERN_INFO(ZypperCommand::RUG_PATTERN_INFO_e);
+const ZypperCommand ZypperCommand::RUG_PRODUCT_INFO(ZypperCommand::RUG_PRODUCT_INFO_e);
ZypperCommand::ZypperCommand(const std::string & strval_r)
@@ -84,6 +86,8 @@
// rug commands doable with zypper commands
_table["patch-info"] = ZypperCommand::RUG_PATCH_INFO_e;
+ _table["pattern-info"] = ZypperCommand::RUG_PATTERN_INFO_e;
+ _table["product-info"] = ZypperCommand::RUG_PRODUCT_INFO_e;
}
std::mapstd::string,ZypperCommand::Command::const_iterator it
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-command.h new/zypper-0.9.4/src/zypper-command.h
--- old/zypper-0.9.3/src/zypper-command.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-command.h 2007-12-12 13:42:43.000000000 +0100
@@ -41,6 +41,8 @@
/** name rug commands */
//!@{
static const ZypperCommand RUG_PATCH_INFO;
+ static const ZypperCommand RUG_PATTERN_INFO;
+ static const ZypperCommand RUG_PRODUCT_INFO;
//!@}
enum Command
@@ -73,6 +75,8 @@
NONE_e,
RUG_PATCH_INFO_e,
+ RUG_PATTERN_INFO_e,
+ RUG_PRODUCT_INFO_e
};
ZypperCommand(Command command) : _command(command) {}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper.h new/zypper-0.9.4/src/zypper.h
--- old/zypper-0.9.3/src/zypper.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper.h 2007-12-12 13:42:43.000000000 +0100
@@ -4,6 +4,7 @@
#include <string>
#include <vector>
+#include "zypp/base/Exception.h"
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/NonCopyable.h"
#include "zypp/base/PtrTypes.h"
@@ -83,10 +84,6 @@
const ZypperCommand & command() const { return _command; }
const std::string & commandHelp() const { return _command_help; }
const std::vectorstd::string & arguments() const { return _arguments; }
- /** Check whether is exiting (has entered the exit path). \see _exiting */
- int exiting() const { return _exiting; }
- /** Tell zypper to enter the exit path \see _exiting */
- void exit(bool value = true) { _exiting = value; }
int exitCode() const { return _exit_code; }
void setExitCode(int exit) { _exit_code = exit; }
bool runningShell() const { return _running_shell; }
@@ -109,8 +106,8 @@
void doCommand();
void setCommand(const ZypperCommand & command) { _command = command; }
- void setRunningShell(bool value) { _running_shell = value; }
- void setRunningHelp(bool value) { _running_help = value; }
+ void setRunningShell(bool value = true) { _running_shell = value; }
+ void setRunningHelp(bool value = true) { _running_help = value; }
private:
@@ -124,10 +121,6 @@
std::vectorstd::string _arguments;
std::string _command_help;
- /** Indicates that zypper is exiting through exit checkers like
- * <tt>if (zypper.exiting()) return;</tt>. To be used for SIGINT or SIGTERM
- * handling */
- bool _exiting;
int _exit_code;
bool _running_shell;
bool _running_help;
@@ -158,15 +151,15 @@
extern RuntimeData gData;
extern std::ostream no_stream;
-class ExitRequestException
+class ExitRequestException : public zypp::Exception
{
public:
- ExitRequestException(const std::string & msg = "") : _msg(msg) {}
- ~ExitRequestException() {}
+ ExitRequestException(const std::string & msg = "") : zypp::Exception(msg) {}
+// ExitRequestException(const std::string & msg = "") : _msg(msg) {}
- const std::string & msg() const { return _msg; }
+// const std::string & msg() const { return _msg; }
private:
- std::string _msg;
+// std::string _msg;
};
#endif /*ZYPPER_H*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-info.cc new/zypper-0.9.4/src/zypper-info.cc
--- old/zypper-0.9.3/src/zypper-info.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-info.cc 2007-12-12 13:42:43.000000000 +0100
@@ -7,6 +7,7 @@
#include "zypp/ZYpp.h"
#include "zypp/base/Algorithm.h"
#include "zypp/Patch.h"
+#include "zypp/Product.h"
#include "zypper.h"
#include "zypper-main.h"
@@ -20,17 +21,26 @@
extern ZYpp::Ptr God;
+void printNVA(const ResObject::constPtr & res)
+{
+ cout << _("Name: ") << res->name() << endl;
+ cout << _("Version: ") << res->edition().asString() << endl;
+ cout << _("Arch: ") << res->arch().asString() << endl;
+ cout << _("Vendor: ") << res->vendor() << endl;
+}
+
+void printSummaryDesc(const ResObject::constPtr & res)
+{
+ cout << _("Summary: ") << res->summary() << endl;
+ cout << _("Description: ") << endl;
+ cout << res->description() << endl;
+}
+
/**
*
*/
-void printInfo(const Zypper & zypper)
+void printInfo(const Zypper & zypper, const Resolvable::Kind & kind)
{
- Resolvable::Kind kind;
- if (zypper.command() == ZypperCommand::INFO)
- kind = ResTraits<Package>::kind;
- else if (zypper.command() == ZypperCommand::RUG_PATCH_INFO)
- kind = ResTraits<Patch>::kind;
-
ResPool pool = God->pool();
cout << endl;
@@ -67,10 +77,17 @@
cout << endl << endl;
- if (zypper.command() == ZypperCommand::INFO)
- printPkgInfo(zypper, installer.item,installed);
- else if (zypper.command() == ZypperCommand::RUG_PATCH_INFO)
- printPatchInfo(zypper, installer.item,installed);
+ if (kind == ResTraits<Package>::kind)
+ printPkgInfo(zypper, installer.item, installed);
+ else if (kind == ResTraits<Patch>::kind)
+ printPatchInfo(zypper, installer.item, installed);
+ else if (kind == ResTraits<Pattern>::kind)
+ printPatternInfo(zypper, installer.item, installed);
+ else if (kind == ResTraits<Product>::kind)
+ printProductInfo(zypper, installer.item, installed);
+ else
+ // TranslatorExplanation %s = resolvable type (package, patch, pattern, etc - untranslated).
+ cout << format(_("Info for type '%s' not implemented.")) % kind << endl;
}
}
}
@@ -100,9 +117,9 @@
{
cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
<< pool_item.resolvable()->repository().info().name() << endl;
- cout << _("Name: ") << pool_item.resolvable()->name() << endl;
- cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
- cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
+
+ printNVA(pool_item.resolvable());
+
cout << _("Installed: ") << (!ins_pool_item ? "No" : "Yes") << endl;
cout << _("Status: ");
@@ -117,9 +134,8 @@
cout << _("not installed") << endl;
cout << _("Installed Size: ") << pool_item.resolvable()->size().asString() << endl;
- cout << _("Summary: ") << pool_item.resolvable()->summary() << endl;
- cout << _("Description: ") << endl;
- cout << pool_item.resolvable()->description() << endl;
+
+ printSummaryDesc(pool_item.resolvable());
}
/**
@@ -147,10 +163,8 @@
*
*/
void printPatchInfo(const Zypper & zypper, 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;
-
+ printNVA(pool_item.resolvable());
+
cout << _("Status: "); // TODO debug
bool i = ins_pool_item ? true : false;
if (pool_item.status().isUndetermined ())
@@ -175,8 +189,8 @@
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;
+
+ printSummaryDesc(pool_item.resolvable());
cout << _("Provides:") << endl;
CapSet capSet = pool_item.resolvable()->dep(zypp::Dep::PROVIDES);
@@ -190,6 +204,73 @@
cout << it->refers().asString() << ": " << it->asString() << endl;
}
}
+
+/**
+ * Print pattern information.
+ * <p>
+ * Generates output like this:
+<pre>
+Information for pattern sw_management:
+
+Catalog: factory
+Name: sw_management
+Version: 11.0-2
+Arch: x86_64
+Installed: Yes
+Summary: Software Management
+Description:
+This pattern provides a graphical application and a command line tool for keeping your system up to date.
+</pre>
+ *
+ */
+void printPatternInfo(const Zypper & zypper,
+ const PoolItem & pool_item, const PoolItem & ins_pool_item)
+{
+ cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+ << pool_item.resolvable()->repository().info().name() << endl;
+
+ printNVA(pool_item.resolvable());
+
+ cout << _("Installed: ") << (!ins_pool_item ? "No" : "Yes") << endl;
+
+ printSummaryDesc(pool_item.resolvable());
+}
+
+/**
+ * Print product information.
+ * <p>
+ * Generates output like this:
+<pre>
+Information for product openSUSE-factory:
+
+Repository: factory
+Name: openSUSE-factory
+Version: 11.0
+Arch: x86_64
+Category: base
+Installed: No
+Summary: openSUSE FACTORY 11.0
+Description:
+</pre>
+ *
+ */
+void printProductInfo(const Zypper & zypper,
+ const PoolItem & pool_item, const PoolItem & ins_pool_item)
+{
+ cout << (zypper.globalOpts().is_rug_compatible ? _("Catalog: ") : _("Repository: "))
+ << pool_item.resolvable()->repository().info().name() << endl;
+
+ printNVA(pool_item.resolvable());
+
+ Product::constPtr product = asKind<Product>(pool_item.resolvable());
+ cout << _("Category: ") << product->type() << endl;
+ cout << _("Installed: ") << (!ins_pool_item ? "No" : "Yes") << endl;
+ cout << _("Short Name: ") << product->shortName() << endl;
+ cout << _("Long Name: ") << product->longName() << endl;
+
+ printSummaryDesc(pool_item.resolvable());
+}
+
// Local Variables:
// c-basic-offset: 2
// End:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-info.h new/zypper-0.9.4/src/zypper-info.h
--- old/zypper-0.9.3/src/zypper-info.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-info.h 2007-12-12 13:42:43.000000000 +0100
@@ -2,10 +2,11 @@
#define ZYPPERINFO_H_
#include "zypp/PoolItem.h"
+#include "zypp/Resolvable.h"
#include "zypper.h"
-void printInfo(const Zypper & zypper);
+void printInfo(const Zypper & zypper, const zypp::Resolvable::Kind & kind);
void printPkgInfo(const Zypper & zypper,
const zypp::PoolItem & pool_item,
@@ -15,4 +16,12 @@
const zypp::PoolItem & pool_item,
const zypp::PoolItem & ins_pool_item);
+void printPatternInfo(const Zypper & zypper,
+ const zypp::PoolItem & pool_item,
+ const zypp::PoolItem & ins_pool_item);
+
+void printProductInfo(const Zypper & zypper,
+ const zypp::PoolItem & pool_item,
+ const zypp::PoolItem & ins_pool_item);
+
#endif /*ZYPPERINFO_H_*/
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-misc.cc new/zypper-0.9.4/src/zypper-misc.cc
--- old/zypper-0.9.3/src/zypper-misc.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-misc.cc 2007-12-12 13:42:43.000000000 +0100
@@ -304,7 +304,7 @@
installer.item.status().setTransact( true, zypp::ResStatus::USER );
}
- cout_n << format(_("skipping %s '%s' (already installed)")) % kind_to_string_localized(kind,1) % name << endl;
+ cout_n << format(_("skipping %s '%s' (the newest version already installed)")) % kind_to_string_localized(kind,1) % name << endl;
}
else {
@@ -412,6 +412,47 @@
}
}
+// ----------------------------------------------------------------------------
+
+void remove_selections(Zypper & zypper)
+{
+ MIL << "Removing user selections from the solver pool" << endl;
+
+ DBG << "Removing user setToBeInstalled()/Removed()" << endl;
+
+ // iterate pool, searching for ResStatus::isByUser()
+ // TODO optimize: remember user selections and iterate by name
+ // TODO optimize: it seems this is actually needed only if the selection was
+ // not committed (user has chosen not to continue)
+ const ResPool & pool = God->pool();
+
+ for (ResPool::const_iterator it = pool.begin(); it != pool.end(); ++it)
+ if (it->status().isByUser())
+ {
+ DBG << "Removing user setToBeInstalled()/Removed()" << endl;
+ it->status().resetTransact(zypp::ResStatus::USER);
+ }
+
+ DBG << "Removing user addRequire() addConflict()" << endl;
+
+ Resolver_Ptr solver = God->resolver();
+ CapSet capSet = solver->getConflict();
+ for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
+ {
+ DBG << "removing conflict: " << (*it) << endl;
+ solver->removeConflict(*it);
+ }
+ capSet = solver->getRequire();
+ for (CapSet::const_iterator it = capSet.begin(); it != capSet.end(); ++it)
+ {
+ DBG << "removing require: " << (*it) << endl;
+ solver->removeRequire(*it);
+ }
+
+ MIL << "DONE" << endl;
+}
+
+// ----------------------------------------------------------------------------
// debugging
static
@@ -1440,6 +1481,8 @@
*/
void solve_and_commit (Zypper & zypper)
{
+ MIL << "solving..." << endl;
+
while (true) {
bool success = resolve(zypper);
if (success)
@@ -1463,6 +1506,7 @@
if (!confirm_licenses(zypper)) return;
cerr_v << _("committing") << endl;
+ MIL << "committing..." << endl;
try {
//! \todo fix the media reporting correctly
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-misc.h new/zypper-0.9.4/src/zypper-misc.h
--- old/zypper-0.9.3/src/zypper-misc.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-misc.h 2007-12-12 13:42:43.000000000 +0100
@@ -40,6 +40,12 @@
const zypp::ResObject::Kind &kind,
const std::string &capstr );
+/**
+ * Reset all selections made by mark_* methods. Needed in the shell to reset
+ * selections after the install and remove commands.
+ */
+void remove_selections(Zypper & zypper);
+
int show_summary(Zypper & zypper);
//std::string calculate_token();
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-repos.cc new/zypper-0.9.4/src/zypper-repos.cc
--- old/zypper-0.9.3/src/zypper-repos.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-repos.cc 2007-12-12 13:42:43.000000000 +0100
@@ -828,7 +828,7 @@
// ----------------------------------------------------------------------------
-int add_repo_by_url( Zypper & zypper,
+void add_repo_by_url( Zypper & zypper,
const zypp::Url & url, const string & alias,
const string & type,
tribool enabled, tribool autorefresh)
@@ -850,20 +850,23 @@
if ( !indeterminate(autorefresh) )
repo.setAutorefresh((autorefresh == true));
- return add_repo(zypper, repo);
+ zypper.setExitCode(add_repo(zypper, repo));
}
// ----------------------------------------------------------------------------
//! \todo handle zypp exceptions
-int add_repo_from_file( Zypper & zypper,
- const std::string & repo_file_url,
- tribool enabled, tribool autorefresh)
+void add_repo_from_file( Zypper & zypper,
+ const std::string & repo_file_url,
+ tribool enabled, tribool autorefresh)
{
//! \todo handle local .repo files, validate the URL
Url url = make_url(repo_file_url);
if (!url.isValid())
- return ZYPPER_EXIT_ERR_INVALID_ARGS;
+ {
+ zypper.setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
RepoManager manager(zypper.globalOpts().rm_options);
list<RepoInfo> repos;
@@ -876,7 +879,8 @@
report_problem(e,
_("Problem accessing the file at the specified URL") + string(":"),
_("Please check if the URL is valid and accessible."));
- return ZYPPER_EXIT_ERR_ZYPP;
+ zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);
+ return;
}
catch (const parser::ParseException & e)
{
@@ -886,14 +890,16 @@
// TranslatorExplanation don't translate the URL if the URL itself is not translated.
// Also don't translate the '.repo' string.
_("Is it a .repo file? See http://en.opensuse.org/Standards/RepoInfo for details."));
- return ZYPPER_EXIT_ERR_ZYPP;
+ zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);
+ return;
}
catch (const Exception & e)
{
ZYPP_CAUGHT(e);
report_problem(e,
_("Problem encountered while trying to read the file at the specified URL") + string(":"));
- return ZYPPER_EXIT_ERR_ZYPP;
+ zypper.setExitCode(ZYPPER_EXIT_ERR_ZYPP);
+ return;
}
// add repos
@@ -911,7 +917,7 @@
add_repo(zypper, repo);
}
- return ZYPPER_EXIT_OK;
+ return;
}
// ----------------------------------------------------------------------------
@@ -1106,11 +1112,14 @@
if (done)
return;
+ MIL << "Going to load resolvables" << endl;
+
load_repo_resolvables(zypper, to_pool);
if (!zypper.globalOpts().disable_system_resolvables && to_pool)
load_target_resolvables(zypper);
done = true;
+ MIL << "Done loading resolvables" << endl;
}
// ---------------------------------------------------------------------------
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-repos.h new/zypper-0.9.4/src/zypper-repos.h
--- old/zypper-0.9.3/src/zypper-repos.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-repos.h 2007-12-12 13:42:43.000000000 +0100
@@ -39,12 +39,12 @@
* \return ZYPPER_EXIT_ERR_ZYPP on unexpected zypp exception,
* ZYPPER_EXIT_OK otherwise
*/
-int add_repo_by_url(Zypper & zypper,
- const zypp::Url & url,
- const std::string & alias,
- const std::string & type = "",
- boost::tribool enabled = boost::indeterminate,
- boost::tribool autorefresh = boost::indeterminate);
+void add_repo_by_url(Zypper & zypper,
+ const zypp::Url & url,
+ const std::string & alias,
+ const std::string & type = "",
+ boost::tribool enabled = boost::indeterminate,
+ boost::tribool autorefresh = boost::indeterminate);
/**
* Add repository specified in given repo file on \a repo_file_url. All repos
@@ -57,10 +57,10 @@
* \return ZYPPER_EXIT_ERR_ZYPP on unexpected zypp exception,
* ZYPPER_EXIT_OK otherwise
*/
-int add_repo_from_file(Zypper & zypper,
- const std::string & repo_file_url,
- boost::tribool enabled = boost::indeterminate,
- boost::tribool autorefresh = boost::indeterminate);
+void add_repo_from_file(Zypper & zypper,
+ const std::string & repo_file_url,
+ boost::tribool enabled = boost::indeterminate,
+ boost::tribool autorefresh = boost::indeterminate);
/**
* Delte repository specified by \a alias.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-search.cc new/zypper-0.9.4/src/zypper-search.cc
--- old/zypper-0.9.3/src/zypper-search.cc 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-search.cc 2007-12-12 13:42:43.000000000 +0100
@@ -333,18 +333,18 @@
cout_vv << "using regex: " << regstr << endl;
// regex flags
- unsigned int flags = boost::regex::normal;
+ unsigned int flags = zypp::str::regex::normal;
if (!_options.caseSensitive())
- flags |= boost::regex_constants::icase;
+ flags |= zypp::str::regex::icase;
// create regex object
try {
_reg.assign(regstr, flags);
}
- catch (regex_error & e) {
+ catch (zypp::str::regex_error & e) {
cerr << "ZyppSearch::setupRegexp(): " << regstr
<< _(" is not a valid regular expression: \"")
- << e.what() << "\"" << endl;
+ << regstr << "\"" << endl;
cerr << _("This is a bug, please file a bug report against zypper.") << endl;
exit(1);
}
@@ -354,19 +354,23 @@
* Converts '*' and '?' wildcards within str into their regex equivalents.
*/
string ZyppSearch::wildcards2regex(const string & str) const {
- string regexed;
+ string regexed = str;
- regex all("\\*"); // regex to search for '*'
- regex one("\\?"); // regex to search for '?'
- string r_all(".*"); // regex equivalent of '*'
- string r_one("."); // regex equivalent of '?'
+ zypp::str::regex all("\\*"); // regex to search for '*'
+ zypp::str::regex one("\\?"); // regex to search for '?'
+ std::string r_all(".*"); // regex equivalent of '*'
+ std::string r_one("."); // regex equivalent of '?'
+ std::string::size_type pos;
// replace all "*" in input with ".*"
- regexed = regex_replace(str, all, r_all);
- cerr_vv << "wildcards2regex: " << str << " -> " << regexed;
+ for (pos = 0; (pos = regexed.find("*", pos)) != std::string::npos; pos+=2)
+ regexed = regexed.replace(pos, 1, r_all);
+ cerr_vv << "wildcards2regex: " << str << " -> " << regexed << std::endl;
// replace all "?" in input with "."
- regexed = regex_replace(regexed, one, r_one);
+ for (pos = 0; (pos = regexed.find('?', pos)) != std::string::npos; ++pos)
+ regexed = regexed.replace(pos, 1, r_one);
+
cerr_vv << " -> " << regexed << endl;
return regexed;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/src/zypper-search.h new/zypper-0.9.4/src/zypper-search.h
--- old/zypper-0.9.3/src/zypper-search.h 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/src/zypper-search.h 2007-12-12 13:42:43.000000000 +0100
@@ -13,10 +13,10 @@
#include <string>
#include <vector>
-#include
#include
#include "zypp/ZYpp.h"
#include "zypp/base/Hash.h"
+#include "zypp/base/Regex.h"
#include "zypp/cache/ResolvableQuery.h"
#include "zypp/RepoManager.h"
@@ -221,7 +221,7 @@
zypp::ZYpp::Ptr & _zypp;
const ZyppSearchOptions & _options;
const std::vectorstd::string _qstrings;
- boost::regex _reg;
+ zypp::str::regex _reg;
InstalledCache _icache;
IdCache _idcache;
@@ -390,10 +390,10 @@
* descriptions) with a regex created according to search criteria.
*/
struct Match {
- const boost::regex * _regex;
+ const zypp::str::regex * _regex;
const bool _search_descs;
- Match(const boost::regex & regex, bool search_descriptions = false) :
+ Match(const zypp::str::regex & regex, bool search_descriptions = false) :
_regex(®ex), _search_descs(search_descriptions)
{}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/test/test-cases/help new/zypper-0.9.4/test/test-cases/help
--- old/zypper-0.9.3/test/test-cases/help 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/test/test-cases/help 2007-12-12 13:42:43.000000000 +0100
@@ -1,4 +1,6 @@
+- zypper
- zypper help
+- zypper -h
show list of global options and list of commands
- zypper help help
@@ -24,6 +26,9 @@
in shell
+- empty line entered
+ show unknown command hint
+
- help
show list of global options and list of commands
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/test/test-cases/info new/zypper-0.9.4/test/test-cases/info
--- old/zypper-0.9.3/test/test-cases/info 1970-01-01 01:00:00.000000000 +0100
+++ new/zypper-0.9.4/test/test-cases/info 2007-12-12 13:42:43.000000000 +0100
@@ -0,0 +1,17 @@
+- zypper info
+ Show 'required argument missing' message.
+ Show info command help.
+
+- zypper info foo
+ show info for package foo
+
+- zypper info -t type foo
+ show info for resolvable foo of the specified type
+
+- zypper info non-existent
+ show 'package non-existent not found' message
+
+- zypper info -t type non-existent
+ show '"type" non-existent not found' message
+
+TODO add patch-info, and info options
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/zypper-0.9.3/VERSION.cmake new/zypper-0.9.4/VERSION.cmake
--- old/zypper-0.9.3/VERSION.cmake 2007-12-03 18:26:49.000000000 +0100
+++ new/zypper-0.9.4/VERSION.cmake 2007-12-12 13:42:43.000000000 +0100
@@ -20,4 +20,4 @@
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "9")
-SET(VERSION_PATCH "3")
+SET(VERSION_PATCH "4")
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org