Recommended usage of git instead of portsnap

Right now until EOL of 13.x the portsnap infrastructure is still in place, its expiration date is set to 2026-04-30.

From FreeBSD 14 it needs to be installed explicitly as ports-mgmt/portsnap because it is no longer included in the base.

portsnap fetch/extract/update was pretty simple, easy and straightforward.

What are the officially recommended git replacement commands for the various portsnap operations?
 
Code:
#!/usr/local/bin/zsh -v
rm -r /usr/ports/* /usr/ports/.??*
cd /usr/ports/
rmdir /usr/ports/distfiles
rmdir /usr/ports/packages
git clone --branch 2024Q2 https://git.FreeBSD.org/ports.git /usr/ports
mkdir /usr/ports/distfiles
mkdir /usr/ports/packages
 
Did you not look at the instructions outlined in the Handbook?
First I did not find the things I was looking for, as I searched for portsnap, but it looks like all references to it have been deleted from the handbook, like as if portsnap were a Soviet politician who had fallen into disgrace. Not even a historical remark remained.

So, I finally found the replacements for portsnap fetch/extract/update here.

Code:
#!/usr/local/bin/zsh -v
rm -r /usr/ports/* /usr/ports/.??*
cd /usr/ports/
rmdir /usr/ports/distfiles
rmdir /usr/ports/packages
git clone --branch 2024Q2 https://git.FreeBSD.org/ports.git /usr/ports
mkdir /usr/ports/distfiles
mkdir /usr/ports/packages
Thank you Alain :)

Now the only thing/issue remaining is finding out which quarter applies. 🤔
Theoretically it would be easy to just derive it from the current date.

But at the end/beginning of quarters, how to handle these corner cases correctly? 🥵
Different time zones, possible delays until a quarterly branch is created and the like?
Is there a recommended way to do this?
Otherwise, would it be correct/advisable to fetch https://cgit.freebsd.org/ports and extract the first (\d{4}Q\d) to obtain the currently active quarterly branch?
 
Code:
#!/usr/local/bin/zsh -v
rm -r /usr/ports/* /usr/ports/.??*
cd /usr/ports/
rmdir /usr/ports/distfiles
rmdir /usr/ports/packages
git clone --branch 2024Q2 https://git.FreeBSD.org/ports.git /usr/ports
mkdir /usr/ports/distfiles
mkdir /usr/ports/packages
I don't recommend deleting /usr/ports/distfiles. (If it's just a transition from svn/portsnap to git, /usr/ports/packages, too.)
Sometimes distfiles upstream are rerolled without renaming, and become unfetchable until distinfo is fixed for the corresponding ports.

My recommendation is move whole distfiles directory to somewhere else (would be better in the same filesystem to avoid messy physical copy) and move back after `git clone` operation.
 
But at the end/beginning of quarters, how to handle these corner cases correctly? 🥵
Different time zones, possible delays until a quarterly branch is created and the like?
The only solution is DO IT MANUALLY.
Quarterly branches are created manually and the time is not the same every time.
And for cases that some fatal/severe problems are left at the beginning of the quarter, branch is delayed until it is solved.

You can notice the creation of branch by accessing ports cgit via web whether new quarterly is created or not.
 
Back
Top