All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple of fixes for devtool
@ 2016-04-14  8:24 Paul Eggleton
  2016-04-14  8:24 ` [PATCH 1/2] devtool: update-recipe: handle where SRC_URI is appended to with += Paul Eggleton
  2016-04-14  8:24 ` [PATCH 2/2] devtool: upgrade: handle recipes where source is not first entry in SRC_URI Paul Eggleton
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-04-14  8:24 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 0e306a53c460302ec20192fc35930983781b7a2e:

  archiver: Improve debug output (2016-04-13 20:58:35 +0100)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool16-oe
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool16-oe

Paul Eggleton (2):
  devtool: update-recipe: handle where SRC_URI is appended to with +=
  devtool: upgrade: handle recipes where source is not first entry in
    SRC_URI

 meta/lib/oe/recipeutils.py     |  7 ++++---
 scripts/lib/devtool/upgrade.py | 10 +++++++++-
 2 files changed, 13 insertions(+), 4 deletions(-)

-- 
2.5.5



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

* [PATCH 1/2] devtool: update-recipe: handle where SRC_URI is appended to with +=
  2016-04-14  8:24 [PATCH 0/2] A couple of fixes for devtool Paul Eggleton
@ 2016-04-14  8:24 ` Paul Eggleton
  2016-04-14  8:24 ` [PATCH 2/2] devtool: upgrade: handle recipes where source is not first entry in SRC_URI Paul Eggleton
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-04-14  8:24 UTC (permalink / raw)
  To: openembedded-core

If a recipe sets SRC_URI and then appends more items to it with +=
(such as the current rpm recipe in OE-Core), the code in
patch_recipe_file() was failing with a traceback. Work around the
problem for now by dropping the existing lines if we understand the
operation, else just set the value outright at the end. This leaves
something to be desired as it either doesn't respect the existing
structure or leaves a mess but it's better than the current
breakage.

We'll need to come up with a better solution later. Part of the problem
is the existing code structure doesn't allow for patch_recipe_file() to
know what's being added or removed - it only knows the final value that
the caller wants set.

Fixes [YOCTO #9458].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/lib/oe/recipeutils.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 5e0fda5..6c7adb5 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -235,9 +235,10 @@ def patch_recipe_file(fn, values, patch=False, relpath=''):
                     outputvalue(k, newlines, rewindcomments=True)
                     del remainingnames[k]
             # Now change this variable, if it needs to be changed
-            if varname in existingnames:
-                outputvalue(varname, newlines)
-                del remainingnames[varname]
+            if varname in existingnames and op in ['+=', '=', '=+']:
+                if varname in remainingnames:
+                    outputvalue(varname, newlines)
+                    del remainingnames[varname]
                 return None, None, 0, True
         else:
             if varname in values:
-- 
2.5.5



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

* [PATCH 2/2] devtool: upgrade: handle recipes where source is not first entry in SRC_URI
  2016-04-14  8:24 [PATCH 0/2] A couple of fixes for devtool Paul Eggleton
  2016-04-14  8:24 ` [PATCH 1/2] devtool: update-recipe: handle where SRC_URI is appended to with += Paul Eggleton
@ 2016-04-14  8:24 ` Paul Eggleton
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-04-14  8:24 UTC (permalink / raw)
  To: openembedded-core

It is unusual but not impossible to find recipes whose first entry is
not the main source URL but instead some patch or other local file, for
example python-cryptography in meta-python (which sets SRC_URI before
inheriting pypi). There's nothing inherently wrong with this, and we
shouldn't assume that the first entry is the main source URL, so just
take the first non-local entry instead.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 scripts/lib/devtool/upgrade.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 680cbf1..a085f78 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -145,7 +145,15 @@ def _get_uri(rd):
     srcuris = rd.getVar('SRC_URI', True).split()
     if not len(srcuris):
         raise DevtoolError('SRC_URI not found on recipe')
-    srcuri = srcuris[0] # it is assumed, URI is at first position
+    # Get first non-local entry in SRC_URI - usually by convention it's
+    # the first entry, but not always!
+    srcuri = None
+    for entry in srcuris:
+        if not entry.startswith('file://'):
+            srcuri = entry
+            break
+    if not srcuri:
+        raise DevtoolError('Unable to find non-local entry in SRC_URI')
     srcrev = '${AUTOREV}'
     if '://' in srcuri:
         # Fetch a URL
-- 
2.5.5



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

* [PATCH 0/2] A couple of fixes for devtool
@ 2015-10-14 20:27 Paul Eggleton
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2015-10-14 20:27 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit 10e5df3503632a6e1c54612055b19f7258c3ae2f:

  lib/oe/image.py: Fix dependency handling for compressed types (2015-10-14 18:08:22 +0300)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/devtool-fixes8
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool-fixes8

Paul Eggleton (2):
  devtool: extract: fix error handling
  devtool: handle virtual providers

 meta/lib/oe/recipeutils.py        |  6 +++++-
 meta/lib/oeqa/selftest/devtool.py | 32 ++++++++++++++++++++++++++++++++
 scripts/lib/devtool/standard.py   | 32 ++++++++++++++++++++++++++------
 scripts/lib/devtool/upgrade.py    | 12 +++++++++---
 4 files changed, 72 insertions(+), 10 deletions(-)

-- 
2.1.0



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

end of thread, other threads:[~2016-04-14  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14  8:24 [PATCH 0/2] A couple of fixes for devtool Paul Eggleton
2016-04-14  8:24 ` [PATCH 1/2] devtool: update-recipe: handle where SRC_URI is appended to with += Paul Eggleton
2016-04-14  8:24 ` [PATCH 2/2] devtool: upgrade: handle recipes where source is not first entry in SRC_URI Paul Eggleton
  -- strict thread matches above, loose matches on Subject: below --
2015-10-14 20:27 [PATCH 0/2] A couple of fixes for devtool Paul Eggleton

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.