Welcome to CRUX bug tracking.
FS#1313 - git ports driver wipes built packages, downloaded sources, etc from ports tree
|
DetailsHello, the git ports driver (/etc/ports/drivers/git) runs a 'git clean' stage during a ports -u that deletes downloaded sources, built packages, work dirs, and so on from the ports tree. The default crux configuration is to store all that stuff in the ports tree, and the other ports drivers don't behave in this manner. As a workaround, all that stuff can be stored outside the tree, but that's not the default setting...
I recommend rethinking the git clean stage (assuming the crux defaults for storing downloads/work/packages won't change). The git driver didn't always have this line in it, and I'm not sure why it was added. |
This task depends upon
Right?
The root of the problem is that the driver runs a 'git clean' on the repo, which will remove all untracked files (which includes built packages and sources). It didn't always do that, so someone must have intended it to work that way and I'm not sure why.
I wasn't aware that ports will keep the packages and sources there, but in /usr/ports/{distfiles,packages}, like this: https://github.com/6c37/crux-ports-git/blob/3.3/bspwm/Pkgfile
Furthermore, /usr/ports/{distfiles,packages} is not the default location for downloads and built packages - the port's directory is. Keeping distfiles and packages stored outside of the ports tree is one possible mitigation for the issue (because then it's outside the git repo that will get cleaned during ports -u), but it's not the default setting.
PKGMK_SOURCE_DIR="$PWD"
PKGMK_PACKAGE_DIR="$PWD"
PKGMK_WORK_DIR="$PWD/work"
Like a NOOB, I blindly followed the wiki instructions. It looks like most people use the default way (code) or the recommended way (comments/wiki/fake news). Most of them, judging by the popularity of this issue, follow the comments. It is psychological interesting.
LOL.
It is confusing to have the docs so different than the code/defaults.
And all the silly waves I did in the last days around here...
LOL.
Crux is so libertarian... Only one rule: everybody does what s/he wants with her/his installation. Defaults are just a starting point. Fight Club.
LOL
Anyway, I vote for you on this, but I also vote for defaults based on popularity, because this is the best way to avoid confusion. Of course, simplicity should be on top, but clarity should follow, because confusion makes the simple be less simple, at best.