mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
merge #15236: scripts and tools: Make --setup command independent
Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
This commit is contained in:
parent
2508eaf24e
commit
a8e8a3d585
@ -135,7 +135,7 @@ def verify():
|
||||
def main():
|
||||
global args, workdir
|
||||
|
||||
parser = argparse.ArgumentParser(usage='%(prog)s [options] signer version')
|
||||
parser = argparse.ArgumentParser(description='Script for running full Gitian builds.')
|
||||
parser.add_argument('-c', '--commit', action='store_true', dest='commit', help='Indicate that the version argument is for a commit or branch')
|
||||
parser.add_argument('-p', '--pull', action='store_true', dest='pull', help='Indicate that the version argument is the number of a github repository pull request')
|
||||
parser.add_argument('-u', '--url', dest='url', default='https://github.com/dashpay/dash', help='Specify the URL of the repository. Default is %(default)s')
|
||||
@ -150,24 +150,14 @@ def main():
|
||||
parser.add_argument('-S', '--setup', action='store_true', dest='setup', help='Set up the Gitian building environment. Only works on Debian-based systems (Ubuntu, Debian)')
|
||||
parser.add_argument('-D', '--detach-sign', action='store_true', dest='detach_sign', help='Create the assert file for detached signing. Will not commit anything.')
|
||||
parser.add_argument('-n', '--no-commit', action='store_false', dest='commit_files', help='Do not commit anything to git')
|
||||
parser.add_argument('signer', help='GPG signer to sign each build assert file')
|
||||
parser.add_argument('version', help='Version number, commit, or branch to build. If building a commit or branch, the -c option must be specified')
|
||||
parser.add_argument('signer', nargs='?', help='GPG signer to sign each build assert file')
|
||||
parser.add_argument('version', nargs='?', help='Version number, commit, or branch to build. If building a commit or branch, the -c option must be specified')
|
||||
|
||||
args = parser.parse_args()
|
||||
workdir = os.getcwd()
|
||||
|
||||
args.linux = 'l' in args.os
|
||||
args.windows = 'w' in args.os
|
||||
args.macos = 'm' in args.os
|
||||
|
||||
args.is_bionic = b'bionic' in subprocess.check_output(['lsb_release', '-cs'])
|
||||
|
||||
if args.buildsign:
|
||||
args.build = True
|
||||
args.sign = True
|
||||
|
||||
args.sign_prog = 'true' if args.detach_sign else 'gpg --detach-sign'
|
||||
|
||||
args.lxc = (args.virtualization == 'lxc')
|
||||
args.kvm = (args.virtualization == 'kvm')
|
||||
args.docker = (args.virtualization == 'docker')
|
||||
@ -193,13 +183,28 @@ def main():
|
||||
print('Try '+script_name+' --help for more information')
|
||||
exit(1)
|
||||
|
||||
# Signer and version shouldn't be empty
|
||||
if args.signer == '':
|
||||
print(script_name+': Missing signer.')
|
||||
if args.setup:
|
||||
setup()
|
||||
|
||||
if args.buildsign:
|
||||
args.build = True
|
||||
args.sign = True
|
||||
|
||||
if not args.build and not args.sign and not args.verify:
|
||||
sys.exit(0)
|
||||
|
||||
args.linux = 'l' in args.os
|
||||
args.windows = 'w' in args.os
|
||||
args.macos = 'm' in args.os
|
||||
|
||||
args.sign_prog = 'true' if args.detach_sign else 'gpg --detach-sign'
|
||||
|
||||
if not args.signer:
|
||||
print(script_name+': Missing signer')
|
||||
print('Try '+script_name+' --help for more information')
|
||||
exit(1)
|
||||
if args.version == '':
|
||||
print(script_name+': Missing version.')
|
||||
if not args.version:
|
||||
print(script_name+': Missing version')
|
||||
print('Try '+script_name+' --help for more information')
|
||||
exit(1)
|
||||
|
||||
@ -208,12 +213,6 @@ def main():
|
||||
raise Exception('Cannot have both commit and pull')
|
||||
args.commit = ('' if args.commit else 'v') + args.version
|
||||
|
||||
if args.setup:
|
||||
setup()
|
||||
|
||||
if not args.build and not args.sign and not args.verify:
|
||||
exit(0)
|
||||
|
||||
os.chdir('dash')
|
||||
if args.pull:
|
||||
subprocess.check_call(['git', 'fetch', args.url, 'refs/pull/'+args.version+'/merge'])
|
||||
|
Loading…
Reference in New Issue
Block a user