From: Raphael Ning Date: Thu, 19 Jan 2023 10:13:04 +0000 (+0000) Subject: livepatch-build: Allow a patch to introduce new subdirs X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=0564f0c7a57a3ac58f35ae9a6b508b757bd9453d;p=livepatch-build-tools.git livepatch-build: Allow a patch to introduce new subdirs 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 Reviewed-by: Bjoern Doebel Reviewed-by: Martin Pohlack Reviewed-by: Ross Lagerwall --- diff --git a/livepatch-build b/livepatch-build index a3f311a..91d203b 100755 --- a/livepatch-build +++ b/livepatch-build @@ -228,6 +228,7 @@ function create_patch() 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