[pacman-dev] about vercmp tools
mcu GPS
zlbgps at gmail.com
Mon Oct 19 00:08:30 EDT 2009
thanks
runtest 1.0rc 1.0 -1
2009/10/19 Dan McGee <dpmcgee at gmail.com>
> On Sun, Oct 18, 2009 at 10:17 PM, mcu GPS <zlbgps at gmail.com> wrote:
> > usage: vercmp <ver1> <ver2>
> >
> > return values:
> > < 0 : if ver1 < ver2
> > 0 : if ver1 == ver2
> > > 0 : if ver1 > ver2
> > [arch at myarchtp mkarchlive] $ vercmp 0.1 0.1_rc1
> > -1
> > [arch at myarchtp mkarchlive] $ vercmp 0.1_rc1 0.1
> > 1
> > [arch at myarchtp mkarchlive] $ vercmp 0.1_rc1 0.1_r1
> > 1
> > [arch at myarchtp mkarchlive] $ vercmp 0.1_r1 0.1_rc1
> > -1
> >
> >
> > 0.1_rc1 > 0.1 ?
> > 0.1_rc1 > 0.1_r1 ?
> >
> > this is a bug?
>
> No, it isn't a bug. For every example and corner case you try to fix,
> you will break two more. The rules are quite simple- split on dots
> ".", and then compare numerically if possible, followed by
> alphabetically. We don't deal with shitty versioning schemes because
> there is no universal way to do so.
>
> See pactest/vercmptest.sh for some examples of what vercmp does support.
>
> -Dan
>
>
More information about the pacman-dev
mailing list