[yum-commits] yumdownloader.py
skvidal at osuosl.org
skvidal at osuosl.org
Mon Mar 23 16:37:05 UTC 2009
yumdownloader.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 006de72b24efdf6ad0c5de0d55d1e566546da818
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Mon Mar 23 12:35:21 2009 -0400
include a check to make sure the pkg makes sense.
diff --git a/yumdownloader.py b/yumdownloader.py
index 81bd950..1c4e98b 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -21,7 +21,7 @@ sys.path.insert(0,'/usr/share/yum-cli')
import yum
from yum.misc import getCacheDir, setup_locale
from yum.packages import parsePackages
-
+from yum.Errors import RepoError
from utils import YumUtilBase
from urlparse import urljoin
@@ -240,11 +240,14 @@ class YumDownloader(YumUtilBase):
repo.cache = 0
download.localpath = local # Hack: to set the localpath we want.
try:
- path = repo.getPackage(download)
+ checkfunc = (self.verifyPkg, (download, 1), {})
+ path = repo.getPackage(download, checkfunc=checkfunc)
except IOError, e:
self.logger.error("Cannot write to file %s. Error was: %s" % (local, e))
continue
-
+ except RepoError, e:
+ self.logger.error("Could not download/verify pkg %s: %s" % (download, e)
+ continue
if not os.path.exists(local) or not os.path.samefile(path, local):
progress = TextMeter()
More information about the Yum-commits
mailing list