From e647c20e9f387b250469cda2b515cf767d2955a8 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 18 May 2026 10:21:56 +0200 Subject: refactor: extract update_checksums, apply version/md5 on --new --new with -v now sets version and recalculates md5sums via shared update_checksums function. Previously -n ignored VERSION entirely. --- mkhint | 53 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'mkhint') diff --git a/mkhint b/mkhint index aefc3a0..9d307f5 100755 --- a/mkhint +++ b/mkhint @@ -156,7 +156,7 @@ create_new_hint_file() { # Check if file exists if [[ ! -f "$normalized_file" ]]; then - # the hint file we want to create doesn't exists, so we can check + # the hint file we want to create doesn't exists, so we can check # the sbo repository for a .info file and use that as hint if [[ -n $info ]]; then cp $info $normalized_file @@ -174,6 +174,13 @@ create_new_hint_file() { echo 'ARCH="x86_64"' >> $normalized_file fi + if [[ -n "$VERSION" ]]; then + local old_version + old_version=$(grep '^VERSION=' "$normalized_file" | sed 's/VERSION="//;s/"$//') + sed -i "s/${old_version}/${VERSION}/g" "$normalized_file" + update_checksums "$normalized_file" + fi + if [[ $NO_DL -eq 1 ]]; then add_nodownload "$normalized_file" fi @@ -187,7 +194,7 @@ create_new_hint_file() { echo "Backed up to: ${normalized_file}.bak" >&2 # Create new hint file with empty variables cat > "$normalized_file" <