1VERCMP(8)                        Pacman Manual                       VERCMP(8)
2
3
4

NAME

6       vercmp - version comparison utility
7

SYNOPSIS

9       vercmp [-h] [--help] <version1> <version2>
10

DESCRIPTION

12       vercmp is used to determine the relationship between two given version
13       numbers. It outputs values as follows:
14
15       •   < 0 : if ver1 < ver2
16
17       •   = 0 : if ver1 == ver2
18
19       •   > 0 : if ver1 > ver2
20
21       Version comparison operates as follows:
22
23           Alphanumeric:
24             1.0a < 1.0b < 1.0beta < 1.0p < 1.0pre < 1.0rc < 1.0 < 1.0.a < 1.0.1
25           Numeric:
26             1 < 1.0 < 1.1 < 1.1.1 < 1.2 < 2.0 < 3.0.0
27
28       Additionally, version strings can have an epoch value defined that will
29       overrule any version comparison, unless the epoch values are equal.
30       This is specified in an epoch:version-rel format. For example, 2:1.0-1
31       is always greater than 1:3.6-1.
32
33       Keep in mind that the pkgrel is only compared if it is available on
34       both versions given to this tool. For example, comparing 1.5-1 and 1.5
35       will yield 0; comparing 1.5-1 and 1.5-2 will yield < 0 as expected.
36       This is mainly for supporting versioned dependencies that do not
37       include the pkgrel.
38

OPTIONS

40       -h, --help
41           Display summary of the available return codes. Must be the first
42           option specified.
43

EXAMPLES

45           $ vercmp 1 2
46           -1
47
48           $ vercmp 2 1
49           1
50
51           $ vercmp 2.0-1 1.7-6
52           1
53
54           $ vercmp 2.0 2.0-13
55           0
56
57           $ vercmp 4.34 1:001
58           -1
59

SEE ALSO

61       pacman(8), makepkg(8), libalpm(3)
62
63       See the pacman website at https://archlinux.org/pacman/ for current
64       information on pacman and its related tools.
65

BUGS

67       Bugs? You must be kidding; there are no bugs in this software. But if
68       we happen to be wrong, submit a bug report with as much detail as
69       possible at the Arch Linux Bug Tracker in the Pacman section.
70

AUTHORS

72       Current maintainers:
73
74       •   Allan McRae <allan@archlinux.org>
75
76       •   Andrew Gregory <andrew.gregory.8@gmail.com>
77
78       •   Eli Schwartz <eschwartz@archlinux.org>
79
80       •   Morgan Adamiec <morganamilo@archlinux.org>
81
82       Past major contributors:
83
84       •   Judd Vinet <jvinet@zeroflux.org>
85
86       •   Aurelien Foret <aurelien@archlinux.org>
87
88       •   Aaron Griffin <aaron@archlinux.org>
89
90       •   Dan McGee <dan@archlinux.org>
91
92       •   Xavier Chantry <shiningxc@gmail.com>
93
94       •   Nagy Gabor <ngaba@bibl.u-szeged.hu>
95
96       •   Dave Reisner <dreisner@archlinux.org>
97
98       For additional contributors, use git shortlog -s on the pacman.git
99       repository.
100
101
102
103Pacman 6.0.1                      2022-07-22                         VERCMP(8)
Impressum