Re: git-clone(1) after base 3e8619e535b6 for /usr/ports subdirectories

Marek Zarychta <[email protected]>
Newsgroups gmane.os.freebsd.current
Message-ID <[email protected]>
On 8.02.2026 04:46, Graham Perrin wrote:
> On 08/02/2026 03:17, Warner Losh wrote:
>
>> That only works if don't already have a ports tree. What's there?
>
>
> root@freebsd-16-amd64-qemu:~ # ls -hlR /usr/ports
>
> total 1.0 KB
> drwxr-xr-x  2 root wheel    2B Jan 19 19:37 distfiles
> drwxr-xr-x  2 root wheel    2B Jan 19 19:37 packages
>
> /usr/ports/distfiles:
> total 0 B
>
> /usr/ports/packages:
> total 0 B
> root@freebsd-16-amd64-qemu:~ # mount | grep ports
>
> zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
> zroot/usr/ports/distfiles on /usr/ports/distfiles (zfs, local, 
> noatime, nosuid, nfsv4acls)
> zroot/usr/ports/packages on /usr/ports/packages (zfs, local, noatime, 
> nosuid, nfsv4acls)
> root@freebsd-16-amd64-qemu:~ #
>
>
Hello Graham,

my recommendation is to set WRKDIRPREFIX, DISTDIR, PACKAGES and INDEXDIR 
(if you are using indexes) to the separate subtree as follows:

#zfs destroy zroot/usr/ports/distfiles
#zfs destroy zroot/usr/ports/packages
#mkdir -p /var/ports/{distfiles,packages}
#cat <<EOF >> /etc/make.conf
WRKDIRPREFIX= /var/ports
DISTDIR= /var/ports/distfiles
PACKAGES= /var/ports/packages
INDEXDIR= /var/ports
EOF

The above configuration works best and is absolutely required if you are 
using read-only mounts for /usr/ports (NFS, nullfs, etc.)

There is another option, if you don't want to change anything, create 
local ports repo and add remote origin:

#cd /usr/ports
#git init
#git remote add origin https://git.freebsd.org/ports.git
#git fetch
#git branch -f main origin/main
#git checkout main

Cheers

-- 
Marek Zarychta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.