On Wed, 5 Oct 2016, Alan Mizrahi wrote:
My results are: 31 files shared, 1 collision (see below).
I don't know why we got different counts of sharing. My main interest was the amount of disk space that will be consumed and the extra Internet use since the sharing will stop with some of the proposed solutions.
Unless I missed something, at the moment there is no problem, just a small "inconvenience".
Agreed. For more experienced users of CRUX it is not hard to understand what's going on. I wrote up the patch simply to see what it would cost to do renaming but still allow sharing. I am not invested in it.
You can use separate download directories by name (like I suggested in the bug report) by using /usr/ports/dist/$name/file.tar.gz. It requires a change in pkgmk to create missing directories, I have this patch in my personal repo [1]. The change in pkgmk is small, and nobody has to change their ports.
This is nice. It doesn't require change to any of the other pkgutils scripts.
If anything I would prefer this:
name=cairo-dock version=3.4.1 release=1 declare -A source=([$name-$version.tar.gz]=https://github.com/Cairo-Dock/$name-core/archive/$version.tar.gz) ... name=cairo-dock-plug-ins version=3.4.1 release=1 declare -A source=([$name-$version.tar.gz]=https://github.com/Cairo-Dock/$name/archive/$version.tar.gz) ...
Using associative arrays instead of two separate ones will prevent mistakes. And ports without risks of filename collisions (eg: including $name in the filename), should continue using a normal array. Pkgmk would have to check the type of the array and behave accordingly (to be backward compatible).
This is better than parallel arrays. Still requires that some of the other scripts in pkgutils be updated but still allows source sharing. I wonder if the code in pkgmk script would be more elegant (obvious) than my patch? Probably. Hashing is usually easier to code than indexing.
But my preferred solution continues to be my pkgutils patch (or to just continue ignoring this).
I prefer ignoring it if the solution doesn't include source sharing but I am OK with any solution the CRUX team comes up with. They (you) rock! I have a greater appreciation for the simplicity of CRUX infrastructure from developing that patch. My bash-fu has lots of room for improvement :) -Daryl