diff options
author | Remi Collet <remi@remirepo.net> | 2020-11-25 08:29:20 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-11-25 08:29:20 +0100 |
commit | ac9b2488788cba18bc9de7c0202262210fad04a1 (patch) | |
tree | b58bdb36ceeba72a9c003f8cd71c68db90d76feb /cleanoldrpm | |
parent | 7ac16136fa7df1b87dd31332966409a28f860ad3 (diff) |
cleanoldrpm: fix version to compare
Diffstat (limited to 'cleanoldrpm')
-rwxr-xr-x | cleanoldrpm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cleanoldrpm b/cleanoldrpm index 17d659c..e8451b9 100755 --- a/cleanoldrpm +++ b/cleanoldrpm @@ -34,10 +34,14 @@ foreach (glob("*.rpm") as $name) { if (isset($multi[$i])) { $i .= "/" . substr($info['Version'], 0, $multi[$i]); } - $rpms[$i][$info['Version']] = $name; + $ver = $info['Version'] . '-' . $info['Release']; + if (isset($info['Epoch'])) { + $ver = $info['Epoch'] . ':' . $ver; + } + $rpms[$i][$ver] = $name; } -foreach($rpms as $rpm) { +foreach($rpms as $n => $rpm) { if (count($rpm) > $keep) { uksort($rpm, "rpmvercmp"); $i = count($rpm) - $keep; |