55 MIL << (*its) << endl;
58 std::map<std::string,std::pair<std::string,ServiceInfo::RepoState>> repoStates;
65 if ( it->first ==
"name" )
67 else if ( it->first ==
"url" && ! it->second.empty() )
69 else if ( it->first ==
"enabled" )
71 else if ( it->first ==
"autorefresh" )
73 else if ( it->first ==
"type" )
75 else if ( it->first ==
"ttl_sec" )
76 service.
setTtl( str::strtonum<Date::Duration>(it->second) );
77 else if ( it->first ==
"lrf_dat" )
79 else if ( it->first ==
"repostoenable" )
81 std::vector<std::string> aliases;
83 for_( ait, aliases.begin(), aliases.end() )
88 else if ( it->first ==
"repostodisable" )
90 std::vector<std::string> aliases;
92 for_( ait, aliases.begin(), aliases.end() )
99 static str::regex rxexpr(
"([0-9]+)(_(.*))?" );
103 std::string tag( what[1] );
104 if ( what.
size() > 3 )
107 if ( what[3] ==
"enabled" )
108 repoStates[tag].second.enabled =
str::strToBool( it->second, repoStates[tag].second.enabled );
109 else if ( what[3] ==
"autorefresh" )
110 repoStates[tag].second.autorefresh =
str::strToBool( it->second, repoStates[tag].second.autorefresh );
111 else if ( what[3] ==
"priority" )
112 str::strtonum( it->second, repoStates[tag].second.priority );
114 ERR <<
"Unknown attribute " << it->first <<
" ignored" << endl;
119 repoStates[tag].first = it->second;
123 ERR <<
"Unknown attribute " << it->first <<
" ignored" << endl;
126 ERR <<
"Unknown attribute " << it->first <<
" ignored" << endl;
129 if ( ! repoStates.empty() )
132 for (
const auto & el : repoStates )
134 if ( el.second.first.empty() )
135 ERR <<
"Missing alias for repo_" << el.first <<
"; ignore entry" << endl;
137 data[el.second.first] = el.second.second;
139 if ( ! data.empty() )
143 MIL <<
"Linking ServiceInfo with file " << file << endl;
147 if ( !callback(service) )