summaryrefslogtreecommitdiffstats
path: root/db-move
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-08-17 20:32:47 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-08-17 20:32:47 +0200
commit17c9dab4b420ca55fd4fb3f277805af148159a4d (patch)
treebf48b576e2d7886713d4e01cd7b2feccfc3aed2e /db-move
parenta2b3b2bb2bde44289d41b956dde1f5bca61e581b (diff)
downloaddbscripts-17c9dab4b420ca55fd4fb3f277805af148159a4d.tar.gz
dbscripts-17c9dab4b420ca55fd4fb3f277805af148159a4d.tar.xz
Add additional checks when reading PKGBUILDs
If reading from a PKGBUILD fails stop immediatly. Also put out more usefull error messages.
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move13
1 files changed, 11 insertions, 2 deletions
diff --git a/db-move b/db-move
index a274cd3..5ffb8bc 100755
--- a/db-move
+++ b/db-move
@@ -32,12 +32,21 @@ for pkgbase in ${args[@]:2}; do
svnrepo_from="${WORKDIR}/svn/${pkgbase}/repos/${repo_from}-${pkgarch}"
if [ -r "${svnrepo_from}/PKGBUILD" ]; then
pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo ${pkgname[@]}))
+ if [ ${#pkgnames[@]} -lt 1 ]; then
+ die "Could not read pkgname"
+ fi
+
pkgver=$(. "${svnrepo_from}/PKGBUILD"; echo "${pkgver}-${pkgrel}")
+ if [ -z "${pkgver}" ]; then
+ die "Could not read pkgver"
+ fi
+
if [ "${pkgarch}" == 'any' ]; then
tarches=(${ARCHES[@]})
else
tarches=("${pkgarch}")
fi
+
for pkgname in ${pkgnames[@]}; do
for tarch in ${tarches[@]}; do
getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null
@@ -98,9 +107,9 @@ done
for tarch in ${ARCHES[@]}; do
if [ -n "${add_pkgs[${tarch}]}" ]; then
/usr/bin/repo-add -q "${ftppath_to}/${tarch}/${repo_to}${DBEXT}" ${add_pkgs[${tarch}]} >/dev/null \
- || die "Error in repo-add ${add_pkgs[${tarch}]}"
+ || error "repo-add ${tarch}/${repo_to}${DBEXT} ${add_pkgs[${tarch}]}"
/usr/bin/repo-remove -q "${ftppath_from}/${tarch}/${repo_from}${DBEXT}" ${remove_pkgs[${tarch}]} >/dev/null \
- || die "Error in repo-remove ${remove_pkgs[${tarch}]}"
+ || error "repo-remove ${tarch}/${repo_from}${DBEXT} ${remove_pkgs[${tarch}]}"
fi
done