First, my comments address a world where DESTDIR is the only mode that matters. I agree that there should (at least) be an easy way to tell pkgsrc to retain any binary packages that it might have created. This includes install, replace, and installation of dependencies. I think it's far easier to have a variable then to expect people to type different things. And, having fewer targets (that users/scripts invoke) makes writing scripts that behave sanely easier. PKGSRC_KEEP_BIN_PKGS seems like a reasonable name. In my view, this is about making a link in /usr/pkgsrc/packages/All for a binary package that would already have been created. If one expands to thinking about the (shrinking in importance) non-DESTDIR world, then PKGSRC_CREATE_BIN_PKGS would do similarly, but also create binary packages when they weren't requested and weren't going to be created anyway (install). So I am 100% in favor of your patch. I would also be inclined to make the default be yes, but that's a separate matter. While I can see the point that DESTDIR caused the same commands to leave binary packages in ${PACKAGES} in circumstances that they previously weren't, I think it almost always makes sense to keep created packages, unless one is short on disk space. I find that the space to store binary packages is smallish compared to the size of installed packages, so the short-on-space situation feels like an edge case, not the norm.
Attachment:
pgpto5z4zr6yi.pgp
Description: PGP signature