summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/tlpkg/libexec/tl-merge-tlpdb27
1 files changed, 27 insertions, 0 deletions
diff --git a/Master/tlpkg/libexec/tl-merge-tlpdb b/Master/tlpkg/libexec/tl-merge-tlpdb
index 75d7c2aef8d..0a52f10425b 100755
--- a/Master/tlpkg/libexec/tl-merge-tlpdb
+++ b/Master/tlpkg/libexec/tl-merge-tlpdb
@@ -32,14 +32,17 @@ use strict;
use TeXLive::TLPDB;
use TeXLive::TLPOBJ;
use TeXLive::TLUtils qw(win32);
+use Digest::MD5;
use Getopt::Long qw(:config no_autoabbrev);
use Pod::Usage;
my $opt_save = 0;
my $opt_help = 0;
+my $opt_nocleanup = 0;
GetOptions(
"save" => \$opt_save,
+ "nocleanup" => \$opt_nocleanup,
"help|h|?" => \$opt_help) or pod2usage(1);
if ($opt_help) {
@@ -84,6 +87,20 @@ for my $p ($sub_tlpdb->list_packages()) {
if ($opt_save) {
printf STDERR "overwriting main tlpdb ...\n";
$main_tlpdb->save();
+ if (!$opt_nocleanup) {
+ # update the md5sum
+ my $ctx = Digest::MD5->new;
+ my $fh;
+ open $fh, "<$tlnetroot/tlpkg/texlive.tlpdb" or die("Cannot open tlpdb: $!");
+ binmode $fh;
+ $ctx->addfile($fh);
+ open MDFILE, ">$tlnetroot/tlpkg/texlive.tlpdb.md5" or die ("Cannot open md5sum: $!");
+ print MDFILE $ctx->hexdigest . " texlive.tlpdb\n";
+ close MDFILE;
+ close $fh;
+ # we also have to remove the .xz file
+ unlink "$tlnetroot/tlpkg/texlive.tlpdb.xz";
+ }
} else {
printf STDERR "writing generated tlpdb to stdout ...\n";
$main_tlpdb->writeout();
@@ -145,6 +162,16 @@ it can be captured and compared with the existing one. If one does not
want to take this extra safety step, providing this options overwrites
the tlpdb immediately.
+=item B<-nocleanup>
+
+In case of B<-save> being present, by default, the script updates
+the C<texlive.tlpdb.md5> file with the correct value, and also
+removes the file C<texlive.tlpdb.xz> to facilitate easy integration
+into a web service.
+
+Giving the option B<-nocleanup> prevents the script from executing
+these steps.
+
=item B<-help>, B<--help>, B<-h>, B<-?>
Display this help and exit.