From f33038750bee150998f6944d34e1ac7767be11e9 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Thu, 7 Jun 2012 16:26:35 +0800 Subject: [PATCH] resolve the depends of python-urlgrabber Signed-off-by: Gui Chen --- distfiles/debian/control | 7 ++++--- distfiles/mic.spec | 1 + mic/imager/raw.py | 2 +- mic/utils/rpmmisc.py | 10 ++++++---- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/distfiles/debian/control b/distfiles/debian/control index a8ee6c2..b34aa3e 100644 --- a/distfiles/debian/control +++ b/distfiles/debian/control @@ -21,14 +21,15 @@ Depends: ${misc:Depends}, ${python:Depends}, psmisc, squashfs-tools (>= 4.0), qemu-user-static | qemu-arm-static, - syslinux (>= 3.82), + syslinux (>= 4.05), + extlinux (>= 4.05), yum (>= 3.2), libzypp, - python-zypp + python-zypp, + python-urlgrabber Recommends: binfmt-support, btrfs-tools, - extlinux | syslinux, udisks | hal Replaces: mic2 diff --git a/distfiles/mic.spec b/distfiles/mic.spec index 428dea1..327a7e4 100644 --- a/distfiles/mic.spec +++ b/distfiles/mic.spec @@ -32,6 +32,7 @@ Requires: isomd5sum Requires: gzip Requires: bzip2 Requires: squashfs-tools >= 4.0 +Requires: python-urlgrabber %if 0%{?suse_version} Requires: btrfsprogs %else diff --git a/mic/imager/raw.py b/mic/imager/raw.py index 68b138d..90b90c5 100644 --- a/mic/imager/raw.py +++ b/mic/imager/raw.py @@ -19,7 +19,7 @@ import os import stat import shutil -from pykickstart.urlgrabber import progress +from urlgrabber import progress from mic import kickstart, msger from mic.utils import fs_related, runner, misc diff --git a/mic/utils/rpmmisc.py b/mic/utils/rpmmisc.py index c1b0c95..e0af019 100644 --- a/mic/utils/rpmmisc.py +++ b/mic/utils/rpmmisc.py @@ -24,11 +24,13 @@ from mic import msger from .errors import CreatorError from .proxy import get_proxy_for import runner +from urlgrabber import grabber, __version__ as grabber_version +if rpm.labelCompare(grabber_version.split('.'), '3.9.0'.split('.')) == -1: + msger.warning("Version of python-urlgrabber is %s, lower than '3.9.0', " + "you may encounter some network issues" % grbber_version) def myurlgrab(url, filename, proxies, progress_obj = None): - from pykickstart.urlgrabber.grabber import URLGrabber, URLGrabError - - g = URLGrabber() + g = grabber.URLGrabber() if progress_obj is None: progress_obj = TextProgress() @@ -43,7 +45,7 @@ def myurlgrab(url, filename, proxies, progress_obj = None): ssl_verify_host = False, ssl_verify_peer = False, proxies = proxies, http_headers = (('Pragma', 'no-cache'),), quote = 0, progress_obj = progress_obj) - except URLGrabError, e: + except grabber.URLGrabError, e: raise CreatorError("URLGrabber error: %s" % url) return filename -- 2.7.4