summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-11-22 02:14:10 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2008-11-22 02:14:10 +0100
commit3606df775189459eef24fdec2bad5cab6ccc7ec6 (patch)
tree26c55bd807eaa0cabc7930d8c1a965c6d0ac1f74
parent9960434e090fc4a02adb2434c6f941c725642158 (diff)
downloaddbscripts-3606df775189459eef24fdec2bad5cab6ccc7ec6.tar.gz
dbscripts-3606df775189459eef24fdec2bad5cab6ccc7ec6.tar.xz
Fix a variable overwrite when sourcing PKGBUILDs
The local variable 'arch' was being overwritten when we source PKGBUILDs. Change it to _arch wherever we deal with PKGBUILD files Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rwxr-xr-xdb-move24
-rwxr-xr-xdb-update22
-rwxr-xr-xtesting2x16
3 files changed, 31 insertions, 31 deletions
diff --git a/db-move b/db-move
index 8d006f4..74e0b0b 100755
--- a/db-move
+++ b/db-move
@@ -13,14 +13,14 @@ source_makepkg
packagename="$1"
repofrom="$2"
repoto="$3"
-arch="$4"
+_arch="$4"
-export CARCH="$arch"
+export CARCH="$_arch"
-ftppath_from="$FTP_BASE/$repofrom/os/$arch/"
-ftppath_to="$FTP_BASE/$repoto/os/$arch/"
-svnrepo_from="$repofrom-$arch"
-svnrepo_to="$repoto-$arch"
+ftppath_from="$FTP_BASE/$repofrom/os/$_arch/"
+ftppath_to="$FTP_BASE/$repoto/os/$_arch/"
+svnrepo_from="$repofrom-$_arch"
+svnrepo_to="$repoto-$_arch"
[ "$UID" = "" ] && UID=$(uid)
@@ -29,8 +29,8 @@ WORKDIR="$TMPDIR/db-move.$svnrepo_from.$svnrepo_to.$UID"
cleanup() {
trap '' 0 2
# unlock
- repo_unlock $repoto $arch
- repo_unlock $repofrom $arch
+ repo_unlock $repoto $_arch
+ repo_unlock $repofrom $_arch
rm -rf "$WORKDIR"
[ "$1" ] && exit $1
}
@@ -48,8 +48,8 @@ die() {
trap ctrl_c 2
trap cleanup 0
-repo_lock $repoto $arch
-repo_lock $repofrom $arch
+repo_lock $repoto $_arch
+repo_lock $repofrom $_arch
/bin/mkdir -p "$WORKDIR"
@@ -60,7 +60,7 @@ cd checkout
/usr/bin/svn up -q $packagename
if [ -d "$packagename/repos/$svnrepo_from" ]; then
. "$packagename/repos/$svnrepo_from/$BUILDSCRIPT"
- _pkgfile="$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT"
+ _pkgfile="$pkgname-$pkgver-$pkgrel-$_arch$PKGEXT"
if [ ! -f "$ftppath_from/$_pkgfile" ]; then
die "error: package file '$_pkgfile' not found in repo '$repofrom'"
@@ -74,7 +74,7 @@ if [ -d "$packagename/repos/$svnrepo_from" ]; then
echo " Moving svn entries"
/usr/bin/svn mv -r HEAD "$packagename/repos/$svnrepo_from" "$packagename/repos/$svnrepo_to"
- /usr/bin/svn commit -m "$(basename $0): moved $packagename from [$repofrom] to [$repoto] ($arch)"
+ /usr/bin/svn commit -m "$(basename $0): moved $packagename from [$repofrom] to [$repoto] ($_arch)"
echo " Moving package file and updating DBs"
cd "$WORKDIR"
diff --git a/db-update b/db-update
index 397a046..d98b60d 100755
--- a/db-update
+++ b/db-update
@@ -10,12 +10,12 @@ fi
source_makepkg
reponame="$1"
-arch="$2"
+_arch="$2"
-export CARCH="$arch"
+export CARCH="$_arch"
-ftppath="$FTP_BASE/$reponame/os/$arch/"
-svnrepo="$reponame-$arch"
+ftppath="$FTP_BASE/$reponame/os/$_arch/"
+svnrepo="$reponame-$_arch"
stagedir="$STAGING/$reponame"
[ "$UID" = "" ] && UID=$(uid)
@@ -48,7 +48,7 @@ getpkgname() {
cleanup() {
trap '' 0 2
# unlock
- repo_unlock $reponame $arch
+ repo_unlock $reponame $_arch
rm -rf "$WORKDIR"
[ "$1" ] && exit $1
}
@@ -66,7 +66,7 @@ die() {
trap ctrl_c 2
trap cleanup 0
-repo_lock $reponame $arch
+repo_lock $reponame $_arch
/bin/mkdir -p "$WORKDIR/build"
cd "$WORKDIR"
@@ -78,7 +78,7 @@ else
touch "build/$reponame.db.tar.$DB_COMPRESSION"
fi
-echo "Updating DB for $reponame $arch"
+echo "Updating DB for $reponame $_arch"
if [ -d "${stagedir}64" ]; then
echo "--------------------------------------------------"
@@ -102,7 +102,7 @@ fi
to_add=""
if [ -d "$stagedir" ]; then
- ADDPKGS="$(/bin/ls $stagedir/*-${arch}$PKGEXT 2>/dev/null)"
+ ADDPKGS="$(/bin/ls $stagedir/*-${_arch}$PKGEXT 2>/dev/null)"
fi
if [ -n "$ADDPKGS" ]; then
@@ -116,15 +116,15 @@ if [ -n "$ADDPKGS" ]; then
_pkgfile=$(basename $pkg)
_pkgname="$(getpkgname $pkg)"
- echo " Validating package arch ($arch) $_pkgname"
- if ! check_pkg_arch "$pkg" "$arch"; then
+ echo " Validating package arch ($_arch) $_pkgname"
+ if ! check_pkg_arch "$pkg" "$_arch"; then
echo " ERROR: $_pkgfile was built for the wrong architecture"
else
echo " Checking SVN for $_pkgname"
/usr/bin/svn up -q $_pkgname
if [ -d "$_pkgname/repos/$svnrepo" ]; then
. "$_pkgname/repos/$svnrepo/$BUILDSCRIPT"
- if [ "$_pkgfile" = "$pkgname-$pkgver-$pkgrel-$CARCH$PKGEXT" ]; then
+ if [ "$_pkgfile" = "$pkgname-$pkgver-$pkgrel-$_arch$PKGEXT" ]; then
to_add="$to_add $pkg"
else
echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo"
diff --git a/testing2x b/testing2x
index a5e3098..6a3a70e 100755
--- a/testing2x
+++ b/testing2x
@@ -6,10 +6,10 @@ source_makepkg
case "$0" in
*64)
- arch="x86_64"
+ _arch="x86_64"
;;
*)
- arch="i686"
+ _arch="i686"
;;
esac
WORKDIR="$TMPDIR/testing2x.$UID"
@@ -36,20 +36,20 @@ cd checkout
for pkg in $*; do
moved=0
/usr/bin/svn up -q ${pkg}
- if [ -f "${pkg}/repos/testing-${arch}/${BUILDSCRIPT}" ]; then
+ if [ -f "${pkg}/repos/testing-${_arch}/${BUILDSCRIPT}" ]; then
for repo in core extra; do
- if [ -f "${pkg}/repos/${repo}-${arch}/${BUILDSCRIPT}" ]; then
- echo "===> Moving package '${pkg}': testing-${arch} -> ${repo}-${arch}"
- $(dirname $0)/db-move "${pkg}" "testing" "${repo}" "${arch}"
+ if [ -f "${pkg}/repos/${repo}-${_arch}/${BUILDSCRIPT}" ]; then
+ echo "===> Moving package '${pkg}': testing-${_arch} -> ${repo}-${_arch}"
+ $(dirname $0)/db-move "${pkg}" "testing" "${repo}" "${_arch}"
moved=1
break
fi
done
if [ ${moved} -eq 0 ]; then
- echo "===> Warning: ${pkg} is only in testing-${arch}, cannot determine where to move it"
+ echo "===> Warning: ${pkg} is only in testing-${_arch}, cannot determine where to move it"
fi
else
- echo "===> Warning: ${pkg} is not in testing-${arch}"
+ echo "===> Warning: ${pkg} is not in testing-${_arch}"
fi
done