summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuayyad Alsadi <alsadi@ojuba.org>2009-07-29 17:00:58 +0100
committerRichard Hughes <richard@hughsie.com>2009-07-29 17:09:42 +0100
commit891dbfa2c27191e63fd8765e3400886c44198c70 (patch)
treebbd976ac1cc467bad006be2fd91064ee7e02a9a6
parent9d9a9433a2272197d3fc2f5cfa1abd2a5fee979b (diff)
Ignore physical media when refreshing
Signed-off-by: Richard Hughes <richard@hughsie.com>
-rwxr-xr-xbackends/yum/yumBackend.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/backends/yum/yumBackend.py b/backends/yum/yumBackend.py
index 9ef8b9cdd..732836629 100755
--- a/backends/yum/yumBackend.py
+++ b/backends/yum/yumBackend.py
@@ -1417,6 +1417,9 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
bump = (95/len(self.yumbase.repos.listEnabled()))/2
for repo in self.yumbase.repos.listEnabled():
+ # is physical media
+ if repo.mediaid:
+ continue
repo.metadata_expire = 0
self.yumbase.repos.populateSack(which=[repo.id], mdtype='metadata', cacheonly=1)
pct += bump
@@ -2479,12 +2482,18 @@ class PackageKitYumBackend(PackageKitBaseBackend, PackagekitPackage):
# we don't care about freshest data
elif lazy_cache:
for repo in self.yumbase.repos.listEnabled():
+ # is physical media
+ if repo.mediaid:
+ continue
repo.metadata_expire = 60 * 60 * 24 # 24 hours
repo.mdpolicy = "group:all"
# default
else:
for repo in self.yumbase.repos.listEnabled():
+ # is physical media
+ if repo.mediaid:
+ continue
repo.metadata_expire = 60 * 60 * 1.5 # 1.5 hours, the default
repo.mdpolicy = "group:primary"