From adac48cfc4efd9fdcdec5c8780fcd8a8fbcaa504 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 11 Dec 2017 22:25:02 +0000 Subject: bibtexperllibs (10dec17) git-svn-id: svn://tug.org/texlive/trunk@46044 c570f23f-e606-0410-a88d-b1316a301751 --- .../support/bibtexperllibs/BibTeX-Parser/Changes | 42 ++++++++----- .../support/bibtexperllibs/BibTeX-Parser/MANIFEST | 3 + .../support/bibtexperllibs/BibTeX-Parser/META.yml | 2 +- .../bibtexperllibs/BibTeX-Parser/Makefile.PL | 2 +- .../support/bibtexperllibs/BibTeX-Parser/README | 4 +- .../support/bibtexperllibs/BibTeX-Parser/dist.ini | 2 +- .../BibTeX-Parser/t/03-parse_entry.t | 39 +++++++++++- .../bibtexperllibs/BibTeX-Parser/t/09-complex.t | 3 +- .../bibtexperllibs/BibTeX-Parser/t/10-funnyname.t | 1 + .../bibtexperllibs/BibTeX-Parser/t/14-extratext.t | 65 +++++++++++++++++++ .../BibTeX-Parser/t/15-capitalization.t | 72 ++++++++++++++++++++++ .../BibTeX-Parser/t/bibs/14-extratext.bib | 22 +++++++ .../BibTeX-Parser/t/bibs/english.bib | 2 +- .../source/support/bibtexperllibs/Makefile | 2 +- .../source/support/bibtexperllibs/README | 4 +- 15 files changed, 236 insertions(+), 29 deletions(-) create mode 100644 Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t create mode 100644 Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t create mode 100644 Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib (limited to 'Master/texmf-dist/source/support/bibtexperllibs') diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes index a7724c0541a..cdcb9b93984 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Changes @@ -1,13 +1,21 @@ Revision history for BibTeX-Parser +1.01 2017-11-19 03:12:34 +0000 + New options for to_string: + - print_pre - whether to print text preceding the entry + - type_capitalization ('Uppercase', 'Lowercase', + 'Titlecase') + - field_capitalization ('Uppercase', 'Lowercase', + 'Titlecase') + 1.00 2017-03-18 21:53:15+00:00 - Typo corrected: editors -> editor + Typo corrected: editors -> editor 0.70 2016-11-23 02:28:35+00:00 Compatibility with perl 5.25 (Alexandr Ciornii) 0.69 2016-03-24 15:13:50-04:00 - Added option canonize_names to Entry::to_string + Added option canonize_names to Entry::to_string 0.68 2016-03-10 13:45:31-05:00 Now we preserve the order of entries @@ -21,13 +29,13 @@ Revision history for BibTeX-Parser No Do not remove braces from the authors' names 0.65 2013-09-03 21:04:43 - Add links in documentation. + Add links in documentation. 0.64 2012-03-10 22:23:50 Remove a warning about undefined value. 0.63 2011-03-15 23:08:18 - Parse files with errors (no keys, spaces in wrong positions). Bug #66325 + Parse files with errors (no keys, spaces in wrong positions). Bug #66325 0.62 2010-10-15 08:52:53 Declare Test::More minimum version with done_testing @@ -43,27 +51,27 @@ Revision history for BibTeX-Parser Do not attempt to clean up returned values Author names with braces are split correctly -0.4 2010-02-09 - Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}") +0.4 2010-02-09 + Parsing of quoted author names (e.g. "{Foo and Bar, Inc.}") -0.3.2 2009-07-26 - Removed dependency on Text::Balanced +0.3.2 2009-07-26 + Removed dependency on Text::Balanced 0.3.1 2009-07-19 - No changes, removed huge test file from dist + No changes, removed huge test file from dist 0.3 2009-07-18 - Better parsing of author names, - new Method B::P::Entry->raw_bibtex - Removed Module::Install from package + Better parsing of author names, + new Method B::P::Entry->raw_bibtex + Removed Module::Install from package -0.21 2009-01-23 - Fixed errors in synopsis. +0.21 2009-01-23 + Fixed errors in synopsis. -0.2 2008-12-30 - First public release. +0.2 2008-12-30 + First public release. -0.1 2008-03-14 +0.1 2008-03-14 First version, internal diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST index 7896b2c5165..ec2f7719ea8 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/MANIFEST @@ -23,10 +23,13 @@ t/10-funnyname.t t/11-split_braced.t t/12-von_token.t t/13_output.t +t/14-extratext.t +t/15-capitalization.t t/bibs/01.bib t/bibs/06.bib t/bibs/09-complex.bib t/bibs/10-funnyname.bib +t/bibs/14-extratext.bib t/bibs/braces.bib t/bibs/endnote.txt t/bibs/engineering_village.txt diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml index dafdba5d3d9..1196376ffbc 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/META.yml @@ -20,4 +20,4 @@ requires: IO::String: 0 LaTeX::ToUnicode: 0.02 Test::More: 0 -version: 1.00 +version: 1.01 diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL index b2007039082..41a067a8b34 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/Makefile.PL @@ -29,7 +29,7 @@ my %WriteMakefileArgs = ( "TEST_REQUIRES" => { "Test::More" => "0.88" }, - "VERSION" => "1.00", + "VERSION" => "1.01", "test" => { "TESTS" => "t/*.t" } diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README index 3ba51951176..dd5a193c2e6 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/README @@ -1,5 +1,5 @@ This archive contains the distribution BibTeX-Parser, -version 1.00: +version 1.01: A pure perl BibTeX parser @@ -8,5 +8,3 @@ This software is copyright (c) 2013--2017 by Gerhard Gossen and Boris Veytsman This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. - - diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini index 7d27817487f..5aee4c846fb 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/dist.ini @@ -1,5 +1,5 @@ name = BibTeX-Parser -version = 1.00 +version = 1.01 author = Gerhard Gossen and Boris Veytsman license = Perl_5 copyright_holder = Gerhard Gossen and Boris Veytsman diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t index 62badfe9365..6b4e4632bcc 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/03-parse_entry.t @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -use Test::More tests => 2; +use Test::More tests => 3; use IO::String; use BibTeX::Parser; @@ -30,9 +30,43 @@ use BibTeX::Parser; pages => "498--516", _parse_ok => 1, _fieldnums => {'author' => 0, 'title' => 1, 'journal' => 2, 'volume' => 3, - 'year' => 4, 'pages' => 5}, + 'year' => 4, 'pages' => 5}, + _pre => '', _raw => $string}, "parse \@ARTICLE"); +} +{ + my $string1 = q|@article{lin1973, + author = "Shen Lin and Brian W. Kernighan", + title = "An Effective Heuristic Algorithm for the Travelling-Salesman Problem", + journal = "Operations Research", + volume = 21, + year = 1973, + pages = "498--516" + }|; + my $string = "some +text +$string1"; + my $fh = IO::String->new($string); + + my $parser = BibTeX::Parser->new( $fh ); + +#my @result = BibTeX::Parser->_parse($fh); + + my $entry = $parser->next; + + is_deeply($entry, {_type => 'ARTICLE', _key => 'lin1973', author => "Shen Lin and Brian W. Kernighan", + title => "An Effective Heuristic Algorithm for the Travelling-Salesman Problem", + journal => "Operations Research", + volume => 21, + year => 1973, + pages => "498--516", _parse_ok => 1, + _fieldnums => {'author' => 0, 'title' => 1, + 'journal' => 2, 'volume' => 3, + 'year' => 4, 'pages' => 5}, + _pre => "some\ntext", + _raw => $string1}, "parse \@ARTICLE"); + } { my $string = q|@InProceedings{Herper:2001:MVS, @@ -63,5 +97,6 @@ use BibTeX::Parser; editor => "Reinhard Keil-Slavik and Johannes Magenheim", year => 2001, _parse_ok => 1, + _pre => '', _raw => $string}, "parse \@ARTICLE"); } diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t index 0dc126b974c..56ce75cceb0 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/09-complex.t @@ -37,5 +37,6 @@ is_deeply($entry, {_type => 'ARTICLE', _key => 'Ahrenberg88', pages = "66--70", year = "1988", keywords = "conver", -}' +}', + _pre => '' }, "parse \@ARTICLE"); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t index 6d32521aacd..8ab48396e9d 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/10-funnyname.t @@ -39,6 +39,7 @@ is_deeply( number = {1}, pages = {1}, }', + _pre => '' }, "parse \@ARTICLE" ); diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t new file mode 100644 index 00000000000..0a663b043ad --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/14-extratext.t @@ -0,0 +1,65 @@ +#!/usr/bin/perl -w + + +use Test::More tests => 6; + +use BibTeX::Parser; +use IO::File; + + +my $fh = new IO::File "t/bibs/14-extratext.bib", "r" ; + +my $parser = new BibTeX::Parser $fh; + + + + +while (my $entry = $parser->next) { + + if($entry->key eq 'Partridge') { + my $result1= '@BOOK{Partridge, + author = {Partridge, Eric}, + title = {Use and Abuse: a Guide to Good {E}nglish}, + publisher = {Hamish Hamilton}, + edition = {4}, + year = {1970}, +}'; + my $result2 = "First published in 1947\n$result1"; + is($entry->to_string,$result1); + is($entry->to_string(print_pre=>1),$result2); + } + + if ($entry->key eq 'Cooper') { + my $result1 = '@BOOK{Cooper, + author = {Cooper, Bruce M.}, + title = {Writing Technical Reports}, + publisher = {Penguin}, + year = {1964}, +}'; + my $result2 = "\n\n$result1"; + is($entry->to_string,$result1); + is($entry->to_string(print_pre=>1),$result2); + } + + + if ($entry->key eq 'Fowler-ModernEnglish') { + + my $result1 = '@BOOK{Fowler-ModernEnglish, + author = {Fowler, H. W.}, + title = {[A Dictionary of] Modern {E}nglish Usage}, + publisher = {Oxford University Press}, + edition = {2}, + year = {1965}, +}'; + my $result2 = ' + + +First published in 1926 +'. $result1; + is($entry->to_string,$result1); + is($entry->to_string(print_pre=>1),$result2); + } +} + +done_testing(); + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t new file mode 100644 index 00000000000..4254f5c12f4 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/15-capitalization.t @@ -0,0 +1,72 @@ +#!/usr/bin/perl -w + +use Test::More tests=>7; + +use BibTeX::Parser; +use IO::File; + + +my $fh = new IO::File "t/bibs/01.bib", "r" ; + +my $parser = new BibTeX::Parser $fh; + + + + +while (my $entry = $parser->next) { + if($entry->key eq 'key01') { + my $result1='@ARTICLE{key01, + year = {1950}, + author = {Duck, Donald and Else, Someone}, + editor = {Itor, E. D. and Other, A. N.}, + title = {Title text}, + month = {January~1}, +}'; + my $result2='@ARTICLE{key01, + YEAR = {1950}, + AUTHOR = {Duck, Donald and Else, Someone}, + EDITOR = {Itor, E. D. and Other, A. N.}, + TITLE = {Title text}, + MONTH = {January~1}, +}'; + my $result3='@ARTICLE{key01, + Year = {1950}, + Author = {Duck, Donald and Else, Someone}, + Editor = {Itor, E. D. and Other, A. N.}, + Title = {Title text}, + Month = {January~1}, +}'; + my $result4='@article{key01, + year = {1950}, + author = {Duck, Donald and Else, Someone}, + editor = {Itor, E. D. and Other, A. N.}, + title = {Title text}, + month = {January~1}, +}'; + my $result5='@Article{key01, + year = {1950}, + author = {Duck, Donald and Else, Someone}, + editor = {Itor, E. D. and Other, A. N.}, + title = {Title text}, + month = {January~1}, +}'; + is($entry->to_string,$result1); + is($entry->to_string(field_capitalization=>'Lowercase'), + $result1); + is($entry->to_string(field_capitalization=>'Uppercase'), + $result2); + is($entry->to_string(field_capitalization=>'Titlecase'), + $result3); + + is($entry->to_string(type_capitalization=>'Lowercase'), + $result4); + is($entry->to_string(type_capitalization=>'Uppercase'), + $result1); + is($entry->to_string(type_capitalization=>'Titlecase'), + $result5); + } + +} + +done_testing(); + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib new file mode 100644 index 00000000000..56f96aa01b6 --- /dev/null +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/14-extratext.bib @@ -0,0 +1,22 @@ +First published in 1947 +@BOOK{Partridge, + AUTHOR="Eric Partridge", + TITLE="Use and Abuse: a Guide to Good {E}nglish", + PUBLISHER="Hamish Hamilton", + EDITION="4", YEAR="1970"} + + +@BOOK{Cooper, + AUTHOR="Bruce M. Cooper", + TITLE="Writing Technical Reports", + PUBLISHER="Penguin", YEAR="1964"} + + + +First published in 1926 +@BOOK{Fowler-ModernEnglish, + AUTHOR="H. W. Fowler", + TITLE="[A Dictionary of] Modern {E}nglish Usage", + PUBLISHER="Oxford University Press", + EDITION="2", YEAR="1965"} + diff --git a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib index 2a5779e653a..34c3e67a794 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib +++ b/Master/texmf-dist/source/support/bibtexperllibs/BibTeX-Parser/t/bibs/english.bib @@ -1,4 +1,4 @@ -$Id: english.bib,v 1.5 2017/03/19 19:14:20 boris Exp $ +$Id: english.bib,v 1.6 2017/12/10 02:43:44 boris Exp $ Please notify Adrian F Clark of any additions or corrections to this list. diff --git a/Master/texmf-dist/source/support/bibtexperllibs/Makefile b/Master/texmf-dist/source/support/bibtexperllibs/Makefile index 8590d7c549c..ba762569fea 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/Makefile +++ b/Master/texmf-dist/source/support/bibtexperllibs/Makefile @@ -19,4 +19,4 @@ install: for dir in ${DIRS}; do cd $$dir; ${MAKE} -f Makefile.TDS install; cd ..; done archive: - tar -czvf $(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE) + COPYFILE_DISABLE=1 tar -czvf $(PACKAGE).tgz -C .. --exclude '*~' --exclude '*.tgz' --exclude CVS $(PACKAGE) diff --git a/Master/texmf-dist/source/support/bibtexperllibs/README b/Master/texmf-dist/source/support/bibtexperllibs/README index 042c3a2455f..feb8c4cd682 100644 --- a/Master/texmf-dist/source/support/bibtexperllibs/README +++ b/Master/texmf-dist/source/support/bibtexperllibs/README @@ -1,5 +1,5 @@ BibTeX Perl Libs - Version 1.3 + Version 1.4 Gerhard Gossen and Boris Veytsman This package provides BibTeX related Perl libraries by Gerhard Gossen, @@ -12,6 +12,8 @@ scripts/bibtexperllibs inside your TeX distribution. Changes: + version 1.4 Upgraded BibTeX::Parser to 1.01 + version 1.3 Upgraded BibTeX::Parser to 1.00 version 1.2 Upgraded BibTeX::Parser to v0.70 and LaTeX::ToUnicode to 0.05 -- cgit v1.2.3