I think we should fallback to use a manifest file if present.<br>In particluar, the wikipedia activity can be builded with different data files,<br>but the same codebase, and is using a manifest file to select the included files.<br>
Anyway, is he only case. May be we can implement it in a custom setup.py in the activity,<br>but imho would be better if the toolkit resolve it.<br><br>Gonzalo<br><br><div class="gmail_quote">On Fri, Oct 21, 2011 at 7:27 AM, Simon Schampijer <span dir="ltr"><<a href="mailto:simon@schampijer.de">simon@schampijer.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">We need to make sure that we do not fail if git is not<br>
installed and use the same fallback code as if we are<br>
in a directory where no git information is present.<br>
<br>
Signed-off-by: Simon Schampijer <<a href="mailto:simon@laptop.org">simon@laptop.org</a>><br>
---<br>
 src/sugar/activity/bundlebuilder.py |   20 ++++++++++++++++----<br>
 1 files changed, 16 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py<br>
index e7641bb..96020b9 100644<br>
--- a/src/sugar/activity/bundlebuilder.py<br>
+++ b/src/sugar/activity/bundlebuilder.py<br>
@@ -184,8 +184,14 @@ class XOPackager(Packager):<br>
         bundle_zip.close()<br>
<br>
     def _get_files_in_git(self):<br>
-        git_ls = subprocess.Popen(['git', 'ls-files'], stdout=subprocess.PIPE,<br>
-                                  cwd=self.config.source_dir)<br>
+        try:<br>
+            git_ls = subprocess.Popen(['git', 'ls-files'],<br>
+                                      stdout=subprocess.PIPE,<br>
+                                      cwd=self.config.source_dir)<br>
+        except OSError:<br>
+            # Git not installed. Fall back to filtered list<br>
+            return list_files(self.config.source_dir,<br>
+                              IGNORE_DIRS, IGNORE_FILES)<br>
         stdout, _ = git_ls.communicate()<br>
         if git_ls.returncode:<br>
             # Fall back to filtered list<br>
@@ -204,8 +210,14 @@ class SourcePackager(Packager):<br>
                                          self.config.tar_name)<br>
<br>
     def get_files(self):<br>
-        git_ls = subprocess.Popen(['git', 'ls-files'], stdout=subprocess.PIPE,<br>
-                                  cwd=self.config.source_dir)<br>
+        try:<br>
+            git_ls = subprocess.Popen(['git', 'ls-files'],<br>
+                                      stdout=subprocess.PIPE,<br>
+                                      cwd=self.config.source_dir)<br>
+        except OSError:<br>
+            # Git not installed. Fall back to filtered list<br>
+            return list_files(self.config.source_dir,<br>
+                              IGNORE_DIRS, IGNORE_FILES)<br>
         stdout, _ = git_ls.communicate()<br>
         if git_ls.returncode:<br>
             # Fall back to filtered list<br>
<font color="#888888">--<br>
1.7.4.4<br>
<br>
_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
</font></blockquote></div><br>