From ee69eb1e45eed739ab606e975d9e166abecf5c46 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:10:45 -0500 Subject: [PATCH] api: `remove_repofile_if_unused` remove single space requirement after field colon it is convention to follow a field separator colon by a space and then the package name but the specification allows for no space or any number of spaces or tab characters --- api | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api b/api index 7c73d526a95..3a20afdbaf4 100755 --- a/api +++ b/api @@ -283,9 +283,9 @@ remove_repofile_if_unused() { #Given a sources.list.d file, delete it if nothing # determine what uri, suite, and components are in a file #each stanza can only have one matching section. if there are multiple matches the last one is used #case should be ignored for fields - local uri="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^URIs: ' | sed 's/URIs: //Ig' | tail -1)" - local suites="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^Suites: ' | sed 's/Suites: //Ig' | tail -1)" - local components="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^Components: ' | sed 's/Components: //Ig' | tail -1)" + local uri="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^URIs:' | sed 's/URIs://Ig' | awk '{print $1}' | tail -1)" + local suites="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^Suites:' | sed 's/Suites://Ig' | awk '{print $1}' | tail -1)" + local components="$(sed -n "$line_start","$line_end"p "$file" | grep -v '^#' | grep -i '^Components:' | sed 's/Components://Ig' | awk '{print $1}' | tail -1)" local IFS=' ' for suite in $suites ;do if [ -z "$components" ]; then