Fix a bug in create_patch() where cp, strip, etc. will fail if the new
object file introduced by the patch is located in a new subdirectory:
DEBUG: cp: cannot create regular file `output/xen/common/lu/lu.o': No such file or directory
DEBUG: strip: 'output/xen/common/lu/lu.o': No such file
In this example, xen/common/lu/ does not exist in the original
(unpatched) Xen source tree. It needs to be created in output/ as well.
Signed-off-by: Raphael Ning <raphning@amazon.com>
Reviewed-by: Bjoern Doebel <doebel@amazon.de>
Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
NEW_FILES=$(comm -23 <(cd patched/xen && find . -type f -name '*.o' | sort) <(cd original/xen && find . -type f -name '*.o' | sort))
for i in $NEW_FILES; do
+ mkdir -p "output/$(dirname "$i")"
cp "patched/$i" "output/$i"
[[ $STRIP -eq 1 ]] && strip --strip-unneeded "output/$i"
CHANGED=1