Conversation
|
this is an alternative fix for #869 that possibly addresses the fundamental issue a little better. i think it might still be worth having a way to skip this mechanism in any case. |
dpkg --compare-versions is debian-specific, but we're already debian-specific here.
15b6934 to
0a7329d
Compare
|
i will note that the conflict here was due to a rewrite of that version comparison to this function: version_gt() (
set +x
yy_a="$(echo "$1" | cut -d'.' -f1)"
yy_b="$(echo "$2" | cut -d'.' -f1)"
if [ "$yy_a" -lt "$yy_b" ]; then
return 1
fi
if [ "$yy_a" -gt "$yy_b" ]; then
return 0
fi
mm_a="$(echo "$1" | cut -d'.' -f2)"
mm_b="$(echo "$2" | cut -d'.' -f2)"
mm_a="${mm_a#0}"
mm_b="${mm_b#0}"
if [ "${mm_a:-0}" -lt "${mm_b:-0}" ]; then
return 1
fi
if [ "${mm_a:-0}" -gt "${mm_b:-0}" ]; then
return 0
fi
bb_a="$(echo "$1" | cut -d'.' -f3)"
bb_b="$(echo "$2" | cut -d'.' -f3)"
bb_a="${bb_a#0}"
bb_b="${bb_b#0}"
if [ "${bb_a:-0}" -lt "${bb_b:-0}" ]; then
return 1
fi
if [ "${bb_a:-0}" -gt "${bb_b:-0}" ]; then
return 0
fi
return 1
)which... i mean. i am having a hard time putting this nicely, but let's just say this could be slightly more readable and less buggy, to say the least. that function is 35 lines long, compared to my one-line patch, and doesn't actually work for debian versions: so i've rebased this and urge maintainers here to take another look at this merge request instead of reinventing the wheel like this. i haven't actually ripped out |
dpkg --compare-versions is debian-specific, but we're already debian-specific here.
Closes: #869