summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-11-19 22:17:35 +0000
committerKarl Berry <karl@freefriends.org>2017-11-19 22:17:35 +0000
commitb40b1cb1e5dc67b35e577a4d9ea88d80bd6673c3 (patch)
tree068e7dabc1c2e9079e302da5058355b6d047c69a /Build
parent39010d345f62fd98626853160fbacf66fc329f0d (diff)
crossrefware (19nov17)
git-svn-id: svn://tug.org/texlive/trunk@45853 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl41
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl2
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl2
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl115
6 files changed, 131 insertions, 37 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
index a2df920382d..477412d140e 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bbl2bib.pl
@@ -8,13 +8,15 @@ bbl2bib.pl - convert thebibliography environment to a bib file
=head1 SYNOPSIS
-bbl2bib.pl [B<-o> I<output>] I<file>
+bbl2bib.pl [-d] [B<-o> I<output>] I<file>
=head1 OPTIONS
=over 4
+=item [-d]
+Send debugging output to stdout
=item B<-o> I<output>
@@ -98,10 +100,13 @@ use LaTeX::ToUnicode qw (convert);
use Getopt::Std;
use URI::Escape;
use LWP::Simple;
+# Sometimes AMS forgets to update certificates
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
+
my $USAGE="USAGE: $0 [-o output] file\n";
my $VERSION = <<END;
-bbl2bib v2.1a
+bbl2bib v2.2
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
@@ -109,7 +114,7 @@ extent permitted by law.
$USAGE
END
our %opts;
-getopts('c:o:s:hV',\%opts) or die $USAGE;
+getopts('do:hV',\%opts) or die $USAGE;
if ($opts{h} || $opts{V}){
print $VERSION;
@@ -130,6 +135,10 @@ if (exists $opts{o}) {
$outputfile = $opts{o};
}
+my $debug=0;
+if ($opts{d}) {
+ $debug=1;
+}
my $input= IO::File->new($inputfile) or
@@ -168,7 +177,15 @@ sub ProcessBibitem {
my $bibitem = shift;
my $key = $bibitem->{key};
my $text=$bibitem->{text};
+
+ if ($debug) {
+ print STDOUT "DEBUG: Processing item $key\n";
+ }
+
if (!length($text) || $text =~ /^\s+$/s) {
+ if ($debug) {
+ print STDOUT "DEBUG: No text found\n";
+ }
return;
}
@@ -180,21 +197,33 @@ sub ProcessBibitem {
# Arxiv entry?
if ($text =~ s/\\arxiv\{([^\}]+)\}\.?//) {
+ if ($debug) {
+ print STDOUT "DEBUG: Found arXiv number $1\n";
+ }
$bibitem->{arxiv}=$1;
}
# Mr number exists?
if ($text =~ s/\\mr\{([^\}]+)\}\.?//) {
+ if ($debug) {
+ print STDOUT "DEBUG: Found mr number $1\n";
+ }
$bibitem->{mr}=$1;
}
# zbl number exists?
if ($text =~ s/\\zbl\{([^\}]+)\}\.?//) {
+ if ($debug) {
+ print STDOUT "DEBUG: Found zbl number $1\n";
+ }
$bibitem->{zbl}=$1;
}
# doi number exists?
if ($text =~ s/\\doi\{([^\}]+)\}\.?//) {
+ if ($debug) {
+ print STDOUT "DEBUG: Found doi $1\n";
+ }
$bibitem->{doi}=$1;
}
@@ -208,8 +237,14 @@ sub SearchMref {
my $bibitem = shift;
my $mirror = "http://www.ams.org/mathscinet-mref";
my $string=uri_escape_utf8($bibitem->{text});
+ if ($debug) {
+ print STDOUT "Sending $mirror?ref=$string".'&'."dataType=bibtex\n"
+ }
my $response = $userAgent->get("$mirror?ref=$string&dataType=bibtex") ->
decoded_content();
+ if ($debug) {
+ print STDOUT "DEBUG: Response $response\n";
+ }
if ($response =~ /<pre>(.*)<\/pre>/s) {
my $bib= $1;
my $fh = new FileHandle;
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
index bf7bc1a2856..52eba925283 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bibdoiadd.pl
@@ -104,10 +104,12 @@ use LaTeX::ToUnicode qw (convert);
use Getopt::Std;
use URI::Escape;
use LWP::Simple;
+# Sometimes AMS forgets to update certificates
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-c config] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibdoiadd v2.1
+bibdoiadd v2.2
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
index 8b1c9938a56..10f36113f6a 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bibmradd.pl
@@ -75,10 +75,12 @@ use Getopt::Std;
use URI::Escape;
use LWP::UserAgent;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
+# Sometimes AMS forgets to update certificates
+$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-d] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibmradd v2.1
+bibmradd v2.2
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
index b946766fdf9..2dba99eeedc 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/bibzbladd.pl
@@ -78,7 +78,7 @@ $ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;
my $USAGE="USAGE: $0 [-d] [-e 1|0] [-f] [-o output] file\n";
my $VERSION = <<END;
-bibzbladd v2.1
+bibzbladd v2.2
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
diff --git a/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl b/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl
index f9585399cfa..105611a7dc9 100755
--- a/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl
+++ b/Build/source/texk/texlive/linked_scripts/crossrefware/ltx2crossrefxml.pl
@@ -82,7 +82,7 @@ extent permitted by law.
use File::Spec;
my $USAGE="USAGE: $0 [-c config] [-o output] file1 file2 ...\n";
my $VERSION = <<END;
-ltx2crossrefxml v2.0
+ltx2crossrefxml v2.2
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
http://www.gnu.org/licenses/gpl.html. There is NO WARRANTY, to the
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index ccbf7a22a42..99d24521621 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,14 +1,15 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 45815 2017-11-15 03:45:40Z preining $
+# $Id: tlmgr.pl 45838 2017-11-17 02:13:42Z preining $
#
# Copyright 2008-2017 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-my $svnrev = '$Revision: 45815 $';
-my $datrev = '$Date: 2017-11-15 04:45:40 +0100 (Wed, 15 Nov 2017) $';
+my $svnrev = '$Revision: 45838 $';
+my $datrev = '$Date: 2017-11-17 03:13:42 +0100 (Fri, 17 Nov 2017) $';
my $tlmgrrevision;
+my $tlmgrversion;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
$tlmgrrevision = $1;
@@ -17,7 +18,7 @@ if ($svnrev =~ m/: ([0-9]+) /) {
}
$datrev =~ s/^.*Date: //;
$datrev =~ s/ \(.*$//;
-$tlmgrrevision .= " ($datrev)";
+$tlmgrversion = "$tlmgrrevision ($datrev)";
our $Master;
our $ismain;
@@ -522,7 +523,7 @@ sub main {
} else {
# give a short message about usage
print "
-tlmgr revision $tlmgrrevision
+tlmgr revision $tlmgrversion
usage: tlmgr OPTION... ACTION ARGUMENT...
where ACTION is one of:\n";
for my $k (sort keys %action_specification) {
@@ -541,7 +542,7 @@ for the full story.\n";
# --machine-readable is only supported by update.
if ($::machinereadable &&
- $action ne "update" && $action ne "install" && $action ne "option" && $action ne "shell") {
+ $action ne "update" && $action ne "install" && $action ne "option" && $action ne "shell" && $action ne "remove") {
tlwarn("$prg: --machine-readable output not supported for $action\n");
}
@@ -666,29 +667,45 @@ for the full story.\n";
sub give_version {
if (!defined($::version_string)) {
$::version_string = "";
- $::version_string .= "tlmgr revision $tlmgrrevision\n";
+ $::mrversion = "";
+ $::version_string .= "tlmgr revision $tlmgrversion\n";
+ $::mrversion .= "revision $tlmgrrevision\n";
$::version_string .= "tlmgr using installation: $Master\n";
+ $::mrversion .= "installation $Master\n";
if (open (REL_TL, "$Master/release-texlive.txt")) {
- # print first and last lines, which have the TL version info.
- my @rel_tl = <REL_TL>;
- $::version_string .= $rel_tl[0];
- $::version_string .= $rel_tl[$#rel_tl];
+ # print first, which has the TL version info.
+ my $rel_tl = <REL_TL>;
+ $::version_string .= $rel_tl;
+ # for machine readable we only want the last word which is the version
+ my @foo = split(' ', $rel_tl);
+ $::mrversion .= "tlversion $foo[$#foo]\n";
close (REL_TL);
}
+ #
+ # add the list of revisions
+ if ($::opt_verbosity > 0) {
+ $::version_string .= "Revisions of TeXLive:: modules:";
+ $::version_string .= "\nTLConfig: " . TeXLive::TLConfig->module_revision();
+ $::version_string .= "\nTLUtils: " . TeXLive::TLUtils->module_revision();
+ $::version_string .= "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision();
+ $::version_string .= "\nTLPDB: " . TeXLive::TLPDB->module_revision();
+ $::version_string .= "\nTLPaper: " . TeXLive::TLPaper->module_revision();
+ $::version_string .= "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision();
+ $::version_string .= "\n";
+ }
+ $::mrversion .= "TLConfig " . TeXLive::TLConfig->module_revision();
+ $::mrversion .= "\nTLUtils " . TeXLive::TLUtils->module_revision();
+ $::mrversion .= "\nTLPOBJ " . TeXLive::TLPOBJ->module_revision();
+ $::mrversion .= "\nTLPDB " . TeXLive::TLPDB->module_revision();
+ $::mrversion .= "\nTLPaper " . TeXLive::TLPaper->module_revision();
+ $::mrversion .= "\nTLWinGoo " . TeXLive::TLWinGoo->module_revision();
+ $::mrversion .= "\n";
+ }
+ if ($::machinereadable) {
+ return $::mrversion;
+ } else {
+ return $::version_string;
}
- #
- # add the list of revisions
- if ($::opt_verbosity > 0) {
- $::version_string .= "Revisions of TeXLive:: modules:";
- $::version_string .= "\nTLConfig: " . TeXLive::TLConfig->module_revision();
- $::version_string .= "\nTLUtils: " . TeXLive::TLUtils->module_revision();
- $::version_string .= "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision();
- $::version_string .= "\nTLPDB: " . TeXLive::TLPDB->module_revision();
- $::version_string .= "\nTLPaper: " . TeXLive::TLPaper->module_revision();
- $::version_string .= "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision();
- $::version_string .= "\n";
- }
- return $::version_string;
}
@@ -1120,6 +1137,20 @@ sub action_remove {
}
}
@packs = keys %packs;
+
+ my %sizes = %{$localtlpdb->sizes_of_packages(
+ $localtlpdb->option("install_srcfiles"),
+ $localtlpdb->option("install_docfiles"), undef, @packs)};
+ defined($sizes{'__TOTAL__'}) || ($sizes{'__TOTAL__'} = 0);
+ my $totalsize = $sizes{'__TOTAL__'};
+ my $totalnr = $#packs;
+ my $currnr = 1;
+ my $starttime = time();
+ my $donesize = 0;
+
+ print "total-bytes\t$sizes{'__TOTAL__'}\n" if $::machinereadable;
+ print "end-of-header\n" if $::machinereadable;
+
foreach my $pkg (sort @packs) {
my $tlp = $localtlpdb->get_package($pkg);
next if defined($already_removed{$pkg});
@@ -1127,17 +1158,27 @@ sub action_remove {
info("$pkg: package not present, cannot remove\n");
$ret |= $F_WARNING;
} else {
+ my ($estrem, $esttot) = TeXLive::TLUtils::time_estimate($totalsize,
+ $donesize, $starttime);
+
# in the first round we only remove collections, nothing else
# but removing collections will remove all dependencies, too
# save the information of which packages have already been removed
# into %already_removed.
if ($tlp->category eq "Collection") {
my $foo = 0;
- info ("$prg: removing $pkg\n");
+ if ($::machinereadable) {
+ machine_line($pkg, "d", $tlp->revision, "-", $sizes{$pkg}, $estrem, $esttot);
+ } else {
+ # info ("$prg: removing $pkg\n");
+ info("[$currnr/$totalnr, $estrem/$esttot] remove: $pkg\n");
+ }
if (!$opts{"dry-run"}) {
$foo = backup_and_remove_package($pkg, $autobackup);
logpackage("remove: $pkg");
}
+ $currnr++;
+ $donesize += $sizes{$pkg};
if ($foo) {
# removal was successful, so the return is at least 0x0001 mktexlsr
# remove dependencies, too
@@ -1153,8 +1194,19 @@ sub action_remove {
}
}
foreach my $pkg (sort @more_removal) {
+ my $tlp = $localtlpdb->get_package($pkg);
if (!defined($already_removed{$pkg})) {
- info ("$prg: removing package $pkg\n");
+ my ($estrem, $esttot) = TeXLive::TLUtils::time_estimate($totalsize,
+ $donesize, $starttime);
+ # info ("$prg: removing package $pkg\n");
+ if ($::machinereadable) {
+ machine_line($pkg, "d", $tlp->revision, "-", $sizes{$pkg}, $estrem, $esttot);
+ } else {
+ # info ("$prg: removing $pkg\n");
+ info("[$currnr/$totalnr, $estrem/$esttot] remove: $pkg\n");
+ }
+ $currnr++;
+ $donesize += $sizes{$pkg};
if (!$opts{"dry-run"}) {
if (backup_and_remove_package($pkg, $autobackup)) {
# removal was successful
@@ -1164,6 +1216,7 @@ sub action_remove {
}
}
}
+ print "end-of-updates\n" if $::machinereadable;
if ($opts{"dry-run"}) {
# stop here, don't do any postinstall actions
return ($ret | $F_NOPOSTACTION);
@@ -1171,9 +1224,11 @@ sub action_remove {
$localtlpdb->save;
my @foo = sort keys %already_removed;
if (@foo) {
- info("$prg: ultimately removed these packages: @foo\n");
+ info("$prg: ultimately removed these packages: @foo\n")
+ if (!$::machinereadable);
} else {
- info("$prg: no packages removed.\n");
+ info("$prg: no packages removed.\n")
+ if (!$::machinereadable);
}
}
return ($ret);
@@ -6194,7 +6249,7 @@ sub action_shell {
} elsif ($cmd eq "help") {
print "Please see tlmgr help or http://tug.org/texlive/tlmgr.html.\n";
} elsif ($cmd eq "version") {
- print give_version(), "\n";
+ print give_version();
} elsif ($cmd =~ m/^(quit|end|bye(bye)?)$/i) {
return $F_OK;
} elsif ($cmd eq "setup-location") {
@@ -9259,7 +9314,7 @@ This script and its documentation were written for the TeX Live
distribution (L<http://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 45815 2017-11-15 03:45:40Z preining $
+$Id: tlmgr.pl 45838 2017-11-17 02:13:42Z preining $
=cut
# to remake HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html