diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-03-23 19:50:56 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-03-23 19:50:56 +0100 |
commit | d568b8aeb0be95d6a1da7da0434de23e6b2260e2 (patch) | |
tree | 3051c14427751e9e79b1f4878fb6e8299440d728 /db-functions | |
parent | 9e4f661adf89d150b0891d6edd39e19682d923bf (diff) | |
download | dbscripts-d568b8aeb0be95d6a1da7da0434de23e6b2260e2.tar.gz dbscripts-d568b8aeb0be95d6a1da7da0434de23e6b2260e2.tar.xz |
Add support for packages which use the epoch variable
Diffstat (limited to 'db-functions')
-rw-r--r-- | db-functions | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/db-functions b/db-functions index 7d431fc..676ecf4 100644 --- a/db-functions +++ b/db-functions @@ -71,6 +71,19 @@ in_array() { return 1 # Not Found } +## +# usage : get_full_version( $epoch, $pkgver, $pkgrel ) +# return : full version spec, including epoch (if necessary), pkgver, pkgrel +## +get_full_version() { + if [[ $1 -eq 0 ]]; then + # zero epoch case, don't include it in version + echo $2-$3 + else + echo $1:$2-$3 + fi +} + script_lock() { local LOCKDIR="$TMPDIR/.scriptlock.$(basename $0)" if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then @@ -328,7 +341,7 @@ check_pkgsvn() { [ $? -ge 1 ] && return 1 fi - local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgver}-${pkgrel}")" + local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) )" [ "${svnver}" == "${_pkgver}" ] || return 1 local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo ${pkgname[@]})) |