Author: jkupec Date: Tue Jan 15 17:23:22 2008 New Revision: 8293 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8293&view=rev Log: - skip repos with no alias or url when adding repos from file 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=8293&r1=8292&r2=8293&view=diff ============================================================================== --- trunk/zypper/src/zypper-repos.cc (original) +++ trunk/zypper/src/zypper-repos.cc Tue Jan 15 17:23:22 2008 @@ -903,7 +903,12 @@ cout_n << _("Enabled") << ": " << (repo.enabled() ? _("Yes") : _("No")) << endl; // TranslatorExplanation used as e.g. "Autorefresh: Yes" cout_n << _("Autorefresh") << ": " << (repo.autorefresh() ? _("Yes") : _("No")) << endl; - cout_n << "URL: " << *repo.baseUrlsBegin() << endl; + + cout_n << "URL:"; + for (RepoInfo::urls_const_iterator uit = repo.baseUrlsBegin(); + uit != repo.baseUrlsEnd(); uit++) + cout_n << " " << *uit; + cout_n << endl; } MIL << "Repository successfully added: " << repo << endl; @@ -1006,12 +1011,25 @@ { RepoInfo repo = *it; + if(repo.alias().empty()) + { + cerr << _("A repository with no alias defined found in the file, skipping.") << endl; + continue; + } + + if(repo.baseUrlsEmpty()) + { + cerr << format(_("Repository '%s' has no URL defined, skipping.")) % repo.name() << endl; + continue; + } + MIL << "enabled: " << enabled << " autorefresh: " << autorefresh << endl; if ( !indeterminate(enabled) ) repo.setEnabled((enabled == true)); if ( !indeterminate(autorefresh) ) repo.setAutorefresh((autorefresh == true)); MIL << "enabled: " << repo.enabled() << " autorefresh: " << repo.autorefresh() << endl; + add_repo(zypper, repo); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org