pkg-stage.sh revision 259246
1#!/bin/sh
2#
3# $FreeBSD: head/release/scripts/pkg-stage.sh 259246 2013-12-12 05:49:27Z gjb $
4#
5
6set -e
7
8usage() {
9	echo "$(basename ${0}) /path/to/pkg-stage.conf revision"
10	exit 1
11}
12
13if [ ! -e "${1}" ]; then
14	echo "Configuration file not specified."
15	echo
16	usage
17fi
18
19if [ "$#" -lt 2 ]; then
20	usage
21fi
22
23# Source config file for this architecture.
24REVISION="${2}"
25. "${1}" || exit 1
26
27# If NOPORTS is set for the release, do not attempt to build pkg(8).
28if [ ! -f /usr/ports/Makefile ]; then
29	exit 0
30fi
31
32if [ ! -x /usr/local/sbin/pkg ]; then
33	/usr/bin/make -C /usr/ports/ports-mgmt/pkg install clean
34fi
35
36/bin/mkdir -p ${PKG_CACHEDIR}
37
38${PKGCMD} update -f
39${PKGCMD} fetch -d ${DVD_PACKAGES}
40
41${PKGCMD} repo ${PKG_CACHEDIR}
42
43# Always exit '0', even if pkg(8) complains about conflicts.
44exit 0
45