Re: git: 0dfaefa97547 - main - depend-cleanup.sh: Simplify the logic, and clean bootstrap tools.

From: Alexander Leidinger <Alexander_at_leidinger.net>
Date: Fri, 10 Feb 2023 07:29:33 UTC
Quoting Dag-Erling Smørgrav <des@freebsd.org> (from Thu, 09 Feb 2023  
10:46:49 +0100):

> Alexander Leidinger <Alexander@leidinger.net> writes:
>> 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).
>
> Have you measured this?  Because the whole point of clean_dep() is that

No, I haven't measured, for this reason I used "may".

> the file it looks for nearly always exists.  It's the grep we're not
> sure of.  So checking if the file exists is nearly always a waste.

Thanks for clarifying that.

>> 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?
>
> Our sh does not support the {} syntax.  Besides, what would it change?
> What else would match .*o but not .{o,pico}?

My point here is, that making this more specific (we can also list the  
files explicitely), we _maybe_ can prevent foot-shooting in the  
_future_, in case there is something else added. I've seen enough  
cases where wildcarded removals caused harm after a little change in  
some other place. I have no doubts that you checked that this  
_currently_ is working fine. Based upon my experience in  
troubleshooting issues with "lost files" after an innocent change  
somewhere else, I prefer to at least ask about it.

Bye,
Alexander.

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