All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Lehtonen <markus.lehtonen@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/5] devtool: extract: cleanup srctree
Date: Fri, 18 Dec 2015 10:39:43 +0200	[thread overview]
Message-ID: <1450427985-12504-4-git-send-email-markus.lehtonen@linux.intel.com> (raw)
In-Reply-To: <1450427985-12504-1-git-send-email-markus.lehtonen@linux.intel.com>

Some bitbake tasks, notably do_kernel_metadata et al. dirty the
sourcetree. Run git clean in order to get rid of the confusing and
possibly outdated extra files.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
---
 scripts/lib/devtool/standard.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 43fce11..f817671 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -458,10 +458,21 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d):
                 bb.process.run('git checkout patches', cwd=srcsubdir)
 
         if bb.data.inherits_class('kernel-yocto', d):
-            # Store generate and store kernel config
             logger.info('Generating kernel config')
             task_executor.exec_func('do_configure', False)
             kconfig = os.path.join(crd.getVar('B', True), '.config')
+        else:
+            kconfig = None
+
+        # Clean source tree in case it has been dirtied by some bitbake task
+        stdout, _ = bb.process.run('git status --porcelain --ignored',
+                                   cwd=srcsubdir)
+        if stdout:
+            logger.info('Source tree is dirty, cleaning up')
+            bb.process.run('git clean -fdx', cwd=srcsubdir)
+
+        if kconfig:
+            # Store kernel config in srctree
             shutil.copy2(kconfig, srcsubdir)
 
 
-- 
2.1.4



  parent reply	other threads:[~2015-12-18  8:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  8:39 [PATCH 0/5] devtool: create kernel config fragment Markus Lehtonen
2015-12-18  8:39 ` [PATCH 1/5] devtool: extract: use the correct datastore for builddir Markus Lehtonen
2015-12-18  8:39 ` [PATCH 2/5] kernel.bbclass: copy .config instead of moving Markus Lehtonen
2015-12-18 12:22   ` Richard Purdie
2015-12-18 12:39     ` Markus Lehtonen
2015-12-18 14:18       ` Richard Purdie
2015-12-18 15:48         ` Markus Lehtonen
2015-12-18  8:39 ` Markus Lehtonen [this message]
2015-12-18  8:39 ` [PATCH 4/5] cml1.bbclass: copy .config to S if externalsr is in use Markus Lehtonen
2015-12-18  8:39 ` [PATCH 5/5] devtool: update-recipe: create kernel config fragment Markus Lehtonen

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=1450427985-12504-4-git-send-email-markus.lehtonen@linux.intel.com \
    --to=markus.lehtonen@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --subject='Re: [PATCH 3/5] devtool: extract: cleanup srctree' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.