Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix recipetool issue highlighted by oe-selftest test
@ 2016-03-13 19:59 Paul Eggleton
  2016-03-13 19:59 ` [PATCH 1/1] recipetool: create: don't create extra files directory unconditionally Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2016-03-13 19:59 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 4be0e15f74cff85edca9de55248939fb438f30ae:

  oeqa/selftest/recipetool: Fix test_recipetool_create_simple (2016-03-13 18:15:41 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/recipetool-selftest-fix
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/recipetool-selftest-fix

Paul Eggleton (1):
  recipetool: create: don't create extra files directory unconditionally

 meta/lib/oeqa/selftest/recipetool.py |  6 ++++--
 scripts/lib/recipetool/create.py     | 15 ++++++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)

-- 
2.5.0



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

* [PATCH 1/1] recipetool: create: don't create extra files directory unconditionally
  2016-03-13 19:59 [PATCH 0/1] Fix recipetool issue highlighted by oe-selftest test Paul Eggleton
@ 2016-03-13 19:59 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-03-13 19:59 UTC (permalink / raw)
  To: openembedded-core

The extra directory next to the recipe should only be created if there
are files to put into it; currently only the npm plugin does this. I
didn't notice the issue earlier because the test was actually able to
succeed under these circumstances if the recipe file came first in the
directory listing, which was a fault in my original oe-selftest test;
apparently on some YP autobuilder machines the order came out reversed.

With this change we can put the oe-selftest test that highlighted the
issue back to the way it was, with an extra check to reinforce that only
a single file should be created.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oeqa/selftest/recipetool.py |  6 ++++--
 scripts/lib/recipetool/create.py     | 15 ++++++++-------
 2 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
index 72ee110..a04ee87 100644
--- a/meta/lib/oeqa/selftest/recipetool.py
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -410,9 +410,11 @@ class RecipetoolTests(RecipetoolBase):
         srcuri = 'http://www.dest-unreach.org/socat/download/socat-%s.tar.bz2' % pv
         result = runCmd('recipetool create %s -o %s' % (srcuri, temprecipe))
         dirlist = os.listdir(temprecipe)
-        if len(dirlist) < 1 or not os.path.isfile(os.path.join(temprecipe, 'socat_%s.bb' % pv)):
+        if len(dirlist) > 1:
+            self.fail('recipetool created more than just one file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
+        if len(dirlist) < 1 or not os.path.isfile(os.path.join(temprecipe, dirlist[0])):
             self.fail('recipetool did not create recipe file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
-        self.assertIn('socat_%s.bb' % pv, dirlist, 'Recipe file incorrectly named')
+        self.assertEqual(dirlist[0], 'socat_%s.bb' % pv, 'Recipe file incorrectly named')
         checkvars = {}
         checkvars['LICENSE'] = set(['Unknown', 'GPLv2'])
         checkvars['LIC_FILES_CHKSUM'] = set(['file://COPYING.OpenSSL;md5=5c9bccc77f67a8328ef4ebaf468116f4', 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'])
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1649e40..bb9fb9b 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -604,13 +604,14 @@ def create_recipe(args):
                 sys.exit(1)
 
     # Move any extra files the plugins created to a directory next to the recipe
-    if outfile == '-':
-        extraoutdir = pn
-    else:
-        extraoutdir = os.path.join(os.path.dirname(outfile), pn)
-    bb.utils.mkdirhier(extraoutdir)
-    for destfn, extrafile in extrafiles.iteritems():
-        shutil.move(extrafile, os.path.join(extraoutdir, destfn))
+    if extrafiles:
+        if outfile == '-':
+            extraoutdir = pn
+        else:
+            extraoutdir = os.path.join(os.path.dirname(outfile), pn)
+        bb.utils.mkdirhier(extraoutdir)
+        for destfn, extrafile in extrafiles.iteritems():
+            shutil.move(extrafile, os.path.join(extraoutdir, destfn))
 
     lines = lines_before
     lines_before = []
-- 
2.5.0



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

end of thread, other threads:[~2016-03-13 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-13 19:59 [PATCH 0/1] Fix recipetool issue highlighted by oe-selftest test Paul Eggleton
2016-03-13 19:59 ` [PATCH 1/1] recipetool: create: don't create extra files directory unconditionally Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox