Bug 12318

Summary: devtool upgrade+finish not deleting old files
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Paul Eggleton <bluelightning>
Component: Scripts and ToolsAssignee: Paul Eggleton <bluelightning>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: ross.burton
Version: 2.4   
Target Milestone: 2.5 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Paul Eggleton 2017-11-07 20:08:11 UTC
If you do a devtool upgrade, make and commit any needed changes, then run devtool finish, devtool is supposed to remove the old files (old recipe and any patches that were removed) from the metadata, but this appears not to be working.

Here's a reproducer (note that at this time (poky rev 65d23bd7986615fdfb0f1717b615534a2a14ab80) ffmpeg is at version 3.3.3, so this is assumed):

1) Ensure LICENSE_FLAGS_WHITELIST = "commercial" is set in your configuration
2) devtool upgrade ffmpeg -V 3.3.5
3) (in a separate shell, within the source tree): git rebase --skip
4) devtool finish ffmpeg ../meta

Note that devtool upgrade and finish both have to cooperate to make this work - devtool upgrade records the original files it copies, and devtool finish takes that recorded list and removes them, so the bug could be at either end.
Comment 1 Paul Eggleton 2017-11-07 20:48:49 UTC
It turns out that this is only a problem if you specify a relative path as I did in the above example, so we just need to call os.path.abspath() in the right place in the code to fix it.