Shorthand variable for latest quarterly ports tree

Hi all,

Does anyone know if there is a shorthand form I can use in scripts to fetch the latest quarterly ports tree using svn?

For packages, EG in /etc/pkg/FreeBSD.conf, there is this:
Code:
url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly
Which always downloads packages from the newest / latest quarterly repo.

However, if I wanted to write a script that will automagicaly update my ports tree to whatever the latest quarterly ports tree is, what can I use?

The latest quarterly ports tree is:
Code:
https://svn.freebsd.org/ports/branches/2017Q3/
But should I want to run the script 6 months from now (using this address), it would download the wrong tree.

So does anyone know a smarter way to do it?
 
Can't you just generate the current quarter dynamically in your script?
Code:
#!/bin/sh

QUARTER=$(date +%Y)Q$((($(date +%-m)-1)/3+1))

echo https://svn.freebsd.org/ports/branches/$QUARTER/
Or am I missing something here?!
 
Can't you just generate the current quarter dynamically in your script?
Code:
#!/bin/sh

QUARTER=$(date +%Y)Q$((($(date +%-m)-1)/3+1))

echo https://svn.freebsd.org/ports/branches/$QUARTER/
Or am I missing something here?!

I'm shamefully bad at shell scripting, I couldn't get it quite right :/

EDIT: Glad you did though. Thank you.
 
Back
Top