mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-25 07:31:01 +02:00
pkg-auto: Move regular expression for package name to gentoo_ver
I did it initially, because I think I'll use this expression in other place too. In the end I didn't but I still think it's a better place for it.
This commit is contained in:
parent
80d12ea75f
commit
fff6bd78b2
@ -12,7 +12,10 @@ __GENTOO_VER_SH_INCLUDED__=x
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/util.sh"
|
||||
|
||||
VER_ERE="^([0-9]+(\.[0-9]+)*)([a-z]?)((_(alpha|beta|pre|rc|p)[0-9]*)*)(-r[0-9]+)?$"
|
||||
VER_ERE_UNBOUNDED="([0-9]+(\.[0-9]+)*)([a-z]?)((_(alpha|beta|pre|rc|p)[0-9]*)*)(-r[0-9]+)?"
|
||||
VER_ERE='^'"${VER_ERE_UNBOUNDED}"'$'
|
||||
|
||||
PKG_ERE_UNBOUNDED="[A-Za-z0-9_][A-Za-z0-9+_.-]*/[A-Za-z0-9_][A-Za-z0-9+_-]*"
|
||||
|
||||
# @FUNCTION: _ver_compare_int
|
||||
# @USAGE: <a> <b>
|
||||
|
@ -1006,14 +1006,6 @@ function process_listings() {
|
||||
# shellcheck disable=SC1091 # generated file
|
||||
source "${WORKDIR}/globals"
|
||||
|
||||
local ver_ere pkg_ere
|
||||
# VER_ERE comes from gentoo_ver.sh
|
||||
ver_ere=${VER_ERE}
|
||||
# regexp begins with ^ and ends with $, so strip them
|
||||
ver_ere=${ver_ere#'^'}
|
||||
ver_ere=${ver_ere%'$'}
|
||||
pkg_ere='[a-z0-9]*-?[a-z0-9]*/[a-z0-9A-Z_+-]*'
|
||||
|
||||
#mvm_debug_enable pl_pkg_to_tags_set_mvm
|
||||
mvm_declare pl_pkg_to_tags_set_mvm mvm_mvc_set
|
||||
|
||||
@ -1036,7 +1028,8 @@ function process_listings() {
|
||||
pkg_debug "processing listings: adding tag ${kind^^}"
|
||||
pkg_debug_disable
|
||||
mvm_add pl_pkg_to_tags_set_mvm "${pkg}" "${kind^^}"
|
||||
done < <(sed -E -e 's#^('"${pkg_ere}"')-'"${ver_ere}"'::.*#\1#' "${listing}")
|
||||
# VER_ERE_UNBOUNDED and PKG_ERE_UNBOUNDED come from gentoo_ver.sh
|
||||
done < <(sed -E -e 's#^('"${PKG_ERE_UNBOUNDED}"')-'"${VER_ERE_UNBOUNDED}"'::.*#\1#' "${listing}")
|
||||
done
|
||||
done
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user