Ports upgrade script

Polytropon freebsd at edvax.de
Sat Apr 16 15:20:48 UTC 2016

On Sat, 16 Apr 2016 16:34:16 +0200, JosC wrote:
> In een bericht van 16-4-2016 12:18:
> >
> > Portsnap isn't compatible with svn.
> >
> So I think I should revise the way I update my ports.
> What I did with my 9.3 BSD was the following script (which worked 
> perfectly):
> !/bin/sh
> cd /local/user/etc
> svn update /usr/src
> svn update /usr/ports
> #
> cd /usr/ports
> make fetchindex
> portsdb -fu
> #
> #
> cd /usr/local/etc
> portupgrade -na
> #
> So this part I replaced now with:
> portsnap fetch update
> kind of lost how to continue now...

Your script does _more_ than just update installed ports. It also
updates the OS sources, but it does _not_ upgrade the OS according
to those sources.

If that's what you intend, try the following:

# update OS sources
svn update /usr/src
# update ports tree
svn update /usr/ports
make fetchindex
portsdb -fu
# upgrade all installed ports
portupgrade -na

You can exchange 

	# update ports tree
	svn update /usr/ports

with the following:

	# update ports tree
	portsnap fetch extract

But you should keep _one_ of those two methods. It's usually wise to
start with an empty /usr/ports directory and have the desired tool
populate it for the first time, then apply changes on further runs.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list