# HG changeset patch # User Franz Glasner # Date 1670373459 -3600 # Node ID 9b388927b12b662da8a8ffae175a0b4feafc2367 # Parent 673505e96cea30ac739f9eaabad0b17bc5e8ec80 FIX: Use BREs with grep because is handles "+" characters in package names properly. Otherwise a package like "lucene++" given an error: egrep: repetition-operator operand invalid diff -r 673505e96cea -r 9b388927b12b sbin/check-ports --- a/sbin/check-ports Mon Dec 05 16:01:54 2022 +0100 +++ b/sbin/check-ports Wed Dec 07 01:37:39 2022 +0100 @@ -161,7 +161,12 @@ # "grep" does a fast pre-selection, reading, parsing and comparing is done for # exact matching. # - _lines=$(egrep '^'"${_package}" "${_indexdir}/${_indexfile}") + # Use BREs because a `+' char needs to be handled as an ordinary + # character (e.g. for the "lucene++" package). + # Note that `^' at the start of an RE is not an ordinary + # character. See re_format(7). + # + _lines=$(/usr/bin/grep -G '^'"${_package}" "${_indexdir}/${_indexfile}") while read _line ; do _fqpn="${_line%%|*}" _n=${_fqpn%-*}