diff options
author | 2010-08-12 11:36:35 +0200 | |
---|---|---|
committer | 2015-10-11 10:45:56 +0200 | |
commit | a2890b063846161a0249cb1c2a586e93b2506e0a (patch) | |
tree | e9b5fa05f53ca4788855915eeb47c93c43ad495b /dev-tex | |
parent | Bump squash_dir to make cd -P tacit (diff) | |
download | mv-a2890b063846161a0249cb1c2a586e93b2506e0a.tar.gz mv-a2890b063846161a0249cb1c2a586e93b2506e0a.tar.bz2 mv-a2890b063846161a0249cb1c2a586e93b2506e0a.zip |
chklref: Add a patch to find uncited bibliography entries
Diffstat (limited to 'dev-tex')
-rw-r--r-- | dev-tex/chklref/ChangeLog | 3 | ||||
-rw-r--r-- | dev-tex/chklref/Manifest | 7 | ||||
-rw-r--r-- | dev-tex/chklref/chklref-2.4-r1.ebuild (renamed from dev-tex/chklref/chklref-2.4.ebuild) | 14 | ||||
-rw-r--r-- | dev-tex/chklref/files/citations.patch | 93 | ||||
-rw-r--r-- | dev-tex/chklref/metadata.xml | 3 |
5 files changed, 112 insertions, 8 deletions
diff --git a/dev-tex/chklref/ChangeLog b/dev-tex/chklref/ChangeLog index 8741fa2f..d812e96a 100644 --- a/dev-tex/chklref/ChangeLog +++ b/dev-tex/chklref/ChangeLog @@ -4,6 +4,9 @@ *chkltex-2.4 (23 Apr 2010) + 12 Aug 2010; Martin Väth <martin@mvath.de> + Add a patch to find uncited bibliography entries + 27 Apr 2010; Martin Väth <martin@mvath.de> Use ${ED} in install phase diff --git a/dev-tex/chklref/Manifest b/dev-tex/chklref/Manifest index 99f71156..ff6a8a37 100644 --- a/dev-tex/chklref/Manifest +++ b/dev-tex/chklref/Manifest @@ -1,4 +1,5 @@ +AUX citations.patch 2899 RMD160 f8ff3b5263532b78c8f4486a59042d508642644b SHA1 88204742e10d056b31cf1499069ab85dbc0ad477 SHA256 c188d735758aa489ed8842357fd94028066fc3be8f87acf22c17b60bb0cf7144 DIST chklref-2.4.tar.gz 57856 RMD160 1ac099f6c137ac8ceacf0e38df39146ea117a208 SHA1 afb5651f7a50e50de3c703e338b8d8c8712cb029 SHA256 3037c8db7c4666f2e1df840e64e6b04ec621a6e7f5470ffbbdbe2ff426374e88 -EBUILD chklref-2.4.ebuild 755 RMD160 0da1bd9bc3cd614fc72d62aaef0dea95cadce7e9 SHA1 6dbc5d42b85bcb858a33a0f5c489098cf9144320 SHA256 837ba06e290cc2a5460a8884a5bb8383e12cd1f21b7908fdbe9e35aa43ff5c1e -MISC ChangeLog 411 RMD160 5a870ff495b09a26ba7719031692e1d6710372f9 SHA1 e5ff89b8ed91ebf26a9b2655937702db74deb71b SHA256 430a82a7122b00d1a1181c149ba930e3d740c8f0ff6e47ac1253c25fa8fe0870 -MISC metadata.xml 264 RMD160 4c10b5dfc6857fcb2e9cdc91ff64bb5d4a5c2204 SHA1 69886f7e401bdf99a78d428ff4361991607e86c6 SHA256 dd28333300fc1ec2dbd96450bddbdd9e1061c1eff809e687442c53c91c05d86d +EBUILD chklref-2.4-r1.ebuild 850 RMD160 74c0cbc87f4592ec35f18823910a99a5fcec6551 SHA1 e1c0e29a61db5d0753859f98e4337d87b10db370 SHA256 4da0e5b9707dc4e50733c157850c5a1e45972e6481904f7e5e180927c7268e8e +MISC ChangeLog 527 RMD160 6dae870813e0076df9412ae528b972e46cf4b892 SHA1 d9e57af263848ec5fee09da2d6f7e1d646018ba4 SHA256 9e795e23a06801cdb51caba4c9fac41c7c38aa1588bddb970012b631ea092823 +MISC metadata.xml 357 RMD160 979676c17e8907c0acc8ad51ce85eea4f2499dba SHA1 4cf647edb1fcb116c94f287e752ea21f9a7882fb SHA256 620aeff03b89af691b6b21c54ce2aac423db0b625743f403e218364111b40982 diff --git a/dev-tex/chklref/chklref-2.4.ebuild b/dev-tex/chklref/chklref-2.4-r1.ebuild index 9bfa2157..1cb02b65 100644 --- a/dev-tex/chklref/chklref-2.4.ebuild +++ b/dev-tex/chklref/chklref-2.4-r1.ebuild @@ -3,7 +3,7 @@ # $Header $ EAPI="3" -inherit latex-package +inherit latex-package eutils RESTRICT="mirror" DESCRIPTION="Finds out useless references in latex files or numbered environments that should not be" @@ -13,20 +13,24 @@ SRC_URI="http://www-ljk.imag.fr/membres/Jerome.Lelong/soft/chklref/${P}.tar.gz" LICENSE="GPL-3" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="+citations" RDEPEND="virtual/latex-base dev-lang/perl" DEPEND="${RDEPEND}" -src_configure() { +src_prepare () { + use citations && epatch "${FILESDIR}"/citations.patch +} + +src_configure () { econf --docdir="${EPREFIX}/usr/share/doc/${PF}" } -src_compile() { +src_compile () { emake || die "emake failed" } -src_install() { +src_install () { emake prefix="${ED}/usr" install || die "emake install failed" } diff --git a/dev-tex/chklref/files/citations.patch b/dev-tex/chklref/files/citations.patch new file mode 100644 index 00000000..5fd51282 --- /dev/null +++ b/dev-tex/chklref/files/citations.patch @@ -0,0 +1,93 @@ +--- chklref.in ++++ chklref.in +@@ -57,10 +57,13 @@ + fi + + +-basetexfile=$(basename $1 .tex) ++basetexfile=${1##*/} ++basetexfile=${basetexfile%.tex} + echo "Running $latex_cmd on $basetexfile.tex to collect labels," + echo "references and environment declarations" ++$latex_cmd --interaction errorstopmode "${basetexfile}" >"$out" 2>&1 ++rm -- "$basetexfile".tex.chk + $latex_cmd --interaction errorstopmode --jobname "$basetexfile" \ +- '\RequirePackage{chklref}\input' "{$basetexfile.tex}" &> $out +-$PERL $prefix/share/chklref/chkparser $basetexfile.tex.chk +-if (( ! $debug )) ; then rm $basetexfile.tex.chk; fi ++ '\RequirePackage{chklref}\input' "{$basetexfile.tex}" >"$out" 2>&1 ++$PERL "$prefix"/share/chklref/chkparser "$basetexfile".tex.chk ++[ $debug -ne 0 ] || rm -- "$basetexfile".tex.chk +--- chklref.sty ++++ chklref.sty +@@ -135,11 +135,15 @@ + \CHK@redefine@{eqref}{ref} + \CHK@redefine@{ref}{ref} + \CHK@redefine@{label}{label} ++ \CHK@redefine@{citation}{citation} ++ \CHK@redefine@{bibcite}{bibcite} + + \else + \ifchk@hyperref\else + \CHK@redefine@{label}{label} + \CHK@redefine@{ref}{ref} ++ \CHK@redefine@{citation}{citation} ++ \CHK@redefine@{bibcite}{bibcite} + \fi + \fi + } +--- chkparser ++++ chkparser +@@ -77,7 +77,7 @@ + ## last 3 args are passed by reference and are modified + sub chk_parse + { +- my ($txt, $entries, $refs, $labels) = @_; ++ my ($txt, $entries, $refs, $labels, $citations, $bibcites) = @_; + my ($str, $begin, $end, $star, $labeled_env, $label, $file, $entry, $l); + + # ## swap end and label commands in an array +@@ -105,6 +105,15 @@ + { + push(@$refs, new_ref($1, $2, $3)); + } ++ elsif ($l =~ m/^citation (.+) line (\d+) file (.+)$/o) ++ { ++ foreach my $c (split(/\s*,\s*/, $1)) ++ { ${$citations}{$c}=1 } ++ } ++ elsif ($l =~ m/^bibcite (.+) line (\d+) file (.+)$/o) ++ { ++ push(@$bibcites, $1); ++ } + elsif ($l =~ m/^begin{$have_star_mode(\**)} line (\d+) file (.+)$/o) + { + $str = $1; +@@ -237,6 +246,8 @@ + my @entries = (); + my @refs = (); + my @labels = (); ++my %citations = (); ++my @bibcites = (); + my $FIC; + + ## reads whole file to an array because label and end commands +@@ -245,7 +256,7 @@ + my @txt = <$FIC>; + close($FIC); + +-chk_parse(\@txt, \@entries, \@refs, \@labels); ++chk_parse(\@txt, \@entries, \@refs, \@labels, \%citations, \@bibcites); + + @labels = sort { $a->{line} cmp $b->{line} } @labels; + @refs = sort { $a->{str} cmp $b->{str} } @refs; +@@ -253,3 +264,9 @@ + star_label(\@entries); + ##disp_msg( \@entries ); + unused_label(\@labels, $uniq_refs); ++ print "**************************** ++** Uncited Bibliographies ** ++****************************\n"; ++for my $c (@bibcites) { ++ print("Unused bibliography entry: $c\n") unless exists ${citations}{$c} ++} diff --git a/dev-tex/chklref/metadata.xml b/dev-tex/chklref/metadata.xml index 0c91bdcd..cbd809f5 100644 --- a/dev-tex/chklref/metadata.xml +++ b/dev-tex/chklref/metadata.xml @@ -6,4 +6,7 @@ <email>martin@mvath.de</email> <name>Martin Väth</name> </maintainer> +<use> + <flag name="citations">Add a patch to find uncited bibliography entries</flag> +</use> </pkgmetadata> |