Closed echawk closed 3 years ago
Thanks for the PR.
I wrote a different version utilizing curl directly, the only downside is that it now has to (temporarily) store the information somewhere. There is also a check to see if the remote file is modified on the remote though I haven't tested to see if it works yet. If the modified check doesn't work I will make the tool wipe the directory on exit (and make the tool use TMPDIR to prefer usage of a tmpfs).
Let me know what you think or if any further changes are needed.
-> ls
LICENSE README core extra testing wayland
-> time kiss ou */
# snip
real 0m 3.14s
user 0m 0.68s
sys 0m 0.22s
I think the new version you wrote is great, it's faster than mine by a good margin. I'm just glad that it no longer takes minutes to check to check for updates now :) Awesome work!
The biggest change from the original implementation is that chekcing for updates is now done in parallel via xargs. This provides a massive speed increase for even small repositories.
Old times: core - 17.141s extra - 1m29.778s
New times: core - 1.689s extra - 4.246s
Where 'core' and 'extra' are the core and extra repositories in the main kisslinux repo.
One thing that is regressed in this patch is the maintainability of kiss-outdated is now reduced, as much of the script is now contained as a string argument. Ideally this could be fixed by splitting up the script to be two new scripts.