summaryrefslogtreecommitdiff
path: root/scripts/libmakepkg/lint_pkgbuild/provides.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/libmakepkg/lint_pkgbuild/provides.sh.in')
-rw-r--r--scripts/libmakepkg/lint_pkgbuild/provides.sh.in29
1 files changed, 11 insertions, 18 deletions
diff --git a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in
index c2407dc0..7500a88a 100644
--- a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in
@@ -23,6 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH=1
LIBRARY=${LIBRARY:-'@libmakepkgdir@'}
+source "$LIBRARY/lint_pkgbuild/pkgname.sh"
+source "$LIBRARY/lint_pkgbuild/pkgver.sh"
source "$LIBRARY/util/message.sh"
source "$LIBRARY/util/pkgbuild.sh"
@@ -31,30 +33,21 @@ lint_pkgbuild_functions+=('lint_provides')
lint_provides() {
- local a list name provides_list ret=0
+ local provides_list provide name ver ret=0
- provides_list=("${provides[@]}")
- for a in "${arch[@]}"; do
- array_build list "provides_$a"
- provides_list+=("${list[@]}")
- done
-
- for name in "${pkgname[@]}"; do
- if extract_function_variable "package_$name" provides 1 list; then
- provides_list+=("${list[@]}")
- fi
-
- for a in "${arch[@]}"; do
- if extract_function_variable "package_$name" "provides_$a" 1 list; then
- provides_list+=("${list[@]}")
- fi
- done
- done
+ get_pkgbuild_all_split_attributes provides provides_list
for provide in "${provides_list[@]}"; do
if [[ $provide == *['<>']* ]]; then
error "$(gettext "%s array cannot contain comparison (< or >) operators.")" "provides"
ret=1
+ continue
+ fi
+ name=${provide%%=*}
+ ver=${provide#*=}
+ lint_one_pkgname provides "$name" || ret=1
+ if [[ $ver != $provide ]]; then
+ check_pkgver "$ver" provides || ret=1
fi
done