xbps-src: added suport for XBPS_CACHEDIR in configuration file.

XBPS_CACHEDIR will be bind mounted as read/write in target masterdir
into /cachedir. This directory must have read/write perms for the user
running xbps-src.
This commit is contained in:
Juan RP 2011-06-26 01:45:12 +02:00
parent 2bbfbc658f
commit 8b40d5cd68
4 changed files with 25 additions and 6 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
#-
# Copyright (c) 2010 Juan Romero Pardines.
# Copyright (c) 2010-2011 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -31,8 +31,11 @@ HANDLER="$1"
if [ -n "${MASTERDIR}" ]; then
export XBPS_MASTERDIR="${MASTERDIR}"
fi
if [ -n "${CACHEDIR}" ]; then
export XBPS_CACHEDIR="${CACHEDIR}"
fi
REQFS="sys proc dev xbps"
REQFS="sys proc dev xbps cachedir"
mount_chroot_fs()
{
@ -50,6 +53,10 @@ mount_chroot_fs()
blah=${XBPS_DISTRIBUTIONDIR}
dowrite="-w"
;;
cachedir)
blah=${XBPS_CACHEDIR}
dowrite="-w"
;;
*) blah=/${f};;
esac
[ ! -d ${blah} ] && echo "failed." && continue
@ -60,7 +67,7 @@ mount_chroot_fs()
echo 1 > ${XBPS_MASTERDIR}/.${f}_mount_bind_done
echo "done."
else
echo "FAILED!!!!!"
echo "FAILED!"
exit 1
fi
else