summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-05-24 16:18:50 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-25 07:50:16 +0100
commitab227452c79eda9a30c1461a2b611b2453e0c650 (patch)
tree7aec10fd987ab0c70d98a5220eab4991306ae526
parentc7e614c438706fb3ed7520b4990ebb3973366942 (diff)
downloadpoky-ab227452c79eda9a30c1461a2b611b2453e0c650.tar.gz
devtool: upgrade: handle upgrading recipes with a versioned inc file
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]. (From OE-Core rev: 3c623aac9333d20a62475279c72b6b6ec3d7dd6b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/devtool/upgrade.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index a085f78c43..e34234a34f 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -77,11 +77,19 @@ def _recipe_contains(rd, var):
77 77
78def _rename_recipe_dirs(oldpv, newpv, path): 78def _rename_recipe_dirs(oldpv, newpv, path):
79 for root, dirs, files in os.walk(path): 79 for root, dirs, files in os.walk(path):
80 # Rename directories with the version in their name
80 for olddir in dirs: 81 for olddir in dirs:
81 if olddir.find(oldpv) != -1: 82 if olddir.find(oldpv) != -1:
82 newdir = olddir.replace(oldpv, newpv) 83 newdir = olddir.replace(oldpv, newpv)
83 if olddir != newdir: 84 if olddir != newdir:
84 shutil.move(os.path.join(path, olddir), os.path.join(path, newdir)) 85 shutil.move(os.path.join(path, olddir), os.path.join(path, newdir))
86 # Rename any inc files with the version in their name (unusual, but possible)
87 for oldfile in files:
88 if oldfile.endswith('.inc'):
89 if oldfile.find(oldpv) != -1:
90 newfile = oldfile.replace(oldpv, newpv)
91 if oldfile != newfile:
92 os.rename(os.path.join(path, oldfile), os.path.join(path, newfile))
85 93
86def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path): 94def _rename_recipe_file(oldrecipe, bpn, oldpv, newpv, path):
87 oldrecipe = os.path.basename(oldrecipe) 95 oldrecipe = os.path.basename(oldrecipe)