summaryrefslogtreecommitdiffstats
path: root/cleanoldrpm
diff options
context:
space:
mode:
Diffstat (limited to 'cleanoldrpm')
-rwxr-xr-xcleanoldrpm8
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;