1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

don't fetch packages if build was called with --no-init

This commit is contained in:
Ludwig Nussel 2009-10-09 11:37:27 +00:00
parent 32ca3b83b7
commit ca237c5af9
2 changed files with 6 additions and 1 deletions

View File

@ -452,6 +452,7 @@ def main(opts, argv):
fetcher = Fetcher(cachedir = config['packagecachedir'],
urllist = urllist,
api_host_options = config['api_host_options'],
offline = opts.noinit,
http_debug = config['http_debug'],
cookiejar=cookiejar)

View File

@ -22,7 +22,7 @@ def join_url(self, base_url, rel_url):
class Fetcher:
def __init__(self, cachedir = '/tmp', api_host_options = {}, urllist = [], http_debug = False, cookiejar = None):
def __init__(self, cachedir = '/tmp', api_host_options = {}, urllist = [], http_debug = False, cookiejar = None, offline = 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
self.offline = offline
passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
for host in api_host_options.keys():
@ -66,6 +67,9 @@ class Fetcher:
# for use by the failure callback
self.curpac = pac
if self.offline:
return True
MirrorGroup._join_url = join_url
mg = MirrorGroup(self.gr, pac.urllist)