diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 12:08:55 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-04-17 14:46:22 -0400 |
commit | 9705ba8a148d03dfd4c2184f3a1f13ee373eb826 (patch) | |
tree | 3a6778fa074509cf105c09366ec1f403a517bfcd | |
parent | be03c311fedf4532ea6ac4d14b4becf5c7dc150e (diff) |
Use the librelib version of get_full_versionlukeshu/archlinux+cleanup+librelib
-rw-r--r-- | db-functions | 19 | ||||
-rwxr-xr-x | db-move | 4 | ||||
-rw-r--r-- | test/lib/common.inc | 4 |
3 files changed, 7 insertions, 20 deletions
diff --git a/db-functions b/db-functions index 5a304e6..217e62f 100644 --- a/db-functions +++ b/db-functions @@ -34,27 +34,14 @@ fi LOCKS=() REPO_MODIFIED=0 -# Used: plain, msg, msg2, warning, error, in_array, abort, die -# Overwritten: get_full_version, cleanup +# Used: plain, msg, msg2, warning, error, in_array, get_full_version, abort, die +# Overwritten: cleanup # Ignored: stat_busy, stat_done, # setup_workdir, trap_abort, trap_exit, # lock, slock, lock_close # pkgver_equal, find_cached_package, check_root . "$(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 @@ -338,7 +325,7 @@ check_pkgsvn() { [ $? -ge 1 ] && return 1 fi - local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}")" + local svnver="$(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; get_full_version)" [ "${svnver}" == "${_pkgver}" ] || return 1 local svnnames=($(. "${WORKDIR}/pkgbuilds/${repo}-${_pkgarch}/${_pkgbase}"; echo "${pkgname[@]}")) @@ -36,7 +36,7 @@ for pkgbase in "${args[@]:2}"; do die "Could not read pkgname" fi - pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version) if [ -z "${pkgver}" ]; then die "Could not read pkgver" fi @@ -76,7 +76,7 @@ for pkgbase in "${args[@]:2}"; do fi msg2 "%s (%s)" "${pkgbase}" "${tarches[*]}" pkgnames=($(. "${svnrepo_from}/PKGBUILD"; echo "${pkgname[@]}")) - pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgver=$(. "${svnrepo_from}/PKGBUILD"; get_full_version) if [ -d "${svnrepo_to}" ]; then for file in $(arch_svn ls "${svnrepo_to}"); do diff --git a/test/lib/common.inc b/test/lib/common.inc index 954868b..bef8749 100644 --- a/test/lib/common.inc +++ b/test/lib/common.inc @@ -35,7 +35,7 @@ oneTimeSetUp() { pushd "$d" >/dev/null pkgname=($(. PKGBUILD; echo "${pkgname[@]}")) pkgarch=($(. PKGBUILD; echo "${arch[@]}")) - pkgversion=$(. PKGBUILD; get_full_version "${epoch:-0}" "${pkgver}" "${pkgrel}") + pkgversion=$(. PKGBUILD; get_full_version) build=true for a in "${pkgarch[@]}"; do @@ -140,7 +140,7 @@ releasePackage() { pushd "${TMP}/svn-packages-copy/${pkgbase}/trunk/" >/dev/null archrelease "${repo}-${arch}" >/dev/null 2>&1 - pkgver=$(. PKGBUILD; 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}/" |