]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
livepatch-build: Allow a patch to introduce new subdirs
authorRaphael Ning <raphning@amazon.com>
Thu, 19 Jan 2023 10:13:04 +0000 (10:13 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 20 Feb 2023 11:25:28 +0000 (11:25 +0000)
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>
livepatch-build

index a3f311af2cfebb626885370c2c3978bb5d34f1c6..91d203bda0eb733a195289fac7cb25ec9224c6a4 100755 (executable)
@@ -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