diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-12 16:37:00 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-02-12 16:37:00 (GMT) |
commit | e71b9f830b0a3829de799c6b826ea2b4450762c4 (patch) | |
tree | 6ee1cef39f577714a9bf544e01d6528d2b4a4e29 | |
parent | c13f19f1fc70bfeb88c69d89cefd8494176c15b4 (diff) | |
download | cpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.zip cpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.tar.gz cpython-e71b9f830b0a3829de799c6b826ea2b4450762c4.tar.bz2 |
- Use distutils to find site-python (suggested by Thomas Heller, thanks!)
- Fixed a bug for packages without MD5 checksum.
-rw-r--r-- | Lib/plat-mac/pimp.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 2ca5369..84bee42 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -18,6 +18,7 @@ import urllib import urlparse import plistlib import distutils.util +import distutils.sysconfig import md5 __all__ = ["PimpPreferences", "PimpDatabase", "PimpPackage", "main"] @@ -33,12 +34,7 @@ PIMP_VERSION="0.1" DEFAULT_FLAVORORDER=['source', 'binary'] DEFAULT_DOWNLOADDIR='/tmp' DEFAULT_BUILDDIR='/tmp' -for _p in sys.path: - if _p[-13:] == 'site-packages': - DEFAULT_INSTALLDIR=_p - break -else: - DEFAULT_INSTALLDIR=sys.prefix # Have to put things somewhere +DEFAULT_INSTALLDIR=distutils.sysconfig.get_python_lib() DEFAULT_PIMPDATABASE="http://www.cwi.nl/~jack/pimp/pimp-%s.plist" % distutils.util.get_platform() ARCHIVE_FORMATS = [ @@ -419,7 +415,7 @@ class PimpPackage: if not os.path.exists(self.archiveFilename): return 0 - if not self._dict['MD5Sum']: + if not self._dict.get('MD5Sum'): sys.stderr.write("Warning: no MD5Sum for %s\n" % self.fullname()) return 1 data = open(self.archiveFilename, 'rb').read() |