forked from the-distro/channel-scripts
d6bbc1d9f5
git-svn-id: https://nixos.org/repos/nix/release/trunk/channels@34040 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb
22 lines
519 B
Perl
22 lines
519 B
Perl
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";
|