Welcome to CRUX bug tracking.

FS#1313 - git ports driver wipes built packages, downloaded sources, etc from ports tree

Attached to Project: CRUX
Opened by Ryan Mullen (rmull) - Thursday, 05 May 2016, 11:53 GMT
Task Type Bug Report
Category ports
Status New
Assigned To Thomas Penteker (teK)
Operating System CRUX
Severity Low
Priority Normal
Reported Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


Hello, 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

Comment by Fun (fun) - Tuesday, 28 February 2017, 23:08 GMT
Is this still happening?
Comment by Ryan Mullen (rmull) - Tuesday, 28 February 2017, 23:47 GMT
Yes, it is.
Comment by Fun (fun) - Wednesday, 01 March 2017, 08:11 GMT
It might do that if there is a some .git file without NAME=... in /etc/ports/.

Comment by Ryan Mullen (rmull) - Wednesday, 01 March 2017, 12:47 GMT
If any of the git repos in /etc/ports were missing their $NAME settings, the driver would error out prior to running any of the git commands, since it performs a check to make sure $NAME is set.

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.
Comment by Fun (fun) - Wednesday, 01 March 2017, 15:39 GMT
Maybe I'm missing something. For sure I've missed the NAME check.

I wasn't aware that ports will keep the packages and sources there, but in /usr/ports/{distfiles,packages}, like this:
Comment by Ryan Mullen (rmull) - Wednesday, 01 March 2017, 16:28 GMT
I think we may be talking about two different things. My report was regarding the git ports driver at /etc/ports/drivers/git that is installed when the opt/git port is installed. These drivers are used for syncing the ports tree (with 'ports -u'), not for installing packages. The Pkgfile you linked is from a collection of third-party ports that use git repositories for downloading their sources rather than the usual tarball. Fetching sources from a git repo is not something handled by the git driver in question.

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.
Comment by Fun (fun) - Wednesday, 01 March 2017, 19:24 GMT
I didn't realized that default is

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.

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...
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.

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.