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:
parent
c335a73af5
commit
b6c21b960b
5 changed files with 40 additions and 37 deletions
|
@ -31,11 +31,12 @@ HANDLER="$1"
|
|||
if [ -n "${MASTERDIR}" ]; then
|
||||
export XBPS_MASTERDIR="${MASTERDIR}"
|
||||
fi
|
||||
if [ -n "${CACHEDIR}" ]; then
|
||||
export XBPS_CACHEDIR="${CACHEDIR}"
|
||||
if [ -n "${HOSTDIR}" ]; then
|
||||
export XBPS_HOSTDIR="${HOSTDIR}"
|
||||
fi
|
||||
|
||||
REQFS="sys proc dev xbps cachedir"
|
||||
|
||||
REQFS="sys proc dev xbps host"
|
||||
|
||||
mount_chroot_fs()
|
||||
{
|
||||
|
@ -53,13 +54,13 @@ mount_chroot_fs()
|
|||
blah=${XBPS_DISTRIBUTIONDIR}
|
||||
dowrite="-w"
|
||||
;;
|
||||
cachedir)
|
||||
blah=${XBPS_CACHEDIR}
|
||||
host)
|
||||
blah=${XBPS_HOSTDIR}
|
||||
dowrite="-w"
|
||||
;;
|
||||
*) blah=/${f};;
|
||||
esac
|
||||
if [ -z "$XBPS_CACHEDIR" -a "$f" = "cachedir" ]; then
|
||||
if [ -z "$XBPS_HOSTDIR" -a "$f" = "host" ]; then
|
||||
echo "unset, ignoring."
|
||||
continue
|
||||
fi
|
||||
|
@ -105,15 +106,6 @@ umount_chroot_fs()
|
|||
fi
|
||||
unset fs
|
||||
done
|
||||
|
||||
# Remove created dirs
|
||||
for fs in xbps cachedir; do
|
||||
if [ ! -f ${XBPS_MASTERDIR}/.${fs}_mount_bind_done ]; then
|
||||
if [ -d ${XBPS_MASTERDIR}/${fs} ]; then
|
||||
rmdir ${XBPS_MASTERDIR}/${fs} 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue