mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-16 17:44:23 +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()
|
print()
|
||||||
exit(255)
|
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):
|
if (opts.opts['---DESTDIR'] is not None) and (opts.opts['--dest-dir'] is None):
|
||||||
destdir = opts.opts['---DESTDIR'][0]
|
destdir = opts.opts['---DESTDIR'][0]
|
||||||
if len(destdir) > 0:
|
if len(destdir) > 0:
|
||||||
|
@ -272,33 +276,39 @@ class Setup():
|
||||||
elif method == 'clean-old': self.cleanOld()
|
elif method == 'clean-old': self.cleanOld()
|
||||||
else:
|
else:
|
||||||
conf = self.configure(opts.opts)
|
conf = self.configure(opts.opts)
|
||||||
self.viewconf(conf)
|
|
||||||
os.umask(0o022)
|
|
||||||
|
|
||||||
if method == 'build':
|
if method == 'build':
|
||||||
checkFreedom()
|
checkFreedom()
|
||||||
|
setup_config()
|
||||||
self.build(conf)
|
self.build(conf)
|
||||||
|
|
||||||
elif method == 'prebuilt':
|
elif method == 'prebuilt':
|
||||||
checkFreedom()
|
checkFreedom()
|
||||||
|
setup_config()
|
||||||
self.applyDestDir(conf)
|
self.applyDestDir(conf)
|
||||||
self.install(conf)
|
self.install(conf)
|
||||||
|
|
||||||
elif method == 'install':
|
elif method == 'install':
|
||||||
checkFreedom()
|
checkFreedom()
|
||||||
|
setup_config()
|
||||||
self.build(conf)
|
self.build(conf)
|
||||||
self.applyDestDir(conf)
|
self.applyDestDir(conf)
|
||||||
self.install(conf)
|
self.install(conf)
|
||||||
self.clean()
|
self.clean()
|
||||||
|
|
||||||
elif method == 'uninstall':
|
elif method == 'uninstall':
|
||||||
|
setup_config()
|
||||||
self.uninstall(conf)
|
self.uninstall(conf)
|
||||||
|
|
||||||
elif method == 'uninstall-old':
|
elif method == 'uninstall-old':
|
||||||
|
setup_config()
|
||||||
self.uninstallOld(conf)
|
self.uninstallOld(conf)
|
||||||
|
|
||||||
elif not method == 'view':
|
elif method == 'view':
|
||||||
opts.help()
|
setup_config()
|
||||||
|
else:
|
||||||
|
opts.print_fatal('Unknown command: {}', method)
|
||||||
|
opts.usage()
|
||||||
|
|
||||||
def viewconf(self, conf):
|
def viewconf(self, conf):
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in a new issue