Author: jkupec Date: Fri Oct 3 10:17:29 2008 New Revision: 11236 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11236&view=rev Log: - simulate rug ping command (bnc #430756) Modified: trunk/zypper/doc/zypper.8 trunk/zypper/src/Command.cc trunk/zypper/src/Command.h trunk/zypper/src/Zypper.cc Modified: trunk/zypper/doc/zypper.8 URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/doc/zypper.8?rev=11236&r1=11235&r2=11236&view=diff ============================================================================== --- trunk/zypper/doc/zypper.8 (original) +++ trunk/zypper/doc/zypper.8 Fri Oct 3 10:17:29 2008 @@ -1348,6 +1348,17 @@ .I rug product-info zypper info -t product +.SS System Commands +.TP +.I rug ping +zypper ping +.IP +This command just returns 0 without producing any output or doing anything +to the system. Rug's ping command is used to wake up the ZLM daemon +or to check whether it is up and running. Since zypper does no require +ZLM or any other daemon to run, it is safe to always return 0 here to +indicate it is ready for operation. + .SS Other Compatibility Notes .TP Modified: trunk/zypper/src/Command.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Command.cc?rev=11236&r1=11235&r2=11236&view=diff ============================================================================== --- trunk/zypper/src/Command.cc (original) +++ trunk/zypper/src/Command.cc Fri Oct 3 10:17:29 2008 @@ -86,6 +86,7 @@ const ZypperCommand ZypperCommand::RUG_INFO_OBSOLETES(ZypperCommand::RUG_INFO_OBSOLETES_e); const ZypperCommand ZypperCommand::RUG_INFO_REQUIREMENTS(ZypperCommand::RUG_INFO_REQUIREMENTS_e); const ZypperCommand ZypperCommand::RUG_PATCH_SEARCH(ZypperCommand::RUG_PATCH_SEARCH_e); +const ZypperCommand ZypperCommand::RUG_PING(ZypperCommand::RUG_PING_e); ZypperCommand::ZypperCommand(const std::string & strval_r) @@ -162,6 +163,7 @@ _table["info-conflicts"] = _table["ic"] = ZypperCommand::RUG_INFO_CONFLICTS_e; _table["info-obsoletes"] = _table["io"] = ZypperCommand::RUG_INFO_OBSOLETES_e; _table["patch-search"] = _table["pse"] = ZypperCommand::RUG_PATCH_SEARCH_e; + _table["ping"] = ZypperCommand::RUG_PING_e; } std::mapstd::string,ZypperCommand::Command::const_iterator it Modified: trunk/zypper/src/Command.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Command.h?rev=11236&r1=11235&r2=11236&view=diff ============================================================================== --- trunk/zypper/src/Command.h (original) +++ trunk/zypper/src/Command.h Fri Oct 3 10:17:29 2008 @@ -85,6 +85,7 @@ static const ZypperCommand RUG_INFO_OBSOLETES; static const ZypperCommand RUG_INFO_REQUIREMENTS; static const ZypperCommand RUG_PATCH_SEARCH; + static const ZypperCommand RUG_PING; //!@} enum Command @@ -152,7 +153,8 @@ RUG_INFO_CONFLICTS_e, RUG_INFO_OBSOLETES_e, RUG_INFO_REQUIREMENTS_e, - RUG_PATCH_SEARCH_e + RUG_PATCH_SEARCH_e, + RUG_PING_e }; ZypperCommand(Command command) : _command(command) {} Modified: trunk/zypper/src/Zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/Zypper.cc?rev=11236&r1=11235&r2=11236&view=diff ============================================================================== --- trunk/zypper/src/Zypper.cc (original) +++ trunk/zypper/src/Zypper.cc Fri Oct 3 10:17:29 2008 @@ -2164,6 +2164,24 @@ break; } + case ZypperCommand::RUG_PING_e: + { + static struct option options[] = { + {"help", no_argument, 0, 'h'}, + {"if-active", no_argument, 0, 'a'}, + {0, 0, 0, 0} + }; + specific_options = options; + _command_help = _( + // translators: this is just a rug-compatiblity command + "ping [options]\n" + "\n" + "This command has dummy implementation which always returns 0.\n" + "It is provided for compatibility with rug.\n" + ); + break; + } + default: { if (runningHelp()) @@ -3951,6 +3969,13 @@ break; } + // dummy commands + case ZypperCommand::RUG_PING_e: + { + if (runningHelp()) { out().info(_command_help, Out::QUIET); return; } + break; + } + default: // if the program reaches this line, something went wrong setExitCode(ZYPPER_EXIT_ERR_BUG); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org