mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 02:26:16 +01:00
fix offline build mode
The offline mode does not really work offline since parse_repoarchdescr() uses get_buildconfig to store the buildconfig in a temporary file. Solution: Use the same logic as in build.py. If in offline mode(noinit = True) try to use the local _buildconfig file. If not in offline mode just download the buildconfig from the server via get_buildconfig
This commit is contained in:
parent
6fe6dbc724
commit
178dfd16c3
@ -6092,16 +6092,26 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
raise oscerr.WrongArgs("Repository is missing. Cannot guess build description without repository")
|
raise oscerr.WrongArgs("Repository is missing. Cannot guess build description without repository")
|
||||||
apiurl = self.get_api_url()
|
apiurl = self.get_api_url()
|
||||||
project = store_read_project('.')
|
project = store_read_project('.')
|
||||||
bc = get_buildconfig(apiurl, project, arg_repository)
|
# some distros like Debian rename and move build to obs-build
|
||||||
with tempfile.NamedTemporaryFile() as f:
|
if not os.path.isfile('/usr/lib/build/queryconfig') and os.path.isfile('/usr/lib/obs-build/queryconfig'):
|
||||||
f.write(bc)
|
queryconfig = '/usr/lib/obs-build/queryconfig'
|
||||||
f.flush()
|
else:
|
||||||
# some distros like Debian rename and move build to obs-build
|
queryconfig = '/usr/lib/build/queryconfig'
|
||||||
if not os.path.isfile('/usr/lib/build/queryconfig') and os.path.isfile('/usr/lib/obs-build/queryconfig'):
|
if noinit:
|
||||||
queryconfig = '/usr/lib/obs-build/queryconfig'
|
bc_filename = '_buildconfig-%s-%s' % (arg_repository, arg_arch)
|
||||||
|
if is_package_dir('.'):
|
||||||
|
bc_filename = os.path.join(os.getcwd(), osc.core.store, bc_filename)
|
||||||
else:
|
else:
|
||||||
queryconfig = '/usr/lib/build/queryconfig'
|
bc_filename = os.path.abspath(bc_filename)
|
||||||
recipe = return_external(queryconfig, '--dist', f.name, 'type')
|
if not os.path.isfile(bc_filename):
|
||||||
|
raise oscerr.WrongOptions('--offline is not possible, no local buildconfig file')
|
||||||
|
recipe = return_external(queryconfig, '--dist', bc_filename, 'type')
|
||||||
|
else:
|
||||||
|
bc = get_buildconfig(apiurl, project, arg_repository)
|
||||||
|
with tempfile.NamedTemporaryFile() as f:
|
||||||
|
f.write(bc)
|
||||||
|
f.flush()
|
||||||
|
recipe = return_external(queryconfig, '--dist', f.name, 'type')
|
||||||
recipe = recipe.strip()
|
recipe = recipe.strip()
|
||||||
if recipe == 'arch':
|
if recipe == 'arch':
|
||||||
recipe = 'PKGBUILD'
|
recipe = 'PKGBUILD'
|
||||||
|
Loading…
Reference in New Issue
Block a user