From 7e8e0e3d4302a08993371ba9c641c3c4dc8648e7 Mon Sep 17 00:00:00 2001 From: ckunki Date: Thu, 19 Dec 2024 13:58:30 +0100 Subject: [PATCH] Updated script update_apt_package_in_package_list.sh 3 --- scripts/update_apt_package_in_package_list.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/update_apt_package_in_package_list.sh b/scripts/update_apt_package_in_package_list.sh index 3b29d466..5d98d98d 100644 --- a/scripts/update_apt_package_in_package_list.sh +++ b/scripts/update_apt_package_in_package_list.sh @@ -10,13 +10,15 @@ if [ $# == 0 ]; then exit 1 fi -LIST_NEWEST_VERSION_OUTPUT=$1 # Package|Installed|Candidate +# Format of $1: Package|Installed|Candidate +# Set array variable SPEC. +IFS='|' read -ra SPEC <<< "$1" SEARCH_DIRECTORY=${2:-.} REPLACE=${3:-no} -PACKAGE=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 1 -d "|") -CURRENT_VERSION=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 2 -d "|") -CANDIDATE_VERSION=$(echo "$LIST_NEWEST_VERSION_OUTPUT" | cut -f 3 -d "|") +PACKAGE=${SPEC[0]} +CURRENT_VERSION=${SPEC[1]} +CANDIDATE_VERSION=${SPEC[2]} FILES=$(grep -R "^$PACKAGE|$CURRENT_VERSION" "$SEARCH_DIRECTORY" | cut -f 1 -d ":") for FILE in $FILES; do