Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 04 Jan 2015 11:16:52 +0000
From:      Mike Clarke <jmc-freebsd2@milibyte.co.uk>
To:        freebsd-questions@freebsd.org
Cc:        Leslie Jensen <leslie@eskk.nu>
Subject:   Re: pkg upgrade question
Message-ID:  <3260976.9592SAMzda@curlew.lan>
In-Reply-To: <CADtCJqrMK_iJW9QqCCEV=sW3ay%2BZaQpCkGmxLRNp1jBMKOajmQ@mail.gmail.com>
References:  <54A8ED8C.8020404@eskk.nu> <CADtCJqrMK_iJW9QqCCEV=sW3ay%2BZaQpCkGmxLRNp1jBMKOajmQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--nextPart3692520.cOyImHYnJC
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@ 
<https://lists.freebsd.org/pipermail/freebsd-ports/2014-November/096804.html>.
A script for synchronising the ports tree for poudriere was posted in 
<https://lists.freebsd.org/pipermail/freebsd-ports/2014-December/096833.html>.

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 
beefy1.isc.freebsd.org 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
--nextPart3692520.cOyImHYnJC
Content-Disposition: inline; filename="portsync"
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"; name="portsync"

#!/bin/sh
# Copyright (c) 2014 Reed A. Cartwright <cartwright@asu.edu>
#
# 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

SERVER=beefy2.isc.freebsd.org
JAIL=10amd64-default

URL="http://${SERVER}/data/${JAIL}/.data.json"

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin

PORTSDIR=/usr/ports

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

# 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}"
	else 
	  echo No update needed
	fi
else
	>& echo "ERROR: Unable to determine revision number for latest packages."
	exit 1
fi

--nextPart3692520.cOyImHYnJC--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3260976.9592SAMzda>