Author: jkupec Date: Fri Nov 30 18:31:54 2007 New Revision: 8001 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8001&view=rev Log: - shellCleanup() added Modified: trunk/zypper/src/zypper.cc trunk/zypper/src/zypper.h Modified: trunk/zypper/src/zypper.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8001&r1=8000&r2=8001&view=diff ============================================================================== --- trunk/zypper/src/zypper.cc (original) +++ trunk/zypper/src/zypper.cc Fri Nov 30 18:31:54 2007 @@ -402,9 +402,6 @@ read_history (histfile.c_str ()); while (true) { - // reset globals - setRunningHelp(false); - // read a line string line = readline_getline (); cerr_vv << "Got: " << line << endl; @@ -439,8 +436,7 @@ print_unknown_command_hint(); } - if (exiting()) - return; + shellCleanup(); } if (!histfile.empty ()) @@ -450,6 +446,36 @@ setRunningShell(false); } +void Zypper::shellCleanup() +{ + // clear any previous arguments + _arguments.clear(); + // clear command options + if (!_copts.empty()) + { + _copts.clear(); + _cmdopts = CommandOptions(); + } + // clear the command + _command = ZypperCommand::NONE; + // clear command help text + _command_help.clear(); + // reset help flag + setRunningHelp(false); + // reset the exitting flag + exit(false); + // ... and the exit code does not matter in the shell + + // gData + gData.current_repo = RepoInfo(); + + // TODO: + // gData.repos re-read after repo operations or modify/remove these very repoinfos + // gData.repo_resolvables re-read only after certain repo operations (all?) + // gData.target_resolvables re-read only after installation/removal/update + // call target commit refresh pool after installation/removal/update (#328855) +} + /// process one command from the OS shell or the zypper shell // catch unexpected exceptions and tell the user to report a bug (#224216) Modified: trunk/zypper/src/zypper.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.h?rev=8001&r1=8000&r2=8001&view=diff ============================================================================== --- trunk/zypper/src/zypper.h (original) +++ trunk/zypper/src/zypper.h Fri Nov 30 18:31:54 2007 @@ -104,6 +104,7 @@ void processGlobalOptions(); void processCommandOptions(); void commandShell(); + void shellCleanup(); void safeDoCommand(); void doCommand(); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org