index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Eli Schwartz <eschwartz@archlinux.org> | 2018-05-10 23:23:58 -0400 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-05-12 21:10:44 +1000 |
commit | 2c94118dc168f16231e38a84c0b569b5b0006fd9 (patch) | |
tree | 7f1f7c850ced3a7f83749340dcd418924188b1ce /scripts/libmakepkg/lint_pkgbuild/provides.sh.in | |
parent | fa8b99189e9f2035a81c8ff8275894b61dc0bce7 (diff) |
-rw-r--r-- | scripts/libmakepkg/lint_pkgbuild/provides.sh.in | 14 |
diff --git a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in index 7500a88a..102be08e 100644 --- a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in +++ b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in @@ -37,19 +37,27 @@ lint_provides() { get_pkgbuild_all_split_attributes provides provides_list + # this function requires extglob - save current status to restore later + local shellopts=$(shopt -p extglob) + shopt -s extglob + 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#*=} + name=${provide%=*} + # remove optional epoch in version specifier + ver=${provide##$name=?(+([0-9]):)} lint_one_pkgname provides "$name" || ret=1 if [[ $ver != $provide ]]; then - check_pkgver "$ver" provides || ret=1 + # remove optional pkgrel in version specifier + check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" provides || ret=1 fi done + eval "$shellopts" + return $ret } |