The branch main has been updated by des:URL: https://cgit.FreeBSD.org/src/commit/?id=0dfaefa975477cee2ec3155c3e0689ba1fcdde9acommit 0dfaefa975477cee2ec3155c3e0689ba1fcdde9a Author: Dag-Erling Smørgrav <[email protected]> AuthorDate: 2023-02-08 22:58:51 +0000 Commit: Dag-Erling Smørgrav <[email protected]> CommitDate: 2023-02-08 22:59:13 +0000 depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.* There's no need to check if the file exists before grepping it; if it does not exist, grep will fail, which is what we want. Just redirect the error message to /dev/null.
You change from "no fork+exec if the file doesn't exist" (due to "if" and "[" being shell-builtins) to "always fork+exec". On fast machines surely not an issue, on slow ones, it may make a difference (I have an old amd64 machine at an ISP which takes days to do a buildworld with -j2 due to not much memory, only 2 cores, old HDs, and other stuff going on in parallel).
While the .depend.* namespace is surely controlled by us, would it make sense to change the glob to ".{o,pico}" instead of ".*o" instead to prevent unexpected surprises in the future?
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -28,18 +28,8 @@ fi
# $3 source extension
clean_dep()
{
- if [ -e "$OBJTOP"/$1/.depend.$2.pico ] && \
- egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.pico; then \
- echo "Removing stale dependencies and objects for $2.$3"; \
- rm -f \
- "$OBJTOP"/$1/.depend.$2.* \
- "$OBJTOP"/$1/$2.*o \
- "$OBJTOP"/obj-lib32/$1/.depend.$2.* \
- "$OBJTOP"/obj-lib32/$1/$2.*o
- fi
- if [ -e "$OBJTOP"/$1/.depend.$2.o ] && \
- egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.o; then \
- echo "Removing stale dependencies and objects for $2.$3"; \
+ if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then
+ echo "Removing stale dependencies and objects for $2.$3"
rm -f \
"$OBJTOP"/$1/.depend.$2.* \
"$OBJTOP"/$1/$2.*o \
Bye, Alexander. -- http://www.Leidinger.net [email protected]: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org [email protected] : PGP 0x8F31830F9F2772BF
pgp_TeR5pCoJI.pgp
Description: Digitale PGP-Signatur
