Skip to content

Instantly share code, notes, and snippets.

@nakal
Created October 7, 2016 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nakal/7d3ddf547909934bbf8e9e8c10665c4d to your computer and use it in GitHub Desktop.
Save nakal/7d3ddf547909934bbf8e9e8c10665c4d to your computer and use it in GitHub Desktop.
Command wrapper for poudriere
#!/bin/sh
JAIL=11amd64
FUN="$1"
DEST="$2"
shift 2
PKG="$@"
OPT_EXT=""
if [ -z "$PKG" ]; then
PKG="-f ${JAIL}-local-${DEST}-pkglist"
else
OPT_EXT="-c"
fi
if [ "$FUN" = "bulk" ] || [ "$FUN" = "options" ] || [ "$FUN" = "pkgclean" ]; then
if [ -z "$DEST" ]; then
echo "Please specify a target repository." >&2
exit 1
fi
if [ "$FUN" = "options" ]; then
FUN="$FUN $OPT_EXT"
fi
echo poudriere $FUN -j ${JAIL} -p local -z "$DEST" $PKG
exec poudriere $FUN -j ${JAIL} -p local -z "$DEST" $PKG
fi
if [ "$FUN" = "ports" ]; then
exec poudriere "$FUN" -p local -u
fi
echo "Please specify a valid poudriere command (bulk, options, pkgclean or ports)." >&2
exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment