summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2010-09-12 12:47:34 +0200
committerPierre Schmitz <pierre@archlinux.de>2010-09-12 12:47:34 +0200
commitdcf9b85295b36b3e510870052f3e617df84fce5e (patch)
tree6519d84689f5476080a0c88446067fd9efb75556
parenta8832a42d659b58f3494e414e67ea3d7f334c87d (diff)
downloaddbscripts-dcf9b85295b36b3e510870052f3e617df84fce5e.tar.gz
dbscripts-dcf9b85295b36b3e510870052f3e617df84fce5e.tar.xz
check_pkgsvn: check if pkgname is in sync with svn
In addition to pkgver and pkgrel it is checked if pkgname is defined in the PKGBUILD.
-rw-r--r--db-functions28
1 files changed, 16 insertions, 12 deletions
diff --git a/db-functions b/db-functions
index d9b38e2..f7699ff 100644
--- a/db-functions
+++ b/db-functions
@@ -288,28 +288,32 @@ check_pkgfile() {
check_pkgsvn() {
local pkgfile="${1}"
- local pkgbase="$(getpkgbase $pkg)"
+ local _pkgbase="$(getpkgbase ${pkgfile})"
[ $? -ge 1 ] && return 1
- local pkgarch="$(getpkgarch ${pkgfile})"
+ local _pkgname="$(getpkgname ${pkgfile})"
+ [ $? -ge 1 ] && return 1
+ local _pkgver="$(getpkgver ${pkgfile})"
+ [ $? -ge 1 ] && return 1
+ local _pkgarch="$(getpkgarch ${pkgfile})"
[ $? -ge 1 ] && return 1
local repo="${2}"
in_array "${repo}" ${PKGREPOS[@]} || return 1
- if [ ! -f "${WORKDIR}/pkgbuilds/${repo}/${pkgbase}" ]; then
+ if [ ! -f "${WORKDIR}/pkgbuilds/${repo}/${_pkgbase}" ]; then
mkdir -p "${WORKDIR}/pkgbuilds/${repo}"
- svn export -q "${SVNREPO}/${pkgbase}/repos/${repo}-${pkgarch}/PKGBUILD" \
- "${WORKDIR}/pkgbuilds/${repo}/${pkgbase}" >/dev/null
+ svn export -q "${SVNREPO}/${_pkgbase}/repos/${repo}-${_pkgarch}/PKGBUILD" \
+ "${WORKDIR}/pkgbuilds/${repo}/${_pkgbase}" >/dev/null
[ $? -ge 1 ] && return 1
fi
- local pkgver="$(. "${WORKDIR}/pkgbuilds/${repo}/${pkgbase}"; echo "${pkgver}-${pkgrel}")"
- [ -z "${pkgver}" ] && return 1
- if echo "$(basename ${pkgfile})" | grep -q "${pkgver}-${pkgarch}"; then
- return 0
- else
- return 1
- fi
+ local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}/${_pkgbase}"; echo "${pkgver}-${pkgrel}")"
+ [ "${svnver}" == "${_pkgver}" ] || return 1
+
+ local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}/${_pkgbase}"; echo ${pkgname[@]}))
+ in_array "${_pkgname}" ${svnnames[@]} || return 1
+
+ return 0
}
check_pkgrepos() {