summary refs log tree commit diff
path: root/scripts/maintenance/readcache.pm
blob: f6beeeeb46d0f084cdb0c31b193a9460902f9497 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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) {
        $archives{$archive} = "$dir/$archive";
    }
    closedir DIR;
}

readDir "/data/webserver/dist/nix-cache";
readDir "/data/webserver/dist/test-cache";
readDir "/data/webserver/dist/patches";

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