From b40a557d22ddee09ecde1dd173d7055c671e0a2a Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Wed, 26 Feb 2025 09:12:50 +0100 Subject: [PATCH] MT#61101 ec2-create-ce: fix disabling backports repository Followup fix for commit 5e6c5363a1b499843c8aef2f781b9721e1bb7978 grep interprets the provided argument `-backports` as option. We need to mark the end of the grep options accordingly via "--", to avoid failure during grep execution. Change-Id: I6f0360a34583b2d0e961d282be16b3f6e90445a2 --- ec2-create-ce | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec2-create-ce b/ec2-create-ce index 1a70e02..43fcb37 100755 --- a/ec2-create-ce +++ b/ec2-create-ce @@ -454,7 +454,7 @@ if [ -f /etc/apt/sources.list.d/backports.list ] && grep -q 'jessie-backports' / fi # workaround for mr13.2.1 and newer with bookworm-backports enabled by default: -if [ -f /etc/apt/sources.list.d/debian.sources ] && grep -q '-backports' /etc/apt/sources.list.d/debian.sources ; then +if [ -f /etc/apt/sources.list.d/debian.sources ] && grep -q -- '-backports' /etc/apt/sources.list.d/debian.sources ; then echo "backports is unexpected, disabling from /etc/apt/sources.list.d/debian.sources" sed -i -E 's/ [a-z]+-backports//' /etc/apt/sources.list.d/debian.sources fi