Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Jan 2015 11:16:52 +0000
From:      Mike Clarke <>
Cc:        Leslie Jensen <>
Subject:   Re: pkg upgrade question
Message-ID:  <3260976.9592SAMzda@curlew.lan>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
This is a multi-part message in MIME format.

Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="iso-8859-1"

On Sunday 04 Jan 2015 08:50:18 Zsolt Udvari wrote:

> If you don't care about ports tree only the repository, please use
> "pkg version -R". Check "man pkg-version" for documentation

Alternatively you can use svn or svnlite to synchronise your ports 
tree with the snapshot which was used for the packages currently in 
the repository. This is an advantage if you build some packages from 
ports since it ensures you don't get any dependency conflicts. This was 
recently  discussed in a thread in ports@ 
A script for synchronising the ports tree for poudriere was posted in 

I don't use poudriere so I've modified a copy of the script to 
synchronise /usr/ports instead of the poudriere jails.

The script works for 64 bit 10.x-RELEASE. For 8.x or 9,x you'll need 
to change the value of JAIL.

If you're using 32 bit I think you'll need to change SERVER to as well as changing JAIL but there appears to 
be a problem with the website at the moment so I can't check.

Mike Clarke
Content-Disposition: inline; filename="portsync"
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"; name="portsync"

# Copyright (c) 2014 Reed A. Cartwright <>
# Modified by Mike Clarke to use /usr/ports instead of poudriere
# This script determines the revision number used to build FreeBSD packages
# and syncs a local ports directory to match it. 
# USAGE: portsync
# REQUIREMENTS: textproc/jq




# Fetch data from server
JSON=`fetch -qo - $URL`
if [ $? -gt 0 ]; then
	>&2 echo "ERROR: Unable to fetch data from package server."
	exit 1

# Parse Revision information from server
REV=`echo "${JSON}" | jq -r '.builds[.builds.latest].svn_url | split("@")[1]'`

# Check revision information
if expr "$REV" : '^[[:digit:]][[:digit:]]*$' >/dev/null; then
	# Skip update if revisions are in sync
	CURREV=`svnlite info "${PORTSDIR}" | sed -ne '/^Revision: /s/^Revision: //p'`
	echo "====>> Updating ${PORTSDIR} from revision ${CURREV} to ${REV}"
	if [ "${CURREV}" -ne "${REV}" ]; then
		svnlite up -r "${REV}" "${PORTSDIR}"
	  echo No update needed
	>& echo "ERROR: Unable to determine revision number for latest packages."
	exit 1


Want to link to this message? Use this URL: <>