Skip to content

Commit

Permalink
setup.py: Do not print the configuration when an unknown command was …
Browse files Browse the repository at this point in the history
…given so that the printed usage is better noticed.
  • Loading branch information
Feuermurmel committed Sep 8, 2014
1 parent e5c6503 commit 6658221
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,10 @@ def checkFreedom():
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:
Expand All @@ -272,33 +276,39 @@ def checkFreedom():
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):
'''
Expand Down

0 comments on commit 6658221

Please sign in to comment.