mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-22 12:27:59 +01:00
minor improvments to setup
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
1120630ea4
commit
3a6ac727a5
1 changed files with 19 additions and 13 deletions
12
setup.py
12
setup.py
|
@ -239,7 +239,8 @@ class Setup():
|
||||||
self.free = True
|
self.free = True
|
||||||
elif opts.opts['--freedom'][0].lower() in ('partial', 'sloppy', 'false', 'no'):
|
elif opts.opts['--freedom'][0].lower() in ('partial', 'sloppy', 'false', 'no'):
|
||||||
self.free = False
|
self.free = False
|
||||||
if self.free is None:
|
def checkFreedom():
|
||||||
|
if force and (self.free is None):
|
||||||
if (opts.opts['--version'] is None) and ((len(opts.files) != 1) or (opts.files[0] != 'version')):
|
if (opts.opts['--version'] is None) and ((len(opts.files) != 1) or (opts.files[0] != 'version')):
|
||||||
print('')
|
print('')
|
||||||
print('You need to select your freedom, add --freedom=strict or --freedom=partial.')
|
print('You need to select your freedom, add --freedom=strict or --freedom=partial.')
|
||||||
|
@ -276,13 +277,16 @@ class Setup():
|
||||||
os.umask(0o022)
|
os.umask(0o022)
|
||||||
|
|
||||||
if method == 'build':
|
if method == 'build':
|
||||||
|
checkFreedom()
|
||||||
self.build(conf)
|
self.build(conf)
|
||||||
|
|
||||||
elif method == 'prebuilt':
|
elif method == 'prebuilt':
|
||||||
|
checkFreedom()
|
||||||
self.applyDestDir(conf)
|
self.applyDestDir(conf)
|
||||||
self.install(conf)
|
self.install(conf)
|
||||||
|
|
||||||
elif method == 'install':
|
elif method == 'install':
|
||||||
|
checkFreedom()
|
||||||
self.build(conf)
|
self.build(conf)
|
||||||
self.applyDestDir(conf)
|
self.applyDestDir(conf)
|
||||||
self.install(conf)
|
self.install(conf)
|
||||||
|
@ -342,7 +346,9 @@ class Setup():
|
||||||
for miscfile in miscfiles: print(GREEN % ('Installing ' + miscfile[0] + ' to ', conf[miscfile[0]]))
|
for miscfile in miscfiles: print(GREEN % ('Installing ' + miscfile[0] + ' to ', conf[miscfile[0]]))
|
||||||
print('Using system configuration directory: ' + conf['sysconf-dir'])
|
print('Using system configuration directory: ' + conf['sysconf-dir'])
|
||||||
print('Prefered linking style: ' + self.linking)
|
print('Prefered linking style: ' + self.linking)
|
||||||
if self.free: print(GREEN % ('', 'Installing only fully free parts of the package'))
|
print('Using umask: 022 (only owner can do modifications)')
|
||||||
|
if self.free is None: print(YELLOW % ('\033[01m--freedom is manditory and has not be specified\033[21m'))
|
||||||
|
elif self.free: print(GREEN % ('', 'Installing only fully free parts of the package'))
|
||||||
else: print(RED % ('Installing \033[1mnot\033[21m only fully free parts of the package'))
|
else: print(RED % ('Installing \033[1mnot\033[21m only fully free parts of the package'))
|
||||||
|
|
||||||
print()
|
print()
|
||||||
|
@ -1167,7 +1173,7 @@ class ArgParser():
|
||||||
if opt_help is not None:
|
if opt_help is not None:
|
||||||
for opt_alt in opt_alts:
|
for opt_alt in opt_alts:
|
||||||
if opt_alt is opt_alts[-1]:
|
if opt_alt is opt_alts[-1]:
|
||||||
print('\t%s \033[4m%s\033[24m' % (opt_alt, opt_arg) if opt_type == ARGUMENTED else '\t' + opt_alt)
|
print('\t%s=\033[4m%s\033[24m' % (opt_alt, opt_arg) if opt_type == ARGUMENTED else '\t' + opt_alt)
|
||||||
else:
|
else:
|
||||||
print('\t\033[2m' + opt_alt + '\033[22m')
|
print('\t\033[2m' + opt_alt + '\033[22m')
|
||||||
first = True
|
first = True
|
||||||
|
|
Loading…
Reference in a new issue