aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-08-27 23:26:32 +0200
committerMattias Andrée <maandree@operamail.com>2012-08-27 23:26:32 +0200
commitbc9f6ae120ae210c2222297666b9f7ab0c4c2f8b (patch)
treec8ff5f780ce2eb212a4bd5ba432785540de2f48d /setup.py
parent27562de3b3785cc2aaf3f2f7bbf8529e7c17a641 (diff)
downloadponysay-bc9f6ae120ae210c2222297666b9f7ab0c4c2f8b.tar.gz
ponysay-bc9f6ae120ae210c2222297666b9f7ab0c4c2f8b.tar.bz2
ponysay-bc9f6ae120ae210c2222297666b9f7ab0c4c2f8b.zip
setup fix
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py47
1 files changed, 37 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 0901e74..d99e5c4 100755
--- a/setup.py
+++ b/setup.py
@@ -163,11 +163,26 @@ class Setup():
else:
conf = self.configure(opts.opts)
self.viewconf(conf)
- if method == 'build': self.build (conf)
- elif method == 'prebuilt': self.install (conf)
- elif method == 'install': self.build (conf); self.install(conf); self.clean()
- elif method == 'uninstall': self.uninstall (conf)
- elif method == 'uninstall-old': self.uninstallOld(conf)
+
+ if method == 'build':
+ self.build(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':
opts.help()
@@ -793,14 +808,26 @@ class Setup():
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:
if conf[key] not in (None, False, True):
if conf[key].startswith('/'):
- conf[key] = destdir + conf[key]
-
- return conf
+ conf[key] = self.destDir + conf[key]
+
+
+ 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):]