mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-01-17 23:34:07 +00:00
scripts/find-oldest-pkgs.pl to find the packages that were built the longest ago to facilitate rebuilding of older binaries
This commit is contained in:
parent
51cb35c7d0
commit
74c07418e1
1 changed files with 56 additions and 0 deletions
56
scripts/find-oldest-pkgs.pl
Normal file
56
scripts/find-oldest-pkgs.pl
Normal file
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
|
||||
use File::Find;
|
||||
use POSIX;
|
||||
|
||||
|
||||
|
||||
my @dirs = qw(arm armv6h armv7h);
|
||||
my @files = ();
|
||||
my @unfails = ();
|
||||
my %packages;
|
||||
|
||||
|
||||
|
||||
foreach my $arch (@dirs){
|
||||
find(\&pushFile, "/var/www/archlinuxarm/html/$arch");
|
||||
}
|
||||
|
||||
|
||||
foreach (@files){
|
||||
my $filename = $_;
|
||||
my @parts = split('/', $_);
|
||||
my $package = $parts[-1];
|
||||
#break the package name down to it's base part...this is probably missing a few, but it's quick and dirty for now.
|
||||
$package =~ s/-\d.*-\d{1,2}-(any|arm|armv6h|armv7h)\.pkg\.tar\.xz//;
|
||||
my @temparray = ($parts[5], $package, $filename);
|
||||
$packages{(((stat($filename))[9]))} = \@temparray;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
my $counter = 0;
|
||||
|
||||
foreach my $key (sort keys %packages){
|
||||
$counter++;
|
||||
if ($counter > 10){
|
||||
last;
|
||||
}
|
||||
|
||||
if (${$packages{$key}}[0] eq "arm"){
|
||||
print "!unfail 5 ". ${$packages{$key}}[1];
|
||||
}
|
||||
elsif (${$packages{$key}}[0] eq "armv6h"){
|
||||
print "!unfail 6 ". ${$packages{$key}}[1];
|
||||
}
|
||||
elsif (${$packages{$key}}[0] eq "armv7h"){
|
||||
print "!unfail 7 ". ${$packages{$key}}[1];
|
||||
}
|
||||
}
|
||||
|
||||
sub pushFile()
|
||||
{
|
||||
push @files, $File::Find::name if(/\.pkg\.tar\.xz/i);
|
||||
}
|
Loading…
Reference in a new issue