summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/combo-layer22
-rw-r--r--scripts/combo-layer.conf.example5
2 files changed, 23 insertions, 4 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer
index d6d238d83c..db38a95805 100755
--- a/scripts/combo-layer
+++ b/scripts/combo-layer
@@ -26,7 +26,7 @@ import logging
26import subprocess 26import subprocess
27import ConfigParser 27import ConfigParser
28 28
29__version__ = "0.1.0" 29__version__ = "0.2.0"
30 30
31def logger_create(): 31def logger_create():
32 logger = logging.getLogger("") 32 logger = logging.getLogger("")
@@ -146,7 +146,7 @@ def runcmd(cmd,destdir=None):
146def action_init(conf, args): 146def action_init(conf, args):
147 """ 147 """
148 Clone component repositories 148 Clone component repositories
149 Check git initialised and working tree is clean 149 Check git is initialised; if not, copy initial data from component repos
150 """ 150 """
151 for name in conf.repos: 151 for name in conf.repos:
152 ldir = conf.repos[name]['local_repo_dir'] 152 ldir = conf.repos[name]['local_repo_dir']
@@ -155,6 +155,24 @@ def action_init(conf, args):
155 subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True) 155 subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True)
156 if not os.path.exists(".git"): 156 if not os.path.exists(".git"):
157 runcmd("git init") 157 runcmd("git init")
158 for name in conf.repos:
159 ldir = conf.repos[name]['local_repo_dir']
160 logger.info("copying data from %s..." % name)
161 dest_dir = conf.repos[name]['dest_dir']
162 if dest_dir and dest_dir != ".":
163 extract_dir = os.path.join(os.getcwd(), dest_dir)
164 os.makedirs(extract_dir)
165 else:
166 extract_dir = os.getcwd()
167 file_filter = conf.repos[name].get('file_filter',"")
168 runcmd("git archive master | tar -x -C %s %s" % (extract_dir, file_filter), ldir)
169 lastrev = runcmd("git rev-parse HEAD", ldir).strip()
170 conf.update(name, "last_revision", lastrev)
171 runcmd("git add .")
172 logger.info("Initial combo layer repository data has been created; please make any changes if desired and then use 'git commit' to make the initial commit.")
173 else:
174 logger.info("Repository already initialised, nothing to do.")
175
158 176
159def check_repo_clean(repodir): 177def check_repo_clean(repodir):
160 """ 178 """
diff --git a/scripts/combo-layer.conf.example b/scripts/combo-layer.conf.example
index 09b94156fd..8cee04f771 100644
--- a/scripts/combo-layer.conf.example
+++ b/scripts/combo-layer.conf.example
@@ -11,8 +11,9 @@ local_repo_dir = /home/kyu3/src/test/bitbake
11# use "." if it is root dir 11# use "." if it is root dir
12dest_dir = bitbake 12dest_dir = bitbake
13 13
14# the updated revision last time. 14# the last update revision.
15# If empty, the tool will start from the first commit 15# "init" will set this automatically, however if it is empty when "update"
16# is run, the tool will start from the first commit.
16last_revision = 17last_revision =
17 18
18# optional options 19# optional options