diff options
author | Karl Berry <karl@freefriends.org> | 2007-10-08 16:57:09 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-10-08 16:57:09 +0000 |
commit | f57244a3af3d7a59bb330ac772ec782b71184f19 (patch) | |
tree | e8f569e5133059639124dd92bababbd40c02c02f /Build/cdbuild/zap-empty-dirs | |
parent | 19a42d9cc5c26f46914f065ba66498541203c092 (diff) |
move ctan2tds.pl and place to tlpkg/bin, logs to Build, remove rest
git-svn-id: svn://tug.org/texlive/trunk@5141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/cdbuild/zap-empty-dirs')
-rwxr-xr-x | Build/cdbuild/zap-empty-dirs | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/Build/cdbuild/zap-empty-dirs b/Build/cdbuild/zap-empty-dirs deleted file mode 100755 index b34ca0708c5..00000000000 --- a/Build/cdbuild/zap-empty-dirs +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -s - -# Usage: $0 [-debug] [-noaction] dir-name [regexp] - -# checks whether only files matching regexp are contained in -# dir-name and removes the directory if this is the case. -# -debug prints out what it does -# -noaction suppresses the deletion - -$debug = 0 unless $debug; -$noaction = 0 unless $noaction; - -sub usage { - print STDERR "Usage: $0 [-debug] [-noaction] dir-name [regexp]\n"; -} - - -if ($#ARGV >= 0) { - $dir_name = shift; -} else { - &usage; - exit 1; -} - -if ($#ARGV < 0) { - $regexp = "^(\\.zipped|\\.cache|\\.cache\\+|00Contents|00Description)\$"; -} elsif ($#ARGV == 0) { - $regexp = shift; -} else { - &usage; - exit 1; -} - - -opendir(DIR,$dir_name) || die "Cannot open directory `$dir_name'. Reason: $!"; - -@all_files = grep(! /^\.\.?$/,readdir(DIR)); # exclude . and .. - -closedir(DIR); - -@files = grep(! /$regexp/,@all_files); - -if ($#files < 0) { - print "Empty directory: $dir_name\n"; - &deldir; -} - -exit 0; - -sub deldir { - -# system "ls -lA $dir_name"; -# return; - - foreach $file (@all_files) { - $debug && print "unlink($dir_name/$file)\n"; - $noaction || - unlink("$dir_name/$file") || - die "Could not unlink file `$dir_name/$file'! Reason: $!\n"; - } - - $debug && print "rmdir($dir_name)\n"; - $noaction || - rmdir($dir_name) || - "Could not rmdir directory `$dir_name'! Reason: $!\n"; -} - |