build: simplify for loop in fetch_trees()

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-05-15 03:53:26 +01:00 committed by Leah Rowe
parent c2baebc79a
commit 48c5c57cff
1 changed files with 2 additions and 4 deletions

6
build
View File

@ -178,10 +178,8 @@ fetch_trees()
done
for x in config/*/build.list; do
[ -f "${x}" ] || continue
xp="${x#*/}"; xp="${xp%/*}"
[ -L "${xp}" ] || rm -Rf "src/${xp}/${xp}" || \
$err "!rm -Rf \"src/${xp}/${xp}\""
[ -f "$x" ] && xp="${x#*/}" && xp="${xp%/*}"
[ ! -f "$x" ] || [ -L "$xp" ] || x_ rm -Rf "src/$xp/$xp"
done
find . -name ".git" -exec rm -Rf {} + || $err "$_xm: rm .git"