mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 09:16:14 +01:00
Fix indentation
This commit is contained in:
parent
beaf312eee
commit
ee39653dc7
@ -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:
|
||||
|
@ -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')
|
||||
|
54
osc/core.py
54
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:
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user