Jan Kupec wrote:
dmacvicar@svn.opensuse.org wrote:
Author: dmacvicar Date: Mon Jul 30 23:42:43 2007 New Revision: 6311
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6311&view=rev Log: dont use baseUrls (deprecated, perhaps we remove it) use the url iterator
Let's keep baseUrls(), it's handy for the application to store the set of urls and then work with it if appropriate. Example use case: when initializing repos (checking if to refresh for those with autorefresh enabled), if the app finds out the repo is invalid, it can disable it in its internal set and ignore it for the rest of the operation.
WOW. Can't believe it. Two days passed until i realized i must have had my brain short-circuited when writing this!!! It should have been about baseUrls() but i've had knownRepositories() in my mind all the time! Jeesh, sorry for the noise. j.
But for list repos operation, as is the case below, it is appropriate to use the iterator which always works with data of the *.repo files.
Jano
Modified: trunk/zypper/src/zypper-sources.cc
Modified: trunk/zypper/src/zypper-sources.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-sources.cc?rev=6311&r1=6310&r2=6311&view=diff ============================================================================== --- trunk/zypper/src/zypper-sources.cc (original) +++ trunk/zypper/src/zypper-sources.cc Mon Jul 30 23:42:43 2007 @@ -123,10 +123,8 @@ tr << repo.type().asString(); tr << repo.alias();
- std::set<Url> urls; - urls = repo.baseUrls(); - for ( RepoInfo::urls_const_iterator uit = urls.begin(); - uit != urls.end(); + for ( RepoInfo::urls_const_iterator uit = repo.baseUrlsBegin(); + uit != repo.baseUrlsEnd(); ++uit ) { tr << (*uit).asString();
-- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org