• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Solved Non-default distfiles directory?

mefizto

Well-Known Member

Thanks: 5
Messages: 331

#1
Greetings all,

what would be the motivation to move the distfiles from the default /usr/ports/distfiles directory? I am asking because ports-mgmt/synth suggests to place the distfiles outside the /usr/ports tree. What would be a preferred/logical location?

The only reason that I could think of, in general, not specifically for ports-mgmt/synth, is some corruption during ports update, which would require to delete and re-fetch the /usr/ports, but to avoid the need to re-download the distfiles.

Kindest regards,

M
 

tobik@

Daemon
Developer

Thanks: 1,179
Messages: 1,770

#2
FWIW, here are two more reasons:
  • To share it with other machines over NFS (though I suppose you could mount it on /usr/ports/distfiles as well then)
  • To share it between different ports tree checkouts
 

mefizto

Well-Known Member

Thanks: 5
Messages: 331

#3
Hi tobik@,

thank you for the reply. I understand the first bullet-point, although I do not see why it could not be mounted as you suggested. Just for my education, could you elaborate on the second bullet-point?

Kindest regards,

M
 

tobik@

Daemon
Developer

Thanks: 1,179
Messages: 1,770

#4
Let's assume I have 3 ports tree checkouts with various half-baked ports ideas/fixes etc.
Code:
~/ports/head
~/ports/branch1
~/ports/branch2
Now when I switch ports trees it'll download things into ~/ports/head/distfiles, ~/ports/branch1/distfiles, ~/ports/branch2/distfiles i.e. distfiles will be duplicated for every ports tree.

To prevent that I can set
Code:
DISTDIR=/distfiles
in /etc/make.conf to share a common distfiles directory with all ports trees.
 

mefizto

Well-Known Member

Thanks: 5
Messages: 331

#5
Hi tobik@,

thank you once again for the clear explanation.

So what would be a logical place to mount such the distfiles, somewhere under /var?

Kindest regards,

M
 

tingo

Daemon

Thanks: 272
Messages: 1,727

#6
Don't forget that you can also link (ln(1)) a directory into place. Example # ln -s /hugedisk/distfiles /usr/ports/
 

mefizto

Well-Known Member

Thanks: 5
Messages: 331

#7
Hi tingo,

is it really necessary? Should the
Code:
DISTDIR=/path/to/distfiles
take care of the system's knowledge regarding the /distfiles directory?

Kindest regards,

M