summaryrefslogtreecommitdiffstats
path: root/examples/rpmvercmp.php
blob: de2acae31cf43d3ea5d3642c8927a7f713692a69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/php
<?php

extension_loaded("rpminfo") or die("rpminfo extension missing");

if ($_SERVER['argc'] < 3) {
	die("usage rpmvercmp  evr1 evr2 [ evr3 ... ]\n");
}

$vers = $_SERVER['argv'];
unset($vers[0]);
usort($vers, 'rpmvercmp');
echo implode(' < ', $vers) . "\n";