diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-13 15:41:16 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2008-06-13 15:41:16 (GMT) |
commit | 3f4a809b80a1561a3b29f02802d1f2cd06584f61 (patch) | |
tree | f848c26cdd3d4fd22f1bc4a7c7d038792d4fc5ee | |
parent | 4762897239ae102a59fd7940f133a96caea95043 (diff) |
Generate the MANIFEST automatically if it doesn't exit. I'm
not sure if we want to keep doing that, but it's necessary at
the moment to keep stuff working.
-rw-r--r-- | src/sugar/activity/bundlebuilder.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index 436da99..fd59233 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -40,7 +40,7 @@ def list_files(base_dir, ignore_dirs=None, ignore_files=None): rel_path = root[len(base_dir) + 1:] for f in files: result.append(os.path.join(rel_path, f)) - + if ignore_dirs and root == base_dir: for ignore in ignore_dirs: if ignore in dirs: @@ -113,14 +113,20 @@ class Packager(object): if not os.path.exists(self.config.dist_dir): os.mkdir(self.config.dist_dir) - class BuildPackager(Packager): def get_files(self): - return self.config.bundle.get_files() + files = self.config.bundle.get_files() + + if not files: + logging.error('No files found, fixing the MANIFEST.') + self.fix_manifest() + files = self.config.bundle.get_files() + + return files def _list_useful_files(self): - ignore_dirs = ['dist', '.git'], + ignore_dirs = ['dist', '.git'] ignore_files = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak'] return list_files(self.config.source_dir, ignore_dirs, ignore_files) |