Add also this patch On Mon, Mar 20, 2017 at 5:02 PM, Bastien ROUCARIES <roucaries.bast...@gmail.com> wrote: > On Mon, Mar 20, 2017 at 4:32 PM, Bastien ROUCARIES > <roucaries.bast...@gmail.com> wrote: >> control: tags -1 + patch >> >> Hi, >> >> Found joinded patch to honor DPKG_ROOT. Tested using test suite > > Improve portability by not using find -printf
From d5942a928354a18e5f368cbd7c8441fc41e7c67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bast...@gmail.com> Date: Mon, 20 Mar 2017 23:00:36 +0100 Subject: [PATCH 7/7] Use simpler variant for find
Safer and simpler --- scripts/dpkg-maintscript-helper.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/dpkg-maintscript-helper.sh b/scripts/dpkg-maintscript-helper.sh index e8f4c662c..5a0ee988a 100755 --- a/scripts/dpkg-maintscript-helper.sh +++ b/scripts/dpkg-maintscript-helper.sh @@ -418,14 +418,13 @@ prepare_dir_to_symlink() error "directory '$PATHNAME' contains files not owned by" \ "package $PACKAGE, cannot switch to symlink" else - (cd "$DPKG_ROOT$PATHNAME"; find ./ -print0 | xargs -0 -n1 \ + (cd "$DPKG_ROOT"; find "./$PATHNAME" -print0) | xargs -0 -n1 \ sh -c ' - file=$2; - pathname=$1; - echo -n $file |sed s,[.]/,$pathname/,g ;printf "\0"' \ - findhelper $PATHNAME | \ + file="$1"; + echo -n "$file" |sed s,^[.]/,, ;printf "\0"' \ + findhelper | \ xargs -0 -n1 \ - dpkg-maintscript-helper package_owns_file_or_error $PACKAGE) || \ + dpkg-maintscript-helper package_owns_file_or_error $PACKAGE || \ error "directory '$PATHNAME' contains files not owned by" \ "package $PACKAGE, cannot switch to symlink" fi -- 2.11.0