Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] Fixes for devtool upgrade
@ 2016-05-24  4:18 Paul Eggleton
  2016-05-24  4:18 ` [PATCH 1/3] devtool: upgrade: handle upgrading recipes with a versioned inc file Paul Eggleton
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-05-24  4:18 UTC (permalink / raw)
  To: openembedded-core

The following changes since commit d6241e4c94a0a72acfc57e96a59918c0b2146d65:

  useradd: Fix infinite build loop (2016-05-23 10:33:39 +0100)

are available in the git repository at:

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

Paul Eggleton (3):
  devtool: upgrade: handle upgrading recipes with a versioned inc file
  devtool: upgrade: tweak conflict handling
  devtool: upgrade: clarify help text for --srcrev option

 scripts/lib/devtool/upgrade.py | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

-- 
2.5.5



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

* [PATCH 1/3] devtool: upgrade: handle upgrading recipes with a versioned inc file
  2016-05-24  4:18 [PATCH 0/3] Fixes for devtool upgrade Paul Eggleton
@ 2016-05-24  4:18 ` Paul Eggleton
  2016-05-24  4:18 ` [PATCH 2/3] devtool: upgrade: tweak conflict handling Paul Eggleton
  2016-05-24  4:18 ` [PATCH 3/3] devtool: upgrade: clarify help text for --srcrev option Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-05-24  4:18 UTC (permalink / raw)
  To: openembedded-core

The gdb recipe in OE-Core has an inc file with the version in it;
since the inc file is pulled in with a "require ${PV}.inc", when
upgrading the recipe we need to also rename the inc file it will fail to
parse and the upgrade itself will fail.

Fixes [YOCTO #9574].

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

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index a085f78..e34234a 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -77,11 +77,19 @@ def _recipe_contains(rd, var):
 
 def _rename_recipe_dirs(oldpv, newpv, path):
     for root, dirs, files in os.walk(path):
+        # Rename directories with the version in their name
         for olddir in dirs:
             if olddir.find(oldpv) != -1:
                 newdir = olddir.replace(oldpv, newpv)
                 if olddir != newdir:
                     shutil.move(os.path.join(path, olddir), os.path.join(path, newdir))
+        # Rename any inc files with the version in their name (unusual, but possible)
+        for oldfile in files:
+            if oldfile.endswith('.inc'):
+                if oldfile.find(oldpv) != -1:
+                    newfile = oldfile.replace(oldpv, newpv)
+                    if oldfile != newfile:
+                        os.rename(os.path.join(path, oldfile), os.path.join(path, newfile))
 
 def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path):
     oldrecipe = os.path.basename(oldrecipe)
-- 
2.5.5



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

* [PATCH 2/3] devtool: upgrade: tweak conflict handling
  2016-05-24  4:18 [PATCH 0/3] Fixes for devtool upgrade Paul Eggleton
  2016-05-24  4:18 ` [PATCH 1/3] devtool: upgrade: handle upgrading recipes with a versioned inc file Paul Eggleton
@ 2016-05-24  4:18 ` Paul Eggleton
  2016-05-24  4:18 ` [PATCH 3/3] devtool: upgrade: clarify help text for --srcrev option Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-05-24  4:18 UTC (permalink / raw)
  To: openembedded-core

Make a couple of changes to the rebase operation:

1) Only wrap the actual rebase command in try...except since a failure
   in any of the other commands should be an error, not a warning
2) If it's a conflict (which unfortunately we can only tell by checking
   for the keyword "conflict" since git doesn't return error codes based
   on the type of error) then print a message clarifying that the user
   needs to resolve the issue themselves to finish the upgrade.

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

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index e34234a..7e6aa42 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -236,16 +236,22 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin
             for patch in patches:
                 logger.warn("%s" % os.path.basename(patch))
     else:
+        __run('git checkout devtool-patched -b %s' % branch)
+        skiptag = False
         try:
-            __run('git checkout devtool-patched -b %s' % branch)
             __run('git rebase %s' % rev)
+        except bb.process.ExecutionError as e:
+            skiptag = True
+            if 'conflict' in e.stdout:
+                logger.warn('Command \'%s\' failed:\n%s\n\nYou will need to resolve conflicts in order to complete the upgrade.' % (e.command, e.stdout.rstrip()))
+            else:
+                logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
+        if not skiptag:
             if uri.startswith('git://'):
                 suffix = 'new'
             else:
                 suffix = newpv
             __run('git tag -f devtool-patched-%s' % suffix)
-        except bb.process.ExecutionError as e:
-            logger.warn('Command \'%s\' failed:\n%s' % (e.command, e.stdout))
 
     if tmpsrctree:
         if keep_temp:
-- 
2.5.5



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

* [PATCH 3/3] devtool: upgrade: clarify help text for --srcrev option
  2016-05-24  4:18 [PATCH 0/3] Fixes for devtool upgrade Paul Eggleton
  2016-05-24  4:18 ` [PATCH 1/3] devtool: upgrade: handle upgrading recipes with a versioned inc file Paul Eggleton
  2016-05-24  4:18 ` [PATCH 2/3] devtool: upgrade: tweak conflict handling Paul Eggleton
@ 2016-05-24  4:18 ` Paul Eggleton
  2 siblings, 0 replies; 4+ messages in thread
From: Paul Eggleton @ 2016-05-24  4:18 UTC (permalink / raw)
  To: openembedded-core

The -S / --srcrev option must be specified if fetching from a git
repository, so spell that out in the help text.

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

diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 7e6aa42..07a9018 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -385,7 +385,7 @@ def register_commands(subparsers, context):
     parser_upgrade.add_argument('recipename', help='Name of recipe to upgrade (just name - no version, path or extension)')
     parser_upgrade.add_argument('srctree',  nargs='?', help='Path to where to extract the source tree. If not specified, a subdirectory of %s will be used.' % defsrctree)
     parser_upgrade.add_argument('--version', '-V', help='Version to upgrade to (PV)')
-    parser_upgrade.add_argument('--srcrev', '-S', help='Source revision to upgrade to (if fetching from an SCM such as git)')
+    parser_upgrade.add_argument('--srcrev', '-S', help='Source revision to upgrade to (required if fetching from an SCM such as git)')
     parser_upgrade.add_argument('--srcbranch', '-B', help='Branch in source repository containing the revision to use (if fetching from an SCM such as git)')
     parser_upgrade.add_argument('--branch', '-b', default="devtool", help='Name for new development branch to checkout (default "%(default)s")')
     parser_upgrade.add_argument('--no-patch', action="store_true", help='Do not apply patches from the recipe to the new source code')
-- 
2.5.5



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

end of thread, other threads:[~2016-05-24  4:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24  4:18 [PATCH 0/3] Fixes for devtool upgrade Paul Eggleton
2016-05-24  4:18 ` [PATCH 1/3] devtool: upgrade: handle upgrading recipes with a versioned inc file Paul Eggleton
2016-05-24  4:18 ` [PATCH 2/3] devtool: upgrade: tweak conflict handling Paul Eggleton
2016-05-24  4:18 ` [PATCH 3/3] devtool: upgrade: clarify help text for --srcrev option Paul Eggleton

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