phase1: support specifying repository source branch
authorJo-Philipp Wich <jo@mein.io>
Mon, 14 Nov 2016 14:20:37 +0000 (15:20 +0100)
committerJo-Philipp Wich <jo@mein.io>
Mon, 14 Nov 2016 14:21:01 +0000 (15:21 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
phase1/config.ini.example
phase1/master.cfg

index 6c69ef1d2fae11813ee1c28e10432d3df63e79e2..c502d139fd3a0566030fc15eba30545e0ad97be6 100644 (file)
@@ -20,6 +20,7 @@ password = example
 
 [repo]
 url = https://git.lede-project.org/source.git
+branch = master
 
 [rsync]
 binary_url = user@example.org::upload-binary
index b9fd34ef2452ff62fd244de204e329117b6cdd5b..750763ea877193fa9e3026ad4180b2e0669cdf90 100644 (file)
@@ -59,6 +59,10 @@ if ini.has_option("general", "expire"):
        tree_expire = ini.getint("general", "expire")
 
 repo_url = ini.get("repo", "url")
+repo_branch = "master"
+
+if ini.has_option("repo", "branch"):
+       repo_branch = ini.get_option("repo", "branch")
 
 rsync_bin_url = ini.get("rsync", "binary_url")
 rsync_bin_key = ini.get("rsync", "binary_password")
@@ -89,6 +93,7 @@ targets = [ ]
 
 if not os.path.isdir(home_dir+'/source.git'):
        subprocess.call(["git", "clone", "--depth=1", repo_url, home_dir+'/source.git'])
+       subprocess.call(["git", "checkout", repo_branch], cwd = home_dir+'/source.git')
 
 findtargets = subprocess.Popen([home_dir+'/dumpinfo.pl', 'targets'],
        stdout = subprocess.PIPE, cwd = home_dir+'/source.git')