From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: Paul Eggleton <paul.eggleton@linux.intel.com>,
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR
Date: Fri, 24 Apr 2015 11:38:45 +0300 [thread overview]
Message-ID: <D15FDB62.4EB39%markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <c1dd117694b4df1c77bac677d00dba392f3f7487.1429805738.git.paul.eggleton@linux.intel.com>
Hi,
On 23/04/15 19:18, "Paul Eggleton" <paul.eggleton@linux.intel.com> wrote:
>From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
>
>All local files from the layer, including patches, are added to to
>srctree repository when S==WORKDIR. The patch files are useless as they
>are automatically applied on top of the srctree by devtool.
>
>This change causes devtool extract to not commit these unnecessary (and
>possibly confusing) patch file(s) into srctree repository.
>
>[YOCTO #7602]
>
>Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
>---
> scripts/lib/devtool/standard.py | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
>diff --git a/scripts/lib/devtool/standard.py
>b/scripts/lib/devtool/standard.py
>index aa30a98..926ec6c 100644
>--- a/scripts/lib/devtool/standard.py
>+++ b/scripts/lib/devtool/standard.py
>@@ -153,6 +153,7 @@ def extract(args, config, basepath, workspace):
>
> def _extract_source(srctree, keep_temp, devbranch, d):
> import bb.event
>+ import oe.recipeutils
>
> def eventfilter(name, handler, event, d):
> if name == 'base_eventhandler':
>@@ -240,6 +241,13 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
> else:
> os.rmdir(patchdir)
>
>+ # Find local patches that were "unpacked" to srctree directory
>+ recipe_patches = [os.path.basename(patch) for patch in
>+ oe.recipeutils.get_recipe_patches(crd)]
>+ patches = [fname for fname in os.listdir(workdir) if fname in
>+ recipe_patches]
>+
>+ # Set-up srctree repo
> if bb.data.inherits_class('kernel-yocto', d):
> (stdout, _) = bb.process.run('git --git-dir="%s" rev-parse
>HEAD' % crd.expand('${WORKDIR}/git'), cwd=srcsubdir)
> initial_rev = stdout.rstrip()
>@@ -251,6 +259,10 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
> if not os.path.exists(os.path.join(srcsubdir, '.git')):
> bb.process.run('git init', cwd=srcsubdir)
> bb.process.run('git add .', cwd=srcsubdir)
>+ # Do not commit patches (would happend if S=WORKDIR)
>+ if patches and srcsubdir == workdir:
>+ bb.process.run('git reset -- %s' % " ".join(patches),
>+ cwd=srcsubdir)
> bb.process.run('git commit -q -m "Initial commit from
>upstream at version %s"' % crd.getVar('PV', True), cwd=srcsubdir)
>
> (stdout, _) = bb.process.run('git rev-parse HEAD',
>cwd=srcsubdir)
>@@ -266,6 +278,14 @@ def _extract_source(srctree, keep_temp, devbranch,
>d):
>
> bb.process.run('git tag -f devtool-patched', cwd=srcsubdir)
>
>+ # Remove patches if S=WORKDIR so that stale patch files are not
>present
>+ # in the srtree
>+ if patches and srcsubdir == workdir:
>+ logger.info('Removing patch files...')
>+ for patch in patches:
>+ os.unlink(os.path.join(workdir, patch))
>+
>+
> if os.path.exists(patchdir):
> shutil.rmtree(patchdir)
> if haspatches:
NACK! Please skip this patch for now. I just found out it doesn't work as
expected. I'll submit a new version when I've worked around the problems.
Thanks,
Markus
next prev parent reply other threads:[~2015-04-24 8:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-23 16:18 [PATCH 0/8] devtool fixes Paul Eggleton
2015-04-23 16:18 ` [PATCH 1/8] devtool: modify: use B=S if that is the default for the recipe Paul Eggleton
2015-04-23 16:18 ` [PATCH 2/8] devtool: modify: implement --no-same-dir Paul Eggleton
2015-04-23 16:18 ` [PATCH 3/8] oe-selftest: devtool: fix update-recipe test after bd1aa28 Paul Eggleton
2015-04-23 16:18 ` [PATCH 4/8] devtool: extract: remove patches when S=WORKDIR Paul Eggleton
2015-04-24 8:38 ` Markus Lehtonen [this message]
2015-04-24 8:41 ` Paul Eggleton
2015-04-23 16:18 ` [PATCH 5/8] devtool: include bbappends in recipe parsing Paul Eggleton
2015-04-23 16:18 ` [PATCH 6/8] devtool: handle . in recipe name Paul Eggleton
2015-04-23 16:18 ` [PATCH 7/8] devtool: add: use correct bbappend file name with -V option Paul Eggleton
2015-04-23 16:18 ` [PATCH 8/8] devtool: reset: avoid errors in case file no longer exists Paul Eggleton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D15FDB62.4EB39%markus.lehtonen@linux.intel.com \
--to=markus.lehtonen@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox