summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/__init__.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2015-04-23 17:11:42 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-10-01 07:43:32 +0100
commite9bae506e520a47e797c405a76f330d041289918 (patch)
treefb8bb6695d4083c31d35768999ca1591c0f627cb /scripts/lib/devtool/__init__.py
parenta74fa38365ab91d3143d8b7d6414c97cd3862794 (diff)
downloadpoky-e9bae506e520a47e797c405a76f330d041289918.tar.gz
devtool: better support for local source files
* extract: Copy all local source files (i.e. non-compressed/non-arcived SRC_URI files that have file:// URI prefix) - excluding patches - to the srctree repository. The files will be placed in a subdirectory called 'oe-local-files'. The oe-local-files directory is not committed to the Git repository, but, marked to be ignored by a .gitignore file. The developer can manually add and commit the files to Git if the changes to them need to be tracked. Before this patch, local source files (were copied (and committed) to the srctree repository only in some special cases (basically when S=WORKDIR) when doing devtool-extract. For most of the packages local files were not copied at all. * update-recipe: This patch causes the local files to be 'synced' from the srctree (i.e. from the 'oe-local-files' subdirectory) to the layer. Being 'synced' means that in addition to copying modified files over the original sources, devtool will also handle removing and adding local source files and updating the recipe accordingly. We don't want to create patches against the local source files but rather update them directly. Thus, 'oe-local-file' directory is ignored in patch generation when doing update-recipe, even if committed to Git. This functionality is only enabled if the 'oe-local-files' directory is present in srctree. [YOCTO #7602] (From OE-Core rev: a3bb5bd25b72bd1bcc156dabd0ffa2d9184bb160) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/__init__.py')
-rw-r--r--scripts/lib/devtool/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py
index 7b1ab1110d..c8c30202b1 100644
--- a/scripts/lib/devtool/__init__.py
+++ b/scripts/lib/devtool/__init__.py
@@ -183,11 +183,17 @@ def setup_git_repo(repodir, version, devbranch, basetag='devtool-base'):
183 if not os.path.exists(os.path.join(repodir, '.git')): 183 if not os.path.exists(os.path.join(repodir, '.git')):
184 bb.process.run('git init', cwd=repodir) 184 bb.process.run('git init', cwd=repodir)
185 bb.process.run('git add .', cwd=repodir) 185 bb.process.run('git add .', cwd=repodir)
186 if version: 186 commit_cmd = ['git', 'commit', '-q']
187 stdout, _ = bb.process.run('git status --porcelain', cwd=repodir)
188 if not stdout:
189 commit_cmd.append('--allow-empty')
190 commitmsg = "Initial empty commit with no upstream sources"
191 elif version:
187 commitmsg = "Initial commit from upstream at version %s" % version 192 commitmsg = "Initial commit from upstream at version %s" % version
188 else: 193 else:
189 commitmsg = "Initial commit from upstream" 194 commitmsg = "Initial commit from upstream"
190 bb.process.run('git commit -q -m "%s"' % commitmsg, cwd=repodir) 195 commit_cmd += ['-m', commitmsg]
196 bb.process.run(commit_cmd, cwd=repodir)
191 197
192 bb.process.run('git checkout -b %s' % devbranch, cwd=repodir) 198 bb.process.run('git checkout -b %s' % devbranch, cwd=repodir)
193 bb.process.run('git tag -f %s' % basetag, cwd=repodir) 199 bb.process.run('git tag -f %s' % basetag, cwd=repodir)