chiark / gitweb /
Allow for subdirectories being present only in relevant commit
authorCiaran Gultnieks <ciaran@ciarang.com>
Fri, 13 Jan 2012 12:28:11 +0000 (12:28 +0000)
committerCiaran Gultnieks <ciaran@ciarang.com>
Fri, 13 Jan 2012 12:28:11 +0000 (12:28 +0000)
common.py

index 262208d106a3a5bc22eec96e67b6ecd08eef97c0..358ba8241ca34790996df4bc7216c69b62c398c1 100644 (file)
--- a/common.py
+++ b/common.py
@@ -555,8 +555,6 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path,
     # Optionally, the actual app source can be in a subdirectory...
     if build.has_key('subdir'):
         root_dir = os.path.join(build_dir, build['subdir'])
-        if not os.path.exists(root_dir):
-            raise BuildException('Missing subdir ' + root_dir)
     else:
         root_dir = build_dir
 
@@ -564,6 +562,11 @@ def prepare_source(vcs, app, build, build_dir, sdk_path, ndk_path, javacc_path,
     print "Resetting repository to " + build['commit']
     vcs.reset(build['commit'])
 
+    # Check that a subdir (if we're using one) exists. This has to happen
+    # after the checkout, since it might not exist elsewhere...
+    if not os.path.exists(root_dir):
+        raise BuildException('Missing subdir ' + root_dir)
+
     # Initialise submodules if requred...
     if build.get('submodules', 'no')  == 'yes':
         vcs.initsubmodules()