zfs create -o quota=5g rpool/export/repos/oi_151a7_illumos_latest

 

hg clone https://hg.openindiana.org/sustaining/oi_151a/pkg-gate
cd pkg-gate/src/util/publish/

cat > set-publisher.transforms << EOF
<transform set name=pkg.fmri -> edit value pkg://[^/]+/ pkg://openindiana.org/>

# These are needed until 14870 is fixed.
<transform file depend -> delete pkg.debug.depend.file .*>
<transform file depend -> delete pkg.debug.depend.reason .*>
<transform file depend -> delete pkg.debug.depend.type .*>
<transform file depend -> delete pkg.debug.depend.path .*>
<transform file depend -> delete pkg.debug.depend.severity .*>
EOF


pfexec pkgrepo create /export/repos/oi_151a7_illumos_latest/
pfexec pkgrepo set -s /export/repos/oi_151a7_illumos_latest/ publisher/prefix=openindiana.org

pfexec /usr/lib/pkg.depotd -d /export/repos/oi_151a7_illumos_latest -p 9005 --rebuild --exit-ready

pfexec mkdir -p /export/scratch

pfexec ./set-publisher.sh -b ".*" -d /export/scratch -p /export/repos/oi_151a7_illumos_latest http://my-build-machine:20317

-----
REPO_NAME="oi_151a7_illumos_latest"
INST_ROOT="/export/repos/oi_151a7_illumos_latest/"
PORT="30147"

svccfg -s svc:/application/pkg/server add ${REPO_NAME}

svccfg -s svc:/application/pkg/server:${REPO_NAME} addpg pkg application
svccfg -s svc:/application/pkg/server:${REPO_NAME} setprop pkg/inst_root=${INST_ROOT}
svccfg -s svc:/application/pkg/server:${REPO_NAME} setprop pkg/port=${PORT}
svccfg -s svc:/application/pkg/server:${REPO_NAME} setprop pkg/pkg_root=/
svccfg -s svc:/application/pkg/server:${REPO_NAME} setprop pkg/readonly=true
svccfg -s svc:/application/pkg/server:${REPO_NAME} setprop pkg/threads=50

svcadm refresh svc:/application/pkg/server:${REPO_NAME}
svcadm enable svc:/application/pkg/server:${REPO_NAME}