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";