diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-10 13:08:04 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-10 13:08:04 (GMT) |
commit | b4bb64e2882297f4759e5d4e6758100d8e9f3273 (patch) | |
tree | 30e8ff89d075f5074a4991d112690be12a32f7ba /Lib/plat-mac/pimp.py | |
parent | e1ebd80b044e012ddfd5a008aa1a2ee51e0c085d (diff) | |
download | cpython-b4bb64e2882297f4759e5d4e6758100d8e9f3273.zip cpython-b4bb64e2882297f4759e5d4e6758100d8e9f3273.tar.gz cpython-b4bb64e2882297f4759e5d4e6758100d8e9f3273.tar.bz2 |
Added preInstall and postInstall commands to packages. PIL needs this
(preInstall, at least).
Diffstat (limited to 'Lib/plat-mac/pimp.py')
-rw-r--r-- | Lib/plat-mac/pimp.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 5d037f7..5876d86 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -176,7 +176,9 @@ class PimpPackage: longdesc=None, downloadURL=None, installTest=None, - prerequisites=None): + prerequisites=None, + preInstall=None, + postInstall=None): self._db = db self.name = name self.version = version @@ -186,6 +188,8 @@ class PimpPackage: self.downloadURL = downloadURL self._installTest = installTest self._prerequisites = prerequisites + self._preInstall = preInstall + self._postInstall = postInstall def dump(self): dict = { @@ -205,6 +209,10 @@ class PimpPackage: dict['installTest'] = self._installTest if self._prerequisites: dict['prerequisites'] = self._prerequisites + if self._preInstall: + dict['preInstall'] = self._preInstall + if self._postInstall: + dict['postInstall'] = self._postInstall return dict def __cmp__(self, other): @@ -312,8 +320,16 @@ class PimpPackage: msg = self.unpackSinglePackage(output) if msg: return "unpack %s: %s" % (_fmtpackagename(self), msg) + if self._preInstall: + if self._cmd(output, self._buildDirname, self._preInstall): + return "pre-install %s: running \"%s\" failed" % \ + (_fmtpackagename(self), self._preInstall) if self._cmd(output, self._buildDirname, sys.executable, "setup.py install"): return "install %s: running \"setup.py install\" failed" % _fmtpackagename(self) + if self._postInstall: + if self._cmd(output, self._buildDirname, self._postInstall): + return "post-install %s: running \"%s\" failed" % \ + (_fmtpackagename(self), self._postInstall) return None class PimpInstaller: |