Author: jreidinger Date: Tue Jun 24 09:19:28 2008 New Revision: 10447 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10447&view=rev Log: read service only if service.d exist and don't throw exception Modified: trunk/libzypp/zypp/RepoManager.cc Modified: trunk/libzypp/zypp/RepoManager.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/RepoManager.cc?rev=10447&r1=10446&r2=10447&view=diff ============================================================================== --- trunk/libzypp/zypp/RepoManager.cc (original) +++ trunk/libzypp/zypp/RepoManager.cc Tue Jun 24 09:19:28 2008 @@ -1573,15 +1573,17 @@ ServiceCollector collector(services); Pathname dir = options.knownServicesPath; list<Pathname> entries; - - if ( filesystem::readdir( entries, Pathname(dir), false ) != 0 ) - ZYPP_THROW(Exception("failed to read directory")); - - str::regex allowedServiceExt("^\\.service(_[0-9]+)?$"); - for_(it, entries.begin(), entries.end() ) + if (PathInfo(dir).isExist()) { - parser::ServiceFileReader reader(*it, - bind(&ServiceCollector::collect, collector, _1) ); + if ( filesystem::readdir( entries, Pathname(dir), false ) != 0 ) + ZYPP_THROW(Exception("failed to read directory")); + + str::regex allowedServiceExt("^\\.service(_[0-9]+)?$"); + for_(it, entries.begin(), entries.end() ) + { + parser::ServiceFileReader reader(*it, + bind(&ServiceCollector::collect, collector, _1) ); + } } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org