Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2019-12-06 10:13:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new.4691 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Fri Dec 6 10:13:17 2019 rev:142 rq: version:0.166.2 Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2019-12-05 17:38:33.637369519 +0100 +++ /work/SRC/openSUSE:Factory/.osc.new.4691/osc.changes 2019-12-06 10:13:23.106740014 +0100 @@ -2,23 +1,0 @@ -Thu Dec 5 09:47:54 UTC 2019 - Marco Strigl <marco.str...@suse.com> - -- 0.167.0 - * Added --lastsucceeded option for logfile display (requires OBS 2.11) - * osc shell/chroot/wipe is now handled via build script (working for chroot and KVM only atm) - * osc build/shell features: - - --vm-type=qemu support for cross architecture builds - - additional debug packages are read from build config now - (extra-pkgs definition is therefore by default empty now) - - --vm-disk-size= switch supported (has only an effect on clean builds) - - repository, architecture and vm_type from last build is automatically - reused if not specified otherwise. - - support building for kiwi products using obsrepositories:/ - - support local building using RedHat rpm-md modules - * fix decoding for osc aggregatepac -- added Conflicts: build < 20191205. The new osc shell/chroot features might - not work with older build scripts -- removed version dpendency for Recommends: build. Does not work anyway. -- added 0%{?centos_version} >= 800 to some %if statemets to enable build of - python3 version on CentOS 8 and higer - - -------------------------------------------------------------------- Old: ---- osc-0.167.0.tar.gz New: ---- osc-0.166.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.W9IKb5/_old 2019-12-06 10:13:25.946739061 +0100 +++ /var/tmp/diff_new_pack.W9IKb5/_new 2019-12-06 10:13:25.954739059 +0100 @@ -1,7 +1,7 @@ # # spec file for package osc # -# Copyright (c) 2019 SUSE LLC +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,7 @@ # -%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 29 || 0%{?centos_version} >= 800 +%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 29 %bcond_without python3 %else %bcond_with python3 @@ -27,17 +27,17 @@ %define use_python python %endif -%define version_unconverted 0.167.0 +%define version_unconverted 0.166.2 %define osc_plugin_dir %{_prefix}/lib/osc-plugins %define macros_file macros.osc Name: osc -Version: 0.167.0 +Version: 0.166.2 Release: 0 Summary: Open Build Service Commander License: GPL-2.0-or-later Group: Development/Tools/Other -URL: https://github.com/openSUSE/osc +Url: https://github.com/openSUSE/osc Source: %{name}-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: %{use_python}-devel @@ -47,7 +47,7 @@ BuildRequires: python-rpm Requires: python-rpm %else -%if 0%{?suse_version} >= 1500 || 0%{?fedora_version} >= 32 || 0%{?centos_version} >= 800 +%if 0%{?suse_version} >= 1500 BuildRequires: %{use_python}-rpm Requires: %{use_python}-rpm %else @@ -69,7 +69,7 @@ %endif %if 0%{?suse_version} > 1000 Recommends: diffstat -Recommends: build +Recommends: build >= 2010.05.04 Recommends: sudo Recommends: powerpc32 Recommends: ca-certificates @@ -83,9 +83,6 @@ Recommends: obs-service-format_spec_file Recommends: obs-service-source_validator Recommends: xdg-utils -# for osc >= 0.167.0 the newest build version is needed. -# Otherwise osc chroot might not work correctly. -Conflicts: build < 20191205 %endif %endif # needed for storing credentials in kwallet/gnome-keyring @@ -111,7 +108,7 @@ Requires: python-m2crypto > 0.19 %endif %else -%if 0%{?fedora_version} >= 29 || 0%{?centos_version} >= 800 +%if 0%{?fedora_version} >= 29 BuildRequires: python3-m2crypto Requires: python3-m2crypto %else ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.W9IKb5/_old 2019-12-06 10:13:25.990739046 +0100 +++ /var/tmp/diff_new_pack.W9IKb5/_new 2019-12-06 10:13:25.990739046 +0100 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=0.167.0 +pkgver=0.166.2 pkgrel=0 pkgdesc="Open Build Service client" arch=('i686' 'x86_64') ++++++ _service ++++++ --- /var/tmp/diff_new_pack.W9IKb5/_old 2019-12-06 10:13:26.006739042 +0100 +++ /var/tmp/diff_new_pack.W9IKb5/_new 2019-12-06 10:13:26.010739040 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="version">0.167.0</param> - <param name="revision">0.167.0</param> + <param name="version">0.166.2</param> + <param name="revision">0.166.2</param> <param name="url">git://github.com/openSUSE/osc.git</param> <param name="scm">git</param> </service> ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.W9IKb5/_old 2019-12-06 10:13:26.046739028 +0100 +++ /var/tmp/diff_new_pack.W9IKb5/_new 2019-12-06 10:13:26.050739027 +0100 @@ -1,4 +1,4 @@ -osc (0.167.0) unstable; urgency=low +osc (0.166.2) unstable; urgency=low - Update to 0.161.1 -- Marco Strigl <marco.str...@suse.com> Thu, 26 Oct 2017 14:42:00 +0200 ++++++ osc-0.167.0.tar.gz -> osc-0.166.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/NEWS new/osc-0.166.2/NEWS --- old/osc-0.167.0/NEWS 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/NEWS 2019-11-13 13:02:57.000000000 +0100 @@ -1,17 +1,3 @@ -0.167.0 - - Added --lastsucceeded option for logfile display (requires OBS 2.11) - - osc shell/chroot/wipe is now handled via build script (working for chroot and KVM only atm) - - osc build/shell features: - * --vm-type=qemu support for cross architecture builds - * additional debug packages are read from build config now - (extra-pkgs definition is therefore by default empty now) - * --vm-disk-size= switch supported (has only an effect on clean builds) - * repository, architecture and vm_type from last build is automatically - reused if not specified otherwise. - * support building for kiwi products using obsrepositories:/ - * support local building using RedHat rpm-md modules - - fix decoding for osc aggregatepac - 0.166.2 - Don't enforce password reuse (boo#1156501) - Config option check_for_requests_on_action is now diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/osc/build.py new/osc-0.166.2/osc/build.py --- old/osc-0.167.0/osc/build.py 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/osc/build.py 2019-11-13 13:02:57.000000000 +0100 @@ -46,6 +46,15 @@ 'sparcv8': 'linux32', } +# FIXME: qemu_can_build should not be needed anymore since OBS 2.3 +qemu_can_build = [ 'armv4l', 'armv5el', 'armv5l', 'armv6l', 'armv7l', 'armv6el', 'armv6hl', 'armv7el', 'armv7hl', 'armv8el', + 'sh4', 'mips', 'mipsel', + 'ppc', 'ppc64', + 's390', 's390x', + 'sparc64v', 'sparcv9v', 'sparcv9', 'sparcv8', 'sparc', + 'hppa', + ] + can_also_build = { 'aarch64': ['aarch64'], # only needed due to used heuristics in build parameter evaluation 'armv6l': [ 'armv4l', 'armv5l', 'armv6l', 'armv5el', 'armv6el' ], @@ -145,9 +154,6 @@ self.keys = [] self.prjkeys = [] self.pathes = [] - self.modules = [] - for node in root.findall('module'): - self.modules.append(node.text) for node in root.findall('bdep'): p = Pac(node, self.buildarch, self.pacsuffix, apiurl, localpkgs) @@ -534,7 +540,6 @@ cache_dir = None build_uid = '' vm_memory = config['build-memory'] - vm_disk_size = config['build-vmdisk-rootsize'] vm_type = config['build-type'] vm_telnet = None @@ -567,6 +572,8 @@ buildargs.append('--norootforbuild') if opts.clean: buildargs.append('--clean') + if opts.noinit: + buildargs.append('--noinit') if opts.nochecks: buildargs.append('--no-checks') if not opts.no_changelog: @@ -624,8 +631,6 @@ return 1 if opts.vm_memory: vm_memory = opts.vm_memory - if opts.vm_disk_size: - vm_disk_size = opts.vm_disk_size if opts.vm_type: vm_type = opts.vm_type if opts.vm_telnet: @@ -642,8 +647,8 @@ if opts.multibuild_package: buildargs.append('--buildflavor=%s' % opts.multibuild_package) pac = pac + ":" + opts.multibuild_package - if opts.wipe: - buildargs.append("--wipe") + if opts.shell: + buildargs.append("--shell") orig_build_root = config['build-root'] # make it possible to override configuration of the rc file @@ -677,42 +682,6 @@ except: pass - # define buildinfo & config local cache - bi_file = None - bc_file = None - bi_filename = '_buildinfo-%s-%s.xml' % (repo, arch) - bc_filename = '_buildconfig-%s-%s' % (repo, arch) - if is_package_dir('.') and os.access(osc.core.store, os.W_OK): - bi_filename = os.path.join(os.getcwd(), osc.core.store, bi_filename) - bc_filename = os.path.join(os.getcwd(), osc.core.store, bc_filename) - elif not os.access('.', os.W_OK): - bi_file = NamedTemporaryFile(prefix=bi_filename) - bi_filename = bi_file.name - bc_file = NamedTemporaryFile(prefix=bc_filename) - bc_filename = bc_file.name - else: - bi_filename = os.path.abspath(bi_filename) - bc_filename = os.path.abspath(bc_filename) - - if opts.shell: - buildargs.append("--shell") - if os.path.exists(build_root) and os.path.exists(bi_filename) and not opts.clean and not opts.extra_pkgs: - opts.noinit = True - opts.offline = True - # we should check if the service did run before and only skip it then, - # but we have no save point for this atm - opts.noservice = True - - if opts.noinit: - buildargs.append('--noinit') - - # check for source services - if not opts.offline and not opts.noservice: - p = osc.core.Package(os.curdir) - r = p.run_source_services(verbose=True) - if r: - raise oscerr.ServiceRuntimeError('Source service run failed!') - cache_dir = config['packagecachedir'] % {'apihost': apihost} extra_pkgs = [] @@ -799,6 +768,22 @@ raise oscerr.WrongOptions('--overlay %s is no valid directory!' % opts.overlay) specialcmdopts += ['--overlay='+myoverlay] + bi_file = None + bc_file = None + bi_filename = '_buildinfo-%s-%s.xml' % (repo, arch) + bc_filename = '_buildconfig-%s-%s' % (repo, arch) + if is_package_dir('.') and os.access(osc.core.store, os.W_OK): + bi_filename = os.path.join(os.getcwd(), osc.core.store, bi_filename) + bc_filename = os.path.join(os.getcwd(), osc.core.store, bc_filename) + elif not os.access('.', os.W_OK): + bi_file = NamedTemporaryFile(prefix=bi_filename) + bi_filename = bi_file.name + bc_file = NamedTemporaryFile(prefix=bc_filename) + bc_filename = bc_file.name + else: + bi_filename = os.path.abspath(bi_filename) + bc_filename = os.path.abspath(bc_filename) + try: if opts.noinit: if not os.path.isfile(bi_filename): @@ -814,18 +799,8 @@ if not os.path.isfile(bc_filename): raise oscerr.WrongOptions('--offline is not possible, no local buildconfig file') else: - print('Getting buildconfig from server and store to %s' % bc_filename) - bc = get_buildconfig(apiurl, prj, repo) - if not bc_file: - bc_file = open(bc_filename, 'w') - bc_file.write(decode_it(bc)) - bc_file.flush() - if os.path.exists('/usr/lib/build/queryconfig') and not opts.nodebugpackages: - debug_pkgs = decode_it(return_external('/usr/lib/build/queryconfig', '--dist', bc_filename, 'substitute', 'obs:cli_debug_packages')) - if len(debug_pkgs) > 0: - extra_pkgs += debug_pkgs.strip().split(" ") - print('Getting buildinfo from server and store to %s' % bi_filename) + bi_text = decode_it(get_buildinfo(apiurl, prj, pac, @@ -841,10 +816,12 @@ kiwipath = None if build_type == 'kiwi': kiwipath = get_kiwipath_from_buildinfo(apiurl, bi_filename, prj, repo) - bc = get_buildconfig(apiurl, prj, repo, kiwipath) - bc_file.seek(0) - bc_file.write(decode_it(bc)) - bc_file.flush() + print('Getting buildconfig from server and store to %s' % bc_filename) + bc = get_buildconfig(apiurl, prj, repo, kiwipath) + if not bc_file: + bc_file = open(bc_filename, 'w') + bc_file.write(decode_it(bc)) + bc_file.flush() except HTTPError as e: if e.code == 404: # check what caused the 404 @@ -896,14 +873,17 @@ # real arch of this machine # vs. # arch we are supposed to build for - if vm_type != "emulator" and vm_type != "qemu": - if bi.hostarch != None: - if hostarch != bi.hostarch and not bi.hostarch in can_also_build.get(hostarch, []): - print('Error: hostarch \'%s\' is required.' % (bi.hostarch), file=sys.stderr) + if bi.hostarch != None: + if hostarch != bi.hostarch and not bi.hostarch in can_also_build.get(hostarch, []): + print('Error: hostarch \'%s\' is required.' % (bi.hostarch), file=sys.stderr) + return 1 + elif hostarch != bi.buildarch: + if not bi.buildarch in can_also_build.get(hostarch, []): + # OBSOLETE: qemu_can_build should not be needed anymore since OBS 2.3 + if vm_type != "emulator" and not bi.buildarch in qemu_can_build: + print('Error: hostarch \'%s\' cannot build \'%s\'.' % (hostarch, bi.buildarch), file=sys.stderr) return 1 - elif hostarch != bi.buildarch: - if not bi.buildarch in can_also_build.get(hostarch, []): - print('WARNING: It is guessed to build on hostarch \'%s\' for \'%s\' via QEMU user emulation.' % (hostarch, bi.buildarch), file=sys.stderr) + print('WARNING: It is guessed to build on hostarch \'%s\' for \'%s\' via QEMU.' % (hostarch, bi.buildarch), file=sys.stderr) rpmlist_prefers = [] if prefer_pkgs: @@ -942,7 +922,6 @@ api_host_options = config['api_host_options'], offline = opts.noinit or opts.offline, http_debug = config['http_debug'], - modules = bi.modules, enable_cpio = not opts.disable_cpio_bulk_download, cookiejar=cookiejar) @@ -1098,26 +1077,11 @@ print(open(build_descr).read(), file=sys.stderr) sys.exit(1) root = tree.getroot() - # product for xml in root.findall('instsource'): - found_obsrepositories = 0 - for node in xml.findall('instrepo'): - if node and node.find('source').get('path') == 'obsrepositories:/': - found_obsrepositories = found_obsrepositories + 1 - for path in bi.pathes: - new_node = ET.SubElement(xml, 'instrepo') - new_node.set('name', node.get('name') + "_" + str(found_obsrepositories)) - new_node.set('priority', node.get('priority')) - new_node.set('local', 'true') - new_source_node = ET.SubElement(new_node, 'source') - new_source_node.set('path', "obs://" + path) - xml.remove(node) - - if found_obsrepositories > 0: - build_descr = '_service:' + build_descr.rsplit('/', 1)[-1] - tree.write(open(build_descr, 'wb')) - + if xml.find('instrepo').find('source').get('path') == 'obsrepositories:/': + print("obsrepositories:/ for product builds is not yet supported in osc!") + sys.exit(1) # appliance expand_obsrepos=None for xml in root.findall('repository'): @@ -1258,9 +1222,9 @@ vm_options += [ '--vm-initrd=' + config['build-initrd'] ] build_root += '/.mount' - if vm_disk_size: - vm_options += [ '--vmdisk-rootsize=' + vm_disk_size ] + if config['build-vmdisk-rootsize']: + vm_options += [ '--vmdisk-rootsize=' + config['build-vmdisk-rootsize'] ] if config['build-vmdisk-swapsize']: vm_options += [ '--vmdisk-swapsize=' + config['build-vmdisk-swapsize'] ] if config['build-vmdisk-filesystem']: @@ -1294,9 +1258,6 @@ if hostarch != bi.buildarch and bi.buildarch in change_personality: cmd = [ change_personality[bi.buildarch] ] + cmd - # record our settings for later builds - osc.core.store_write_last_buildroot(os.curdir, repo, arch, vm_type) - try: rc = run_external(cmd[0], *cmd[1:]) if rc: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/osc/commandline.py new/osc-0.166.2/osc/commandline.py --- old/osc-0.167.0/osc/commandline.py 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/osc/commandline.py 2019-11-13 13:02:57.000000000 +0100 @@ -5544,8 +5544,6 @@ @cmdln.alias('remotebuildlogtail') @cmdln.option('-l', '--last', action='store_true', help='Show the last finished log file') - @cmdln.option('--lastsucceeded', action='store_true', - help='Show the last succeeded log file') @cmdln.option('-M', '--multibuild-package', metavar='MPAC', help='show log file for specified multibuild package') @cmdln.option('-o', '--offset', metavar='OFFSET', @@ -5601,7 +5599,7 @@ elif opts.offset: offset = int(opts.offset) strip_time = opts.strip_time or conf.config['buildlog_strip_time'] - print_buildlog(apiurl, project, package, repository, arch, offset, strip_time, opts.last, opts.lastsucceeded) + print_buildlog(apiurl, project, package, repository, arch, offset, strip_time, opts.last) def _find_last_repo_arch(self, repo=None, fatal=True): import glob @@ -6117,8 +6115,7 @@ # it seems to be an architecture in general arg_arch = arg if not (arg == osc.build.hostarch or arg in osc.build.can_also_build.get(osc.build.hostarch, [])): - if not (vm_type == 'qemu' or vm_type == 'emulator'): - print("WARNING: native compile is not possible, a emulator via binfmt misc handler must be configured!") + print("WARNING: native compile is not possible, an emulator must be configured!") elif not arg_repository: arg_repository = arg else: @@ -6266,8 +6263,6 @@ help='Do not run build checks on the resulting packages.') @cmdln.option('--no-verify', '--noverify', action='store_true', help='Skip signature verification (via pgp keys) of packages used for build. (Global config in oscrc: no_verify)') - @cmdln.option('--nodebugpackages', '--no-debug-packages', action='store_true', - help='Skip installation of additional debug packages for CLI builds') @cmdln.option('--noservice', '--no-service', action='store_true', help='Skip run of local source services as specified in _service file.') @cmdln.option('-p', '--prefer-pkgs', metavar='DIR', action='append', @@ -6296,8 +6291,8 @@ help='define macro X with value Y') @cmdln.option('--build-opt', metavar='OPT', action='append', help='pass option OPT to the build command') - @cmdln.option('--userootforbuild', '--login-as-root', action='store_true', - help='Run build or shell as root. The default is to build as ' + @cmdln.option('--userootforbuild', action='store_true', + help='Run build as root. The default is to build as ' 'unprivileged user. Note that a line "# norootforbuild" ' 'in the spec file will invalidate this option.') @cmdln.option('--build-uid', metavar='uid:gid|"caller"', @@ -6308,9 +6303,7 @@ @cmdln.option('--linksources', action='store_true', help='use hard links instead of a deep copied source') @cmdln.option('--vm-memory', metavar='MEMORY', - help='amount of memory for VM defined in MB') - @cmdln.option('--vm-disk-size', metavar='DISKSIZE', - help='size for newly created disk image in MB') + help='use given MB for VM') @cmdln.option('--vm-type', metavar='TYPE', help='use VM type TYPE (e.g. kvm)') @cmdln.option('--vm-telnet', metavar='TELNET', @@ -6335,21 +6328,14 @@ help='only fetch packages from the api') @cmdln.option('--oldpackages', metavar='DIR', help='take previous build from DIR (special values: _self, _link)') - @cmdln.option('--wipe', action='store_true', - help=SUPPRESS_HELP) @cmdln.option('--shell', action='store_true', help=SUPPRESS_HELP) - @cmdln.option('--shell-cmd', metavar='COMMAND', - help='run specified command instead of bash') @cmdln.option('--host', metavar='HOST', help='perform the build on a remote server - user@server:~/remote/directory') @cmdln.option('--trust-all-projects', action='store_true', help='trust packages from all projects') @cmdln.option('--nopreinstallimage', '--no-preinstallimage', action='store_true', help='Do not use preinstall images for creating the build root.') - @cmdln.alias('chroot') - @cmdln.alias('shell') - @cmdln.alias('wipe') def do_build(self, subcmd, opts, *args): """${cmd_name}: Build a package on your local machine @@ -6376,7 +6362,6 @@ osc build [OPTS] --alternative-project openSUSE:10.3 standard i586 BUILD_DESCR usage: - osc build [OPTS] # will try to guess a build environement osc build [OPTS] REPOSITORY ARCH BUILD_DESCR osc build [OPTS] REPOSITORY ARCH osc build [OPTS] REPOSITORY (ARCH = hostarch, BUILD_DESCR is detected automatically) @@ -6384,28 +6369,6 @@ osc build [OPTS] BUILD_DESCR (REPOSITORY = build_repository (config option), ARCH = hostarch) osc build [OPTS] (REPOSITORY = build_repository (config option), ARCH = hostarch, BUILD_DESCR is detected automatically) - For debugging purposes you can run after a build the following to jump inside of of - the build environemnt: - - osc shell [OPTS] REPOSITORY ARCH - - OPTS may be - - --noinit # for faster run - --shell-cmd=COMMAND - - To clean up the build environment run - - osc wipe [OPTS] - osc wipe [OPTS] REPOSITORY ARCH - - You may set the used VM type in oscrc already, but you can also overwrite it for example - with - - --vm-type=chroot # for faster, but uncleaner and unsecure build - --vm-type=kvm # for clean and secure build - --vm-type=qemu # for slow cross architecture build using system emulator - # Note: # Configuration can be overridden by envvars, e.g. # OSC_SU_WRAPPER overrides the setting of su-wrapper. @@ -6425,12 +6388,6 @@ if opts.debuginfo and opts.disable_debuginfo: raise oscerr.WrongOptions('osc: --debuginfo and --disable-debuginfo are mutual exclusive') - if subcmd == 'chroot' or subcmd == 'shell': - opts.shell = True - - if subcmd == 'wipe': - opts.wipe = True - if len(args) > 3: raise oscerr.WrongArgs('Too many arguments') @@ -6442,16 +6399,20 @@ if project == opts.alternative_project: opts.alternative_project = None - if len(args) == 0: - # build env not specified, just read from last build attempt - lastbuildroot = store_read_last_buildroot(os.curdir) - if lastbuildroot: - args = [ lastbuildroot[0], lastbuildroot[1] ] - if not opts.vm_type: - opts.vm_type = lastbuildroot[2] - args = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project, False, opts.vm_type, opts.multibuild_package) + # check for source services + if not opts.offline and not opts.noservice: + p = Package('.') + r = p.run_source_services(verbose=True) + if r: + print('Source service run failed!', file=sys.stderr) + sys.exit(1) + else: + msg = ('WARNING: source services from package or project will not' + 'be executed. This may not be the same build as on server!') + print(msg) + if not opts.local_package: try: package = store_read_package(os.curdir) @@ -6480,9 +6441,6 @@ if opts.offline and opts.preload: raise oscerr.WrongOptions('--offline and --preload are mutually exclusive') - if opts.shell or opts.wipe: - opts.noservice = True - if opts.preload: opts.nopreinstallimage = True @@ -6627,6 +6585,148 @@ return build_ret + @cmdln.option('--local-package', action='store_true', + help='package doesn\'t exist on the server') + @cmdln.option('--alternative-project', metavar='PROJECT', + help='specify the used build target project') + @cmdln.option('--noinit', '--no-init', action='store_true', + help='do not guess/verify specified repository') + @cmdln.option('-r', '--login-as-root', action='store_true', + help='login as root instead of abuild') + @cmdln.option('--root', metavar='ROOT', + help='Path to the buildroot') + @cmdln.option('-o', '--offline', action='store_true', + help='Use cached data without contacting the api server') + @cmdln.option('--wipe', action='store_true', + help='Delete the build root instead of chrooting into it') + @cmdln.option('-f', '--force', action='store_true', + help='Do not ask confirmation for wipe') + def do_chroot(self, subcmd, opts, *args): + """${cmd_name}: opens a shell inside of the build root + + chroot into the build root for the given repository, arch and build description + (NOTE: this command does not work if a VM is used) + + usage: + osc chroot [OPTS] REPOSITORY ARCH BUILD_DESCR + osc chroot [OPTS] REPOSITORY (ARCH = hostarch, BUILD_DESCR is detected automatically) + osc chroot [OPTS] ARCH (REPOSITORY = build_repository (config option), BUILD_DESCR is detected automatically) + osc chroot [OPTS] BUILD_DESCR (REPOSITORY = build_repository (config option), ARCH = hostarch) + osc chroot [OPTS] (REPOSITORY = build_repository (config option), ARCH = hostarch, BUILD_DESCR is detected automatically) + ${cmd_option_list} + """ + + if len(args) > 3: + raise oscerr.WrongArgs('Too many arguments') + if conf.config['build-type'] and conf.config['build-type'] != "lxc": + print('Not implemented for VMs', file=sys.stderr) + sys.exit(1) + + user = 'abuild' + if opts.login_as_root: + user = 'root' + buildroot = opts.root + if buildroot is None: + repository, arch, descr = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project) + project = opts.alternative_project or store_read_project('.') + if opts.local_package: + package = os.path.splitext(os.path.basename(descr))[0] + else: + package = store_read_package('.') + apihost = urlsplit(self.get_api_url())[1] + if buildroot is None: + buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \ + % {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost} + if not os.path.isdir(buildroot): + raise oscerr.OscIOError(None, '\'%s\' is not a directory' % buildroot) + + suwrapper = os.environ.get('OSC_SU_WRAPPER', conf.config['su-wrapper']) + + # Wipe build root if --wipe was given + if opts.wipe: + sucmd = suwrapper.split() + cmd = [ conf.config['build-cmd'], '--root='+buildroot, '--wipe' ] + if sucmd[0] == 'su': + if sucmd[-1] == '-c': + sucmd.pop() + cmd = sucmd + ['-s', cmd[0], 'root', '--' ] + cmd[1:] + else: + cmd = sucmd + cmd + + if opts.force: + sys.exit(run_external(cmd[0], *cmd[1:])) + else: + # Confirm delete + print("Really wipe '%s'? [y/N]: " % buildroot) + choice = raw_input().lower() + if choice == 'y': + sys.exit(run_external(cmd[0], *cmd[1:])) + else: + print('Aborting') + sys.exit(0) + + # Normal chroot + sucmd = suwrapper.split()[0] + suargs = ' '.join(suwrapper.split()[1:]) + if suwrapper.startswith('su '): + mntproc = [sucmd, '%s mount -n -tproc none %s/proc' % (suargs, buildroot)] + mntsys = [sucmd, '%s mount -n -tsysfs none %s/sys' % (suargs, buildroot)] + mntdevpts = [sucmd, '%s mount -n -tdevpts -omode=0620,gid=5 none %s/dev/pts' % (suargs, buildroot)] + umntproc = [sucmd, '%s umount %s/proc' % (suargs, buildroot)] + umntsys = [sucmd, '%s umount %s/sys' % (suargs, buildroot)] + umntdevpts = [sucmd, '%s umount %s/devpts' % (suargs, buildroot)] + cmd = [sucmd, '%s chroot "%s" su - %s' % (suargs, buildroot, user)] + else: + mntproc = [sucmd, 'mount', '-n', '-tproc' , 'none', '%s/proc' % buildroot] + mntsys = [sucmd, 'mount', '-n', '-tsysfs' , 'none', '%s/sys' % buildroot] + mntdevpts = [sucmd, 'mount', '-n', '-tdevpts' , '-omode=0620,gid=5', 'none', '%s/dev/pts' % buildroot] + umntproc = [sucmd, 'umount', '%s/proc' % buildroot] + umntsys = [sucmd, 'umount', '%s/sys' % buildroot] + umntdevpts = [sucmd, 'umount', '%s/dev/pts' % buildroot] + cmd = [sucmd, 'chroot', buildroot, 'su', '-', user] + if suargs: + mntproc[1:1] = suargs.split() + mntsys[1:1] = suargs.split() + mntdevpts[1:1] = suargs.split() + umntproc[1:1] = suargs.split() + umntsys[1:1] = suargs.split() + umntdevpts[1:1] = suargs.split() + cmd[1:1] = suargs.split() + + #signal handler for chroot procfs umount + def umount_handle(signum = None, frame = None, ret=1): + subprocess.call(umntproc) + subprocess.call(umntsys) + subprocess.call(umntdevpts) + sys.exit(ret) + for sig in [signal.SIGTERM, signal.SIGINT, signal.SIGHUP, signal.SIGQUIT]: + signal.signal(sig, umount_handle) + + print('mounting proc: %s' % ' '.join(mntproc)) + print('mounting sys: %s' % ' '.join(mntsys)) + print('mounting devpts: %s' % ' '.join(mntdevpts)) + mount_err = -1 + proc_mount_err = subprocess.call(mntproc) + sys_mount_err = subprocess.call(mntsys) + devpts_mount_err = subprocess.call(mntdevpts) + if proc_mount_err > 0: + print('There was an error mounting proc. Please check mountpoints in chroot') + if sys_mount_err > 0: + print('There was an error mounting sys. Please check mountpoints in chroot') + if devpts_mount_err > 0: + print('There was an error mounting devpts. Please check mountpoints in chroot') + print('running: %s' % ' '.join(cmd)) + retval = 0 + try: + retval = subprocess.call(cmd) + finally: + if ((not proc_mount_err or proc_mount_err == 32) and + (not sys_mount_err or sys_mount_err == 32) and + (not devpts_mount_err or devpts_mount_err == 32)): + print('unmounting %s/proc and %s/sys and %s/dev/pts ...' % (buildroot, buildroot, buildroot)) + umount_handle(ret=retval) + + @cmdln.option('', '--csv', action='store_true', help='generate output in CSV (separated by |)') @cmdln.option('-l', '--limit', metavar='limit', @@ -8732,7 +8832,7 @@ @cmdln.option('--delete', action='store_true', default=False, help='delete the gpg signing key in this project') @cmdln.option('--notraverse', action='store_true', default=False, - help='don\'t traverse projects upwards to find key') + help='don\' traverse projects upwards to find key') @cmdln.option('--sslcert', action='store_true', default=False, help='fetch SSL certificate instead of GPG key') def do_signkey(self, subcmd, opts, *args): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/osc/conf.py new/osc-0.166.2/osc/conf.py --- old/osc-0.167.0/osc/conf.py 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/osc/conf.py 2019-11-13 13:02:57.000000000 +0100 @@ -278,11 +278,8 @@ # extra packages to install when building packages locally (osc build) # this corresponds to osc build's -x option and can be overridden with that # -x '' can also be given on the command line to override this setting, or -# you can have an empty setting here. This global setting may leads to -# dependency problems when the base distro is not providing the package. -# => using server side definition via cli_debug_packages substitute rule is -# recommended therefore. -#extra-pkgs = +# you can have an empty setting here. +#extra-pkgs = vim gdb strace # build platform is used if the platform argument is omitted to osc build #build_repository = %(build_repository)s diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/osc/core.py new/osc-0.166.2/osc/core.py --- old/osc-0.167.0/osc/core.py 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/osc/core.py 2019-11-13 13:02:57.000000000 +0100 @@ -5,7 +5,7 @@ from __future__ import print_function -__version__ = '0.167.0' +__version__ = '0.166.2' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration @@ -1140,7 +1140,7 @@ REQ_STOREFILES = ('_project', '_package', '_apiurl', '_files', '_osclib_version') OPT_STOREFILES = ('_to_be_added', '_to_be_deleted', '_in_conflict', '_in_update', '_in_commit', '_meta', '_meta_mode', '_frozenlink', '_pulled', '_linkrepair', - '_size_limit', '_commit_msg', '_last_buildroot') + '_size_limit', '_commit_msg') def __init__(self, workingdir, progress_obj=None, size_limit=None, wc_check=True): global store @@ -5237,7 +5237,7 @@ path_args=(quote_plus(dst_project), quote_plus(dst_package)), template_args=None, create_new=False, apiurl=apiurl) - root = ET.fromstring(b''.join(dst_meta)) + root = ET.fromstring(''.join(dst_meta)) if root.get('project') != dst_project: # The source comes from a different project via a project link, we need to create this instance meta_change = True @@ -6118,7 +6118,7 @@ return time_regex.sub(b'', data) -def print_buildlog(apiurl, prj, package, repository, arch, offset=0, strip_time=False, last=False, lastsucceeded=False): +def print_buildlog(apiurl, prj, package, repository, arch, offset=0, strip_time=False, last=False): """prints out the buildlog on stdout""" def print_data(data, strip_time=False): @@ -6137,8 +6137,6 @@ query = {'nostream' : '1', 'start' : '%s' % offset} if last: query['last'] = 1 - if lastsucceeded: - query['lastsucceeded'] = 1 retry_count = 0 while True: query['start'] = offset @@ -6510,17 +6508,6 @@ apiurl = conf.config['apiurl'] return apiurl -def store_read_last_buildroot(dir): - global store - - fname = os.path.join(dir, store, '_last_buildroot') - if os.path.exists(fname): - lines = open(fname).read().splitlines() - if len(lines) == 3: - return lines - - return - def store_write_string(dir, file, string, subdir=''): global store @@ -6545,9 +6532,6 @@ def store_write_apiurl(dir, apiurl): store_write_string(dir, '_apiurl', apiurl + '\n') -def store_write_last_buildroot(dir, repo, arch, vm_type): - store_write_string(dir, '_last_buildroot', repo + '\n' + arch + '\n' + vm_type + '\n') - def store_unlink_file(dir, file): global store diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.167.0/osc/fetch.py new/osc-0.166.2/osc/fetch.py --- old/osc-0.167.0/osc/fetch.py 2019-12-05 13:13:25.000000000 +0100 +++ new/osc-0.166.2/osc/fetch.py 2019-11-13 13:02:57.000000000 +0100 @@ -28,8 +28,7 @@ class Fetcher: def __init__(self, cachedir='/tmp', api_host_options={}, urllist=[], - modules = [], http_debug=False, cookiejar=None, offline=False, - enable_cpio=True): + http_debug=False, cookiejar=None, offline=False, enable_cpio=True): # set up progress bar callback self.progress_obj = None if sys.stdout.isatty(): @@ -37,7 +36,6 @@ self.cachedir = cachedir self.urllist = urllist - self.modules = modules self.http_debug = http_debug self.offline = offline self.cpio = {} @@ -61,8 +59,6 @@ return query = ['binary=%s' % quote_plus(i) for i in pkgs] query.append('view=cpio') - for module in self.modules: - query.append('module=' + module) try: url = makeurl(apiurl, ['build', project, repo, arch, package], query=query) sys.stdout.write("preparing download ...\r") @@ -77,8 +73,8 @@ # getbinarylist instead of the public/... route # (which is routed to getbinaries) # getbinaries does not support kiwi builds - if hdr.filename == b'.errors': - archive.copyin_file(decode_it(hdr.filename)) + if hdr.filename == '.errors': + archive.copyin_file(hdr.filename) raise oscerr.APIError('CPIO archive is incomplete ' '(see .errors file)') if package == '_repository': ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.W9IKb5/_old 2019-12-06 10:13:26.370738919 +0100 +++ /var/tmp/diff_new_pack.W9IKb5/_new 2019-12-06 10:13:26.374738918 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 0.167.0 +Version: 0.166.2 Binary: osc Maintainer: Adrian Schroeter <adr...@suse.de> Architecture: any