Hello community, here is the log from the commit of package zypper checked in at Fri Nov 10 13:14:34 CET 2006. -------- --- zypper/zypper.changes 2006-11-08 09:59:14.000000000 +0100 +++ /mounts/work_src_done/STABLE/zypper/zypper.changes 2006-11-10 12:57:42.000000000 +0100 @@ -1,0 +2,25 @@ +Fri Nov 10 12:05:36 CET 2006 - jkupec@suse.cz + +- solve_and_commit() changed to return informative exit codes if + a reboot or package manager restart is needed after + installation/removal of patches requiring such actions. +- 0.6.7 + +------------------------------------------------------------------- +Fri Nov 10 10:50:52 CET 2006 - mvidner@suse.cz + +- Do not obsolete y2pmsh.rpm yet. + +------------------------------------------------------------------- +Thu Nov 9 16:21:33 CET 2006 - mvidner@suse.cz + +- Fixed option parsing broken by unterminated option lists in 0.6.4 + (for example install -t was thinking -t stood for --terse). +- If "install"ing more resolvables at a time, don't commit one by one. +- 0.6.6 +------------------------------------------------------------------- +Wed Nov 8 20:08:30 CET 2006 - jkupec@suse.cz + +- Several exit codes defined for use in scripts. + +------------------------------------------------------------------- Old: ---- zypper-0.6.5.tar.bz2 New: ---- zypper-0.6.7.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ zypper.spec ++++++ --- /var/tmp/diff_new_pack.ath9kQ/_old 2006-11-10 13:14:05.000000000 +0100 +++ /var/tmp/diff_new_pack.ath9kQ/_new 2006-11-10 13:14:05.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package zypper (Version 0.6.5) +# spec file for package zypper (Version 0.6.7) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -21,13 +21,13 @@ Autoreqprov: on PreReq: permissions Summary: Command Line Package Management Using Libzypp -Version: 0.6.5 +Version: 0.6.7 Release: 1 -Source: zypper-0.6.5.tar.bz2 +Source: zypper-0.6.7.tar.bz2 Prefix: /usr -# RIP -Provides: y2pmsh -Obsoletes: y2pmsh +# zypper is not a fully featured replacement yet +#Provides: y2pmsh +#Obsoletes: y2pmsh %description Command Line Package Management Using Libzypp @@ -91,6 +91,20 @@ %doc %{_datadir}/doc/packages/zypper/zypper-rug %changelog -n zypper +* Fri Nov 10 2006 - jkupec@suse.cz +- solve_and_commit() changed to return informative exit codes if + a reboot or package manager restart is needed after + installation/removal of patches requiring such actions. +- 0.6.7 +* Fri Nov 10 2006 - mvidner@suse.cz +- Do not obsolete y2pmsh.rpm yet. +* Thu Nov 09 2006 - mvidner@suse.cz +- Fixed option parsing broken by unterminated option lists in 0.6.4 + (for example install -t was thinking -t stood for --terse). +- If "install"ing more resolvables at a time, don't commit one by one. +- 0.6.6 +* Wed Nov 08 2006 - jkupec@suse.cz +- Several exit codes defined for use in scripts. * Wed Nov 08 2006 - mvidner@suse.cz - Call dump_pool more often for better debugging. - 0.6.5 ++++++ zypper-0.6.5.tar.bz2 -> zypper-0.6.7.tar.bz2 ++++++ ++++ 14094 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/ChangeLog new/zypper-0.6.7/ChangeLog --- old/zypper-0.6.5/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ new/zypper-0.6.7/ChangeLog 2006-11-09 08:16:36.000000000 +0100 @@ -0,0 +1,9 @@ +2006-11-09 gettextize <bug-gnu-gettext@gnu.org> + + * Makefile.am (EXTRA_DIST): Add m4/ChangeLog. + +2006-10-25 gettextize <bug-gnu-gettext@gnu.org> + + * Makefile.am (EXTRA_DIST): Add config.rpath, mkinstalldirs, m4/ChangeLog. + * configure.ac (AC_OUTPUT): Add po/Makefile.in. + diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/VERSION new/zypper-0.6.7/VERSION --- old/zypper-0.6.5/VERSION 2006-11-08 09:58:57.000000000 +0100 +++ new/zypper-0.6.7/VERSION 2006-11-10 12:08:07.000000000 +0100 @@ -10,5 +10,5 @@ dnl ================================================== m4_define([ZYPPER_MAJOR], [0]) m4_define([ZYPPER_MINOR], [6]) -m4_define([ZYPPER_PATCH], [5]) +m4_define([ZYPPER_PATCH], [7]) dnl ================================================== diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/doc/TODO new/zypper-0.6.7/doc/TODO --- old/zypper-0.6.5/doc/TODO 2006-11-05 22:38:42.000000000 +0100 +++ new/zypper-0.6.7/doc/TODO 2006-11-09 17:00:36.000000000 +0100 @@ -5,6 +5,7 @@ - script progress: does the output contain newline?? - installation and deletion notifications - --dry-run (use ZYppCommitPolicy.h) +- FIXME zypper service-rename creates duplicates in sources list Patches diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/doc/zypper.8 new/zypper-0.6.7/doc/zypper.8 --- old/zypper-0.6.5/doc/zypper.8 2006-11-08 08:57:31.000000000 +0100 +++ new/zypper-0.6.7/doc/zypper.8 2006-11-08 20:06:13.000000000 +0100 @@ -235,6 +235,41 @@ .B /var/lib/zypp/cache Directory for storing metadata contained in installation sources. +.SH "EXIT CODES" +.LP +There are several exit codes defined for zypper for use e.g. within scripts. These codes are defined in header file src/zmart.h found in zypper source package. Codes from interval (1-5) denote an error, numbers (100-103) provide a specific information, 0 represents a normal successfull run. Following is a list of these codes with descriptions. +.TP +0 - ZYPPER_EXIT_OK +Successfull run of zypper with no special info. +.TP +1 - ZYPPER_EXIT_ERR_BUG +Unexpected situation occured, probably caused by a bug. +.TP +2 - ZYPPER_EXIT_ERR_SYNTAX +zypper was invoked with an invalid command or option, or a bad syntax. +.TP +3 - ZYPPER_EXIT_ERR_INVALID_ARGS +Some of provided arguments were invalid. E.g. an invalid URI was provided to the service-add command. +.TP +4 - ZYPPER_EXIT_ERR_ZYPP +A problem reported by ZYPP library. E.g. another instance of ZYPP is running. +.TP +5 - ZYPPER_EXIT_ERR_PRIVILEGES +User invoking zypper has insufficient privileges for specified operation. +.TP +100 - ZYPPER_EXIT_INF_UPDATE_NEEDED +Returned by the patch-check command if there are patches available for installation. +.TP +101 - ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED +Returned by the patch-check command if there are security patches available for installation. +.TP +102 - ZYPPER_EXIT_INF_REBOOT_NEEDED +Returned after a successfull installation of a patch which requires reboot of computer. +.TP +103 - ZYPPER_EXIT_INF_RESTART_NEEDED +Returned after a successfull installation of a patch which requires restart of the package manager itself. This means that one of patches to be installed affects the package manager itself and the command used (e.g. zypper update) needs to be executed once again to install any remaining patches. + + .SH "NOTE" .LP Currently, zypper can be run only by user with root privileges. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/po/ChangeLog new/zypper-0.6.7/po/ChangeLog --- old/zypper-0.6.5/po/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ new/zypper-0.6.7/po/ChangeLog 2006-10-25 14:19:44.000000000 +0200 @@ -0,0 +1,11 @@ +2006-10-25 gettextize <bug-gnu-gettext@gnu.org> + + * Makefile.in.in: New file, from gettext-0.14.5. + * boldquot.sed: New file, from gettext-0.14.5. + * en@boldquot.header: New file, from gettext-0.14.5. + * en@quot.header: New file, from gettext-0.14.5. + * insert-header.sin: New file, from gettext-0.14.5. + * quot.sed: New file, from gettext-0.14.5. + * remove-potcdate.sin: New file, from gettext-0.14.5. + * Rules-quot: New file, from gettext-0.14.5. + Binary files old/zypper-0.6.5/po/cs.gmo and new/zypper-0.6.7/po/cs.gmo differ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/po/cs.po new/zypper-0.6.7/po/cs.po --- old/zypper-0.6.5/po/cs.po 2006-11-05 23:06:24.000000000 +0100 +++ new/zypper-0.6.7/po/cs.po 2006-11-10 12:39:38.000000000 +0100 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: zypper 0.5.0\n" "Report-Msgid-Bugs-To: translation@suse.de\n" -"POT-Creation-Date: 2006-11-05 23:06+0100\n" +"POT-Creation-Date: 2006-11-10 12:39+0100\n" "PO-Revision-Date: 2006-10-25 09:22+0200\n" "Last-Translator: Martin Vidner <mvidner@suse.cz>\n" "Language-Team: Czech <translation-team-cs@lists.sourceforge.net>\n" @@ -37,7 +37,7 @@ "\tpatch-info\t\tShow full info for patches\n" msgstr "" -#: src/zypper.cc:256 +#: src/zypper.cc:294 msgid "" "zypper refresh\n" "\n" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/src/zmart-misc.cc new/zypper-0.6.7/src/zmart-misc.cc --- old/zypper-0.6.5/src/zmart-misc.cc 2006-11-08 09:55:24.000000000 +0100 +++ new/zypper-0.6.7/src/zmart-misc.cc 2006-11-09 18:33:38.000000000 +0100 @@ -144,7 +144,7 @@ // name and kind match: ProvideProcess installer (God->architecture(), "" /*version*/); - cerr_vv << "Iterating over " << name << endl; + cerr_vv << "Iterating over [" << kind << "]" << name << endl; invokeOnEach( pool.byNameBegin( name ), pool.byNameEnd( name ), resfilter::ByKind( kind ), @@ -230,10 +230,17 @@ } } -bool show_summary() +/** + * @return (-1) - nothing to do, + * 0 - there is at least 1 resolvable to be installed/uninstalled, + * ZYPPER_EXIT_INF_REBOOT_NEEDED - if one of patches to be installed needs machine reboot, + * ZYPPER_EXIT_INF_RESTART_NEEDED - if one of patches to be installed needs package manager restart + */ +int show_summary() { + int retv = -1; // nothing to do; + cerr << "Summary:" << endl; - bool nothing = true; MIL << "Pool contains " << God->pool().size() << " items." << std::endl; for ( ResPool::const_iterator it = God->pool().begin(); it != God->pool().end(); ++it ) @@ -241,7 +248,20 @@ ResObject::constPtr res = it->resolvable(); if ( it->status().isToBeInstalled() || it->status().isToBeUninstalled() ) { - nothing = false; + if (retv == -1) retv = 0; + + if (it->resolvable()->kind() == ResTraits<Patch>::kind) { + Patch::constPtr patch = asKind<Patch>(it->resolvable()); + + // set return value to 'reboot needed' + if (patch->reboot_needed()) + retv = ZYPPER_EXIT_INF_REBOOT_NEEDED; + // set return value to 'restart needed' (restart of package manager) + // however, 'reboot needed' takes precedence + else if (retv != ZYPPER_EXIT_INF_REBOOT_NEEDED && patch->affects_pkg_manager()) + retv = ZYPPER_EXIT_INF_RESTART_NEEDED; + } + if ( it->status().isToBeInstalled() ) cerr << "<install> "; if ( it->status().isToBeUninstalled() ) @@ -249,10 +269,10 @@ cerr << *res << endl; } } - if (nothing) + if (retv == -1) cerr << "Nothing to do." << endl; - return !nothing; + return retv; } std::string calculate_token() @@ -590,20 +610,43 @@ } } -void solve_and_commit (bool non_interactive) { + +/** + * @return ZYPPER_EXIT_OK - successful commit, + * ZYPPER_EXIT_ERR_ZYPP - if ZYppCommitResult contains resolvables with errors, + * ZYPPER_EXIT_INF_REBOOT_NEEDED - if one of patches to be installed needs machine reboot, + * ZYPPER_EXIT_INF_RESTART_NEEDED - if one of patches to be installed needs package manager restart + */ +int solve_and_commit (bool non_interactive) { resolve(); - + show_problems (); - if (show_summary()) { - + // returns -1, 0, ZYPPER_EXIT_INF_REBOOT_NEEDED, or ZYPPER_EXIT_INF_RESTART_NEEDED + int retv = show_summary(); + + if (retv >= 0) { // there are resolvables to install/uninstall cerr << "Continue? [y/n] " << (non_interactive ? "y\n" : ""); if (non_interactive || readBoolAnswer()) { cerr_v << "committing" << endl; ZYppCommitResult result = God->commit( ZYppCommitPolicy() ); - cerr_v << result << std::endl; + if (!result._errors.empty()) + retv = ZYPPER_EXIT_ERR_ZYPP; + cerr_v << result << std::endl; } } + + if (retv < 0) + retv = ZYPPER_EXIT_OK; + else if (retv == ZYPPER_EXIT_INF_REBOOT_NEEDED) + cout << "WARNING: One of installed patches requires reboot of" + " your machine. Please, do it as soon as possible." << endl; + else if (retv == ZYPPER_EXIT_INF_RESTART_NEEDED) + cout << "WARNING: One of installed patches affects the package" + " manager itself, thus it requires restart before executing" + " next operations." << endl; + + return retv; } // Local Variables: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/src/zmart-misc.h new/zypper-0.6.7/src/zmart-misc.h --- old/zypper-0.6.5/src/zmart-misc.h 2006-11-08 09:05:25.000000000 +0100 +++ new/zypper-0.6.7/src/zmart-misc.h 2006-11-09 14:22:06.000000000 +0100 @@ -24,8 +24,7 @@ void mark_for_uninstall( const zypp::ResObject::Kind &kind, const std::string &name ); void show_problems(); -//! return whether there is anything to commit -bool show_summary(); +int show_summary(); std::string calculate_token(); //! load all resolvables that the user wants void cond_load_resolvables (); @@ -39,7 +38,7 @@ void list_updates( const zypp::ResObject::Kind &kind ); void mark_updates( const zypp::ResObject::Kind &kind ); void usage(int argc, char **argv); -void solve_and_commit (bool non_interactive = false); +int solve_and_commit (bool non_interactive = false); // copied from yast2-pkg-bindings:PkgModuleFunctions::DoProvideNameKind struct ProvideProcess diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/src/zmart.h new/zypper-0.6.7/src/zmart.h --- old/zypper-0.6.5/src/zmart.h 2006-11-03 16:32:23.000000000 +0100 +++ new/zypper-0.6.7/src/zmart.h 2006-11-08 13:53:13.000000000 +0100 @@ -28,6 +28,21 @@ #define ZYPP_BASE_LOGGER_LOGGROUP "zypper" #define RANDOM_TOKEN "sad987432JJDJD948394DDDxxx22" +// ===== exit codes ====== + +#define ZYPPER_EXIT_OK 0 +// errors +#define ZYPPER_EXIT_ERR_BUG 1 // undetermined error +#define ZYPPER_EXIT_ERR_SYNTAX 2 // syntax error, e.g. zypper instal, zypper in --unknown option +#define ZYPPER_EXIT_ERR_INVALID_ARGS 3 // invalid arguments given, e.g. zypper source-add httttps://asdf.net +#define ZYPPER_EXIT_ERR_ZYPP 4 // error indicated from within libzypp, e.g. God = zypp::getZYpp() threw an exception +#define ZYPPER_EXIT_ERR_PRIVILEGES 5 // unsufficient privileges for the operation +// info +#define ZYPPER_EXIT_INF_UPDATE_NEEDED 100 // update needed +#define ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED 101 // security update needed +#define ZYPPER_EXIT_INF_REBOOT_NEEDED 102 // reboot needed after install/upgrade +#define ZYPPER_EXIT_INF_RESTART_NEEDED 103 // restart of package manager itself needed + struct Settings { Settings() diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/src/zypper.cc new/zypper-0.6.7/src/zypper.cc --- old/zypper-0.6.5/src/zypper.cc 2006-11-08 09:53:56.000000000 +0100 +++ new/zypper-0.6.7/src/zypper.cc 2006-11-09 16:26:26.000000000 +0100 @@ -205,7 +205,8 @@ {"catalog", required_argument, 0, 'c'}, {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = install_options; specific_help = " Command options:\n" @@ -218,7 +219,8 @@ static struct option remove_options[] = { {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = remove_options; specific_help = " Command options:\n" @@ -231,7 +233,8 @@ {"disabled", no_argument, 0, 'd'}, {"no-refresh", no_argument, 0, 'n'}, {"repo", required_argument, 0, 'r'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_add_options; specific_help = "service-add [options] URI [alias]\n" @@ -245,7 +248,8 @@ } else if (command == "service-list" || command == "sl") { static struct option service_list_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_list_options; specific_help = "service-list\n" @@ -257,7 +261,8 @@ } else if (command == "service-delete" || command == "sd") { static struct option service_delete_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_delete_options; specific_help = "service-delete [options] <URI|alias>\n" @@ -269,7 +274,8 @@ } else if (command == "service-rename" || command == "sr") { static struct option service_rename_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = service_rename_options; specific_help = "service-rename [options] <URI|alias> <new-alias>\n" @@ -281,7 +287,8 @@ } else if (command == "refresh" || command == "ref") { static struct option refresh_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = refresh_options; specific_help = _("zypper refresh\n" @@ -292,7 +299,8 @@ else if (command == "list-updates" || command == "lu") { static struct option list_updates_options[] = { {"type", required_argument, 0, 't'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = list_updates_options; specific_help = "list-updates [options]\n" @@ -307,7 +315,8 @@ static struct option update_options[] = { {"type", required_argument, 0, 't'}, {"no-confirm", no_argument, 0, 'y'}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = update_options; specific_help = " Command options:\n" @@ -329,7 +338,8 @@ {"type", required_argument, 0, 't'}, {"sort-by-name", no_argument, 0, 0}, {"sort-by-catalog", no_argument, 0, 0}, - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = search_options; specific_help = @@ -356,7 +366,8 @@ } else if (command == "patch-check" || command == "pchk") { static struct option patch_check_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patch_check_options; specific_help = "patch-check\n" @@ -368,7 +379,8 @@ } else if (command == "patches" || command == "pch") { static struct option patches_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patches_options; specific_help = "patches\n" @@ -380,7 +392,8 @@ } else if (command == "info" || command == "if") { static struct option info_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = info_options; specific_help = @@ -391,7 +404,8 @@ } else if (command == "patch-info") { static struct option patch_info_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = patch_info_options; specific_help = @@ -402,7 +416,8 @@ } else if (command == "moo") { static struct option moo_options[] = { - {"help", no_argument, 0, 'h'} + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} }; specific_options = moo_options; specific_help = @@ -414,12 +429,12 @@ else if (!command.empty()) { // empty command is treated earlier cerr << "Unknown command '" << command << "'." << endl << endl; cerr << help_commands; - return 1; + return ZYPPER_EXIT_ERR_SYNTAX; } parsed_opts copts = parse_options (argc, argv, specific_options); if (copts.count("_unknown")) - return 1; + return ZYPPER_EXIT_ERR_SYNTAX; // treat --help command option like global --help option from now on // i.e. when used together with command to print command specific help @@ -465,7 +480,7 @@ { Url url = make_url (*it); if (!url.isValid()) - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; gSettings.additional_sources.push_back(url); } } @@ -479,7 +494,7 @@ ZYPP_CAUGHT (excpt_r); ERR << "a ZYpp transaction is already in progress." << endl; cerr << "a ZYpp transaction is already in progress." << endl; - return 1; + return ZYPPER_EXIT_ERR_ZYPP; } ResObject::Kind kind; @@ -491,7 +506,7 @@ if (command == "moo") { cout << " \\\\\\\\\\\n \\\\\\\\\\\\\\__o\n__\\\\\\\\\\\\\\'/_" << endl; - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( service list )------------------------------- @@ -506,11 +521,11 @@ if ( geteuid() != 0 ) { cerr << "Sorry, you need root privileges to view system sources." << endl; - return 1; + return ZYPPER_EXIT_ERR_PRIVILEGES; } list_system_sources(); - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( service add )-------------------------------- @@ -544,7 +559,7 @@ Url url = make_url (repourl); if (!url.isValid()) - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; string alias = repoalias; if (alias.empty ()) alias = url.asString(); @@ -563,10 +578,10 @@ catch ( const Exception & excpt_r ) { cerr << excpt_r.asUserString() << endl; - return 1; + return ZYPPER_EXIT_ERR_ZYPP; } - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( service delete )----------------------------- @@ -587,10 +602,10 @@ { ZYPP_CAUGHT (excpt_r); cerr << excpt_r.asUserString() << endl; - return 1; + return ZYPPER_EXIT_ERR_ZYPP; } - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( service rename )----------------------------- @@ -611,10 +626,10 @@ catch ( const Exception & excpt_r ) { cerr << excpt_r.asUserString() << endl; - return 1; + return ZYPPER_EXIT_ERR_ZYPP; } - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( refresh )------------------------------------ @@ -659,7 +674,7 @@ kind = string_to_kind (skind); if (kind == ResObject::Kind ()) { cerr << "Unknown resolvable type " << skind << endl; - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; } cond_init_system_sources (); @@ -684,10 +699,10 @@ else { mark_for_uninstall(kind, *it); } - - solve_and_commit (copts.count("no-confirm")); } - return 0; + + solve_and_commit (copts.count("no-confirm")); + return ZYPPER_EXIT_OK; } // --------------------------( search )------------------------------------- @@ -717,7 +732,7 @@ kind = string_to_kind (skind); if (kind == ResObject::Kind ()) { cerr << "Unknown resolvable type " << skind << endl; - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; } options.setKind(kind); } @@ -742,7 +757,7 @@ cout << t; } - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( patch check )-------------------------------- @@ -767,10 +782,10 @@ patch_check (); if (gData.security_patches_count > 0) - return 2; + return ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED; if (gData.patches_count > 0) - return 1; - return 0; + return ZYPPER_EXIT_INF_UPDATE_NEEDED; + return ZYPPER_EXIT_OK; } // --------------------------( patches )------------------------------------ @@ -786,7 +801,7 @@ cond_load_resolvables (); establish (); show_patches (); - return 0; + return ZYPPER_EXIT_OK; } // --------------------------( list updates )------------------------------- @@ -803,7 +818,7 @@ kind = string_to_kind (skind); if (kind == ResObject::Kind ()) { cerr << "Unknown resolvable type " << skind << endl; - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; } cond_init_target (); @@ -813,7 +828,7 @@ list_updates (kind); - return 0; + return ZYPPER_EXIT_OK; } // -----------------------------( update )---------------------------------- @@ -831,7 +846,7 @@ kind = string_to_kind (skind); if (kind == ResObject::Kind ()) { cerr << "Unknown resolvable type " << skind << endl; - return 1; + return ZYPPER_EXIT_ERR_INVALID_ARGS; } cond_init_target (); @@ -840,8 +855,11 @@ establish (); mark_updates (kind); - solve_and_commit (copts.count("no-confirm")); - return 0; + + // commit + // returns ZYPPER_EXIT_OK, ZYPPER_EXIT_ERR_ZYPP, + // ZYPPER_EXIT_INF_REBOOT_NEEDED, or ZYPPER_EXIT_INF_RESTART_NEEDED + return solve_and_commit (copts.count("no-confirm")); } // -----------------------------( info )------------------------------------ @@ -859,10 +877,11 @@ printInfo(command,arguments); - return 0; + return ZYPPER_EXIT_OK; } - return 1; // if the program reaches this line, something went wrong + // if the program reaches this line, something went wrong + return ZYPPER_EXIT_ERR_BUG; } void command_shell () diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/zypper-0.6.5/zypper.spec.in new/zypper-0.6.7/zypper.spec.in --- old/zypper-0.6.5/zypper.spec.in 2006-11-06 11:24:41.000000000 +0100 +++ new/zypper-0.6.7/zypper.spec.in 2006-11-10 10:51:00.000000000 +0100 @@ -24,9 +24,9 @@ Release: 0 Source: @PACKAGE@-@VERSION@.tar.bz2 Prefix: /usr -# RIP -Provides: y2pmsh -Obsoletes: y2pmsh +# zypper is not a fully featured replacement yet +#Provides: y2pmsh +#Obsoletes: y2pmsh %description Command Line Package Management Using Libzypp ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org