![](https://secure.gravatar.com/avatar/f40b961fd497e2471960f7150d986610.jpg?s=120&d=mm&r=g)
Hello all! I've been doing some analysis of this Improvement task [1] and have concerns whether the solutions proposed improve things. It helps me to write things up so here it goes... I'll start out with some of the facts I've found and follow that with a list of the proposed solutions I've heard or read and comments about them. _Facts_ 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 . I wrote another script [3] to sum up the size of those downloaded source files and got: Total size is 259,239,211 bytes for 30 urls. A change to the Pkgfile that affects the meaning of source=() will require changes to these scripts in core or opt: - dllist (bash) - pkgmk (bash) - pkgsize (bash) - prtsweep (bash) - prtwash (bash) _Proposed Solutions_ The as.diff included with the initial improvement request changes the meaning of the contents of source=() in the Pkgfile. There is now a possible keyword in there. This means all consumers of source=() will have to be changed. -5 The comma-separated proposal suffers the same fate. We now have source=() meaning two things: remote source and local source. Again all other consumers of source=() will have to be updated. -3 A new array: names=() . This is better. No change to source=() so no direct breakage of other consumers. But if they are looking for the the local copy of the source they will fail. -1 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 _IMHO_ All the proposed improvements came up negative in my personal view. The least negative is a new array. The delimiter separation is the next in line. Now that I've written this I think I need to go back and do some more analysis. There is no implementation patch for the new array proposal. (a couple of days go by) And now there is a sample implementation of the new array proposed. I chose the array name rename=() so it might be more clear what it is doing in the Pkgfile. Attached is a patch and Pkgfile for the pkgutils port that implements renaming in pkgmk. There is a one-for-one order corelation between the source() array and the rename() array. An equal sign (=) can be used if the same name is desired but it's the third source() item that needs renaming. So a Pkgfile would look like: # Description: text email client # URL: http://www.washington.edu/alpine/ # Maintainer: Daryl Fonseca-Holt, wyatt at prairieturtle dot ca # Packager: Daryl Fonseca-Holt, wyatt at prairieturtle dot ca # Depends on: aspell openssl name=alpine version=2.00 release=2 source=(ftp://ftp.cac.washington.edu/alpine/alpine.tar.bz2) rename=(ftp://ftp.cac.washington.edu/alpine/alpine-$version.tar.bz2) build() { cd ${name}-${version} ./configure \ --prefix=/usr \ --mandir=/usr/man \ --with-passfile=.pinepw \ --with-ssl-lib-dir=/lib \ --with-ssl-dir=/usr \ --with-web-bin=/usr/share/alpine make -j3 make DESTDIR=$PKG install rm -rf $PKG/home } 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) Through trickery in the patch the .md5sum still displays the old name of the file but it actually runs md5sum on the renamed file. If this seems worthwhile I can add it to the Flyspray bug. Comments? [1] https://crux.nu/bugs/index.php?do=details&task_id=923 [2] http://crux.wyatt.fastmail.fm/scripts/find-same-source [3] http://crux.wyatt.fastmail.fm/scripts/sum-inet-file-sizes -Daryl IRC: darfo or nthwyatt