From d8769f6d781af2d1c57681c0da1951faee2d6d25 Mon Sep 17 00:00:00 2001 From: dtw Date: Sun, 8 Mar 2009 09:47:57 +0000 Subject: [PATCH] Added SRCDEST support --- makechrootpkg | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/makechrootpkg b/makechrootpkg index 475e398..2a4e10a 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 @@ -193,7 +193,12 @@ for f in ${source[@]}; do if [ -f "$basef" ]; then cp "$basef" "$uniondir/srcdest/" fi + # here's the new way for copying sources + if [ -f "$SRCDEST/$basef" -a -z "$uniondir/srcdest/$basef" ]; then + cp "$SRCDEST/$basef" "$uniondir/srcdest/" + fi done + if [ "$install" != "" -a -f "$install" ]; then cp "$install" "$uniondir/build/" fi @@ -222,6 +227,7 @@ EOF ) > "$uniondir/chrootbuild" chmod +x "$uniondir/chrootbuild" +# now we build it if mkarchroot -r "/chrootbuild" "$uniondir"; then source ${WORKDIR}/PKGBUILD @@ -252,6 +258,9 @@ else touch ${chrootdir}/union/build/BUILD_FAILED fi +# retrieve any source we have downloaded to our local $SRCDEST +cp -u "$uniondir/srcdest/*" "$SRCDEST/" + if [ -e ${chrootdir}/union/build/BUILD_FAILED ]; then echo "Build failed, check $chrootdir/$LAYER/build" rm ${chrootdir}/union/build/BUILD_FAILED -- 1.6.2