xbps-src: explicitly disallow pattern on build deps
It is not possible to use version other than currently in template.
Specifying pattern breaks build if dependency isn't in binary repo already. That it worked when in repo was a coincidence.
Testing the changes
- I tested the changes in this PR: YES
what about the exact version case? (foo-1.2_3)
it isn't as easy to tell what is an exact version, and calling xbps-uhelper is costly
Closes #37837
openocd seems to be the only package that currently uses a version restriction in build depends
Moved version restriction of openocd on jimtcl to depends.
I think this check should go into setup_pkg in common/xbps-src/shutils/common.sh, this is where we do basic validation on input variables. I would also use pattern matching, either case statement or just [[ matching.
for x in "foo>=1" "bar<2" "fizz" "foo-bar-1.0_1" "font-adobe-100dpi-1.8_blah" "cross-x86_64-linux-musl-libc" "perl-PerlIO-utf8-strict-0.008_1" "perl-PerlIO-utf8-strict"; do
if [[ $x = *[\>\<]* || $x =~ -[^-]+_[0-9]+$ ]]; then
echo $x
fi
done
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
Pull Requests become stale 90 days after last activity and are closed 14 days after that. If this pull request is still relevant bump it or assign it.
@Duncaen: ok, modified regex to match xbps-uhelper getpkgname.
This pattern is more restrictive than the xbps implementation, the only requirement is that revision is numeric not that the version starts with a digit.
Version has to contain digit, see commit message.
ah right, this is so stupid this shouldn't have been implemented and i hate it, but it is what it is...
Maybe we can just add = as alternative pkgver separator in xbps and slowly migrate over to use that as a more sane choice instead of a character that is used in half the packages names already.
+1, i think = makes a lot of sense as a version specifier