xbps-src: new layout in masterdir to use a common directory from host.

XBPS_CACHEDIR has been replaced by XBPS_HOSTDIR in configuration file,
and this expects the following structure:

/host
  |_ /build (previously /pkg-builddir)
  |_ /binpkgs (previously /pkg-binpkgs)
  |_ /repocache (previously /cachedir)
  |_ /sources (previously /pkg-srcdistdir)

Thanks to str1ngs for the great idea!
This commit is contained in:
Juan RP
2011-07-08 02:07:38 +02:00
parent c335a73af5
commit b6c21b960b
5 changed files with 40 additions and 37 deletions

View File

@@ -25,7 +25,7 @@
_mount()
{
MASTERDIR="${XBPS_MASTERDIR}" CACHEDIR="${XBPS_CACHEDIR}" \
MASTERDIR="${XBPS_MASTERDIR}" HOSTDIR="${XBPS_HOSTDIR}" \
${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount
return $?
@@ -33,7 +33,7 @@ _mount()
_umount()
{
MASTERDIR="${XBPS_MASTERDIR}" CACHEDIR="${XBPS_CACHEDIR}" \
MASTERDIR="${XBPS_MASTERDIR}" HOSTDIR="${XBPS_HOSTDIR}" \
${sudo_cmd} \
@@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount
return $?
@@ -86,8 +86,8 @@ _EOF
if [ -n "$XBPS_COMPRESS_LEVEL" ]; then
echo "XBPS_COMPRESS_LEVEL=$XBPS_COMPRESS_LEVEL" >> $XBPSSRC_CF
fi
if [ -n "$XBPS_CACHEDIR" ]; then
echo "XBPS_CACHEDIR=/cachedir" >> $XBPSSRC_CF
if [ -n "$XBPS_HOSTDIR" ]; then
echo "XBPS_HOSTDIR=/host" >> $XBPSSRC_CF
fi
echo "# End of configuration file." >> $XBPSSRC_CF

View File

@@ -1,5 +1,5 @@
#-
# Copyright (c) 2008-2010 Juan Romero Pardines.
# Copyright (c) 2008-2011 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -37,13 +37,13 @@ set_defvars()
: ${XBPS_PKGMETADIR:=$XBPS_DBDIR/metadata}
: ${XBPS_SRCPKGDIR:=$XBPS_DISTRIBUTIONDIR/srcpkgs}
if [ -n "$IN_CHROOT" ]; then
: ${XBPS_DESTDIR:=/pkg-destdir}
: ${XBPS_DESTDIR:=/host/destdir}
else
: ${XBPS_DESTDIR:=$XBPS_MASTERDIR/pkg-destdir}
: ${XBPS_DESTDIR:=$XBPS_MASTERDIR/host/destdir}
fi
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/pkg-binpkgs}
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir}
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir}
: ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/host/binpkgs}
: ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/host/build}
: ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/host/sources}
: ${XBPS_TRIGGERSDIR:=$XBPS_SRCPKGDIR/xbps-triggers/files}
DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR"
@@ -65,9 +65,7 @@ set_defvars()
if [ -n "$xver" ]; then
# XBPS utils >= 0.9.0.
xbps_conf="-C $XBPS_MASTERDIR/usr/local/etc/xbps-conf.plist"
if [ -n "$XBPS_CACHEDIR" ]; then
xbps_conf="$xbps_conf -c $XBPS_CACHEDIR"
fi
xbps_conf="$xbps_conf -c $XBPS_MASTERDIR/host/repocache"
fi
export XBPS_PKGDB_CMD="xbps-uhelper.static -r $XBPS_MASTERDIR"
export XBPS_BIN_CMD="xbps-bin.static $xbps_conf -r $XBPS_MASTERDIR"