g++ install is failing because + is treated as a regex control character

This commit is contained in:
jroddev 2022-02-13 16:54:39 +11:00
parent 4d3d45c02f
commit 13d7657f54

View file

@ -28,7 +28,8 @@ echo "done."
echo -n "Verifying packages..." echo -n "Verifying packages..."
for package in $packages; do for package in $packages; do
apt-cache search ^$package$ | grep $package > /dev/null escaped=$(echo $package | sed 's/+/\\+/g')
apt-cache search ^$escaped$ | grep $package > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "aborted." echo "aborted."
echo "Package '$package' not found." >&2 echo "Package '$package' not found." >&2