xbps-src: use XBPS_LIBEXECDIR and XBPS_SHAREDIR in all scripts that need substs.

This commit is contained in:
Juan RP 2011-11-18 14:05:51 +01:00
parent dd4feb7b41
commit c011a2749b
5 changed files with 13 additions and 24 deletions

View file

@ -55,7 +55,7 @@ mount_chroot_fs()
continue
fi
[ ! -d ${blah} ] && echo "failed." && continue
@@XBPS_INSTALL_LIBEXECDIR@@/capmount \
${XBPS_LIBEXECDIR}/capmount \
${dowrite} ${blah} ${MASTERDIR}/${f} \
2>/dev/null
if [ $? -eq 0 ]; then
@ -85,7 +85,7 @@ umount_chroot_fs()
echo ${cnt} > ${MASTERDIR}/.${fs}_mount_bind_done
else
echo -n "=> Unmounting ${fs} from chroot... "
@@XBPS_INSTALL_LIBEXECDIR@@/capumount \
${XBPS_LIBEXECDIR}/capumount \
${MASTERDIR} ${fs} 2>/dev/null
if [ $? -eq 0 ]; then
rm -f ${MASTERDIR}/.${fs}_mount_bind_done

View file

@ -28,23 +28,13 @@ PKG_TMPLNAME="$1"
if [ -n "${CONFIG_FILE}" -a -r "${CONFIG_FILE}" ]; then
. ${CONFIG_FILE}
else
if [ -n "$IN_CHROOT" ]; then
. /usr/local/etc/xbps-src.conf
else
. @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf
fi
fi
if [ -n "${MASTERDIR}" ]; then
export XBPS_MASTERDIR="${MASTERDIR}"
fi
if [ -n "$IN_CHROOT" ]; then
. /usr/local/share/xbps-src/shutils/init_funcs.sh
else
. @@XBPS_INSTALL_SHAREDIR@@/shutils/init_funcs.sh
fi
. ${XBPS_SHAREDIR}/shutils/init_funcs.sh
set_defvars

View file

@ -26,16 +26,18 @@
_mount()
{
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" ${SUDO_CMD} \
@@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper mount
HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \
XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \
${XBPS_LIBEXECDIR}/chroot-helper mount
return $?
}
_umount()
{
MASTERDIR="${XBPS_MASTERDIR}" DISTRIBUTIONDIR="${XBPS_DISTRIBUTIONDIR}" \
HOSTDIR="${XBPS_HOSTDIR}" ${SUDO_CMD} \
@@XBPS_INSTALL_LIBEXECDIR@@/chroot-helper umount
HOSTDIR="${XBPS_HOSTDIR}" XBPS_ETCDIR="${XBPS_ETCDIR}" \
XBPS_SHAREDIR="${XBPS_SHAREDIR}" ${SUDO_CMD} \
${XBPS_LIBEXECDIR}/chroot-helper umount
return $?
}

View file

@ -129,19 +129,14 @@ install_pkg()
fi
fi
if [ -n "$IN_CHROOT" ]; then
DOINST_HELPER=/usr/local/libexec/doinst-helper
else
DOINST_HELPER=@@XBPS_INSTALL_LIBEXECDIR@@/doinst-helper
fi
# Install pkg into destdir.
env XBPS_MACHINE=${XBPS_MACHINE} wrksrc=${wrksrc} \
MASTERDIR="${XBPS_MASTERDIR}" \
BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \
CONFIG_FILE=${XBPS_CONFIG_FILE} \
${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \
${DOINST_HELPER} ${curpkgn} || return $?
${XBPS_LIBEXECDIR}/doinst-helper ${curpkgn} \
|| return $?
# Strip binaries/libraries.
strip_files

View file

@ -28,9 +28,11 @@ readonly XBPS_SRC_BUILD_VERSION=20111118
if [ -n "$IN_CHROOT" ]; then
export XBPS_ETCDIR=/usr/local/etc/xbps
export XBPS_SHAREDIR=/usr/local/share/xbps-src
export XBPS_LIBEXECDIR=/usr/local/libexec
else
export XBPS_ETCDIR=@@XBPS_INSTALL_ETCDIR@@
export XBPS_SHAREDIR=@@XBPS_INSTALL_SHAREDIR@@
export XBPS_LIBEXECDIR=@@XBPS_INSTALL_LIBEXECDIR@@
fi
XBPS_CONFIG_FILE=${XBPS_ETCDIR}/xbps-src.conf