chiark / gitweb /
if building directly in git repo, use file path for remote
authorHans-Christoph Steiner <hans@eds.org>
Tue, 8 Nov 2016 15:26:22 +0000 (16:26 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Wed, 16 Nov 2016 22:28:03 +0000 (23:28 +0100)
When a git repo has a .fdroid.yml file in it, and `fdroid build` is run
directly in that git repo, then this uses the file path as the remote for
the git repo in build/appid that is actually built.  That makes it possible
to run builds of commits that are only local, and makes things a whole lot
faster.

fdroidserver/common.py

index 121f6eddb031392eb9dc71ab7f51b636f2677dd7..e61d29be1e5ffaaa5f29fa5329751ceb505790bf 100644 (file)
@@ -502,7 +502,11 @@ def setup_vcs(app):
     # Set up vcs interface and make sure we have the latest code...
     logging.debug("Getting {0} vcs interface for {1}"
                   .format(app.RepoType, app.Repo))
-    vcs = getvcs(app.RepoType, app.Repo, build_dir)
+    if app.RepoType == 'git' and os.path.exists('.fdroid.yml'):
+        remote = os.getcwd()
+    else:
+        remote = app.Repo
+    vcs = getvcs(app.RepoType, remote, build_dir)
 
     return vcs, build_dir