update-alternatives: correctly match priority
PATCH 1/1 update-alternatives: correctly match priority
It should always be at the end of string, otherwise something like "/usr/bin/python3.9-config 123" will erroneously match against priority 9.
Signed-off-by Alexander Kanavin <[email protected]>
--- update-alternatives | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
update-alternatives +1 -1
@@ -94,7 +94,7 @@ add_alt() { local path="$2" local priority="$3" remove_alt $name $path - if grep -qw "$priority" $ad/$name; then + if grep -qw "$priority"$ $ad/$name; then echo "Warn: update-alternatives: $name has multiple providers with the same priority, please check $ad/$name for details" fi echo "$path $priority" >> $ad/$name
Signature · 1 line
2.28.0