summaryrefslogtreecommitdiff
path: root/makechrootpkg
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2009-09-18 14:54:50 -0700
committerAaron Griffin <aaronmgriffin@gmail.com>2009-09-18 14:54:50 -0700
commit06b02906b89d1af6a2e4c9cb6412c187c9619612 (patch)
treea1bbd1774e2395cadc11686cc217ce7ec410d7cf /makechrootpkg
parent71a6d2c89587da5299b5a6c00542f49a1325721b (diff)
makechrootpkg: fixed copying of split packages
This patch fixed copying of packages with splitting (FS#16181) It also adds missing quotes around chrootdir variable. Signed-off-by: Eric BĂ©langer <snowmaniscool@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'makechrootpkg')
-rwxr-xr-xmakechrootpkg35
1 files changed, 16 insertions, 19 deletions
diff --git a/makechrootpkg b/makechrootpkg
index 2b71707..276a72f 100755
--- a/makechrootpkg
+++ b/makechrootpkg
@@ -225,31 +225,28 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then
[ -f /etc/makepkg.conf ] && source /etc/makepkg.conf
[ -f ~/.makepkg.conf ] && source ~/.makepkg.conf
- source ${WORKDIR}/PKGBUILD
+ for pkgfile in "${chrootdir}"/union/pkgdest/*${PKGEXT}; do
+ [ -e "$pkgfile" ] || continue
+ _pkgname=$(basename "$pkgfile")
+ if [ -n "$add_to_db" ]; then
- for _pkgname in ${pkgname[@]}; do
- pkgfile="${chrootdir}"/union/pkgdest/${_pkgname}-*${PKGEXT}
-
- if [ -n "$add_to_db" -a -e "$pkgfile" ]; then
[ -d "${chrootdir}/union/repo" ] || mkdir -p "${chrootdir}/union/repo"
pushd "${chrootdir}/union/repo" >/dev/null
cp "$pkgfile" .
- repo-add repo.db.tar.${DB_COMPRESSION} ${_pkgname}-${pkgver}-${pkgrel}-*${PKGEXT}
+ repo-add repo.db.tar.${DB_COMPRESSION} "$_pkgname"
popd >/dev/null
fi
- if [ -e $pkgfile ]; then
- if [ -n "$PKGDEST" ]; then
- echo "Moving completed ${_pkgname} package file to ${PKGDEST}"
- mv $pkgfile "${PKGDEST}"
- else
- echo "Moving completed ${_pkgname} package file to ${WORKDIR}"
- mv $pkgfile "${WORKDIR}"
- fi
+ if [ -n "$PKGDEST" ]; then
+ echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${PKGDEST}"
+ mv "$pkgfile" "${PKGDEST}"
+ else
+ echo "Moving completed ${_pkgname%${PKGEXT}} package file to ${WORKDIR}"
+ mv "$pkgfile" "${WORKDIR}"
fi
done
- for f in ${chrootdir}/union/srcdest/*; do
+ for f in "${chrootdir}"/union/srcdest/*; do
[ -e "$f" ] || continue
if [ -n "$SRCDEST" ]; then
echo "Moving downloaded source file $(basename $f) to ${SRCDEST}"
@@ -261,14 +258,14 @@ if mkarchroot -r "/chrootbuild" "$uniondir"; then
done
else
#just in case. We returned 1, make sure we fail
- touch ${chrootdir}/union/build/BUILD_FAILED
+ touch "${chrootdir}/union/build/BUILD_FAILED"
fi
-if [ -e ${chrootdir}/union/build/BUILD_FAILED ]; then
+if [ -e "${chrootdir}/union/build/BUILD_FAILED" ]; then
echo "Build failed, check $chrootdir/$LAYER/build"
- rm ${chrootdir}/union/build/BUILD_FAILED
+ rm "${chrootdir}/union/build/BUILD_FAILED"
else
- rm -rf ${chrootdir}/union/build/*
+ rm -rf "${chrootdir}"/union/build/*
echo "Build complete"
fi