From 1820342609895b5a888299be518f4ae237516e69 Mon Sep 17 00:00:00 2001 From: Phil Dillon-Thiselton Date: Wed, 4 Mar 2009 13:18:34 +0000 Subject: [PATCH] Added $SRCDEST support --- makechrootpkg | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/makechrootpkg b/makechrootpkg index 475e398..4660113 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -169,7 +169,7 @@ source $uniondir/etc/makepkg.conf [ -d "$uniondir/srcdest" ] || mkdir "$uniondir/srcdest" [ -d "$uniondir/pkgdest" ] || mkdir "$uniondir/pkgdest" [ ! -z "$PKGDEST" ] && mount --bind "$PKGDEST" "$uniondir/pkgdest" -[ ! -z "$SRCDEST" ] && mount --bind "$SRCDEST" "$uniondir/srcdest" +#[ ! -z "$SRCDEST" ] && mount --bind "$SRCDEST" "$uniondir/srcdest" if ! grep "PKGDEST=/pkgdest" "$uniondir/etc/makepkg.conf" >/dev/null 2>&1; then echo "Setting PKGDEST in makepkg.conf" @@ -185,7 +185,7 @@ chown -R nobody "$uniondir/build" chown -R nobody "$uniondir/srcdest" chown -R nobody "$uniondir/pkgdest" -# Copy PKGBUILD and sources +# Copy PKGBUILD and any existing sources from orignal work dir source PKGBUILD cp PKGBUILD "$uniondir/build/" for f in ${source[@]}; do @@ -222,6 +222,15 @@ EOF ) > "$uniondir/chrootbuild" chmod +x "$uniondir/chrootbuild" +# here's the new way for copying sources +for f in ${source[@]}; do + basef=$(echo $f | sed 's|::.*||' | sed 's|^.*://.*/||g') + if [ -f "$SRCDEST/$basef" -a -z "$uniondir/srcdest/$basef" ]; then + cp "$SRCDEST/$basef" "$uniondir/srcdest/" + fi +done + +# now we build it if mkarchroot -r "/chrootbuild" "$uniondir"; then source ${WORKDIR}/PKGBUILD @@ -252,6 +261,14 @@ else touch ${chrootdir}/union/build/BUILD_FAILED fi +# retrieve any source we have downloaded to our local $SRCDEST +for f in ${source[@]}; do + basef=$(echo $f | sed 's|::.*||' | sed 's|^.*://.*/||g') + if [ -f "$uniondir/srcdest/$basef" -a -z "$SRCDIR/$basef" ]; then + cp "$uniondir/srcdest/$basef" "$SRCDEST/" + fi +done + if [ -e ${chrootdir}/union/build/BUILD_FAILED ]; then echo "Build failed, check $chrootdir/$LAYER/build" rm ${chrootdir}/union/build/BUILD_FAILED -- 1.6.1.3