diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-29 00:45:43 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-29 00:45:43 -0600 |
commit | 7034eed1f7ceec379b34f8dd782fb986c7165ad4 (patch) | |
tree | f27909fc75724e6e9ab0115055b9dd17a0624cec | |
parent | d744cae51bf5ea3e8c01d70ddbec564ad66b036c (diff) |
use the get_full_version from libremessages (actually, common.sh)
It works properly when split packages have different versions.
-rw-r--r-- | db-functions | 20 | ||||
-rwxr-xr-x | db-move | 10 | ||||
-rw-r--r-- | test/lib/common.inc | 4 |
3 files changed, 10 insertions, 24 deletions
diff --git a/db-functions b/db-functions index dabb22b..f5e2b3d 100644 --- a/db-functions +++ b/db-functions @@ -19,27 +19,13 @@ restore_umask () { WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX") LOCKS=() -# Used: plain, msg, msg2, warning, error, in_array -# Overwritten: get_full_version, -# cleanup, abort, die +# Used: plain, msg, msg2, warning, error, in_array, get_full_version +# Overwritten: cleanup, abort, die # Ignored: stat_busy, stat_done, # setup_workdir, trab_abort, trap_exit, # lock, slock, lock_close . $(librelib common) -## -# 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.${0##*/}" if ! mkdir "$LOCKDIR" >/dev/null 2>&1 ; then @@ -301,7 +287,7 @@ check_pkgxbs() { in_array "${repo}" ${PKGREPOS[@]} || return 1 - local xbsver="$(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel}) )" + local xbsver="$(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; get_full_version "${_pkgname}")" [ "${xbsver}" == "${_pkgver}" ] || return 1 local xbsnames=($(. "`xbs releasepath ${_pkgbase} ${repo} ${_pkgarch}`/PKGBUILD"; echo ${pkgname[@]})) @@ -34,10 +34,6 @@ for pkgbase in ${args[@]:2}; do die "Could not read pkgname" fi - pkgver=$(. "${xbsrepo_from}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) - if [ -z "${pkgver}" ]; then - die "Could not read pkgver" - fi if [ "${pkgarch}" == 'any' ]; then tarches=(${ARCHES[@]}) @@ -46,6 +42,10 @@ for pkgbase in ${args[@]:2}; do fi for pkgname in ${pkgnames[@]}; do + pkgver=$(. "${xbsrepo_from}/PKGBUILD"; get_full_version ${pkgname}) + if [ -z "${pkgver}" ]; then + die "Could not read pkgver" + fi for tarch in ${tarches[@]}; do getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT} >/dev/null done @@ -73,9 +73,9 @@ for pkgbase in ${args[@]:2}; do tarches=("${pkgarch}") fi pkgnames=($(. "${dir_to}/PKGBUILD"; echo ${pkgname[@]})) - pkgver=$(. "${dir_to}/PKGBUILD"; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) for pkgname in ${pkgnames[@]}; do + pkgver=$(. "${dir_to}/PKGBUILD"; get_full_version ${pkgname}) for tarch in ${tarches[@]}; do pkgpath=$(getpkgfile "${ftppath_from}/${tarch}/"${pkgname}-${pkgver}-${pkgarch}${PKGEXT}) pkgfile="${pkgpath##*/}" diff --git a/test/lib/common.inc b/test/lib/common.inc index 396f12f..2f308dd 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -54,7 +54,7 @@ oneTimeSetUp() { pushd $d >/dev/null pkgname=($(. PKGBUILD; echo ${pkgname[@]})) pkgarch=($(. PKGBUILD; echo ${arch[@]})) - pkgversion=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) + pkgversion=$(. PKGBUILD; get_full_version) build=true for a in ${pkgarch[@]}; do @@ -169,7 +169,7 @@ releasePackage() { pushd "${TMP}/svn-packages-copy"/${pkgbase}/trunk/ >/dev/null xbs release ${repo} ${arch} >/dev/null 2>&1 - pkgver=$(. PKGBUILD; echo $(get_full_version ${epoch:-0} ${pkgver} ${pkgrel})) + pkgver=$(. PKGBUILD; get_full_version) pkgname=($(. PKGBUILD; echo ${pkgname[@]})) popd >/dev/null cp "${pkgdir}/${pkgbase}"/*-${pkgver}-${arch}${PKGEXT} "${STAGING}"/${repo}/ |