// can ignore repos targetted for other systems
init_target(zypper);
- MIL << "Refreshing autorefresh services." << endl;
-
- const list<ServiceInfo> & services = zypper.repoManager().knownServices();
- bool called_refresh = false;
- for_(s, services.begin(), services.end())
+ if (!zypper.globalOpts().no_refresh)
{
- if (s->enabled() && s->autorefresh())
+ MIL << "Refreshing autorefresh services." << endl;
+
+ const list<ServiceInfo> & services = zypper.repoManager().knownServices();
+ bool called_refresh = false;
+ for_(s, services.begin(), services.end())
{
- refresh_service(zypper, *s);
- called_refresh = true;
+ if (s->enabled() && s->autorefresh())
+ {
+ refresh_service(zypper, *s);
+ called_refresh = true;
+ }
}
+ // reinitialize the repo manager to re-read the list of repos
+ if (called_refresh)
+ zypper.initRepoManager();
}
- // reinitialize the repo manager to re-read the list of repos
- if (called_refresh)
- zypper.initRepoManager();
MIL << "Going to initialize repositories." << endl;
RepoManager & manager = zypper.repoManager();