From 88e8bef6b42bbd1a831e5c8a37e0567251df83bb Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 24 Jan 2018 13:21:47 +0100 Subject: initial work, only PoC for now --- examples/repomanage.php | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 examples/repomanage.php (limited to 'examples') diff --git a/examples/repomanage.php b/examples/repomanage.php new file mode 100644 index 0000000..8428118 --- /dev/null +++ b/examples/repomanage.php @@ -0,0 +1,74 @@ +#!/usr/bin/php + $tab[0], + 'path' => $tab[5], + 'evr' => "${tab[1]}:${tab[2]}-${tab[3]}", + ]; + } else { + echo "Ignore $line\n"; + } +} +foreach($tree as $arch => $subtree) { + foreach ($subtree as $name => $versions) { + if (count($versions) > $keep) { + if ($old) { + usort($versions, function($a, $b) { return -rpmvercmp($a['evr'], $b['evr']);} ); + } else { + usort($versions, function($a, $b) { return rpmvercmp($a['evr'], $b['evr']);} ); + } + for ($i = $keep ; $i < count($versions) ; $i++) { + echo $versions[$i]['path'] . "\n"; + } + } + } +} + -- cgit