Skip to content

Commit

Permalink
Updated script update_apt_package_in_package_list.sh 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Dec 19, 2024
1 parent eeed56f commit 7e8e0e3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/update_apt_package_in_package_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e8e0e3

Please sign in to comment.