diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-05-08T19·43-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-05-08T19·43-0400 |
commit | 0c4c8f7a9d09c497d95771c894a5cc3d4276609b (patch) | |
tree | 69f34fb0eda2401a9f477ae97994d8248b0ef267 /scripts/maintenance | |
parent | afa7b8a479e48c5642a796563a615314c0261a1a (diff) |
Remove obsolete files (moved to release tree)
Diffstat (limited to 'scripts/maintenance')
-rw-r--r-- | scripts/maintenance/gc-commands | 2 | ||||
-rwxr-xr-x | scripts/maintenance/gc-releases.pl | 58 | ||||
-rw-r--r-- | scripts/maintenance/readcache.pm | 21 | ||||
-rwxr-xr-x | scripts/maintenance/shrink-manifest.pl | 76 |
4 files changed, 0 insertions, 157 deletions
diff --git a/scripts/maintenance/gc-commands b/scripts/maintenance/gc-commands deleted file mode 100644 index 3d548da19a2d..000000000000 --- a/scripts/maintenance/gc-commands +++ /dev/null @@ -1,2 +0,0 @@ -./gc-releases.pl /data/releases/patches/all-patches $(find /data/releases -name MANIFEST) | sort > dead -cat dead | xargs -d '\n' sh -c 'find "$@" -mtime +100 -print' | xargs -d '\n' mv -v --target-directory=/data/releases/trash/ diff --git a/scripts/maintenance/gc-releases.pl b/scripts/maintenance/gc-releases.pl deleted file mode 100755 index b1e41a97c04f..000000000000 --- a/scripts/maintenance/gc-releases.pl +++ /dev/null @@ -1,58 +0,0 @@ -#! /var/run/current-system/sw/bin/perl -w -I. -I.. - -use strict; -use NixManifest; -use readcache; -use File::Basename; - - -# Read the manifests. -my %narFiles; -my %patches; - -foreach my $manifest (@ARGV) { - print STDERR "loading $manifest\n"; - if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) { -# die "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n"; - } -} - - -# Find the live archives. -my %usedFiles; - -foreach my $narFile (keys %narFiles) { - foreach my $file (@{$narFiles{$narFile}}) { - $file->{url} =~ /\/([^\/]+)$/; - my $basename = $1; - die unless defined $basename; -# print $basename, "\n"; - $usedFiles{$basename} = 1; - print STDERR "missing archive `$basename'\n" - unless defined $readcache::archives{$basename}; - } -} - -foreach my $patch (keys %patches) { - foreach my $file (@{$patches{$patch}}) { - $file->{url} =~ /\/([^\/]+)$/; - my $basename = $1; - die unless defined $basename; -# print $basename, "\n"; - $usedFiles{$basename} = 1; - die "missing archive `$basename'" - unless defined $readcache::archives{$basename}; - } -} - - -# Print out the dead archives. -foreach my $archive (keys %readcache::archives) { - next if $archive eq "." || $archive eq ".."; - if (!defined $usedFiles{$archive}) { - my $file = $readcache::archives{$archive}; - print "$file\n"; - my $hashFile = dirname($file) . "/.hash." . basename($file); - print "$hashFile\n" if -e $hashFile; - } -} diff --git a/scripts/maintenance/readcache.pm b/scripts/maintenance/readcache.pm deleted file mode 100644 index 9addf02aa900..000000000000 --- a/scripts/maintenance/readcache.pm +++ /dev/null @@ -1,21 +0,0 @@ -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"; diff --git a/scripts/maintenance/shrink-manifest.pl b/scripts/maintenance/shrink-manifest.pl deleted file mode 100755 index 60cf9c5b46a0..000000000000 --- a/scripts/maintenance/shrink-manifest.pl +++ /dev/null @@ -1,76 +0,0 @@ -#! /usr/bin/perl -w -I. -I.. - -use strict; -use readmanifest; -use readcache; - - -my %allNarFiles; -my %allLocalPaths; -my %allPatches; - -foreach my $manifest (glob "/data/webserver/dist/*/*/MANIFEST") { - print STDERR "loading $manifest\n"; - readManifest($manifest, \%allNarFiles, \%allLocalPaths, \%allPatches, 1); -} - - - -foreach my $manifest (@ARGV) { - - print STDERR "shrinking manifest $manifest...\n"; - - my %narFiles; - my %patches; - - if (readManifest($manifest, \%narFiles, \%patches, 1) < 3) { - print STDERR "manifest `$manifest' is too old (i.e., for Nix <= 0.7)\n"; - next; - } - - my %done; - - sub traverse { - my $p = shift; - my $prefix = shift; - print "$prefix$p\n"; - - my $reachesNAR = 0; - - foreach my $patch (@{$patches{$p}}) { - next if defined $done{$patch->{url}}; - $done{$patch->{url}} = 1; - $reachesNAR = 1 if traverse ($patch->{basePath}, $prefix . " "); - } - - $reachesNAR = 1 if defined $allNarFiles{$p}; - - print " $prefix$reachesNAR\n"; - return $reachesNAR; - } - -# foreach my $p (keys %narFiles) { -# traverse ($p, ""); -# } - - my %newPatches; - - foreach my $p (keys %patches) { - my $patchList = $patches{$p}; - my @newList; - foreach my $patch (@{$patchList}) { - if (! defined $allNarFiles{$patch->{basePath}} || - ! defined $allNarFiles{$p} ) - { -# print "REMOVING PATCH ", $patch->{basePath}, " -> ", $p, "\n"; - } else { -# print "KEEPING PATCH ", $patch->{basePath}, " -> ", $p, "\n"; - push @newList, $patch; - } - } - $newPatches{$p} = \@newList; - } - - writeManifest ($manifest, \%narFiles, \%newPatches); -} - |