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

Merge pull request #1447 from adrianschroeter/obsproduct

initial support for obsproduct build type
This commit is contained in:
Daniel Mach 2023-11-16 13:41:10 +01:00 committed by GitHub
commit 1470476cd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -450,6 +450,11 @@ def get_built_files(pacdir, buildtype):
'-type', 'f'], '-type', 'f'],
stdout=subprocess.PIPE).stdout.read().strip() stdout=subprocess.PIPE).stdout.read().strip()
s_built = '' s_built = ''
elif buildtype == 'obsproduct':
b_built = subprocess.Popen(['find', os.path.join(pacdir, 'OBSPRODUCT'),
'-type', 'f'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = ''
else: else:
print('WARNING: Unknown package type \'%s\'.' % buildtype, file=sys.stderr) print('WARNING: Unknown package type \'%s\'.' % buildtype, file=sys.stderr)
b_built = '' b_built = ''
@ -703,10 +708,10 @@ def main(apiurl, store, opts, argv):
build_type = 'flatpak' build_type = 'flatpak'
if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild', if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild',
'simpleimage', 'snapcraft', 'appimage', 'docker', 'helm', 'simpleimage', 'snapcraft', 'appimage', 'docker', 'helm',
'podman', 'fissile', 'flatpak', 'preinstallimage']: 'podman', 'fissile', 'flatpak', 'preinstallimage', 'obsproduct']:
raise oscerr.WrongArgs( raise oscerr.WrongArgs(
'Unknown build type: \'%s\'. ' 'Unknown build type: \'%s\'. '
'Build description should end in .spec, .dsc, .kiwi, or .livebuild. ' 'Build description should end in .spec, .dsc, .kiwi, .obsproduct or .livebuild. '
'Or being named PKGBUILD, build.collax, simpleimage, appimage.yml, ' 'Or being named PKGBUILD, build.collax, simpleimage, appimage.yml, '
'Chart.yaml, snapcraft.yaml, flatpak.json, flatpak.yml, flatpak.yaml, ' 'Chart.yaml, snapcraft.yaml, flatpak.json, flatpak.yml, flatpak.yaml, '
'preinstallimage or Dockerfile' % build_type) 'preinstallimage or Dockerfile' % build_type)
@ -1224,7 +1229,7 @@ def main(apiurl, store, opts, argv):
buildargs.append('--oldpackages=%s' % old_pkg_dir) buildargs.append('--oldpackages=%s' % old_pkg_dir)
# Make packages from buildinfo available as repos for kiwi/docker/fissile # Make packages from buildinfo available as repos for kiwi/docker/fissile
if build_type in ('kiwi', 'docker', 'podman', 'fissile'): if build_type in ('kiwi', 'docker', 'podman', 'fissile', 'obsproduct'):
if os.path.exists('repos'): if os.path.exists('repos'):
shutil.rmtree('repos') shutil.rmtree('repos')
if os.path.exists('containers'): if os.path.exists('containers'):