summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-11-02 16:10:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-07 14:05:36 +0000
commit25fc202e213e844334c680a35d7068c202e05aba (patch)
tree2fe43f178ea13b444b6688adca108a11964e8dc2 /scripts
parentcb21ff180763f6d8dc6ec8e3fefb12512346b051 (diff)
downloadpoky-25fc202e213e844334c680a35d7068c202e05aba.tar.gz
scripts/combo-layer: make component repo branch configurable
Add an optional per-component branch setting to allow specifying the branch instead of always using master. (From OE-Core rev: 8e2b8b05607103acd539808c5ab0cc80c0d481fc) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/combo-layer22
1 files changed, 14 insertions, 8 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index e39e4e013f..4cb9ee072b 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -108,19 +108,23 @@ def action_init(conf, args):
108 if not os.path.exists(ldir): 108 if not os.path.exists(ldir):
109 logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir)) 109 logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir))
110 subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True) 110 subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True)
111 branch = conf.repos[name].get('branch', "master")
112 runcmd("git checkout %s" % branch, ldir)
111 if not os.path.exists(".git"): 113 if not os.path.exists(".git"):
112 runcmd("git init") 114 runcmd("git init")
113 for name in conf.repos: 115 for name in conf.repos:
114 ldir = conf.repos[name]['local_repo_dir'] 116 repo = conf.repos[name]
117 ldir = repo['local_repo_dir']
115 logger.info("copying data from %s..." % name) 118 logger.info("copying data from %s..." % name)
116 dest_dir = conf.repos[name]['dest_dir'] 119 dest_dir = repo['dest_dir']
117 if dest_dir and dest_dir != ".": 120 if dest_dir and dest_dir != ".":
118 extract_dir = os.path.join(os.getcwd(), dest_dir) 121 extract_dir = os.path.join(os.getcwd(), dest_dir)
119 os.makedirs(extract_dir) 122 os.makedirs(extract_dir)
120 else: 123 else:
121 extract_dir = os.getcwd() 124 extract_dir = os.getcwd()
122 file_filter = conf.repos[name].get('file_filter',"") 125 branch = repo.get('branch', "master")
123 runcmd("git archive master | tar -x -C %s %s" % (extract_dir, file_filter), ldir) 126 file_filter = repo.get('file_filter', "")
127 runcmd("git archive %s | tar -x -C %s %s" % (branch, extract_dir, file_filter), ldir)
124 lastrev = runcmd("git rev-parse HEAD", ldir).strip() 128 lastrev = runcmd("git rev-parse HEAD", ldir).strip()
125 conf.update(name, "last_revision", lastrev) 129 conf.update(name, "last_revision", lastrev)
126 runcmd("git add .") 130 runcmd("git add .")
@@ -162,9 +166,11 @@ def action_update(conf, args):
162 repo = conf.repos[name] 166 repo = conf.repos[name]
163 ldir = repo['local_repo_dir'] 167 ldir = repo['local_repo_dir']
164 dest_dir = repo['dest_dir'] 168 dest_dir = repo['dest_dir']
169 branch = repo.get('branch', "master")
165 repo_patch_dir = os.path.join(os.getcwd(), patch_dir, name) 170 repo_patch_dir = os.path.join(os.getcwd(), patch_dir, name)
166 171
167 # Step 1: update the component repo 172 # Step 1: update the component repo
173 runcmd("git checkout %s" % branch, ldir)
168 logger.info("git pull for component repo %s in %s ..." % (name, ldir)) 174 logger.info("git pull for component repo %s in %s ..." % (name, ldir))
169 output=runcmd("git pull", ldir) 175 output=runcmd("git pull", ldir)
170 logger.info(output) 176 logger.info(output)
@@ -177,11 +183,11 @@ def action_update(conf, args):
177 prefix = "" 183 prefix = ""
178 if repo['last_revision'] == "": 184 if repo['last_revision'] == "":
179 logger.info("Warning: last_revision of component %s is not set, so start from the first commit" % name) 185 logger.info("Warning: last_revision of component %s is not set, so start from the first commit" % name)
180 patch_cmd_range = "--root master" 186 patch_cmd_range = "--root %s" % branch
181 rev_cmd_range = "master" 187 rev_cmd_range = branch
182 else: 188 else:
183 patch_cmd_range = "%s..master" % repo['last_revision'] 189 patch_cmd_range = "%s..%s" % (repo['last_revision'], branch)
184 rev_cmd_range = "%s..master" % repo['last_revision'] 190 rev_cmd_range = patch_cmd_range
185 191
186 file_filter = repo.get('file_filter',"") 192 file_filter = repo.get('file_filter',"")
187 193