Hi polikuo
... For instance, this would trigger the -nz switch: ...
Actually, the way it's coded the -nz switch will not trigger:
tc@E310:~/Scripting/Provides$ time ./provides.sh stupid-filename-nz
NZ=1 TARGET=stupid-filename
real 0m 1.74s
user 0m 0.48s
sys 0m 0.22s
tc@E310:~/Scripting/Provides$
As you can see, NZ is still set to 1. However, because of the way -nz is
removed from the command, stupid-filename-nz is now 3 characters short.
I did figure out how to fix it:
tc@E310:~/Scripting/Provides$ time ./provides.sh -nzstupid-filename-nz
NZ=1 TARGET=-nzstupid-filename-nz
real 0m 1.19s
user 0m 0.41s
sys 0m 0.23s
tc@E310:~/Scripting/Provides$
Both a leading and trailing -nz in a filename are safe. And it can still
remove -nz from the command,
... As for the -nz switch, I incline to remove it cause extra code results in extra chance for unintentional behavior. ...
I'm leaning in that direction too. Adding the file age test to UpdateProvidesDB() is
looking more and more attractive.
... Are you planning to upload the newer version into the Github Core-scripts repo ?
I'd like it to be added to Core-scripts. We'll see what curaga has to say about it.
If curaga accepts it, I'll let someone who knows their way around github submit it.
I was also considering creating an extension to allow current and previous versions
of Tinycore to run an updated provides.sh.
I'd like to see if we get any more comments on this.