2010-01-16 02:11:44 +01:00
|
|
|
#-
|
|
|
|
# Copyright (c) 2008-2010 Juan Romero Pardines.
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#-
|
|
|
|
|
|
|
|
set_defvars()
|
|
|
|
{
|
|
|
|
local DDIRS i instver instsharedir
|
|
|
|
|
|
|
|
instsharedir=@@XBPS_INSTALL_SHAREDIR@@
|
|
|
|
|
|
|
|
: ${XBPS_TRIGGERSDIR:=$instsharedir/triggers}
|
|
|
|
: ${XBPS_HELPERSDIR:=$instsharedir/helpers}
|
|
|
|
: ${XBPS_SHUTILSDIR:=$instsharedir/shutils}
|
|
|
|
: ${XBPS_COMMONVARSDIR:=$instsharedir/common}
|
|
|
|
: ${XBPS_DBDIR:=$XBPS_MASTERDIR/var/db/xbps}
|
|
|
|
: ${XBPS_META_PATH:=$XBPS_DBDIR/}
|
|
|
|
: ${XBPS_PKGMETADIR:=$XBPS_DBDIR/metadata}
|
|
|
|
: ${XBPS_SRCPKGDIR:=$XBPS_DISTRIBUTIONDIR/srcpkgs}
|
2010-04-26 02:51:48 +02:00
|
|
|
: ${XBPS_DESTDIR:=$XBPS_MASTERDIR/pkg-destdir}
|
|
|
|
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/pkg-binpkgs}
|
|
|
|
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir}
|
|
|
|
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir}
|
|
|
|
|
2010-05-06 22:01:36 +02:00
|
|
|
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
|
|
|
|
DDIRS="$DDIRS DISTRIBUTIONDIR"
|
|
|
|
for i in ${DDIRS}; do
|
2010-04-26 02:51:48 +02:00
|
|
|
eval val="\$XBPS_$i"
|
2010-05-06 22:01:36 +02:00
|
|
|
if [ ! -d "$val" ]; then
|
|
|
|
echo "ERROR: cannot find $i at $val aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-04-26 02:51:48 +02:00
|
|
|
done
|
2010-01-16 02:11:44 +01:00
|
|
|
|
2010-05-06 22:01:36 +02:00
|
|
|
for i in DESTDIR PACKAGESDIR BUILDDIR SRCDISTDIR; do
|
|
|
|
eval val="\$XBPS_$i"
|
|
|
|
[ ! -d "$val" ] && mkdir -p $val
|
2010-01-16 02:11:44 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
|
|
|
|
export XBPS_BIN_CMD="xbps-bin.static -r $XBPS_MASTERDIR"
|
|
|
|
export XBPS_DIGEST_CMD="xbps-uhelper.static digest"
|
|
|
|
export XBPS_CMPVER_CMD="xbps-uhelper.static cmpver"
|
|
|
|
export XBPS_FETCH_CMD="xbps-uhelper.static fetch"
|
2010-04-27 01:34:19 +02:00
|
|
|
export XBPS_REPO_CMD="xbps-repo.static"
|
2010-01-16 02:11:44 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check that installed xbps utils version is recent enough.
|
|
|
|
#
|
|
|
|
instver=$(${XBPS_PKGDB_CMD} -V)
|
|
|
|
${XBPS_CMPVER_CMD} "${instver}" "${XBPS_UTILS_REQVER}"
|
|
|
|
if [ $? -eq 255 ]; then
|
|
|
|
echo -n "Your xbps utilities are too old, "
|
|
|
|
echo "required version: ${XBPS_UTILS_REQVER}"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|