summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/plat-mac')
-rwxr-xr-xLib/plat-mac/bundlebuilder.py23
-rw-r--r--Lib/plat-mac/pimp.py4
2 files changed, 20 insertions, 7 deletions
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 03d8c81..266b845 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -145,11 +145,24 @@ class BundleBuilder(Defaults):
self.message("Building %s" % repr(self.bundlepath), 1)
if os.path.exists(self.bundlepath):
shutil.rmtree(self.bundlepath)
- os.mkdir(self.bundlepath)
- self.preProcess()
- self._copyFiles()
- self._addMetaFiles()
- self.postProcess()
+ if os.path.exists(self.bundlepath + '~'):
+ shutil.rmtree(self.bundlepath + '~')
+ bp = self.bundlepath
+
+ # Create the app bundle in a temporary location and then
+ # rename the completed bundle. This way the Finder will
+ # never see an incomplete bundle (where it might pick up
+ # and cache the wrong meta data)
+ self.bundlepath = bp + '~'
+ try:
+ os.mkdir(self.bundlepath)
+ self.preProcess()
+ self._copyFiles()
+ self._addMetaFiles()
+ self.postProcess()
+ os.rename(self.bundlepath, bp)
+ finally:
+ self.bundlepath = bp
self.message("Done.", 1)
def preProcess(self):
diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py
index 21923ec..456427c 100644
--- a/Lib/plat-mac/pimp.py
+++ b/Lib/plat-mac/pimp.py
@@ -21,7 +21,7 @@ import urlparse
import plistlib
import distutils.util
import distutils.sysconfig
-import md5
+import hashlib
import tarfile
import tempfile
import shutil
@@ -693,7 +693,7 @@ class PimpPackage:
sys.stderr.write("Warning: no MD5Sum for %s\n" % self.fullname())
return 1
data = open(self.archiveFilename, 'rb').read()
- checksum = md5.new(data).hexdigest()
+ checksum = hashlib.md5(data).hexdigest()
return checksum == self._dict['MD5Sum']
def unpackPackageOnly(self, output=None):