summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-09-05 13:32:27 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-09-05 13:32:27 +0200
commit6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67 (patch)
treed5bea9dd1cc7109f616f56507ceb80626fd606a0 /db-functions
parentcca13c2b41ba1389ce4187a728e05a376ad3ad0d (diff)
downloaddbscripts-6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67.tar.gz
dbscripts-6f29ee2f02c2a8e2991599ce1d76a59b58a7ee67.tar.xz
Check if package exists in any other repository on update20100906
This also checks if the sam package exists within the old package layout (without package pool)
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions25
1 files changed, 25 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index 4ac282a..4081d54 100644
--- a/db-functions
+++ b/db-functions
@@ -312,6 +312,31 @@ check_pkgsvn() {
fi
}
+check_pkgrepos() {
+ local pkgfile=$1
+
+ local pkgname="$(getpkgname ${pkgfile})"
+ [ $? -ge 1 ] && return 1
+ local pkgver="$(getpkgver ${pkgfile})"
+ [ $? -ge 1 ] && return 1
+
+ if [ -f "${FTP_BASE}/$(get_pkgpool_for_host)/${pkgname}-${pkgver}-"*${PKGEXT} ]; then
+ return 1
+ fi
+
+ local repo
+ local arch
+ for repo in $(get_repos_for_host); do
+ for arch in ${ARCHES[@]}; do
+ if [ -f "${FTP_BASE}/${repo}/os/${arch}/${pkgname}-${pkgver}"*${PKGEXT} ]; then
+ return 1
+ fi
+ done
+ done
+
+ return 0
+}
+
get_repos_for_host() {
if [ -n "${PKGREPO[$(hostname -s)]}" ]; then
echo "${PKGREPO[$(hostname -s)]}"