From 13d7657f54a7adb371577bea52e00d8e92f9a78a Mon Sep 17 00:00:00 2001 From: jroddev Date: Sun, 13 Feb 2022 16:54:39 +1100 Subject: [PATCH] g++ install is failing because + is treated as a regex control character --- pre_cache_action.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pre_cache_action.sh b/pre_cache_action.sh index 51a5b78..c4f764b 100755 --- a/pre_cache_action.sh +++ b/pre_cache_action.sh @@ -28,7 +28,8 @@ echo "done." echo -n "Verifying packages..." 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 echo "aborted." echo "Package '$package' not found." >&2