77
88def setup ():
99 global args , workdir
10- programs = ['ruby' , 'git' , 'apt-cacher-ng' , ' make' , 'wget' ]
10+ programs = ['ruby' , 'git' , 'make' , 'wget' ]
1111 if args .kvm :
12- programs += ['python-vm-builder' , 'qemu-kvm' , 'qemu-utils' ]
13- elif args .docker :
12+ programs += ['apt-cacher-ng' , ' python-vm-builder' , 'qemu-kvm' , 'qemu-utils' ]
13+ elif args .docker and not os . path . isfile ( '/lib/systemd/system/docker.service' ) :
1414 dockers = ['docker.io' , 'docker-ce' ]
1515 for i in dockers :
1616 return_code = subprocess .call (['sudo' , 'apt-get' , 'install' , '-qq' , i ])
1717 if return_code == 0 :
1818 break
1919 if return_code != 0 :
20- print ('Cannot find any way to install docker ' , file = sys .stderr )
21- exit (1 )
20+ print ('Cannot find any way to install Docker. ' , file = sys .stderr )
21+ sys . exit (1 )
2222 else :
23- programs += ['lxc' , 'debootstrap' ]
23+ programs += ['apt-cacher-ng' , ' lxc' , 'debootstrap' ]
2424 subprocess .check_call (['sudo' , 'apt-get' , 'install' , '-qq' ] + programs )
2525 if not os .path .isdir ('gitian.sigs' ):
2626 subprocess .check_call (['git' , 'clone' , 'https://github.com/bitcoin-core/gitian.sigs.git' ])
@@ -41,7 +41,7 @@ def setup():
4141 if args .is_bionic and not args .kvm and not args .docker :
4242 subprocess .check_call (['sudo' , 'sed' , '-i' , 's/lxcbr0/br0/' , '/etc/default/lxc-net' ])
4343 print ('Reboot is required' )
44- exit (0 )
44+ sys . exit (0 )
4545
4646def build ():
4747 global args , workdir
@@ -165,8 +165,8 @@ def main():
165165 args .is_bionic = b'bionic' in subprocess .check_output (['lsb_release' , '-cs' ])
166166
167167 if args .buildsign :
168- args .build = True
169- args .sign = True
168+ args .build = True
169+ args .sign = True
170170
171171 if args .kvm and args .docker :
172172 raise Exception ('Error: cannot have both kvm and docker' )
@@ -193,11 +193,11 @@ def main():
193193 if args .signer == '' :
194194 print (script_name + ': Missing signer.' )
195195 print ('Try ' + script_name + ' --help for more information' )
196- exit (1 )
196+ sys . exit (1 )
197197 if args .version == '' :
198198 print (script_name + ': Missing version.' )
199199 print ('Try ' + script_name + ' --help for more information' )
200- exit (1 )
200+ sys . exit (1 )
201201
202202 # Add leading 'v' for tags
203203 if args .commit and args .pull :
0 commit comments