From 5d2542522d9760bf4ff01b15bac5f9bbc80fc31e Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Wed, 11 Nov 2020 18:05:20 +0100 Subject: [PATCH] Support flatpak building --- osc/build.py | 9 ++++++++- osc/commandline.py | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osc/build.py b/osc/build.py index 8e1ab606..ac95cd86 100644 --- a/osc/build.py +++ b/osc/build.py @@ -389,6 +389,11 @@ def get_built_files(pacdir, buildtype): '-type', 'f'], stdout=subprocess.PIPE).stdout.read().strip() s_built = '' + elif buildtype == 'flatpak': + b_built = subprocess.Popen(['find', os.path.join(pacdir, 'OTHER'), + '-type', 'f'], + stdout=subprocess.PIPE).stdout.read().strip() + s_built = '' else: print('WARNING: Unknown package type \'%s\'.' % buildtype, file=sys.stderr) b_built = '' @@ -587,7 +592,9 @@ def main(apiurl, opts, argv): build_type = 'docker' if os.path.basename(build_descr) == 'fissile.yml': build_type = 'fissile' - if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild', 'simpleimage', 'snapcraft', 'appimage', 'docker', 'podman', 'fissile']: + if build_descr.endswith('flatpak.yaml') or build_descr.endswith('flatpak.yml') or build_descr.endswith('flatpak.json'): + build_type = 'flatpak' + if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild', 'simpleimage', 'snapcraft', 'appimage', 'docker', 'podman', 'fissile', 'flatpak']: raise oscerr.WrongArgs( 'Unknown build type: \'%s\'. Build description should end in .spec, .dsc, .kiwi, or .livebuild. Or being named PKGBUILD, build.collax, simpleimage, appimage.yml, snapcraft.yaml or Dockerfile' \ % build_type) diff --git a/osc/commandline.py b/osc/commandline.py index 5ebcaf6e..b5a975c5 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -6245,7 +6245,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. for subarch in osc.build.can_also_build.get(mainarch): all_archs.append(subarch) for arg in args: - if arg.endswith('.spec') or arg.endswith('.dsc') or arg.endswith('.kiwi') or arg.endswith('.livebuild') or arg == 'PKGBUILD' or arg == 'build.collax' or arg == 'Dockerfile' or arg == 'fissile.yml' or arg == 'appimage.yml': + if arg.endswith('.spec') or arg.endswith('.dsc') or arg.endswith('.kiwi') or arg.endswith('.livebuild') or arg == 'PKGBUILD' or arg == 'build.collax' or arg == 'Dockerfile' or arg == 'fissile.yml' or arg == 'appimage.yml' or arg.endswith('flatpak.yaml') or arg.endswith('flatpak.yml') or arg.endswith('flatpak.json'): arg_descr = arg else: if (arg == osc.build.hostarch or arg in all_archs) and arg_arch is None: @@ -6309,7 +6309,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. # but be a bit more readable :) descr = glob.glob('*.spec') + glob.glob('*.dsc') + glob.glob('*.kiwi') + glob.glob('*.livebuild') \ + glob.glob('PKGBUILD') + glob.glob('build.collax') + glob.glob('Dockerfile') + glob.glob('fissile.yml') \ - + glob.glob('appimage.yml') + + glob.glob('appimage.yml') \ + + glob.glob('*flatpak.yaml') + glob.glob('*flatpak.yml') + glob.glob('*flatpak.json') # FIXME: # * request repos from server and select by build type.