Author: jreidinger Date: Tue Mar 11 15:21:22 2008 New Revision: 9091 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9091&view=rev Log: improve output modifyrepo for users (bnc #327580) Modified: trunk/zypper/src/zypper-repos.cc Modified: trunk/zypper/src/zypper-repos.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-repos.cc?rev=9091&r1=9090&r2=9091&view=diff ============================================================================== --- trunk/zypper/src/zypper-repos.cc (original) +++ trunk/zypper/src/zypper-repos.cc Tue Mar 11 15:21:22 2008 @@ -958,7 +958,6 @@ } } - bool error = false; try { if( clean_metadata ) @@ -1185,7 +1184,6 @@ MIL << "going to add repository by url (alias=" << alias << ", url=" << url << ")" << endl; - RepoManager manager(zypper.globalOpts().rm_options); RepoInfo repo; if ( ! type.empty() ) @@ -1388,18 +1386,53 @@ { RepoManager manager(zypper.globalOpts().rm_options); RepoInfo repo(manager.getRepositoryInfo(alias)); + bool change_able = false; + bool change_autoref = false; if (!indeterminate(enable)) + { + if (enable != repo.enabled()) + change_able = true; repo.setEnabled(enable); + } if (!indeterminate(autoref)) + { + if (autoref != repo.autorefresh()) + change_autoref = true; repo.setAutorefresh(autoref); + } - manager.modifyRepository(alias, repo); - zypper.out().info(boost::str(format( - _("Repository %s has been sucessfully modified.")) % alias)); - MIL << format("Repository %s modified:") % alias << repo << endl; + if (change_able || change_autoref) + { + manager.modifyRepository(alias, repo); + if (change_able) + { + if (repo.enabled()) + zypper.out().info(boost::str(format( + _("Repository %s has been sucessfully enabled.")) % alias)); + else + zypper.out().info(boost::str(format( + _("Repository %s has been sucessfully disabled.")) % alias)); + } + + if (change_autoref) + { + if (repo.autorefresh()) + zypper.out().info(boost::str(format( + _("Repository %s has activated autorefresh.")) % alias)); + else + zypper.out().info(boost::str(format( + _("Repository %s has disabled autorefresh.")) % alias)); + } + } + else + { + zypper.out().info( + _("Nothink to change. No options change repository settings.")); + MIL << format("Repository %s nothink to modify:") % alias << repo << endl; + } } catch (const Exception & ex) { -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org