Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex used by grep to determine version fails because it's not BRE #2777

Open
Gumnos opened this issue Jan 8, 2025 · 0 comments
Open

Regex used by grep to determine version fails because it's not BRE #2777

Gumnos opened this issue Jan 8, 2025 · 0 comments

Comments

@Gumnos
Copy link

Gumnos commented Jan 8, 2025

The configure.ac file tests the version using non-BRE (Basic Regular Expression) \+ tokens, causing it not to match with OpenBSD's grep. Extracting the relevant log output during the cargo build execution:

5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7 does not match <major>.<minor>.<bugfix>-<nrev>-g<gid> or VERSION                                                                                          

The grep needs to use actual BRE (just using the * and doubling up the previous atom to require one or more):

echo "${with_version}" | grep '^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*-[0-9][0-9]*-g[0-9a-f][0-9a-f]*$'

or (possibly less-portably) you could use -E for Extended Regular Expressions and just + (not \+) such as

echo "${with_version}" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-[0-9]+-g[0-9a-f]+$'

Originally filed as tikv/jemallocator#112 which caused problems attempting to build yazi but was told to file it here, so here it is ☺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant