From c4ba6882948e2f683d587057f6c8cfa2b04e24ef Mon Sep 17 00:00:00 2001 From: Devin Teske Date: Wed, 27 Jan 2016 00:09:53 +0000 Subject: [PATCH] Fix ABI parsing --- usr.sbin/bsdconfig/share/packages/musthavepkg.subr | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsdconfig/share/packages/musthavepkg.subr b/usr.sbin/bsdconfig/share/packages/musthavepkg.subr index 929823e4f21e..b336d26d9c2e 100644 --- a/usr.sbin/bsdconfig/share/packages/musthavepkg.subr +++ b/usr.sbin/bsdconfig/share/packages/musthavepkg.subr @@ -1,6 +1,6 @@ if [ ! "$_PACKAGES_MUSTHAVEPKG_SUBR" ]; then _PACKAGES_MUSTHAVEPKG_SUBR=1 # -# Copyright (c) 2014 Devin Teske +# Copyright (c) 2014-2016 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -45,7 +45,11 @@ f_include $BSDCFG_SHARE/mustberoot.subr f_musthavepkg_init() { local funcname=f_musthavepkg_init - local pkg_abi_awk='$1~/^ABI/{print $NF; exit}' + local pkg_abi_awk=' # BEGIN-AWK + $1 ~ /^ABI/ && $0 = $NF, sub(/^"/, "") && sub(/".*/, "") { + print; found = 1; exit + } END { exit ! found } + ' # END-AWK if [ "$PKG_ABI" ]; then # Already set f_dprintf "PKG_ABI=[%s]" "$PKG_ABI"