From b4bb64e2882297f4759e5d4e6758100d8e9f3273 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Mon, 10 Feb 2003 13:08:04 +0000 Subject: Added preInstall and postInstall commands to packages. PIL needs this (preInstall, at least). --- Lib/plat-mac/pimp.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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: -- cgit v0.12