Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorDan Winship <dwinship@redhat.com>2007-10-01 15:48:46 (GMT)
committer Dan Winship <dwinship@redhat.com>2007-10-01 15:48:46 (GMT)
commit53adb39e8413651b3b1109677b9a32ab3dcd3b60 (patch)
treed9c05b44a67776d813fda792aa0729a987401069 /sugar
parente81ed53d00cea7ae5b11e7f23f06f8fefca75517 (diff)
Allow the first file in a bundle to be "mimetype", and ignore it if it's there
Diffstat (limited to 'sugar')
-rw-r--r--sugar/bundle/bundle.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/sugar/bundle/bundle.py b/sugar/bundle/bundle.py
index 75b4b38..2657846 100644
--- a/sugar/bundle/bundle.py
+++ b/sugar/bundle/bundle.py
@@ -60,7 +60,10 @@ class Bundle:
file_names = zip_file.namelist()
if len(file_names) == 0:
raise MalformedBundleException('Empty zip file')
-
+
+ if file_names[0] == 'mimetype':
+ del file_names[0]
+
self._zip_root_dir = file_names[0].split('/')[0]
if self._unzipped_extension is not None:
(name, ext) = os.path.splitext(self._zip_root_dir)
@@ -113,7 +116,7 @@ class Bundle:
# features, etc makes it impractical.
# FIXME: use manifest
if os.spawnlp(os.P_WAIT, 'unzip', 'unzip', self._path,
- '-d', install_dir):
+ '-x', 'mimetype', '-d', install_dir):
raise ZipExtractException
def _zip(self, bundle_path):