diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/poudriere.d/portsnap.sh | 29 | ||||
-rwxr-xr-x | src/poudriere.sh | 5 |
2 files changed, 34 insertions, 0 deletions
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 |