xbps-src: added -p flag to specify pkg directory.

This overwrittes the value set in the configuration file.

--HG--
extra : convert_revision : 0d46804055edf3400a20d70d5d2917da3064f9f9
This commit is contained in:
Juan RP 2010-03-30 17:01:59 +02:00
parent 370248f246
commit 4804461547

View file

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