summaryrefslogtreecommitdiffstats
path: root/db-update
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-09-14 00:49:59 +0200
committerAaron Griffin <aaronmgriffin@gmail.com>2008-09-14 00:49:59 +0200
commita0f73ceca409fa8995af16eee8440c1467c5f1bf (patch)
treec08c74f9b2f9d6a3d44e34672246565c8179ed34 /db-update
parent0730a707da94ff30b94c1f7829c8d247ddf0eeb2 (diff)
downloaddbscripts-a0f73ceca409fa8995af16eee8440c1467c5f1bf.tar.gz
dbscripts-a0f73ceca409fa8995af16eee8440c1467c5f1bf.tar.xz
Validate a package file's architecture
Apparently, people seem to be renaming files as a "hack" and breaking things. Let's make sure they edited the PKGINFO too Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-update')
-rwxr-xr-xdb-update24
1 files changed, 15 insertions, 9 deletions
diff --git a/db-update b/db-update
index 5060449..d3fff2c 100755
--- a/db-update
+++ b/db-update
@@ -108,17 +108,23 @@ if [ -n "$ADDPKGS" ]; then
for pkg in $ADDPKGS; do
_pkgfile=$(basename $pkg)
_pkgname="$(getpkgname $pkg)"
- 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
- to_add="$to_add $pkg"
+
+ 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
+ to_add="$to_add $pkg"
+ else
+ echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo"
+ fi
else
- echo " WARNING: $_pkgfile does not match $BUILDSCRIPT in $svnrepo"
+ echo " WARNING: Package $_pkgname not found in $svnrepo"
fi
- else
- echo " WARNING: Package $_pkgname not found in $svnrepo"
fi
done