mirror of
https://github.com/erkin/ponysay.git
synced 2024-11-21 20:18:00 +01:00
setup.py: Do not print the configuration when an unknown command was given so that the printed usage is better noticed.
This commit is contained in:
parent
e5c650349b
commit
6658221bbf
1 changed files with 14 additions and 4 deletions
18
setup.py
18
setup.py
|
@ -249,6 +249,10 @@ class Setup():
|
|||
print()
|
||||
exit(255)
|
||||
|
||||
def setup_config():
|
||||
self.viewconf(conf)
|
||||
os.umask(0o022)
|
||||
|
||||
if (opts.opts['---DESTDIR'] is not None) and (opts.opts['--dest-dir'] is None):
|
||||
destdir = opts.opts['---DESTDIR'][0]
|
||||
if len(destdir) > 0:
|
||||
|
@ -272,33 +276,39 @@ class Setup():
|
|||
elif method == 'clean-old': self.cleanOld()
|
||||
else:
|
||||
conf = self.configure(opts.opts)
|
||||
self.viewconf(conf)
|
||||
os.umask(0o022)
|
||||
|
||||
if method == 'build':
|
||||
checkFreedom()
|
||||
setup_config()
|
||||
self.build(conf)
|
||||
|
||||
elif method == 'prebuilt':
|
||||
checkFreedom()
|
||||
setup_config()
|
||||
self.applyDestDir(conf)
|
||||
self.install(conf)
|
||||
|
||||
elif method == 'install':
|
||||
checkFreedom()
|
||||
setup_config()
|
||||
self.build(conf)
|
||||
self.applyDestDir(conf)
|
||||
self.install(conf)
|
||||
self.clean()
|
||||
|
||||
elif method == 'uninstall':
|
||||
setup_config()
|
||||
self.uninstall(conf)
|
||||
|
||||
elif method == 'uninstall-old':
|
||||
setup_config()
|
||||
self.uninstallOld(conf)
|
||||
|
||||
elif not method == 'view':
|
||||
opts.help()
|
||||
elif method == 'view':
|
||||
setup_config()
|
||||
else:
|
||||
opts.print_fatal('Unknown command: {}', method)
|
||||
opts.usage()
|
||||
|
||||
def viewconf(self, conf):
|
||||
'''
|
||||
|
|
Loading…
Reference in a new issue