Skip to content

Fix installing latest extra-packages#280

Merged
deathaxe merged 1 commit intomasterfrom
fix/extra-packages
Feb 4, 2026
Merged

Fix installing latest extra-packages#280
deathaxe merged 1 commit intomasterfrom
fix/extra-packages

Conversation

@deathaxe
Copy link
Member

@deathaxe deathaxe commented Feb 4, 2026

Fixes #279

This commit...

  1. strips tag prefix from listed remote tags before sorting and re-adds it to resulting tag in order to make sort ... work as expected.
  2. raises error 2 if no tag was found.

This commit strips tag prefix before sorting semver tags
and re-adds it to result.
@deathaxe deathaxe merged commit 9b5c688 into master Feb 4, 2026
15 checks passed
@deathaxe deathaxe deleted the fix/extra-packages branch February 4, 2026 17:20
Comment on lines +13 to +22
# find latest ref matching prefix
local ref=$(
echo "$refs" \
| sed -E -n "s%.*refs/tags/${prefix-v?}([0-9]+\.[0-9]+\.[0-9]+)\$%\1%p" \
| grep -v '\^{}$' \
| sort -t. -k1,1nr -k2,2nr -k3,3nr \
| head -n1
)
if [ -n "$ref" ]; then
echo "$prefix$ref"
Copy link
Member

@rchl rchl Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one case it doesn't handle is when no prefix is provided but tags start with v. Then $prefix will be an empty string and v won't be part of returned ref.

Copy link
Member

@rchl rchl Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it seems like ${prefix-v?} will only fall back to v? when it's not set which I believe will never be true in this case. It doesn't fall back when $prefix is empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getting latest tag in extra-packages not working correctly

2 participants