summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/crossrefware
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 /Master/texmf-dist/scripts/crossrefware
parent39010d345f62fd98626853160fbacf66fc329f0d (diff)
crossrefware (19nov17)
git-svn-id: svn://tug.org/texlive/trunk@45853 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/crossrefware')
-rwxr-xr-xMaster/texmf-dist/scripts/crossrefware/bbl2bib.pl41
-rwxr-xr-xMaster/texmf-dist/scripts/crossrefware/bibdoiadd.pl4
-rwxr-xr-xMaster/texmf-dist/scripts/crossrefware/bibmradd.pl4
-rwxr-xr-xMaster/texmf-dist/scripts/crossrefware/bibzbladd.pl2
-rwxr-xr-xMaster/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl2
5 files changed, 46 insertions, 7 deletions
diff --git a/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl b/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
index a2df920382d..477412d140e 100755
--- a/Master/texmf-dist/scripts/crossrefware/bbl2bib.pl
+++ b/Master/texmf-dist/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/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl b/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
index bf7bc1a2856..52eba925283 100755
--- a/Master/texmf-dist/scripts/crossrefware/bibdoiadd.pl
+++ b/Master/texmf-dist/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/Master/texmf-dist/scripts/crossrefware/bibmradd.pl b/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
index 8b1c9938a56..10f36113f6a 100755
--- a/Master/texmf-dist/scripts/crossrefware/bibmradd.pl
+++ b/Master/texmf-dist/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/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl b/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
index b946766fdf9..2dba99eeedc 100755
--- a/Master/texmf-dist/scripts/crossrefware/bibzbladd.pl
+++ b/Master/texmf-dist/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/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl b/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl
index f9585399cfa..105611a7dc9 100755
--- a/Master/texmf-dist/scripts/crossrefware/ltx2crossrefxml.pl
+++ b/Master/texmf-dist/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