zsh-users
 help / color / mirror / code / Atom feed
* possible 'is-at-least' bug?
@ 2015-12-04 23:45 TJ Luoma
  2015-12-05  6:29 ` Benjamin R. Haskell
  0 siblings, 1 reply; 6+ messages in thread
From: TJ Luoma @ 2015-12-04 23:45 UTC (permalink / raw)
  To: Zsh-Users List

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

Thanks to a recent tip from the list, I've started using 'is-at-least' to
compare version numbers.

However, I seem to have found a situation/edge case where it does not seem
to work.

I am trying to compare version numbers of software, in this case ImageOptim
for the Mac.

The version I have installed is '1.6.1a1' where the 'a' is for 'alpha'

There is a newer version '1.6.1b2' where the 'b' is for 'beta'

##

LATEST_VERSION='1.6.1b2'

INSTALLED_VERSION='1.6.1a1'

autoload is-at-least

is-at-least "$LATEST_VERSION" "$INSTALLED_VERSION"

if [ "$?" = "0" ]
then
echo "Up-To-Date (Installed = $INSTALLED_VERSION vs Latest =
$LATEST_VERSION)"
else
echo "Outdated (Installed = $INSTALLED_VERSION vs Latest = $LATEST_VERSION)"
fi

exit 0
##

That test results in "Up-To-Date (Installed = 1.6.1a1 vs Latest = 1.6.1b2)"

TjL

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-12-12  5:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-04 23:45 possible 'is-at-least' bug? TJ Luoma
2015-12-05  6:29 ` Benjamin R. Haskell
2015-12-07 10:25   ` Vincent Lefevre
2015-12-10  0:01     ` Bart Schaefer
2015-12-11 11:22       ` Vincent Lefevre
2015-12-12  5:29         ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).