summaryrefslogtreecommitdiff
path: root/libremakepkg
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-12-14 13:58:35 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2011-12-14 13:58:35 -0300
commitb7350ea957eda0f738bdbe7e74586c0c21fc3334 (patch)
tree279a3caf7f7c1ea60000cc0512310a774b6025a3 /libremakepkg
parent7ce7ee03ad70cc246c5ccba549d8edfdc69c0ff6 (diff)
Make libremakepkg bind local makepkg dirs to chroot's
Diffstat (limited to 'libremakepkg')
-rwxr-xr-xlibremakepkg19
1 files changed, 15 insertions, 4 deletions
diff --git a/libremakepkg b/libremakepkg
index bac9e30..292e4b5 100755
--- a/libremakepkg
+++ b/libremakepkg
@@ -22,6 +22,13 @@
source /etc/libretools.conf
source /etc/makepkg.conf
+# Local vars may differ from chroot's
+LOCALPKGDEST=${PKGDEST}
+LOCALSRCDEST=${SRCDEST}
+LOCALSRCPKGDEST=${SRCPKGDEST}
+
+source ${CHROOTDIR}/${CHROOT}/etc/makepkg.conf
+
function usage { # Display message and exit
echo 'cd to a dir containing a PKGBUILD and run:'
@@ -42,10 +49,14 @@ function usage { # Display message and exit
function buildenv { # Mounts *DEST from makepkg.conf
msg "Building env"
- for mp in ${SRCDEST} ${PKGDEST} ${SRCPKGDEST}; do
- msg2 "binding ${mp} to ${CHROOTDIR}/${CHROOT}${mp}"
- mkdir -p "${CHROOTDIR}/${CHROOT}${mp}"
- mount -o bind ${mp} "${CHROOTDIR}/${CHROOT}${mp}" || exit 1
+ for mp in SRCDEST PKGDEST SRCPKGDEST; do
+# The host system directory
+ lmp=LOCAL${mp}
+
+ msg2 "Binding ${!lmp} to ${CHROOTDIR}/${CHROOT}${!mp}"
+
+ mkdir -p "${CHROOTDIR}/${CHROOT}${!mp}"
+ mount -o bind ${!lmp} "${CHROOTDIR}/${CHROOT}${!mp}" || exit 1
done
}