diff mbox series

[opkg-utils] opkg-feed: Fix adding feeds with same name as architecture

Message ID 20230517181507.891794-1-petar.koynov@ni.com
State New
Headers show
Series [opkg-utils] opkg-feed: Fix adding feeds with same name as architecture | expand

Commit Message

Petar Koynov May 17, 2023, 6:15 p.m. UTC
Attempting to add feeds with some special names was returning an error:
    "5   The named feed already exists"
    This is because the feed name matched with a configured architecture.
    Add a second grep to feedExists to ignore lines starting with "arch".

Signed-off-by: Petar Koynov <petar.koynov@ni.com>
---
 opkg-feed | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/opkg-feed b/opkg-feed
index 25ef879..98850fa 100755
--- a/opkg-feed
+++ b/opkg-feed
@@ -300,7 +300,7 @@  feedExists()
 	fi
 
 	local feedRegex="$( createFeedLineRegex "$1" )"
-	grep -Eoh "$feedRegex" "${ARGS[confDir]}"/*.conf &>/dev/null
+	grep -Eoh "$feedRegex" "${ARGS[confDir]}"/*.conf | grep -vE "^arch\s" &>/dev/null
 	if [[ "$?" == "$IE_GREP_MATCH" ]] ; then
 		return $S_OK
 	fi