Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Feb 2023 08:31:33 +0100
From:      Alexander Leidinger <Alexander@leidinger.net>
To:        dev-commits-src-all@freebsd.org, Dag-Erling =?utf-8?b?U23DuHJncmF2?= <des@freebsd.org>
Subject:   Re: git: 0dfaefa97547 - main - depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.
Message-ID:  <20230209083133.Horde.q3w2RmVjVzPwrvCq2u6yNUU@webmail.leidinger.net>
In-Reply-To: <202302082259.318MxXdm024068@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format and has been PGP signed.

--=_oEKP--qZUYVZNwqdDYHNQBO
Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Quoting Dag-Erling Sm=C3=B8rgrav <des@freebsd.org> (from Wed, 8 Feb 2023=20=
=20
22:59:33=20GMT):

> The branch main has been updated by des:
>
> URL:=20=20
>=20https://cgit.FreeBSD.org/src/commit/?id=3D0dfaefa975477cee2ec3155c3e068=
9ba1fcdde9a
>
> commit 0dfaefa975477cee2ec3155c3e0689ba1fcdde9a
> Author:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> AuthorDate: 2023-02-08 22:58:51 +0000
> Commit:     Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org>
> 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=20=20
>=20it; if it does not exist, grep will fail, which is what we want.=20=20=
=20
>=20Just redirect the error message to /dev/null.

You change from "no fork+exec if the file doesn't exist" (due to "if"=20=20
and=20"[" being shell-builtins) to "always fork+exec". On fast machines=20=
=20
surely=20not an issue, on slow ones, it may make a difference (I have an=20=
=20
old=20amd64 machine at an ISP which takes days to do a buildworld with=20=
=20
-j2=20due to not much memory, only 2 cores, old HDs, and other stuff=20=20
going=20on in parallel).

While the .depend.* namespace is surely controlled by us, would it=20=20
make=20sense to change the glob to ".{o,pico}" instead of ".*o" instead=20=
=20
to=20prevent 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.

--=20
http://www.Leidinger.net=20Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.org    netchild@FreeBSD.org  : PGP 0x8F31830F9F2772BF

--=_oEKP--qZUYVZNwqdDYHNQBO
Content-Type: application/pgp-signature
Content-Description: Digitale PGP-Signatur
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIzBAABCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmPkoVQACgkQEg2wmwP4
2IYIdhAAkKRnKvCWFS2lQmBfkNQXFTDvj6arZ2yiJut+Coxeil8yQ+33BllkCMYP
tzhFYDYQVLIjC/X+8RNsy+XeMRkr9vy0B9CJ7zlDWbv9pjKEeobE7vW4DY69z+Pj
XMHetDUq6gGgsIeB3O+bcvExkeeN9XQrUXUtyxaEhQBkI+/buBVCd1hLWlA12XCC
JizU05NtZzVTKkjk8B6KnjfGlNGC2hJmyPPvhhy+5vmxeeMfl7L8RQhPbmftYe3n
OyoPGgUNZ1vkMmCcON6lGj14Z6HCxmA0MClUvAXHvQIRskRQGV7vpQXsNM24GnXE
7BM9uKzp2qVXFYB4s9ZpcnMFN8x2aUscR/SER4eDoyflA78rANsWWjP1bm+2ECAR
2VgyyLI0nmzlp3Yq2yBPUqHEetCaqDzqEUF8w6cNVrlSPAHrasv3Ts3H9gEwBboZ
KP7xFzHK1WFyOLCwiK9Jgk6L8vQs6Kqq9CB3f+hiRJlbazbw6nmX25tGLg0EaJCQ
ZgrMvkkjDgTMZq4Uz2eGXbTylYAz3HGML2hVxxagoh4hmRq5SQXkvbxDp5jlc8Sb
MIKy7JXXFkJsUD0p5ZnSoIpBvcJHGkmB8mi5MnPeqkcTZg86gdhhta2cwPgmR+Eo
2tnT0mzgseGOvbSG3G0uUGasb0mp3lvZgqk9hudaPL8cHHdfO04=
=Alk9
-----END PGP SIGNATURE-----

--=_oEKP--qZUYVZNwqdDYHNQBO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230209083133.Horde.q3w2RmVjVzPwrvCq2u6yNUU>