summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2016-01-06 04:21:21 +0000
committerNorbert Preining <preining@logic.at>2016-01-06 04:21:21 +0000
commite7dbc0c56fafe5717774ff29b80bc262e210676b (patch)
tree3615f7ca913d5817bf5489cff6d823a55947906b /Master
parentb2789fe251264aceb4417b14edb31f8fe880b3e5 (diff)
checksum verification update, unwinding works again
git-svn-id: svn://tug.org/texlive/trunk@39292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl16
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm1
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm40
3 files changed, 35 insertions, 22 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 7619e353e31..e64ca236fe5 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -3182,8 +3182,11 @@ sub action_update {
$remove_unwind_container = 1;
$unwind_package = $newname;
}
- my $instret = TeXLive::TLPDB->_install_package("$unwind_package", 0,
- [], $localtlpdb);
+
+ my $instret = TeXLive::TLUtils::unpack("$unwind_package",
+ $localtlpdb->root);
+ # my $instret = TeXLive::TLPDB->_install_data("$unwind_package", 0,
+ # [], $localtlpdb);
if ($instret) {
# now we have to include the tlpobj
my $tlpobj = TeXLive::TLPOBJ->new;
@@ -3668,9 +3671,12 @@ sub action_install {
info("[$currnr/$totalnr, $estrem/$esttot] ${re}install: $pkg$tagstr [${kb}k]\n");
}
if (!$opts{"dry-run"}) {
- $remotetlpdb->install_package($pkg, $localtlpdb,
- ($packs{$pkg} ? $packs{$pkg} : undef) );
- logpackage("${re}install: $pkg$tagstr");
+ if ($remotetlpdb->install_package($pkg, $localtlpdb,
+ ($packs{$pkg} ? $packs{$pkg} : undef) )) {
+ logpackage("${re}install: $pkg$tagstr");
+ } else {
+ logpackage("failed ${re}install: $pkg$tagstr");
+ }
}
$donesize += $sizes{$pkg};
$currnr++;
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index 15766d2950f..134b4f4360b 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -1655,7 +1655,6 @@ sub not_virtual_install_package {
sub _install_data {
my ($self, $what, $reloc, $filelistref, $totlpdb, $whatsize, $whatcheck) = @_;
-printf STDERR "_install_data for $what whatsize $whatsize whatcheck $whatcheck\n";
my $target = $totlpdb->root;
my $tempdir = "$target/temp";
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 0b251b2f060..74ff59a0a52 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -1948,25 +1948,18 @@ sub w32_remove_from_path {
=pod
-=item C<unpack($what, $targetdir, @opts>
+=item C<check_file($what, $checksum, $checksize>
-If necessary, downloads C$what>, and then unpacks it into C<$targetdir>.
-C<@opts> is assigned to a hash and can contain the following
-options: C<tmpdir> (use this directory for downloaded files),
-C<checksum> (check downloaded file against this checksum),
-C<size> (check downloaded file against this size),
-C<remove> (remove temporary files after operation).
-Returns the name of the unpacked package (determined from the name of C<$what>)
-in case of success, otherwise undefined.
+Remove C<$what> if either the given C<$checksum> or C<$checksize> does
+not agree. Does nothing if neither of the check arguments is given.
=cut
sub check_file {
my ($xzfile, $checksum, $size) = @_;
- printf STDERR "checking $xzfile for size $size sum $checksum\n";
if ($checksum) {
if (tlmd5($xzfile) ne $checksum) {
- tlwarn("Found $what in $tempdir, but hashsums differ, removing it.\n");
+ tlwarn("Found $xzfile, but hashsums differ, removing it.\n");
unlink($xzfile);
}
} elsif ($size) {
@@ -1978,11 +1971,29 @@ sub check_file {
tlwarn("Found $xzfile, with equal size, continuing fingers crossed.\n");
}
} else {
- tlwarn("Found $xzfile but no size or checksum information, removing it.\n");
- unlink($xzfile);
+ # We cannot remove the file here, otherwise restoring of backups
+ # or unwind packages might die.
+ #
+ #tlwarn("Found $xzfile but no size or checksum information, removing it.\n");
+ # unlink($xzfile);
}
}
+=pod
+
+=item C<unpack($what, $targetdir, @opts>
+
+If necessary, downloads C$what>, and then unpacks it into C<$targetdir>.
+C<@opts> is assigned to a hash and can contain the following
+options: C<tmpdir> (use this directory for downloaded files),
+C<checksum> (check downloaded file against this checksum),
+C<size> (check downloaded file against this size),
+C<remove> (remove temporary files after operation).
+Returns the name of the unpacked package (determined from the name of C<$what>)
+in case of success, otherwise undefined.
+
+=cut
+
sub unpack {
my ($what, $target, %opts) = @_;
# remove by default
@@ -1990,7 +2001,6 @@ sub unpack {
my $tempdir = (defined($opts{'tmpdir'}) ? $opts{'tmpdir'} : tl_tmpdir());
my $checksum = (defined($opts{'checksum'}) ? $opts{'checksum'} : 0);
my $size = (defined($opts{'size'}) ? $opts{'size'} : 0);
- printf STDERR " unpack $what size $size checksum $checksum\n";
if (!defined($what)) {
tlwarn("TLUtils::unpack: nothing to unpack!\n");
@@ -2029,7 +2039,6 @@ sub unpack {
$xzfile_quote = "\"$xzfile\"";
$tarfile_quote = "\"$tarfile\"";
$target_quote = "\"$target\"";
-printf STDERR "BBB xzfile $xzfile for size $size sum $checksum\n";
if ($what =~ m,^(http|ftp)://,) {
# we are installing from the NET
# check for the presence of $what in $tempdir
@@ -2053,7 +2062,6 @@ printf STDERR "BBB xzfile $xzfile for size $size sum $checksum\n";
# we are installing from local compressed files
# copy it to temp
TeXLive::TLUtils::copy($what, $tempdir);
-printf STDERR "AAA xzfile $xzfile for size $size sum $checksum\n";
check_file($xzfile, $checksum, $size);
if (! -r $xzfile) {