mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-27 16:48:54 +02:00
don't fetch packages if build was called with --no-init
This commit is contained in:
@@ -452,6 +452,7 @@ def main(opts, argv):
|
|||||||
fetcher = Fetcher(cachedir = config['packagecachedir'],
|
fetcher = Fetcher(cachedir = config['packagecachedir'],
|
||||||
urllist = urllist,
|
urllist = urllist,
|
||||||
api_host_options = config['api_host_options'],
|
api_host_options = config['api_host_options'],
|
||||||
|
offline = opts.noinit,
|
||||||
http_debug = config['http_debug'],
|
http_debug = config['http_debug'],
|
||||||
cookiejar=cookiejar)
|
cookiejar=cookiejar)
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ def join_url(self, base_url, rel_url):
|
|||||||
|
|
||||||
|
|
||||||
class Fetcher:
|
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'
|
__version__ = '0.1'
|
||||||
__user_agent__ = 'osbuild/%s' % __version__
|
__user_agent__ = 'osbuild/%s' % __version__
|
||||||
@@ -37,6 +37,7 @@ class Fetcher:
|
|||||||
self.cachedir = cachedir
|
self.cachedir = cachedir
|
||||||
self.urllist = urllist
|
self.urllist = urllist
|
||||||
self.http_debug = http_debug
|
self.http_debug = http_debug
|
||||||
|
self.offline = offline
|
||||||
|
|
||||||
passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
|
passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
|
||||||
for host in api_host_options.keys():
|
for host in api_host_options.keys():
|
||||||
@@ -66,6 +67,9 @@ class Fetcher:
|
|||||||
# for use by the failure callback
|
# for use by the failure callback
|
||||||
self.curpac = pac
|
self.curpac = pac
|
||||||
|
|
||||||
|
if self.offline:
|
||||||
|
return True
|
||||||
|
|
||||||
MirrorGroup._join_url = join_url
|
MirrorGroup._join_url = join_url
|
||||||
mg = MirrorGroup(self.gr, pac.urllist)
|
mg = MirrorGroup(self.gr, pac.urllist)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user