summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/check-tlnet-consistency
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2008-11-24 14:33:08 +0000
committerNorbert Preining <preining@logic.at>2008-11-24 14:33:08 +0000
commit76c07b4f156553d51ad62ed31d67cfc8b6e8d49f (patch)
tree09d47c304c87779f4928848612f9115f1da48882 /Master/tlpkg/bin/check-tlnet-consistency
parent159b0cf4cc1b07c22e91b9cbc53a28a9a534a5d4 (diff)
start working on a check-tlnet-consistency files test, first step,
make it a safe temp directory where the contents can be removed git-svn-id: svn://tug.org/texlive/trunk@11410 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/bin/check-tlnet-consistency')
-rwxr-xr-xMaster/tlpkg/bin/check-tlnet-consistency45
1 files changed, 33 insertions, 12 deletions
diff --git a/Master/tlpkg/bin/check-tlnet-consistency b/Master/tlpkg/bin/check-tlnet-consistency
index da247343045..bc7701a19d4 100755
--- a/Master/tlpkg/bin/check-tlnet-consistency
+++ b/Master/tlpkg/bin/check-tlnet-consistency
@@ -27,11 +27,13 @@ my $opt_location = "./tlnet";
my $opt_nosetup = 0;
my $opt_version = 0;
my $opt_help = 0;
+my $opt_filelists = 0;
TeXLive::TLUtils::process_logging_options();
GetOptions(
"location=s" => \$opt_location,
"no-setup" => \$opt_nosetup,
+ "filelists" => \$opt_filelists,
"version" => \$opt_version,
"help|?" => \$opt_help) or pod2usage(1);
@@ -65,10 +67,13 @@ sub main
# get our db, same hierarchy from which we are being run.
my $tlpdb = TeXLive::TLPDB->new("root" => $opt_location);
die "Cannot init tlpdb from $opt_location ..." unless defined($tlpdb);
- my $temp = "$opt_location/temp";
- if (! -d $temp) {
- mkdir($temp) or die "Cannot create $temp directory: $!";
+ my $tempbase = "$opt_location/temp";
+ if (! -d $tempbase) {
+ mkdir($tempbase) or die "Cannot create $tempbase directory: $!";
}
+ my $temp = `mktemp -d -p \"$tempbase\"`;
+ chomp($temp);
+ die "Cannot create temporary directory in $tempbase: $!" if (! -d $temp);
my @notlpobj;
my @revisionerror;
my @missingsrccontainer;
@@ -83,7 +88,11 @@ sub main
my $tlpdbtlpobj = $tlpdb->get_package($pkg);
my $dodoc = ($tlpdb->config_doc_container && $tlpdbtlpobj->docfiles);
my $dosrc = ($tlpdb->config_src_container && $tlpdbtlpobj->srcfiles);
- system("cat $cont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj");
+ if ($opt_filelists) {
+ system("cat $cont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - ");
+ } else {
+ system("cat $cont | $::progs{lzmadec} | $::progs{tar} -C \"$temp\" -xf - tlpkg/tlpobj");
+ }
if (! -r "$temp/tlpkg/tlpobj/$pkg.tlpobj") {
push @notlpobj, $pkg;
} else {
@@ -125,25 +134,37 @@ sub main
# check the file sizes and md5sums
my $c = check_size_md($cont, $tlpdbtlpobj->containersize,
$tlpdbtlpobj->containermd5);
- push @sizeerror, "$pkg (" . ($c == 1 ? "size" : "md5") if ($c > 0);
+ push @sizeerror, "$pkg (" . ($c == 1 ? "size" : "md5") . ")"
+ if ($c > 0);
if ($dodoc) {
my $c = check_size_md($doccont, $tlpdbtlpobj->doccontainersize,
$tlpdbtlpobj->doccontainermd5);
- push @sizeerror, "$pkg.doc (" . ($c == 1 ? "size" : "md5") if ($c > 0);
+ push @sizeerror, "$pkg.doc (" . ($c == 1 ? "size" : "md5") . ")"
+ if ($c > 0);
}
if ($dosrc) {
my $c = check_size_md($srccont, $tlpdbtlpobj->srccontainersize,
$tlpdbtlpobj->srccontainermd5);
- push @sizeerror, "$pkg.source (" . ($c == 1 ? "size" : "md5") if ($c > 0);
+ push @sizeerror, "$pkg.source (" . ($c == 1 ? "size" : "md5") . ")"
+ if ($c > 0);
}
+ # check the actually included files are correct
+ # TODO TODO TODO
+ #
+ #
# should we do more checks?
- unlink("$temp/tlpkg/tlpobj/$pkg.tlpobj");
- unlink("$temp/tlpkg/tlpobj/$pkg.source.tlpobj");
- unlink("$temp/tlpkg/tlpobj/$pkg.doc.tlpobj");
+ # unlink("$temp/tlpkg/tlpobj/$pkg.tlpobj");
+ # unlink("$temp/tlpkg/tlpobj/$pkg.source.tlpobj");
+ # unlink("$temp/tlpkg/tlpobj/$pkg.doc.tlpobj");
+ system("rm -rf \"$temp/tlpkg\"");
+ system("rm -rf \"$temp/texmf\"");
+ system("rm -rf \"$temp/texmf-dist\"");
+ system("rm -rf \"$temp/texmf-doc\"");
+ system("ls \"$temp\"");
}
}
- system("rmdir --ignore-fail-on-non-empty $temp/tlpkg/tlpobj");
- system("rmdir --ignore-fail-on-non-empty $temp/tlpkg");
+ # system("rmdir --ignore-fail-on-non-empty $temp/tlpkg/tlpobj");
+ # system("rmdir --ignore-fail-on-non-empty $temp/tlpkg");
system("rmdir --ignore-fail-on-non-empty $temp");
if (@notlpobj) {
print "packages without containing tlpobj file:\n";