All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] devtool: fix devtool upgrade with reproducible_builds class
@ 2019-11-19 10:52 Paul Eggleton
  2019-11-19 10:52 ` [PATCH 1/1] " Paul Eggleton
  2019-11-19 11:02 ` ✗ patchtest: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2019-11-19 10:52 UTC (permalink / raw)
  To: openembedded-core

NOTE: This change depends upon Richard's fix for recipetool create.

The following changes since commit 185ef531739fddb98577ba822d131188fc1d6c85:

  poky: Default to reproducible builds (2019-11-19 13:43:44 +1300)

are available in the Git repository at:

  git://git.yoctoproject.org/poky-contrib paule/devtool-rb-fix
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/devtool-rb-fix

Paul Eggleton (1):
  devtool: fix devtool upgrade with reproducible_builds class

 scripts/lib/devtool/upgrade.py   |  5 +++--
 scripts/lib/recipetool/create.py |  4 +---
 scripts/lib/scriptutils.py       | 10 ++++++++++
 3 files changed, 14 insertions(+), 5 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] devtool: fix devtool upgrade with reproducible_builds class
  2019-11-19 10:52 [PATCH 0/1] devtool: fix devtool upgrade with reproducible_builds class Paul Eggleton
@ 2019-11-19 10:52 ` Paul Eggleton
  2019-11-19 11:02 ` ✗ patchtest: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2019-11-19 10:52 UTC (permalink / raw)
  To: openembedded-core

If the reproducible_build class is inherited then there may be a
"source-date-epoch" subdirectory in a fetched source tree; devtool
upgrade was not expecting that in the upgraded source. Take a small
snippet of code from recipetool create which already handles this,
and make it a shared function that can be used in both places.

Additionally, fix an assumption that the source is always in a
subdirectory in the cleanup code that blocked debugging this.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/upgrade.py   |  5 +++--
 scripts/lib/recipetool/create.py |  4 +---
 scripts/lib/scriptutils.py       | 10 ++++++++++
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 18c5b66a29..cb6dce378a 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -32,7 +32,7 @@ def _run(cmd, cwd=''):
 
 def _get_srctree(tmpdir):
     srctree = tmpdir
-    dirs = os.listdir(tmpdir)
+    dirs = scriptutils.filter_src_subdirs(tmpdir)
     if len(dirs) == 1:
         srctree = os.path.join(tmpdir, dirs[0])
     return srctree
@@ -281,7 +281,8 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
             logger.info('Preserving temporary directory %s' % tmpsrctree)
         else:
             shutil.rmtree(tmpsrctree)
-            shutil.rmtree(tmpdir)
+            if tmpdir != tmpsrctree:
+                shutil.rmtree(tmpdir)
 
     return (rev, md5, sha256, srcbranch, srcsubdir_rel)
 
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index b5c9f78843..4c4bbadb4c 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -495,9 +495,7 @@ def create_recipe(args):
         if ftmpdir and args.keep_temp:
             logger.info('Fetch temp directory is %s' % ftmpdir)
 
-        dirlist = os.listdir(srctree)
-        filterout = ['git.indirectionsymlink', 'source-date-epoch']
-        dirlist = [x for x in dirlist if x not in filterout]
+        dirlist = scriptutils.filter_src_subdirs(srctree)
         logger.debug('Directory listing (excluding filtered out):\n  %s' % '\n  '.join(dirlist))
         if len(dirlist) == 1:
             singleitem = os.path.join(srctree, dirlist[0])
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py
index c573dc7f67..45bdaf5f4e 100644
--- a/scripts/lib/scriptutils.py
+++ b/scripts/lib/scriptutils.py
@@ -268,3 +268,13 @@ def is_src_url(param):
     elif param.startswith('git@') or ('@' in param and param.endswith('.git')):
         return True
     return False
+
+def filter_src_subdirs(pth):
+    """
+    Filter out subdirectories of initial unpacked source trees that we do not care about.
+    Used by devtool and recipetool.
+    """
+    dirlist = os.listdir(pth)
+    filterout = ['git.indirectionsymlink', 'source-date-epoch']
+    dirlist = [x for x in dirlist if x not in filterout]
+    return dirlist
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✗ patchtest: failure for devtool: fix devtool upgrade with reproducible_builds class
  2019-11-19 10:52 [PATCH 0/1] devtool: fix devtool upgrade with reproducible_builds class Paul Eggleton
  2019-11-19 10:52 ` [PATCH 1/1] " Paul Eggleton
@ 2019-11-19 11:02 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-11-19 11:02 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core

== Series Details ==

Series: devtool: fix devtool upgrade with reproducible_builds class
Revision: 1
URL   : https://patchwork.openembedded.org/series/21212/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at dfb3b56641)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-19 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 10:52 [PATCH 0/1] devtool: fix devtool upgrade with reproducible_builds class Paul Eggleton
2019-11-19 10:52 ` [PATCH 1/1] " Paul Eggleton
2019-11-19 11:02 ` ✗ patchtest: failure for " Patchwork

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.