K 10 svn:author V 5 dougb K 8 svn:date V 27 2012-07-05T09:00:32.437269Z K 7 svn:log V 1955 Major updates/fixes to the distfile handling code ================================================= * Make all parts of the code SUBDIR-safe (most were already) - This involves using $port_subdir globally to refer to just the directory name under DISTDIR, and add a $full_port_subdir to contain the full path to the file for the places where that was used. This also allows simplifying a few places where both were needed. - Fix a few places where the relativity of the cwd was not respected, most often resulting in files not being deleted that should be * When checking DI_FILES, anchor the grep pattern with a ^ to avoid false positives * Move the storage of the distfile info back to /var/db/pkg where it should have been all along. Mostly for correctness, but also to deal with the problem of non-UNIQUENAMEs causing the wrong files to be deleted with -d. * Clean up the old /var/db/ports/*/distfiles files after reading them, and delete the directory if it's empty. Since we are doing this unconditionally now, there is no longer a need for delete_dist_list(). The new ones will live and die with the rest of the package directory. * Update some of the messages printed out for distfile-related things to make it more clear what's going on. * Check DI_FILES to see if the distfile could be valid for another port in more places, so add a function to deal with the common ones. * Add 2 more functions, make_distfiles() and make_port_subdir() to bring that common code (3 places each, ugh) under the same umbrella. Improve both implementations to use fewer forks. Other changes ============= * Add -e to the echo for pm_sv so that we can easily add a newline * Take advantage of the above, and other adjustments to the whitespace to try to fit with the general theme of ws after a section * Change the last 'find -d foo' to 'find foo -depth' * Use 'while read' for the installed distfiles file, less forks END