From dce80571478b96b63a80655b987e61c8da1ad2fb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 14 Nov 2016 15:20:37 +0100 Subject: [PATCH] phase1: support specifying repository source branch Signed-off-by: Jo-Philipp Wich --- phase1/config.ini.example | 1 + phase1/master.cfg | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/phase1/config.ini.example b/phase1/config.ini.example index 6c69ef1..c502d13 100644 --- a/phase1/config.ini.example +++ b/phase1/config.ini.example @@ -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 diff --git a/phase1/master.cfg b/phase1/master.cfg index b9fd34e..750763e 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -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') -- 2.30.2