summaryrefslogtreecommitdiff
authorMuayyad Alsadi <alsadi@ojuba.org>2009-07-29 16:00:58 (GMT)
committer Richard Hughes <richard@hughsie.com>2009-07-29 16:09:42 (GMT)
commit891dbfa2c27191e63fd8765e3400886c44198c70 (patch) (side-by-side diff)
treebbd976ac1cc467bad006be2fd91064ee7e02a9a6
parent9d9a9433a2272197d3fc2f5cfa1abd2a5fee979b (diff)
downloadpackagekit-891dbfa2c27191e63fd8765e3400886c44198c70.zip
packagekit-891dbfa2c27191e63fd8765e3400886c44198c70.tar.gz
Ignore physical media when refreshing
Signed-off-by: Richard Hughes <richard@hughsie.com>
Diffstat (more/less context) (ignore whitespace changes)
-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 9ef8b9c..7328366 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"