2010-01-16 01:11:44 +00:00
|
|
|
#-
|
2011-07-08 00:07:38 +00:00
|
|
|
# Copyright (c) 2008-2011 Juan Romero Pardines.
|
2010-01-16 01:11:44 +00:00
|
|
|
# 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()
|
|
|
|
{
|
2011-11-08 10:56:17 +00:00
|
|
|
local DDIRS i
|
2010-01-16 01:11:44 +00:00
|
|
|
|
2011-11-08 10:56:17 +00:00
|
|
|
XBPS_HELPERSDIR=@@XBPS_INSTALL_SHAREDIR@@/helpers
|
|
|
|
XBPS_SHUTILSDIR=@@XBPS_INSTALL_SHAREDIR@@/shutils
|
|
|
|
XBPS_COMMONVARSDIR=@@XBPS_INSTALL_SHAREDIR@@/common
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_META_PATH=$XBPS_MASTERDIR/var/db/xbps
|
|
|
|
XBPS_PKGMETADIR=$XBPS_META_PATH/metadata
|
|
|
|
XBPS_SRCPKGDIR=$XBPS_DISTRIBUTIONDIR/srcpkgs
|
2011-07-04 17:07:08 +00:00
|
|
|
if [ -n "$IN_CHROOT" ]; then
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_DESTDIR=/destdir
|
2011-11-05 10:55:02 +00:00
|
|
|
XBPS_BUILDDIR=/builddir
|
2011-05-31 14:39:02 +00:00
|
|
|
else
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_DESTDIR=$XBPS_MASTERDIR/destdir
|
2011-11-05 10:55:02 +00:00
|
|
|
XBPS_BUILDDIR=$XBPS_MASTERDIR/builddir
|
2011-05-31 14:39:02 +00:00
|
|
|
fi
|
2011-07-08 00:51:28 +00:00
|
|
|
if [ -n "$XBPS_HOSTDIR" ]; then
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_PACKAGESDIR=$XBPS_HOSTDIR/binpkgs
|
|
|
|
XBPS_SRCDISTDIR=$XBPS_HOSTDIR/sources
|
2011-07-08 00:51:28 +00:00
|
|
|
else
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_SRCDISTDIR=$XBPS_MASTERDIR/host/sources
|
|
|
|
XBPS_PACKAGESDIR=$XBPS_MASTERDIR/host/binpkgs
|
2011-07-08 00:51:28 +00:00
|
|
|
fi
|
2011-07-18 16:50:23 +00:00
|
|
|
XBPS_TRIGGERSDIR=$XBPS_SRCPKGDIR/xbps-triggers/files
|
2010-04-26 00:51:48 +00:00
|
|
|
|
2010-05-06 20:01:36 +00:00
|
|
|
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
|
|
|
|
DDIRS="$DDIRS DISTRIBUTIONDIR"
|
|
|
|
for i in ${DDIRS}; do
|
2010-04-26 00:51:48 +00:00
|
|
|
eval val="\$XBPS_$i"
|
2010-05-06 20:01:36 +00:00
|
|
|
if [ ! -d "$val" ]; then
|
|
|
|
echo "ERROR: cannot find $i at $val aborting."
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-04-26 00:51:48 +00:00
|
|
|
done
|
2010-01-16 01:11:44 +00:00
|
|
|
|
2010-05-06 20:01:36 +00:00
|
|
|
for i in DESTDIR PACKAGESDIR BUILDDIR SRCDISTDIR; do
|
|
|
|
eval val="\$XBPS_$i"
|
2011-07-10 22:16:02 +00:00
|
|
|
if [ ! -d "$val" ]; then
|
|
|
|
mdir=$(dirname $XBPS_MASTERDIR)
|
|
|
|
[ -z "$IN_CHROOT" -a "$mdir" = "/" ] && continue
|
|
|
|
mkdir -p $val
|
|
|
|
fi
|
2010-01-16 01:11:44 +00:00
|
|
|
done
|
|
|
|
|
2011-11-08 10:56:17 +00:00
|
|
|
export XBPS_VERSION=$(xbps-bin.static -V|awk '{print $2}')
|
|
|
|
case "${XBPS_VERSION}" in
|
2011-10-21 09:00:32 +00:00
|
|
|
0.1[0-9].[0-9]*)
|
|
|
|
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps"
|
|
|
|
;;
|
|
|
|
0.[89].[0-9]*)
|
|
|
|
# XBPS < 0.10.0
|
2011-06-24 20:00:47 +00:00
|
|
|
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist"
|
2011-10-21 09:00:32 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
xbps_conf="$xbps_conf -c $XBPS_MASTERDIR/host/repocache"
|
|
|
|
|
2010-01-16 01:11:44 +00:00
|
|
|
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
|
2011-06-24 20:00:47 +00:00
|
|
|
export XBPS_BIN_CMD="xbps-bin.static $xbps_conf -r $XBPS_MASTERDIR"
|
|
|
|
export XBPS_REPO_CMD="xbps-repo.static $xbps_conf -r $XBPS_MASTERDIR"
|
2010-01-16 01:11:44 +00:00
|
|
|
export XBPS_DIGEST_CMD="xbps-uhelper.static digest"
|
|
|
|
export XBPS_CMPVER_CMD="xbps-uhelper.static cmpver"
|
|
|
|
export XBPS_FETCH_CMD="xbps-uhelper.static fetch"
|
|
|
|
}
|