mirror of
https://github.com/openSUSE/osc.git
synced 2025-09-06 13:18:42 +02:00
- add support for buildtime source service mode
This commit is contained in:
14
osc/build.py
14
osc/build.py
@@ -569,13 +569,21 @@ def main(apiurl, opts, argv):
|
||||
build_descr_data = s + build_descr_data
|
||||
|
||||
cpiodata = None
|
||||
servicefile = os.path.join(os.path.dirname(build_descr), "_service")
|
||||
if not os.path.isfile(servicefile):
|
||||
servicefile = os.path.join(os.path.dirname(build_descr), "_service")
|
||||
if not os.path.isfile(servicefile):
|
||||
servicefile = None
|
||||
else:
|
||||
print('Using local _service file')
|
||||
buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv." + repo + "." + arch)
|
||||
if not os.path.isfile(buildenvfile):
|
||||
buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv")
|
||||
if not os.path.isfile(buildenvfile):
|
||||
buildenvfile = None
|
||||
if buildenvfile:
|
||||
print('Using buildenv file: %s' % os.path.basename(buildenvfile))
|
||||
else:
|
||||
print('Using local buildenv file: %s' % os.path.basename(buildenvfile))
|
||||
if buildenvfile or servicefile:
|
||||
from .util import cpio
|
||||
if not cpiodata:
|
||||
cpiodata = cpio.CpioWrite()
|
||||
@@ -592,6 +600,8 @@ def main(apiurl, opts, argv):
|
||||
# buildenv must come last for compatibility reasons...
|
||||
if buildenvfile:
|
||||
cpiodata.add("buildenv", open(buildenvfile).read())
|
||||
if servicefile:
|
||||
cpiodata.add("_service", open(servicefile).read())
|
||||
build_descr_data = cpiodata.get()
|
||||
|
||||
# special handling for overlay and rsync-src/dest
|
||||
|
@@ -389,6 +389,8 @@ class Serviceinfo:
|
||||
for service in allservices:
|
||||
if singleservice and service['name'] != singleservice:
|
||||
continue
|
||||
if service['mode'] == "buildtime":
|
||||
continue
|
||||
if service['mode'] == "serveronly" and callmode != "disabled":
|
||||
continue
|
||||
if service['mode'] == "disabled" and callmode != "disabled":
|
||||
|
Reference in New Issue
Block a user