![](https://secure.gravatar.com/avatar/d51b6f233eee94b37270e5140cadef46.jpg?s=120&d=mm&r=g)
On 2016-10-04 11:21, Daryl F wrote:
I wrote a script [2] to tell me how many times a downloaded source file is used in more than one port in core, opt, xorg, and config. The result is:
ports with the same source URL: 30 Total repos checked: 4 Total ports checked: 1404
These may or may not be collisions. Multiple ports may use the same source. The script does not check for this because pkgmk does not check for this but depends on the .md5sum .
Hi Daryl, Thanks for investigating this. I took the time to write an alternative script (attached) that distinguishes between source collisions and sharing, and I compare the filename only (as should be), not the whole URL. My results are: 31 files shared, 1 collision (see below). Unless I missed something, at the moment there is no problem, just a small "inconvenience".
Downloading to separate directories for each port, like /usr/ports/dist/$name/file.tar.gz . That is already accomplished by the default /etc/pkgmk.conf in pkgutils; the source is stored with the Pkgfile. -10
The default is to save source files in /usr/ports/$repo/$name/file.tar.gz, you won't have a problem this way, but admittedly it's a bit messy. 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.
An example of laziness^Werror prevention is:
source=(http://example.com/well-named-2.0.tar.gz static.file config.file http://example.com/26490.tar.gz) rename=(= = = http://example.com/$name-extra-$version.tar.gz)
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). But my preferred solution continues to be my pkgutils patch (or to just continue ignoring this). [1] http://www.mizrahi.com.ve/crux/ports/pkgutils/