diff --git a/osc/build.py b/osc/build.py index 9aaa8d79..c217f569 100644 --- a/osc/build.py +++ b/osc/build.py @@ -163,7 +163,7 @@ class Buildinfo: else: pac_arch = self.crossarch if pac_arch is None: - pac_arch = self.buildarch + pac_arch = self.buildarch p = Pac(node, pac_arch, self.pacsuffix, apiurl, localpkgs) if p.project: diff --git a/osc/commandline.py b/osc/commandline.py index 13821c27..f7cb86f0 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -1496,7 +1496,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. dst_package, not opts.yes) if not supersede_existing: - (supersede_existing, reqs) = check_existing_maintenance_requests(apiurl, + (supersede_existing, reqs) = check_existing_maintenance_requests(apiurl, src_project, [src_package], dst_project, None, @@ -6524,12 +6524,12 @@ Please submit there instead, or use --nodevelproject to force direct submission. build_root = osc.build.calculate_build_root(apihost, prj, pac, repo, arch) if opts.wipe and not opts.force: - # Confirm delete - print("Really wipe '%s'? [y/N]: " % build_root) - choice = raw_input().lower() - if choice != 'y': - print('Aborting') - sys.exit(0) + # Confirm delete + print("Really wipe '%s'? [y/N]: " % build_root) + choice = raw_input().lower() + if choice != 'y': + print('Aborting') + sys.exit(0) build_args = ['--root=' + build_root, '--noinit', '--shell'] if opts.wipe: build_args.append('--wipe') diff --git a/osc/core.py b/osc/core.py index 6cbaeaeb..2fa07e76 100644 --- a/osc/core.py +++ b/osc/core.py @@ -7974,36 +7974,36 @@ def checkout_deleted_package(apiurl, proj, pkg, dst): print('done.') def vc_export_env(apiurl, quiet=False): - # try to set the env variables for the user's realname and email - # (the variables are used by the "vc" script or some source service) - tag2envs = {'realname': ['VC_REALNAME'], - 'email': ['VC_MAILADDR', 'mailaddr']} - tag2val = {} - missing_tags = [] + # try to set the env variables for the user's realname and email + # (the variables are used by the "vc" script or some source service) + tag2envs = {'realname': ['VC_REALNAME'], + 'email': ['VC_MAILADDR', 'mailaddr']} + tag2val = {} + missing_tags = [] - for (tag, envs) in tag2envs.items(): - env_present = [env for env in envs if env in os.environ] - config_present = tag in conf.config['api_host_options'][apiurl] - if not env_present and not config_present: - missing_tags.append(tag) - elif config_present: - tag2val[tag] = conf.config['api_host_options'][apiurl][tag] + for (tag, envs) in tag2envs.items(): + env_present = [env for env in envs if env in os.environ] + config_present = tag in conf.config['api_host_options'][apiurl] + if not env_present and not config_present: + missing_tags.append(tag) + elif config_present: + tag2val[tag] = conf.config['api_host_options'][apiurl][tag] - if missing_tags: - user = conf.get_apiurl_usr(apiurl) - data = get_user_data(apiurl, user, *missing_tags) - if data: - for tag in missing_tags: - val = data.pop(0) - if val != '-': - tag2val[tag] = val - elif not quiet: - msg = 'Try env %s=...' % tag2envs[tag][0] - print(msg, file=sys.stderr) + if missing_tags: + user = conf.get_apiurl_usr(apiurl) + data = get_user_data(apiurl, user, *missing_tags) + if data: + for tag in missing_tags: + val = data.pop(0) + if val != '-': + tag2val[tag] = val + elif not quiet: + msg = 'Try env %s=...' % tag2envs[tag][0] + print(msg, file=sys.stderr) - for (tag, val) in tag2val.items(): - for env in tag2envs[tag]: - os.environ[env] = val + for (tag, val) in tag2val.items(): + for env in tag2envs[tag]: + os.environ[env] = val class MultibuildFlavorResolver: diff --git a/osc/util/debquery.py b/osc/util/debquery.py index 0b61af2f..4e9d67a2 100644 --- a/osc/util/debquery.py +++ b/osc/util/debquery.py @@ -58,11 +58,11 @@ class DebQuery(packagequery.PackageQuery, packagequery.PackageQueryResult): else: control = arfile.get_file(b'control.tar.xz') if control: - if not HAVE_LZMA: - raise DebError(self.__path, 'can\'t open control.tar.xz without python-lzma') - decompressed = lzma.decompress(control.read()) - tar = tarfile.open(name="control.tar.xz", - fileobj=BytesIO(decompressed)) + if not HAVE_LZMA: + raise DebError(self.__path, 'can\'t open control.tar.xz without python-lzma') + decompressed = lzma.decompress(control.read()) + tar = tarfile.open(name="control.tar.xz", + fileobj=BytesIO(decompressed)) else: control = arfile.get_file(b'control.tar.zst') if control: