mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-13 01:36:15 +02:00
22 lines
469 B
Perl
22 lines
469 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) {
|
||
|
$archives{$archive} = "$dir/$archive";
|
||
|
}
|
||
|
closedir DIR;
|
||
|
}
|
||
|
|
||
|
readDir "/data/webserver/dist/nix-cache";
|
||
|
readDir "/data/webserver/dist/test";
|
||
|
readDir "/data/webserver/dist/patches";
|
||
|
|
||
|
print STDERR scalar (keys %archives), "\n";
|