summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2009-07-21 21:53:39 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2009-07-21 21:53:39 +0200
commit8df23b9ed44bfffbf84522d4e49b81edb4a72b41 (patch)
tree2038d7190bd3cf2fc7e0947b0f978d328a7e5efe
parent0691b6632e612818c52dbecfd2635fd954d42e23 (diff)
downloaddbscripts-8df23b9ed44bfffbf84522d4e49b81edb4a72b41.tar.gz
dbscripts-8df23b9ed44bfffbf84522d4e49b81edb4a72b41.tar.xz
db-move: reduce usage of loops
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xdb-move25
1 files changed, 10 insertions, 15 deletions
diff --git a/db-move b/db-move
index be46dc8..4dbec07 100755
--- a/db-move
+++ b/db-move
@@ -97,9 +97,7 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
# copy the db file into our working area
if [ -f "$ftppath_from/$architecture/$repofrom.db.tar.$DB_COMPRESSION" ]; then
/bin/cp "$ftppath_from/$architecture/$repofrom.db.tar.$DB_COMPRESSION" .
- for i in ${pkgname[@]}; do
- /usr/bin/repo-remove -q "$repofrom.db.tar.$DB_COMPRESSION" $i || die "Error in repo-remove $i"
- done
+ /usr/bin/repo-remove -q "$repofrom.db.tar.$DB_COMPRESSION" ${pkgname[@]} || die "Error in repo-remove"
#use '*' to move the old DB too
mv $repofrom.db.tar.$DB_COMPRESSION* "$ftppath_from/$architecture"
echo " Package files will be cleaned up automatically"
@@ -116,18 +114,15 @@ if [ -d "$packagebase/repos/$svnrepo_from" ]; then
done
#use '*' to move the old DB too
mv $repoto.db.tar.$DB_COMPRESSION* $ftppath_to/$architecture
- if [ "${_arch}" == "any" ]; then
- for i in ${pkgname[@]}; do
- _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT"
- mv ${_pkgfile} $ftppath_to/any
- ln -s ../any/${_pkgfile} $ftppath_to/$architecture/
- done
- else
- for i in ${pkgname[@]}; do
- _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT"
- mv ${_pkgfile} $ftppath_to/$architecture
- done
- fi
+ for i in ${pkgname[@]}; do
+ _pkgfile="$i-$pkgver-$pkgrel-$_arch$PKGEXT"
+ if [ "${_arch}" == "any" ]; then
+ mv ${_pkgfile} $ftppath_to/any
+ ln -s ../any/${_pkgfile} $ftppath_to/$architecture/
+ else
+ mv ${_pkgfile} $ftppath_to/$architecture
+ fi
+ done
done
else
die "Error: $packagebase is not in repo $repofrom"