tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: AWK regexps in pkgsrc/mk

On Wed, 12 Jun 2024 at 11:33:03 +0000, Saulius Krasuckas wrote:
I tried to see if using mawk from Debian breaks the builds as reported in [1]:

	# Debian/Ubuntu's awk is mawk, and mawk does not understand
	# some regexps used in pkgsrc/mk.
	if [ -f /etc/debian_version ]; then

... in my preparation to return to GitHub issue #132 [2].
For that I instructed the bootstrap to use native mawk:

But pkgsrc bootstrapped OK, and build the archivers/bsdtar successfully.

What is the quickest way to test all regexps used in pkgsrc/mk, please, so I can see what breaks?

I'm not sure there is a "quick" (read "simple") way to do that.
awk use includes things that mostly developers would only care about.

The specific context about that choice is explained in the commit that
added it:

On Debian/Ubuntu Linux, system's awk is mawk, and mawk does not
understand some regexp like [[:space:]].
ELF shared lib check is not working properly with mawk.

That refers to code in mk/check/check-shlibs-elf.awk. In order to test
those expressions, you'd need to set PKG_DEVELOPER=yes in your mk.conf
and then try building packages that provide ELF shared libraries.
(There are other places where that same regexp is used.) Or you could
extract a snippet and run it in isolation, of course.

If you want to test awk use in general, then there's more to it. It's
used to generate PLIST entries, for example. Some of that developers
would only normally use, e.g., its purpose in lang/erlang.
(PRINT_PLIST_AWK appears in various places.)



Home | Main Index | Thread Index | Old Index