about summary refs log blame commit diff
path: root/scripts/maintenance/readcache.pm
blob: 9addf02aa9004f108cdd770c6aacc193ac139c86 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                         
                                                                                                       




                                              

                                 

                                           
package readcache;
use strict;

# Read the archive directories.
our %archives;

sub readDir {
    my $dir = shift;
    opendir(DIR, "$dir") or die "cannot open `$dir': $!";
    my @as = readdir DIR;
    foreach my $archive (@as) {
        next unless $archive =~ /^sha256_/ || $archive =~ /\.nar-bsdiff$/ || $archive =~ /\.nar\.bz2$/;
        $archives{$archive} = "$dir/$archive";
    }
    closedir DIR;
}

readDir "/data/releases/nars";
readDir "/data/releases/patches";

print STDERR scalar (keys %archives), "\n";