mirror of
https://github.com/NixOS/nix
synced 2025-06-29 06:21:14 +02:00
* Separate the cache reading code.
This commit is contained in:
parent
928cce5922
commit
43fa1c20e7
2 changed files with 28 additions and 25 deletions
21
scripts/maintenance/readcache.pm
Normal file
21
scripts/maintenance/readcache.pm
Normal file
|
@ -0,0 +1,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";
|
||||
readDir "/data/webserver/dist/patches";
|
||||
|
||||
print STDERR scalar (keys %archives), "\n";
|
Loading…
Add table
Add a link
Reference in a new issue