diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 4afcac16c1..205b44e1eb 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -65,6 +65,8 @@ Options: -C Do not remove build directory after successful installation. -c Path to global configuration file: if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used. + -p Package directory, overwritting XBPS_PACKAGESDIR in xbps-src.conf. + _EOF exit 1 } @@ -115,7 +117,8 @@ check_config_vars() msg_error "cannot find configuration file: $XBPS_CONFIG_FILE" fi - local XBPS_VARS="XBPS_MASTERDIR XBPS_BUILDDIR XBPS_SRCDISTDIR" + local XBPS_VARS="XBPS_MASTERDIR XBPS_BUILDDIR XBPS_SRCDISTDIR \ + XBPS_PACKAGESDIR" for f in ${XBPS_VARS}; do eval val="\$$f" [ -z "$val" ] && msg_error "'$f' not set in configuration file" @@ -132,10 +135,17 @@ check_config_vars() # # main() # -while getopts "Cc:" opt; do +while getopts "Cc:p:" opt; do case $opt in C) export dontrm_builddir=yes;; c) config_file_specified=yes; XBPS_CONFIG_FILE="$OPTARG";; + p) + _PACKAGEDIR="$OPTARG" + if [ ! -d ${_PACKAGEDIR} ]; then + mkdir -p ${_PACKAGEDIR}/${xbps_machine} + mkdir -p ${_PACKAGEDIR}/noarch + fi + ;; --) shift; break;; esac done @@ -205,6 +215,9 @@ build|configure) build-pkg) . $XBPS_SHUTILSDIR/make-binpkg.sh . $XBPS_SHUTILSDIR/tmpl_funcs.sh + if [ -n "${_PACKAGEDIR}" ]; then + export XBPS_PACKAGESDIR=${_PACKAGEDIR} + fi if [ "$2" = "all" ]; then for f in $($XBPS_BIN_CMD list|awk '{print $1}'); do pkg=$(${XBPS_PKGDB_CMD} getpkgname $f)