diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-05-09 11:12:24 +1200 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-05-24 16:17:26 +1200 |
commit | 82db35e40ef7d801b96dc5ac0171085b9135b4a1 (patch) | |
tree | 41297c913132ab213a51ff46881e346df2e25514 /scripts/lib | |
parent | d6241e4c94a0a72acfc57e96a59918c0b2146d65 (diff) | |
download | openembedded-core-contrib-82db35e40ef7d801b96dc5ac0171085b9135b4a1.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].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 8 |
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): 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) |