use -mindepth alongside -maxdepth in find

use of maxdepth 1 does not exclude the main
directory, which is undesired in these contexts,
though excluded in practise due to how find is
actually used.

technically, mindepth should be used, just in
case, as a defensive measure. the context here
is files and directories within a main directory,
used as arguments in other commands.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-09-14 08:48:16 +01:00
parent 4ebede5b99
commit 2fc37b4b47
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -175,7 +175,8 @@ modify_mac()
x_ "$nvmutil" "$xbtmp/gbe" setmac "$new_mac"
fi
fx_ newmac x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
fx_ newmac x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
-type f -name "*.rom"
printf "\nThe following GbE NVM data will be written:\n"
x_ "$nvmutil" "$xbtmp/gbe" dump | grep -v "bytes read from file" || :
+2 -1
View File
@@ -436,7 +436,8 @@ getvfile()
else
# inject vendor files
fx_ prep x_ find "$tmpromdir" -maxdepth 1 -type f -name "*.rom"
fx_ prep x_ find "$tmpromdir" -mindepth 1 -maxdepth 1 \
-type f -name "*.rom"
( check_vendor_hashes ) || \
err "$archive: Can't verify hashes" "getvfile" "$@"; :
fi
+2 -1
View File
@@ -109,7 +109,8 @@ prep_release_bin()
x_ ./mk -b stm32-vserprog
x_ ./mk -b pcsx-redux
fx_ mkrom_tarball x_ find bin -maxdepth 1 -type d -name "serprog_*"
fx_ mkrom_tarball x_ find bin -mindepth 1 -maxdepth 1 \
-type d -name "serprog_*"
x_ mv bin ../roms
}