From 43fa1c20e7e98819925b16d60d6b7c9e87c93fca Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 22 Feb 2006 14:35:19 +0000 Subject: * Separate the cache reading code. --- scripts/maintenance/readcache.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 scripts/maintenance/readcache.pm (limited to 'scripts/maintenance/readcache.pm') diff --git a/scripts/maintenance/readcache.pm b/scripts/maintenance/readcache.pm new file mode 100644 index 000000000000..c0657913eafc --- /dev/null +++ b/scripts/maintenance/readcache.pm @@ -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"; -- cgit 1.4.1