mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-25 19:52:12 +01:00
print the list of URL to try, when in HTTP debug mode
This commit is contained in:
parent
40d2ce205e
commit
bd9ae2fd05
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user