portsnap being retired - what's the alternative?

Status
Not open for further replies.
Thank you.

Looks like:

"portsnap fetch extract" might be "poudriere ports -c"
"portsnap update" might be "poudriere ports -u"

But then all the fun & games of setting up poudriere (I know it's not a huge fuss but it's more than a couple of in-base commands).

So I'll see if I can figure out the svnlite commands to get the same as the portsnap commands.
 
My problem with this move is that portsnap is a tool that does one thing and does it well.
svnlite is a general downloader and file syncronizer.

Instead of removing portsnap maybe they should add the ability to download quarterly with an option flag like -q for quarterly and -h for head.
 
I finally started using subversion because FreeBSD did. Now they're switching to git which I used to use. Now they're saying svnlite is an option but...but...
 
  • Like
Reactions: a6h
Phishfry - yes, I'm happy with portsnap (and portmaster). But I don't do anything to maintain them, so if the people who actually do the work say they aren't going to any more, then I'll have to change.

vigole - thanks - but isn't svn from the port/package - so it's not in base? A bit chicken-and-egg. Will similar commands work with svnlite?

That other thread also suggests I'll also need a make index (I do use the INDEX-xx files sometimes).

drhowarddrfine - yes, I'm also confused about svn/git. Think it's all part of the move-everything-to-poudriere pattern.
 
For myself, as a sole developer, I find git more than I need and clunky. It's easy to get yourself into trouble. Subversion, which I never used before now, is a piece of cake.

Agreed. But, FreeBSD is not a solo-developer project, it is the exact opposite, and for massively distributed projects, git is really useful (though its UI/syntax is subpar).
 
So if I'm open to giving the git repo of ports a go, will these do the job?

First time sudo git clone --depth 1 https://cgit-beta.freebsd.org/ports.git
Updates sudo git pull --all
 
With svnlite, you can also use a quarterly branch instead of the latest/head snapshot that portsnap limits you to, in which case, you would also want to know how to switch branches to be able to change your ports tree to a newer or older branch:
Code:
# Switch to the 2020Q2 branch (the one before the current 2020Q3 branch)
svnlite switch ^/branches/2020Q2 /usr/ports
# Switch to head
svnlite switch ^/head /usr/ports

New portsnap(8) switches like -q for quarterly and -h for head would accomplish the same thing, but then you have arguments about whether portsnap should default to the new -q behavior or retain compatibility with -h being implied.

I still would prefer svnlite, however, because it means I don't need to download a large snapshot tarball every time: a set of diffs is a lot smaller than a full tree. Just don't delete the .svn/ directory at the top of the tree, else it's no better than portsnap.

That said, svn/svnlite does have at least one downside beyond knowing what URL to use for initial checkout: running find(1) or grep -r in the toplevel /usr/ports directory will result in searching the /usr/ports/.svn directory as well, so you need to find a way to exclude that directory; how you accomplish that can depend on the context of your search. Of course this applies to git as well.

As for the svn/git argument, git is definitely faster. GhostBSD actually disabled the svn prompt by default in its shells/fish port because it was so slow in large repos that even cd dirname took several seconds to wait for the svn command to complete before printing the shell prompt.

Of course, git is also more complicated to use since most git commands other than git-clone(1) and git-init(1) require you to already be inside the checked-out source tree. As an example, a simple and intuitive one-liner like svnlite update /usr/ports becomes the more complex sh -c 'cd /usr/ports && git pull' or even a shell function (sh(1)) for the sake of something easy to type and remember:
Code:
update-ports() {
  if cd /usr/ports; then
    git pull
    cd - >/dev/null    # Not sure if this line is necessary, but why take chances?
  fi
}

Every tool has its trade-offs. At the very least, git can be faster while offering the same incremental update advantage as svn/svnlite, something that portsnap in its current incarnation just cannot do. Naturally you won't even need to worry about such a thing if you use poudriere-ports(8) instead of manually updating the repo, but I understand that not everybody wants to use Poudriere.
 
"portsnap fetch extract" alternative with svnlite has gone to plan so far:

Code:
:/usr # mv ports old-ports
:/usr # mkdir ports
:/usr # svnlite checkout https://svn.freebsd.org/ports/head /usr/ports
A    ports/multimedia
A    ports/multimedia/libva-intel-media-driver
A    ports/multimedia/libva-intel-media-driver/files
A    ports/multimedia/py-subliminal
...
A    ports/Keywords/fontsdir.ucl
A    ports/Keywords/shared-mime-info.ucl
A    ports/Makefile
A    ports/.gitmessage
 U   ports
Checked out revision 544188.
:/usr # cd /usr/ports/
:/usr/ports # make index
Generating INDEX-12 - please wait..--- describe.accessibility ---
--- describe.arabic ---
--- describe.archivers ---
...

Slower than portsnap fetch extract but I assume that's because it (svnlite) is carrying out file-by-file network operations rather than downloading a compressed archive and then working locally. Just an observation (or maybe stating the obvious!) not a whinge. The initial check-out is something I'd only do once on a machine anyway.

I'll wait a few hours and then try the "portsnap fetch update" alternative (svnlite update /usr/ports) to see what's new.
 
  • Like
Reactions: a6h
richardtoohey2 You need only three commands
First time: svn checkout https://svn.freebsd.org/ports/head /usr/ports
Update: svn update /usr/ports
Fixing lock problem: svn cleanup /usr/ports
  • Anyone is free to make such command an alias for portsnap or write a wrapper script. Enhancements like the mentioned switching between branches will very fast appear & shared in Usefull Scripts here in the forum.
  • IIRC, svnlite(1) is svn(1) without Python scripting support?
  • Yes, svn/svnlite is buggy regarding bandwidth: it downloads twice as much data volume as would be necessary, uncompressed (the metadata holds an exact copy of each file)... :( If anyone has an idea how to download only the missing .svn metadata, please drop me a note. I'm dialing in via WWAN, my contract in limited on volume.
 
  • Like
Reactions: a6h
Note that there is also net/svnup. It’s a very small, lightweight tool for downloading and synchronizing trees from a Subversion server. I use it regularly to get /usr/src (-stable) on machines, but it can also be used for /usr/ports. With the default configuration, it’s as easy as typing svnup ports.
 
Since we're moving towards git (soonish) I somewhat doubt svn is going to be a viable solution/workaround in the long run...
 
Status
Not open for further replies.
Back
Top