summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2021-01-15 09:30:00 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2021-01-15 09:30:01 +0100
commit1b040da947236aa22caa6e4584e79f5253ce46eb (patch)
treea75c6e1ce11f58c6830bdabceee0663164284cdd
parentcbba868c31f8be9ed521b19ea0e3095c13a19a17 (diff)
downloadptxdist-1b040da947236aa22caa6e4584e79f5253ce46eb.tar.gz
ptxdist-1b040da947236aa22caa6e4584e79f5253ce46eb.tar.xz
ptxd_make_world_clean_sysroot: don't remove generic directories from sysroot
They are created explicitly, so don't remove them even if they are empty. If this happens during rebuilds in the prepare stage, then this may be the cause for race conditions that result in errors like this: cc1: error: [...]/platform-v7a/sysroot-target/include: No such file or directory [-Werror=missing-include-dirs] Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_make_world_clean.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/lib/ptxd_make_world_clean.sh b/scripts/lib/ptxd_make_world_clean.sh
index 6819c93b3..2fc8170e7 100644
--- a/scripts/lib/ptxd_make_world_clean.sh
+++ b/scripts/lib/ptxd_make_world_clean.sh
@@ -14,11 +14,16 @@ ptxd_make_world_clean_sysroot() {
path="${pkg_pkg_dir}"
fi
if [ -d "${path}" ]; then
+ local -a args
echo "Removing files from sysroot..."
echo
find "${path}/" ! -type d -printf "${pkg_sysroot_dir}/%P\0" | \
xargs -0 rm -f
- find "${path}/" -mindepth 1 -depth -type d -printf "${pkg_sysroot_dir}/%P\0" | \
+
+ args=( {/etc,{,/usr}{,/lib,/{,s}bin,/include,/share{,/man{,/man{1,2,3,4,5,6,7,8,9}},/misc}}} )
+ args=( ${args[@]/#/-o -path ${path}} )
+
+ find "${path}/" -mindepth 1 -depth -type d ! \( "${args[@]:1}" \) -printf "${pkg_sysroot_dir}/%P\0" | \
xargs -0 rmdir --ignore-fail-on-non-empty 2> /dev/null
fi
if [ -h "${link}" ]; then