summaryrefslogtreecommitdiffstats
path: root/db-move
diff options
context:
space:
mode:
authorAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 16:26:15 +0100
committerAbhishek Dasgupta <abhidg@gmail.com>2009-03-20 16:26:15 +0100
commit67e112955482397bae1971fa60e1634a92ec361c (patch)
tree4233afa6c9b3936b512631a30d6eab5ee135c309 /db-move
parent60f7e2bf28bed7d18438d9378e19a82e8b6a2d24 (diff)
downloaddbscripts-67e112955482397bae1971fa60e1634a92ec361c.tar.gz
dbscripts-67e112955482397bae1971fa60e1634a92ec361c.tar.xz
'any' architecture support for db-move, db-remove
Also: changed empty variable '$ftpdir' in db-remove to '$ftppath/$architecture'
Diffstat (limited to 'db-move')
-rwxr-xr-xdb-move54
1 files changed, 34 insertions, 20 deletions
diff --git a/db-move b/db-move
index e4f2fef..0759ba2 100755
--- a/db-move
+++ b/db-move
@@ -17,8 +17,8 @@ _arch="$4"
export CARCH="$_arch"
-ftppath_from="$FTP_BASE/$repofrom/os/$_arch/"
-ftppath_to="$FTP_BASE/$repoto/os/$_arch/"
+ftppath_from="$FTP_BASE/$repofrom/os/"
+ftppath_to="$FTP_BASE/$repoto/os/"
svnrepo_from="$repofrom-$_arch"
svnrepo_to="$repoto-$_arch"
svnpath="$(get_svnpath $repoto)"
@@ -67,7 +67,7 @@ if [ -d "$packagename/repos/$svnrepo_from" ]; then
. "$packagename/repos/$svnrepo_from/$BUILDSCRIPT"
_pkgfile="$pkgname-$pkgver-$pkgrel-$_arch$PKGEXT"
- if [ ! -f "$ftppath_from/$_pkgfile" ]; then
+ if [ ! -f "$ftppath_from/${_arch}/$_pkgfile" ]; then
die "error: package file '$_pkgfile' not found in repo '$repofrom'"
fi
@@ -86,23 +86,37 @@ if [ -d "$packagename/repos/$svnrepo_from" ]; then
[ -d build/ ] || mkdir build
cd build/
- # copy the db file into our working area
- if [ -f "$ftppath_from/$repofrom.db.tar.$DB_COMPRESSION" ]; then
- /bin/cp "$ftppath_from/$repofrom.db.tar.$DB_COMPRESSION" .
- /usr/bin/repo-remove -q "$repofrom.db.tar.$DB_COMPRESSION" $packagename || die "Error in repo-remove"
- #use '*' to move the old DB too
- mv $repofrom.db.tar.$DB_COMPRESSION* $ftppath_from
- echo " Package files will be cleaned up automatically"
- fi
-
- if [ -f "$ftppath_to/$repoto.db.tar.$DB_COMPRESSION" ]; then
- /bin/cp "$ftppath_to/$repoto.db.tar.$DB_COMPRESSION" .
- fi
-
- /bin/cp "$ftppath_from/$_pkgfile" .
- /usr/bin/repo-add -q "$repoto.db.tar.$DB_COMPRESSION" $_pkgfile || die "Error in repo-add"
- #use '*' to move the old DB too
- mv $repoto.db.tar.$DB_COMPRESSION* $_pkgfile $ftppath_to
+ if [ "${_arch}" == "any" ]; then
+ arches="i686 x86_64"
+ else
+ arches="${_arch}"
+ fi
+
+ for architecture in $arches; do
+ # 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" .
+ /usr/bin/repo-remove -q "$repofrom.db.tar.$DB_COMPRESSION" $packagename || 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"
+ fi
+
+ if [ -f "$ftppath_to/$architecture/$repoto.db.tar.$DB_COMPRESSION" ]; then
+ /bin/cp "$ftppath_to/$architecture/$repoto.db.tar.$DB_COMPRESSION" .
+ fi
+
+ /bin/cp "$ftppath_from/$architecture/$_pkgfile" .
+ /usr/bin/repo-add -q "$repoto.db.tar.$DB_COMPRESSION" $_pkgfile || die "Error in repo-add"
+ #use '*' to move the old DB too
+ mv $repoto.db.tar.$DB_COMPRESSION* $ftppath_to/$architecture
+ if [ "${_arch}" == "any" ]; then
+ mv ${_pkgfile} $ftppath_to/any
+ ln -s $ftppath_to/any/${_pkgfile} $ftppath_to/$architecture/
+ else
+ mv ${_pkgfile} $ftppath_to/$architecture
+ fi
+ done
else
die "Error: $packagename is not in repo $repofrom"
fi