From 67bf884802bfd4b190fb5f8cd521c37660f05d53 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 7 Aug 2018 00:10:08 -0400 Subject: libre/pacman: Try out some new patches --- ...ter-error-messages-for-versions-in-check-.patch | 339 +++++++++++++++++++++ ...pkg-Treat-pkgrel-more-similarly-to-pkgver.patch | 91 ------ ...ck_pkgrel-Don-t-say-decimal-in-the-error-.patch | 28 ++ ...heck_pkgver-Report-what-the-bad-pkgver-is.patch | 31 ++ ...pkg-Treat-pkgrel-more-similarly-to-pkgver.patch | 91 ++++++ libre/pacman/PKGBUILD | 23 +- 6 files changed, 505 insertions(+), 98 deletions(-) create mode 100644 libre/pacman/0001-makepkg-Better-error-messages-for-versions-in-check-.patch delete mode 100644 libre/pacman/0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch create mode 100644 libre/pacman/0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch create mode 100644 libre/pacman/0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch create mode 100644 libre/pacman/0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch (limited to 'libre/pacman') diff --git a/libre/pacman/0001-makepkg-Better-error-messages-for-versions-in-check-.patch b/libre/pacman/0001-makepkg-Better-error-messages-for-versions-in-check-.patch new file mode 100644 index 000000000..641984e94 --- /dev/null +++ b/libre/pacman/0001-makepkg-Better-error-messages-for-versions-in-check-.patch @@ -0,0 +1,339 @@ +From d45e7d7e660704fac084badc1835aff037995b65 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker +Date: Mon, 6 Aug 2018 23:42:48 -0400 +Subject: [PATCH 1/4] makepkg: Better error messages for versions in + (check,make,opt)depends/provides/conflicts + +Given the depends + + depends=('foo>=1.2-1.par2') + +and the error message + + ==> ERROR: pkgver in depends is not allowed to contain colons, forward slashes, hyphens or whitespace. + +One would be lead to believe that the problem is that they gave a pkgrel in +depends at all, not that the pkgrel contains letters. + +Each of the (check,make,opt)depends, conflicts, and provides linters use a +glob to trim off properly formed epoch an rel from the full version string, +and pass the remainder to check_pkgver(). This does a good job of +accepting/rejecting full versions, but doesn't do a good job of generating +good error messages when rejecting if it's because of the epoch or rel. + +1. Factor out check_epoch() and check_pkgrel() from lint_epoch() and + lint_pkgrel(), similarly to check_pkgver(). +2. Add a check_fullpkgver() that takes a full [epoch:]ver[-rel] string and + splits it in to epoch/ver/rel, and calls the appropriate check_ function + on each. +3. Use check_fullpkgver() in the {,check,make,opt}depends, conflicts, and + provides linters. +--- + .../lint_pkgbuild/checkdepends.sh.in | 10 ++-- + .../libmakepkg/lint_pkgbuild/conflicts.sh.in | 10 ++-- + .../libmakepkg/lint_pkgbuild/depends.sh.in | 14 +++--- + scripts/libmakepkg/lint_pkgbuild/epoch.sh.in | 10 +++- + .../libmakepkg/lint_pkgbuild/fullpkgver.sh.in | 48 +++++++++++++++++++ + .../lint_pkgbuild/makedepends.sh.in | 10 ++-- + .../libmakepkg/lint_pkgbuild/optdepends.sh.in | 10 ++-- + scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in | 20 ++++++-- + .../libmakepkg/lint_pkgbuild/provides.sh.in | 10 ++-- + 9 files changed, 99 insertions(+), 43 deletions(-) + create mode 100644 scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in + +diff --git a/scripts/libmakepkg/lint_pkgbuild/checkdepends.sh.in b/scripts/libmakepkg/lint_pkgbuild/checkdepends.sh.in +index d5648bd4..0a9ddf67 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/checkdepends.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/checkdepends.sh.in +@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_CHECKDEPENDS_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" + source "$LIBRARY/lint_pkgbuild/pkgname.sh" +-source "$LIBRARY/lint_pkgbuild/pkgver.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -43,12 +43,10 @@ lint_checkdepends() { + + for checkdepend in "${checkdepends_list[@]}"; do + name=${checkdepend%%@(<|>|=|>=|<=)*} +- # remove optional epoch in version specifier +- ver=${checkdepend##$name@(<|>|=|>=|<=)?(+([0-9]):)} + lint_one_pkgname checkdepends "$name" || ret=1 +- if [[ $ver != $checkdepend ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" checkdepends || ret=1 ++ if [[ $name != $checkdepend ]]; then ++ ver=${checkdepend##$name@(<|>|=|>=|<=)} ++ check_fullpkgver "$ver" checkdepends || ret=1 + fi + done + +diff --git a/scripts/libmakepkg/lint_pkgbuild/conflicts.sh.in b/scripts/libmakepkg/lint_pkgbuild/conflicts.sh.in +index a18c25fa..b61459e1 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/conflicts.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/conflicts.sh.in +@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_CONFLICTS_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" + source "$LIBRARY/lint_pkgbuild/pkgname.sh" +-source "$LIBRARY/lint_pkgbuild/pkgver.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -43,12 +43,10 @@ lint_conflicts() { + + for conflict in "${conflicts_list[@]}"; do + name=${conflict%%@(<|>|=|>=|<=)*} +- # remove optional epoch in version specifier +- ver=${conflict##$name@(<|>|=|>=|<=)?(+([0-9]):)} + lint_one_pkgname conflicts "$name" || ret=1 +- if [[ $ver != $conflict ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" conflicts || ret=1 ++ if [[ $name != $conflict ]]; then ++ ver=${conflict##$name@(<|>|=|>=|<=)} ++ check_fullpkgver "$ver" conflicts || ret=1 + fi + done + +diff --git a/scripts/libmakepkg/lint_pkgbuild/depends.sh.in b/scripts/libmakepkg/lint_pkgbuild/depends.sh.in +index e363a039..aba43825 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/depends.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/depends.sh.in +@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_DEPENDS_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" + source "$LIBRARY/lint_pkgbuild/pkgname.sh" +-source "$LIBRARY/lint_pkgbuild/pkgver.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -43,13 +43,13 @@ lint_depends() { + + for depend in "${depends_list[@]}"; do + name=${depend%%@(<|>|=|>=|<=)*} +- # remove optional epoch in version specifier +- ver=${depend##$name@(<|>|=|>=|<=)?(+([0-9]):)} + lint_one_pkgname depends "$name" || ret=1 +- # Don't validate empty version because of https://bugs.archlinux.org/task/58776 +- if [[ $ver != $depend && -n $ver ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" depends || ret=1 ++ if [[ $name != $depend ]]; then ++ ver=${depend##$name@(<|>|=|>=|<=)} ++ # Don't validate empty version because of https://bugs.archlinux.org/task/58776 ++ if [[ -n $ver ]]; then ++ check_fullpkgver "$ver" depends || ret=1 ++ fi + fi + done + +diff --git a/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in b/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in +index 93bd05c1..c98f91b0 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/epoch.sh.in +@@ -29,9 +29,15 @@ source "$LIBRARY/util/message.sh" + lint_pkgbuild_functions+=('lint_epoch') + + +-lint_epoch() { ++check_epoch() { ++ local epoch=$1 type=$2 ++ + if [[ $epoch != *([[:digit:]]) ]]; then +- error "$(gettext "%s must be an integer, not %s.")" "epoch" "$epoch" ++ error "$(gettext "%s must be an integer, not %s.")" "epoch${type:+ in $type}" "$epoch" + return 1 + fi + } ++ ++lint_epoch() { ++ check_epoch "$epoch" ++} +diff --git a/scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in +new file mode 100644 +index 00000000..761b3dac +--- /dev/null ++++ b/scripts/libmakepkg/lint_pkgbuild/fullpkgver.sh.in +@@ -0,0 +1,48 @@ ++#!/bin/bash ++# ++# fullpkgver.sh - Check whether a full version conforms to requirements. ++# ++# Copyright (c) 2018 Pacman Development Team ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++[[ -n "$LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH" ]] && return ++LIBMAKEPKG_LINT_PKGBUILD_PKGVER_SH=1 ++ ++LIBRARY=${LIBRARY:-'@libmakepkgdir@'} ++ ++source "$LIBRARY/lint_pkgbuild/epoch.sh" ++source "$LIBRARY/lint_pkgbuild/pkgrel.sh" ++source "$LIBRARY/lint_pkgbuild/pkgver.sh" ++ ++ ++check_fullpkgver() { ++ local fullver=$1 type=$2 ++ local ret=0 ++ ++ if [[ $fullver = *:* ]]; then ++ check_epoch "${fullver%:*}" "$type" || ret=1 ++ fullver=${fullver##*:} ++ fi ++ ++ if [[ $fullver = *-* ]]; then ++ check_pkgrel "${fullver##*-}" "$type" || ret=1 ++ fullver=${fullver%-*} ++ fi ++ ++ check_pkgver "$fullver" "$type" || ret=1 ++ ++ return $ret ++} +diff --git a/scripts/libmakepkg/lint_pkgbuild/makedepends.sh.in b/scripts/libmakepkg/lint_pkgbuild/makedepends.sh.in +index 4cc4ab5d..20c7f7dc 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/makedepends.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/makedepends.sh.in +@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_MAKEDEPENDS_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" + source "$LIBRARY/lint_pkgbuild/pkgname.sh" +-source "$LIBRARY/lint_pkgbuild/pkgver.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -43,12 +43,10 @@ lint_makedepends() { + + for makedepend in "${makedepends_list[@]}"; do + name=${makedepend%%@(<|>|=|>=|<=)*} +- # remove optional epoch in version specifier +- ver=${makedepend##$name@(<|>|=|>=|<=)?(+([0-9]):)} + lint_one_pkgname makedepends "$name" || ret=1 +- if [[ $ver != $makedepend ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" makedepends || ret=1 ++ if [[ $name != $makedepend ]]; then ++ ver=${makedepend##$name@(<|>|=|>=|<=)} ++ check_fullpkgver "$ver" makedepends || ret=1 + fi + done + +diff --git a/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in +index 9978fe9b..505ee848 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/optdepends.sh.in +@@ -23,6 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_OPTDEPENDS_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" ++source "$LIBRARY/lint_pkgbuild/pkgname.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -41,12 +43,10 @@ lint_optdepends() { + + for optdepend in "${optdepends_list[@]%%:[[:space:]]*}"; do + name=${optdepend%%@(<|>|=|>=|<=)*} +- # remove optional epoch in version specifier +- ver=${optdepend##$name@(<|>|=|>=|<=)?(+([0-9]):)} + lint_one_pkgname optdepends "$name" || ret=1 +- if [[ $ver != $optdepend ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" optdepends || ret=1 ++ if [[ $name != $optdepend ]]; then ++ ver=${optdepend##$name@(<|>|=|>=|<=)} ++ check_fullpkgver "$ver" optdepends || ret=1 + fi + done + +diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +index f294a3bf..762f054a 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +@@ -29,14 +29,24 @@ source "$LIBRARY/util/message.sh" + lint_pkgbuild_functions+=('lint_pkgrel') + + +-lint_pkgrel() { +- if [[ -z $pkgrel ]]; then +- error "$(gettext "%s is not allowed to be empty.")" "pkgrel" ++check_pkgrel() { ++ local rel=$1 type=$2 ++ if [[ -z $rel ]]; then ++ error "$(gettext "%s is not allowed to be empty.")" "pkgrel${type:+ in $type}" + return 1 + fi + +- if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then +- error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel" ++ if [[ $rel != +([0-9])?(.+([0-9])) ]]; then ++ error "$(gettext "%s must be a decimal, not %s.")" "pkgrel${type:+ in $type}" "$rel" + return 1 + fi + } ++ ++lint_pkgrel() { ++ if (( PKGVERFUNC )); then ++ # defer check to after getting version from pkgver function ++ return 0 ++ fi ++ ++ check_pkgrel "$pkgrel" ++} +diff --git a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in +index 102be08e..5a529728 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/provides.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/provides.sh.in +@@ -23,8 +23,8 @@ LIBMAKEPKG_LINT_PKGBUILD_PROVIDES_SH=1 + + LIBRARY=${LIBRARY:-'@libmakepkgdir@'} + ++source "$LIBRARY/lint_pkgbuild/fullpkgver.sh" + source "$LIBRARY/lint_pkgbuild/pkgname.sh" +-source "$LIBRARY/lint_pkgbuild/pkgver.sh" + source "$LIBRARY/util/message.sh" + source "$LIBRARY/util/pkgbuild.sh" + +@@ -48,12 +48,10 @@ lint_provides() { + continue + fi + name=${provide%=*} +- # remove optional epoch in version specifier +- ver=${provide##$name=?(+([0-9]):)} + lint_one_pkgname provides "$name" || ret=1 +- if [[ $ver != $provide ]]; then +- # remove optional pkgrel in version specifier +- check_pkgver "${ver%-+([0-9])?(.+([0-9]))}" provides || ret=1 ++ if [[ $name != $provide ]]; then ++ ver=${provide##$name=} ++ check_fullpkgver "$ver" provides || ret=1 + fi + done + +-- +2.18.0 + diff --git a/libre/pacman/0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch b/libre/pacman/0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch deleted file mode 100644 index e2d19122f..000000000 --- a/libre/pacman/0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 612fb2a528924fef206ba0e49122167eb553e139 Mon Sep 17 00:00:00 2001 -From: Luke Shumaker -Date: Thu, 14 Apr 2016 17:06:07 -0400 -Subject: [PATCH] makepkg: Treat pkgrel more similarly to pkgver - -This is perfectly fine with libalpm; it was only makepkg that was more -strict with pkgrel than pkgver. - -Further, the former error message about invalid pkgrel formats claimed that -pkgrel was a "decimal", which would mean that `1.1 == 1.10`. This is not -the case; alpm parses pkgrel as a version, not as a decimal. In that -light, enforcing /[0-9]+(\.([0-9]+)?/ on a version spec seems silly. ---- - doc/PKGBUILD.5.asciidoc | 5 ++-- - scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in | 4 ++-- - test/util/vercmptest.sh | 23 ++++++++++++++++++- - 3 files changed, 26 insertions(+), 6 deletions(-) - -diff --git a/doc/PKGBUILD.5.asciidoc b/doc/PKGBUILD.5.asciidoc -index f12effde..1ad8de37 100644 ---- a/doc/PKGBUILD.5.asciidoc -+++ b/doc/PKGBUILD.5.asciidoc -@@ -60,9 +60,8 @@ systems (see below). - allows package maintainers to make updates to the package's configure - flags, for example. This is typically set to '1' for each new upstream - software release and incremented for intermediate PKGBUILD updates. The -- variable is a postive integer, with an optional subrelease level -- specified by adding another postive integer separated by a period -- (i.e. in the form x.y). -+ variable is not allowed to contain colons, forward slashes, hyphens or -+ whitespace. - - *epoch*:: - Used to force the package to be seen as newer than any previous versions -diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in -index f294a3bf..07292613 100644 ---- a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in -+++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in -@@ -35,8 +35,8 @@ lint_pkgrel() { - return 1 - fi - -- if [[ $pkgrel != +([0-9])?(.+([0-9])) ]]; then -- error "$(gettext "%s must be a decimal, not %s.")" "pkgrel" "$pkgrel" -+ if [[ $pkgrel = *[[:space:]/:-]* ]]; then -+ error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgrel" "$pkgrel" - return 1 - fi - } -diff --git a/test/util/vercmptest.sh b/test/util/vercmptest.sh -index 1541e7ae..f41a0d1e 100755 ---- a/test/util/vercmptest.sh -+++ b/test/util/vercmptest.sh -@@ -39,7 +39,7 @@ tap_runtest() { - tap_is_str "$($bin "$ver2" "$ver1")" "$exp" "$ver2 $ver1" - } - --tap_plan 92 -+tap_plan 124 - - # all similar length, no pkgrel - tap_runtest 1.5.0 1.5.0 0 -@@ -113,4 +113,25 @@ tap_runtest 1:1.0 1.0 1 - tap_runtest 1:1.0 1.1 1 - tap_runtest 1:1.1 1.1 1 - -+# complex pkgrel values -+tap_runtest 1-1.5.0 1-1.5.0 0 -+tap_runtest 1-1.5.1 1-1.5.0 1 -+tap_runtest 1-1.5.1 1-1.5 1 -+tap_runtest 1-1.5b 1-1.5 -1 -+tap_runtest 1-1.5b 1-1.5.1 -1 -+# based on "from the manpage" -+tap_runtest 1-1.0a 1-1.0alpha -1 -+tap_runtest 1-1.0alpha 1-1.0b -1 -+tap_runtest 1-1.0b 1-1.0beta -1 -+tap_runtest 1-1.0beta 1-1.0rc -1 -+tap_runtest 1-1.0rc 1-1.0 -1 -+# based on "going crazy? alpha-dotted versions" -+tap_runtest 1-1.5.a 1-1.5 1 -+tap_runtest 1-1.5.b 1-1.5.a 1 -+tap_runtest 1-1.5.1 1-1.5.b 1 -+# based on Parabola usage -+tap_runtest 1-1 1-2.par1 -1 -+tap_runtest 1-2 1-2.par1 -1 -+tap_runtest 1-3 1-2.par1 1 -+ - tap_finish --- -2.18.0 - diff --git a/libre/pacman/0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch b/libre/pacman/0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch new file mode 100644 index 000000000..7b70fbe50 --- /dev/null +++ b/libre/pacman/0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch @@ -0,0 +1,28 @@ +From fbedcad0073c9c55084c1b619125a29a998c5fe2 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker +Date: Mon, 6 Aug 2018 23:50:39 -0400 +Subject: [PATCH 2/4] makepkg: check_pkgrel: Don't say "decimal" in the error + message + +If you have a malformed pkgrel, the error message says that it must be a +"decimal". That isn't quite true, as that would mean that `1.1 == 1.10`. +--- + scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +index 762f054a..30fa6d71 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +@@ -37,7 +37,7 @@ check_pkgrel() { + fi + + if [[ $rel != +([0-9])?(.+([0-9])) ]]; then +- error "$(gettext "%s must be a decimal, not %s.")" "pkgrel${type:+ in $type}" "$rel" ++ error "$(gettext "%s must be of the form 'integer[.integer]', not %s.")" "pkgrel${type:+ in $type}" "$rel" + return 1 + fi + } +-- +2.18.0 + diff --git a/libre/pacman/0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch b/libre/pacman/0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch new file mode 100644 index 000000000..7704ce730 --- /dev/null +++ b/libre/pacman/0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch @@ -0,0 +1,31 @@ +From 0a5f9c19a3c9c64f6ffacb860d4c7ae2727d6078 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker +Date: Mon, 6 Aug 2018 23:51:47 -0400 +Subject: [PATCH 3/4] makepkg: check_pkgver: Report what the bad pkgver is + +For consistency with check_epoch and check_pkgrel. + +I think that this is important because if there are multiple +provides/depends/whatever that include a version, and one of them is +malformed, including the bad version in the error message identified +which one is the problem. +--- + scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +index c105212b..65216b64 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/pkgver.sh.in +@@ -38,7 +38,7 @@ check_pkgver() { + fi + + if [[ $ver = *[[:space:]/:-]* ]]; then +- error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace.")" "pkgver${type:+ in $type}" ++ error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace; got %s.")" "pkgver${type:+ in $type}" "$ver" + return 1 + fi + } +-- +2.18.0 + diff --git a/libre/pacman/0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch b/libre/pacman/0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch new file mode 100644 index 000000000..b66e6f88d --- /dev/null +++ b/libre/pacman/0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch @@ -0,0 +1,91 @@ +From 25f307b670a10cd05a4584611b79b9d02de47c27 Mon Sep 17 00:00:00 2001 +From: Luke Shumaker +Date: Thu, 14 Apr 2016 17:06:07 -0400 +Subject: [PATCH 4/4] makepkg: Treat pkgrel more similarly to pkgver + +This is perfectly fine with libalpm; it was only makepkg that was more +strict with pkgrel than pkgver. + +Further, the former error message about invalid pkgrel formats claimed that +pkgrel was a "decimal", which would mean that `1.1 == 1.10`. This is not +the case; alpm parses pkgrel as a version, not as a decimal. In that +light, enforcing /[0-9]+(\.([0-9]+)?/ on a version spec seems silly. +--- + doc/PKGBUILD.5.asciidoc | 5 ++-- + scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in | 4 ++-- + test/util/vercmptest.sh | 23 ++++++++++++++++++- + 3 files changed, 26 insertions(+), 6 deletions(-) + +diff --git a/doc/PKGBUILD.5.asciidoc b/doc/PKGBUILD.5.asciidoc +index f12effde..1ad8de37 100644 +--- a/doc/PKGBUILD.5.asciidoc ++++ b/doc/PKGBUILD.5.asciidoc +@@ -60,9 +60,8 @@ systems (see below). + allows package maintainers to make updates to the package's configure + flags, for example. This is typically set to '1' for each new upstream + software release and incremented for intermediate PKGBUILD updates. The +- variable is a postive integer, with an optional subrelease level +- specified by adding another postive integer separated by a period +- (i.e. in the form x.y). ++ variable is not allowed to contain colons, forward slashes, hyphens or ++ whitespace. + + *epoch*:: + Used to force the package to be seen as newer than any previous versions +diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +index 30fa6d71..0888e0b1 100644 +--- a/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in ++++ b/scripts/libmakepkg/lint_pkgbuild/pkgrel.sh.in +@@ -36,8 +36,8 @@ check_pkgrel() { + return 1 + fi + +- if [[ $rel != +([0-9])?(.+([0-9])) ]]; then +- error "$(gettext "%s must be of the form 'integer[.integer]', not %s.")" "pkgrel${type:+ in $type}" "$rel" ++ if [[ $rel = *[[:space:]/:-]* ]]; then ++ error "$(gettext "%s is not allowed to contain colons, forward slashes, hyphens or whitespace; got %s.")" "pkgrel${type:+ in $type}" "$rel" + return 1 + fi + } +diff --git a/test/util/vercmptest.sh b/test/util/vercmptest.sh +index 1541e7ae..f41a0d1e 100755 +--- a/test/util/vercmptest.sh ++++ b/test/util/vercmptest.sh +@@ -39,7 +39,7 @@ tap_runtest() { + tap_is_str "$($bin "$ver2" "$ver1")" "$exp" "$ver2 $ver1" + } + +-tap_plan 92 ++tap_plan 124 + + # all similar length, no pkgrel + tap_runtest 1.5.0 1.5.0 0 +@@ -113,4 +113,25 @@ tap_runtest 1:1.0 1.0 1 + tap_runtest 1:1.0 1.1 1 + tap_runtest 1:1.1 1.1 1 + ++# complex pkgrel values ++tap_runtest 1-1.5.0 1-1.5.0 0 ++tap_runtest 1-1.5.1 1-1.5.0 1 ++tap_runtest 1-1.5.1 1-1.5 1 ++tap_runtest 1-1.5b 1-1.5 -1 ++tap_runtest 1-1.5b 1-1.5.1 -1 ++# based on "from the manpage" ++tap_runtest 1-1.0a 1-1.0alpha -1 ++tap_runtest 1-1.0alpha 1-1.0b -1 ++tap_runtest 1-1.0b 1-1.0beta -1 ++tap_runtest 1-1.0beta 1-1.0rc -1 ++tap_runtest 1-1.0rc 1-1.0 -1 ++# based on "going crazy? alpha-dotted versions" ++tap_runtest 1-1.5.a 1-1.5 1 ++tap_runtest 1-1.5.b 1-1.5.a 1 ++tap_runtest 1-1.5.1 1-1.5.b 1 ++# based on Parabola usage ++tap_runtest 1-1 1-2.par1 -1 ++tap_runtest 1-2 1-2.par1 -1 ++tap_runtest 1-3 1-2.par1 1 ++ + tap_finish +-- +2.18.0 + diff --git a/libre/pacman/PKGBUILD b/libre/pacman/PKGBUILD index 0d81747eb..9f6f1e699 100644 --- a/libre/pacman/PKGBUILD +++ b/libre/pacman/PKGBUILD @@ -12,7 +12,7 @@ pkgname=pacman pkgver=5.1.1 pkgrel=1 -pkgrel+=.parabola1 +pkgrel+=.parabola2 pkgdesc="A library-based package manager with dependency support" arch=('x86_64') arch+=('i686' 'armv7h') @@ -38,7 +38,10 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig makepkg.conf.in pacman-keyring.service pacman-keyring.timer - 0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch) + 0001-makepkg-Better-error-messages-for-versions-in-check-.patch + 0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch + 0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch + 0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch) source_armv7h=(0001-Sychronize-filesystem.patch 0002-Revert-close-stdin-before-running-install-scripts.patch 0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch) @@ -50,7 +53,10 @@ sha256sums=('be04b9162d62d2567e21402dcbabb5bedfdb03909fa5ec6e8568e02ab325bd8d' 'ecef1e98eaaf207f4f2c3d07cfe13533866e1e774240eb833e8b3bd691ada95f' '220f1b25a64727041dc6fa3fd486b0a043f735a3f6cecedc4e2f7c47ec6ce66d' '2a857061f032ff5485f5c75ab74e6f6532621e08963ef48640a792cca16cacd6' - 'a145dca282ad3a130983493f675a5439dfb88c70da8c44b4bf69a5f006dc8a01') + '4ada85b022f3fa7a39a0b67dce145d1da356665aa1d703005a698029e83e0515' + '7188edbc27382e1c1d29b0c3c7e1711ba407423447f4e135e451cf611aa4cea4' + '45c071c6005c590612f619419acd3685cc12cee2a46b9773b80cdb7aa5c6d1e2' + '5205b3b1d8872bbb421d8fe7518d0316d9c827ef2e2b24cb11440b5ba38d79a6') sha256sums_armv7h=('8d70fb5094f58aad98b601bbc42be354c2014b9fe734a1ee0b1e14bb041cc9cc' '0e771370da68c855bfb4eaad4c2ae137883a474886a049b934dac2e775574cb9' '2f586f72c34150330389854575a21be1d3ef3637c4f94bec2e948c2717a5aecb') @@ -60,13 +66,16 @@ prepare() { # From Arch ARM if [ "${CARCH}" = "armv7h" ]; then - patch -p1 -i $srcdir/0001-Sychronize-filesystem.patch - patch -p1 -i $srcdir/0002-Revert-close-stdin-before-running-install-scripts.patch - patch -p1 -i $srcdir/0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch + patch -p1 -i ../0001-Sychronize-filesystem.patch + patch -p1 -i ../0002-Revert-close-stdin-before-running-install-scripts.patch + patch -p1 -i ../0003-Revert-alpm_run_chroot-always-connect-parent2child-p.patch fi # From Parabola - patch -p1 -i $srcdir/0001-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch + patch -p1 -i ../0001-makepkg-Better-error-messages-for-versions-in-check-.patch + patch -p1 -i ../0002-makepkg-check_pkgrel-Don-t-say-decimal-in-the-error-.patch + patch -p1 -i ../0003-makepkg-check_pkgver-Report-what-the-bad-pkgver-is.patch + patch -p1 -i ../0004-makepkg-Treat-pkgrel-more-similarly-to-pkgver.patch } build() { -- cgit v1.2.3