nix-super/scripts/maintenance/readcache.pm

22 lines
519 B
Perl
Raw Normal View History

2006-02-22 16:35:19 +02:00
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) {
2011-08-27 19:59:32 +03:00
next unless $archive =~ /^sha256_/ || $archive =~ /\.nar-bsdiff$/ || $archive =~ /\.nar\.bz2$/;
2006-02-22 16:35:19 +02:00
$archives{$archive} = "$dir/$archive";
}
closedir DIR;
}
2011-08-27 19:59:32 +03:00
readDir "/data/releases/nars";
readDir "/data/releases/patches";
2006-02-22 16:35:19 +02:00
print STDERR scalar (keys %archives), "\n";