diff --git a/osc/build.py b/osc/build.py index 31ea4818..51649886 100644 --- a/osc/build.py +++ b/osc/build.py @@ -281,7 +281,8 @@ def main(opts, argv): print 'Updating cache of required packages' fetcher = Fetcher(cachedir = config['packagecachedir'], urllist = config['urllist'], - auth_dict = config['auth_dict']) + auth_dict = config['auth_dict'], + http_debug = config['http_debug']) # now update the package cache fetcher.run(bi) diff --git a/osc/fetch.py b/osc/fetch.py index 2f614011..a48f7075 100644 --- a/osc/fetch.py +++ b/osc/fetch.py @@ -23,7 +23,7 @@ def join_url(self, base_url, rel_url): class Fetcher: - def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = []): + def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = [], http_debug = False): __version__ = '0.1' __user_agent__ = 'osbuild/%s' % __version__ @@ -37,6 +37,7 @@ class Fetcher: self.cachedir = cachedir self.urllist = urllist + self.http_debug = http_debug passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm() for host in auth_dict.keys(): @@ -67,6 +68,12 @@ class Fetcher: MirrorGroup._join_url = join_url mg = MirrorGroup(self.gr, pac.urllist) + if self.http_debug: + print + print 'URLs to try for package \'%s\':' % pac + print '\n'.join(pac.urllist) + print + try: # it returns the filename ret = mg.urlgrab(pac.filename,