Subject: mawk-as-awk considered harmful for PLIST
To: None <>
From: Hubert Feyrer <>
List: tech-pkg
Date: 04/14/2006 03:18:24
On a Debian Linux system, I had pkgsrc/databases/db4 install with an empty 
PLIST, after printing an error (but not aborting...) during installation:

 	awk: run time error: regular expression compile failed (missing operand)
 	^@dirrm ()$
 	        FILENAME="-" FNR=1 NR=1

The problem can be tracked down to the system's "awk", which is actually 
"mawk". In pkgsrc/mk/plist/plist-info.awk, IGNORE_INFO_REGEXP can get set 
to "()" which then gets used to match as regular expression. This works 
fine with NetBSD's nawk and gawk, but not mawk:

 	miyu% echo "@dirrm xxx" | awk '/^@dirrm ()/{print}'
 	@dirrm xxx
 	miyu% echo "@dirrm xxx" | gawk '/^@dirrm ()/{print}'
 	@dirrm xxx
 	miyu% echo "@dirrm xxx" | mawk '/^@dirrm ()/{print}'
 	mawk: line 1: regular expression compile failed (missing operand)
 	^@dirrm ()

A fix was to nuke mawk and replace it with something working.

I'm not sure if there's an easy workaround/check to fix or prevent this, 
but I thought I'd still mention it.

  - Hubert