Code: Select all
match($2,/^(.*[^:digit:])([:digit:]*$|$)/,pkg_split)
but for some inexplicable reason it appears to be matching 'g' as a numeric digit even though the docs say the following:
https://www.gnu.org/software/gawk/manua ... xpressionsA character class is only valid in a regexp inside the brackets of a bracket expression. Character classes consist of ‘[:’, a keyword denoting the class, and ‘:]’. Table 3.1 lists the character classes defined by the POSIX standard.
....
[:digit:] Numeric characters
Here is my debugging output which shows the awk program:
Code: Select all
++ cat /var/packages/repo/Packages-devuan-ascii-non-free
++ awk ' BEGIN{FS="|"}
{
match($2,/^(.*[^:digit:])([:digit:]*$|$)/,pkg_split)
if ( pkg_split[1] == "libc" ) {
print
}
}'
+ awk_result='libcg_3.1.0013-2+b1|libcg|3.1.0013-2+b1||BuildingBlock|11609K|pool/DEBIAN/non-free/n/nvidia-cg-toolkit|libcg_3.1.0013-2+b1_i386.deb|+libc6&ge2.3.6-6|Nvidia Cg core runtime library|devuan|ascii|'
+ '[' '!' -z 'libcg_3.1.0013-2+b1|libcg|3.1.0013-2+b1||BuildingBlock|11609K|pool/DEBIAN/non-free/n/nvidia-cg-toolkit|libcg_3.1.0013-2+b1_i386.deb|+libc6&ge2.3.6-6|Nvidia Cg core runtime library|devuan|ascii|' ']'
Code: Select all
bash -x /usr/sbin/pkg-list-alias libc 2>&1 | tee pkg_list_alias.log
https://pastebin.com/Yb7gNV2r
which is an updated version of a script which I discussed at:
http://murga-linux.com/puppy/viewtopic. ... 47#1037047
Here is the line of code which calls the AWK program:
Code: Select all
awk_result="$(cat $aRepoDB | awk "$AWK_PRG")"