diff options
| author | Danilo M. <danix@danix.xyz> | 2026-07-07 10:49:22 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-07-07 10:49:22 +0200 |
| commit | 4840c4f8a744ad6a7d296ecf87b84a10b8f4ce0c (patch) | |
| tree | fd8076d0c8740bf25a9b6435410b3706407c5d88 /mkhint | |
| parent | 0c588523a5c5afd6b28e36e14e9ca2c166d61097 (diff) | |
| download | mkhintfile-4840c4f8a744ad6a7d296ecf87b84a10b8f4ce0c.tar.gz mkhintfile-4840c4f8a744ad6a7d296ecf87b84a10b8f4ce0c.zip | |
fix: bump dash-form dated URLs on version changev1.1.3
--hintfile -V and --new -V only substituted the packaged underscore form
of the old version, so download URLs using the upstream dash form (dates
like 2026-07-07, tags) kept pointing at the old tarball and their md5
went stale. Now both the underscore and dash variants of old->new are
rewritten. exploitdb was the trigger case.
Tests T74 (--hintfile) and T75 (--new) cover the dashed-URL bump.
Release v1.1.3.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'mkhint')
| -rwxr-xr-x | mkhint | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -39,7 +39,7 @@ if [[ ! -d $TMP_DIR ]]; then mkdir $TMP_DIR fi -readonly MKHINT_VERSION="1.1.2" +readonly MKHINT_VERSION="1.1.3" # Variables VERSION="" @@ -463,7 +463,11 @@ create_new_hint_file() { if [[ -n "$VERSION" ]]; then local old_version old_version=$(grep '^VERSION=' "$normalized_file" | sed 's/VERSION="//;s/"$//') + # bump both '_' and '-' variants (see update_hint_file note) sed -i "s/${old_version}/${VERSION}/g" "$normalized_file" + if [[ "$old_version" == *_* || "$VERSION" == *_* ]]; then + sed -i "s/${old_version//_/-}/${VERSION//_/-}/g" "$normalized_file" + fi update_checksums "$normalized_file" fi @@ -792,8 +796,14 @@ update_hint_file() { # Extract current version from hint file old_version=$(grep '^VERSION=' "$normalized_file" | sed 's/VERSION="//;s/"$//') - # Use sed for global replacement of OLD_VERSION in all variables + # Use sed for global replacement of OLD_VERSION in all variables. + # SlackBuild VERSION uses '_' but download URLs often carry the upstream + # '-' form (dates like 2026-07-07, tags), so bump both variants — otherwise + # a dated URL keeps pointing at the old tarball and its md5 goes stale. sed -i "s/${old_version}/${new_version}/g" "$normalized_file" + if [[ "$old_version" == *_* || "$new_version" == *_* ]]; then + sed -i "s/${old_version//_/-}/${new_version//_/-}/g" "$normalized_file" + fi update_checksums "$normalized_file" |
