summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-02-27 00:33:02 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2009-02-27 00:33:02 +0100
commitbf48e3ad8f23df3a6888243432faf291235622f6 (patch)
treec1ade7a7e30b8a5d56db8fc0a26ffdc5fe5f409d
parent9ec1e72e65332931dd16300cb09c81b273e0dbde (diff)
downloaddevtools-bf48e3ad8f23df3a6888243432faf291235622f6.tar.gz
devtools-bf48e3ad8f23df3a6888243432faf291235622f6.tar.xz
makechrootpkg: Check for files before copying
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xmakechrootpkg14
1 files changed, 10 insertions, 4 deletions
diff --git a/makechrootpkg b/makechrootpkg
index e25a975..475e398 100755
--- a/makechrootpkg
+++ b/makechrootpkg
@@ -233,13 +233,19 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then
popd >/dev/null
fi
+ local pkgfile=${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz
if [ -z "$(mount | grep ${chrootdir}/union/pkgdest)" ]; then
- echo "Moving completed package file to ${WORKDIR}"
- mv ${chrootdir}/union/pkgdest/${pkgname}-${pkgver}-${pkgrel}-*.pkg.tar.gz ${WORKDIR}
+ if [ -e "$pkgfile" ]; then
+ echo "Moving completed package file to ${WORKDIR}"
+ mv "$pkgfile" "${WORKDIR}"
+ fi
fi
if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then
- echo "Moving downloaded source files to ${WORKDIR}"
- mv ${chrootdir}/union/srcdest/* ${WORKDIR}
+ for f in ${chrootdir}/union/srcdest/*; do
+ [ -e "$f" ] || continue
+ echo "Moving downloaded source file ($(basename $f) to ${WORKDIR}"
+ mv "$f" "${WORKDIR}"
+ done
fi
else
#just in case. We returned 1, make sure we fail