mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-16 17:44:23 +01:00
setup fix
This commit is contained in:
parent
27562de3b3
commit
bc9f6ae120
1 changed files with 37 additions and 10 deletions
47
setup.py
47
setup.py
|
@ -163,11 +163,26 @@ class Setup():
|
||||||
else:
|
else:
|
||||||
conf = self.configure(opts.opts)
|
conf = self.configure(opts.opts)
|
||||||
self.viewconf(conf)
|
self.viewconf(conf)
|
||||||
if method == 'build': self.build (conf)
|
|
||||||
elif method == 'prebuilt': self.install (conf)
|
if method == 'build':
|
||||||
elif method == 'install': self.build (conf); self.install(conf); self.clean()
|
self.build(conf)
|
||||||
elif method == 'uninstall': self.uninstall (conf)
|
|
||||||
elif method == 'uninstall-old': self.uninstallOld(conf)
|
elif method == 'prebuilt':
|
||||||
|
self.applyDestDir(conf)
|
||||||
|
self.install(conf)
|
||||||
|
|
||||||
|
elif method == 'install':
|
||||||
|
self.build(conf)
|
||||||
|
self.applyDestDir(conf)
|
||||||
|
self.install(conf)
|
||||||
|
self.clean()
|
||||||
|
|
||||||
|
elif method == 'uninstall':
|
||||||
|
self.uninstall(conf)
|
||||||
|
|
||||||
|
elif method == 'uninstall-old':
|
||||||
|
self.uninstallOld(conf)
|
||||||
|
|
||||||
elif not method == 'view':
|
elif not method == 'view':
|
||||||
opts.help()
|
opts.help()
|
||||||
|
|
||||||
|
@ -793,14 +808,26 @@ class Setup():
|
||||||
conf['man-section-' + mansection[0]] = mansection[1]
|
conf['man-section-' + mansection[0]] = mansection[1]
|
||||||
|
|
||||||
|
|
||||||
if opts['--dest-dir'] is not None:
|
|
||||||
destdir = opts['--dest-dir'][0]
|
self.destDir = None if opts['--dest-dir'] is None else opts['--dest-dir'][0]
|
||||||
|
|
||||||
|
return conf
|
||||||
|
|
||||||
|
|
||||||
|
def applyDestDir(self, conf):
|
||||||
|
if self.destDir is not None:
|
||||||
for key in conf:
|
for key in conf:
|
||||||
if conf[key] not in (None, False, True):
|
if conf[key] not in (None, False, True):
|
||||||
if conf[key].startswith('/'):
|
if conf[key].startswith('/'):
|
||||||
conf[key] = destdir + conf[key]
|
conf[key] = self.destDir + conf[key]
|
||||||
|
|
||||||
return conf
|
|
||||||
|
def unapplyDestDir(self, conf):
|
||||||
|
if self.destDir is not None:
|
||||||
|
for key in conf:
|
||||||
|
if conf[key] not in (None, False, True):
|
||||||
|
if conf[key].startswith(self.destDir):
|
||||||
|
conf[key] = conf[key][len(self.destDir):]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue