Skip to content

Commit

Permalink
setup fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maandree committed Aug 27, 2012
1 parent 27562de commit bc9f6ae
Showing 1 changed file with 37 additions and 10 deletions.
47 changes: 37 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,26 @@ def __init__(self):
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()

Expand Down Expand Up @@ -793,14 +808,26 @@ def configure(self, opts):
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):]



Expand Down

0 comments on commit bc9f6ae

Please sign in to comment.