summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/pimp.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-02-10 13:08:04 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-02-10 13:08:04 (GMT)
commitb4bb64e2882297f4759e5d4e6758100d8e9f3273 (patch)
tree30e8ff89d075f5074a4991d112690be12a32f7ba /Lib/plat-mac/pimp.py
parente1ebd80b044e012ddfd5a008aa1a2ee51e0c085d (diff)
downloadcpython-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.py18
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: