diff options
author | Mathieu Launay <mathieu@breatheless.net> | 2011-06-01 13:10:14 +0400 |
---|---|---|
committer | Mathieu Launay <mathieu@breatheless.net> | 2011-06-01 13:10:14 +0400 |
commit | 42467d0ec6feb177d1d472e9bb419afae7dd00c4 (patch) | |
tree | ccd4528d12bafdf9d68fa9b332a722c6036643b4 | |
parent | a18b4c0fe9be360a6a18a8246d7331d0f0832350 (diff) |
Implement separated portstree feature.
* We do not want to pollute our basesystem or our own portstree with
poudriere's portstree: install it into /usr/local/poudriere.
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | conf/poudriere.conf.sample | 2 | ||||
-rwxr-xr-x | src/poudriere.d/portsnap.sh | 29 | ||||
-rwxr-xr-x | src/poudriere.sh | 5 |
4 files changed, 36 insertions, 2 deletions
@@ -63,7 +63,7 @@ ZPOOL=poolname # the name of the zfs pool where poudriere will live FTPHOST=ftp.freebsd.org #the host where poudriere will download the sets for the jails IP=192.168.1.1 #the ip of the jail so that it can access internet (fetch distfiles etc) ETH=nfe0 # the network interface linked to the jail -PORTSDIR=/usr/ports # the portstree that will be mounted into the jails +PORTSDIR=/usr/local/poudriere/ports # the portstree that will be mounted into the jails POUDRIERE_DATA=/usr/local/poudriere_data # the directory where poudriere will store packages and logs MFSSIZE=1024m # if set WORKDIRPREFIX will be mdmfs at the given size USE_LOOPBACK=yes|no # you maybe want to use a loopback on your host when needed. lo interface is diff --git a/conf/poudriere.conf.sample b/conf/poudriere.conf.sample index fc7af493..e08ca359 100644 --- a/conf/poudriere.conf.sample +++ b/conf/poudriere.conf.sample @@ -11,7 +11,7 @@ IP=192.168.1.58 ETH=nfe0 # The ports directory to use within jails (mounted via nullfs) -PORTSDIR=/usr/ports +PORTSDIR=/usr/local/poudriere/ports # the directory where the jail will store the packages and logs POUDRIERE_DATA=/usr/local/poudriere_data diff --git a/src/poudriere.d/portsnap.sh b/src/poudriere.d/portsnap.sh new file mode 100755 index 00000000..b6bf9263 --- /dev/null +++ b/src/poudriere.d/portsnap.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +SCRIPTPATH=`realpath $0` +SCRIPTPREFIX=`dirname ${SCRIPTPATH}` +. ${SCRIPTPREFIX}/common.sh + +PORTSNAPDIR=/usr/local/poudriere/portsnap + +# test if there is any args +if [ $# -gt 0 ]; then + echo "poudriere portsnap" + echo " This command does not take any arguments." + exit 1 +fi + +# create needed directories +if [ ! -d $PORTSNAPDIR ]; then + mkdir -p $PORTSNAPDIR +fi +if [ ! -d $PORTSDIR ]; then + mkdir -p $PORTSDIR +fi + +# actually install or update the portstree +if [ ! -f $PORTSNAPDIR/INDEX ]; then + /usr/sbin/portsnap -d $PORTSNAPDIR -p $PORTSDIR fetch extract +else + /usr/sbin/portsnap -d $PORTSNAPDIR -p $PORTSDIR fetch update +fi diff --git a/src/poudriere.sh b/src/poudriere.sh index 040f99aa..c8d9730a 100755 --- a/src/poudriere.sh +++ b/src/poudriere.sh @@ -12,6 +12,7 @@ usage() { echo "- genpkg: generate package for a given port" echo "- bulk: generate packages for given ports" echo "- lsjail: list jails created and used by poudriere" + echo "- portsnap: create or update the portstree used by poudriere" exit 1 } @@ -52,6 +53,10 @@ case $1 in shift /bin/sh ${POUDRIEREPREFIX}/share/poudriere/list_jails.sh $@ ;; + portsnap) + shift + /bin/sh ${POUDRIEREPREFIX}/share/poudriere/portsnap.sh $@ + ;; *) echo "unknown command $1" usage |