From 2187b77b4257f2e6585a87b74a60ab630e591423 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Apr 2012 23:51:05 +0000 Subject: listbib fixes per Christian Mandel, 24 Apr 2012 11:47:55 git-svn-id: svn://tug.org/texlive/trunk@26126 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/texk/texlive/linked_scripts/Makefile.am | 1 + .../source/texk/texlive/linked_scripts/Makefile.in | 1 + .../texk/texlive/linked_scripts/listbib/listbib | 245 ++ .../linked_scripts/pax/pdfannotextractor.pl | 18 +- .../texk/texlive/linked_scripts/texlive/tlmgr.pl | 112 +- Master/bin/alpha-linux/listbib | 1 + Master/bin/amd64-freebsd/listbib | 1 + Master/bin/amd64-kfreebsd/listbib | 1 + Master/bin/i386-cygwin/listbib | 1 + Master/bin/i386-freebsd/listbib | 1 + Master/bin/i386-kfreebsd/listbib | 1 + Master/bin/i386-linux/listbib | 1 + Master/bin/i386-netbsd/listbib | 1 + Master/bin/i386-solaris/listbib | 1 + Master/bin/mips-irix/listbib | 1 + Master/bin/powerpc-aix/listbib | 1 + Master/bin/powerpc-linux/listbib | 1 + Master/bin/sparc-linux/listbib | 1 + Master/bin/sparc-solaris/listbib | 1 + Master/bin/universal-darwin/listbib | 1 + Master/bin/win32/listbib.exe | Bin 0 -> 1536 bytes Master/bin/x86_64-darwin/listbib | 1 + Master/bin/x86_64-linux/listbib | 1 + Master/bin/x86_64-solaris/listbib | 1 + Master/texmf-dist/bibtex/bst/listbib/listbib.bst | 2418 ++++++++++++++++++++ Master/texmf-dist/doc/latex/listbib/listbib | 245 -- Master/texmf-dist/doc/latex/listbib/listbib.doc | 2418 -------------------- Master/texmf-dist/doc/latex/listbib/listbib.tex | 52 - Master/texmf-dist/scripts/listbib/listbib | 245 ++ Master/texmf-dist/tex/latex/listbib/listbib.tex | 52 + Master/tlpkg/libexec/ctan2tds | 16 +- Master/tlpkg/tlpsrc/listbib.tlpsrc | 1 + 32 files changed, 3072 insertions(+), 2770 deletions(-) create mode 100755 Build/source/texk/texlive/linked_scripts/listbib/listbib create mode 120000 Master/bin/alpha-linux/listbib create mode 120000 Master/bin/amd64-freebsd/listbib create mode 120000 Master/bin/amd64-kfreebsd/listbib create mode 120000 Master/bin/i386-cygwin/listbib create mode 120000 Master/bin/i386-freebsd/listbib create mode 120000 Master/bin/i386-kfreebsd/listbib create mode 120000 Master/bin/i386-linux/listbib create mode 120000 Master/bin/i386-netbsd/listbib create mode 120000 Master/bin/i386-solaris/listbib create mode 120000 Master/bin/mips-irix/listbib create mode 120000 Master/bin/powerpc-aix/listbib create mode 120000 Master/bin/powerpc-linux/listbib create mode 120000 Master/bin/sparc-linux/listbib create mode 120000 Master/bin/sparc-solaris/listbib create mode 120000 Master/bin/universal-darwin/listbib create mode 100755 Master/bin/win32/listbib.exe create mode 120000 Master/bin/x86_64-darwin/listbib create mode 120000 Master/bin/x86_64-linux/listbib create mode 120000 Master/bin/x86_64-solaris/listbib create mode 100644 Master/texmf-dist/bibtex/bst/listbib/listbib.bst delete mode 100644 Master/texmf-dist/doc/latex/listbib/listbib delete mode 100644 Master/texmf-dist/doc/latex/listbib/listbib.doc delete mode 100644 Master/texmf-dist/doc/latex/listbib/listbib.tex create mode 100755 Master/texmf-dist/scripts/listbib/listbib create mode 100644 Master/texmf-dist/tex/latex/listbib/listbib.tex diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 3c49b5811aa..276655ae738 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -55,6 +55,7 @@ texmf_dist_shell_scripts = \ bibexport/bibexport.sh \ installfont/installfont-tl \ latexfileversion/latexfileversion \ + listbib/listbib \ listings-ext/listings-ext.sh \ pdfjam/pdf180 \ pdfjam/pdf270 \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index d2398e0e6c7..46133a614eb 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -236,6 +236,7 @@ texmf_dist_shell_scripts = \ bibexport/bibexport.sh \ installfont/installfont-tl \ latexfileversion/latexfileversion \ + listbib/listbib \ listings-ext/listings-ext.sh \ pdfjam/pdf180 \ pdfjam/pdf270 \ diff --git a/Build/source/texk/texlive/linked_scripts/listbib/listbib b/Build/source/texk/texlive/linked_scripts/listbib/listbib new file mode 100755 index 00000000000..d66eab74c90 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/listbib/listbib @@ -0,0 +1,245 @@ +#!/bin/sh +#!/bin/sh -x +#!/bin/bash +# +# listbib +# +# List the contents of all given BibTeX files (bibliographic data bases, +# extension .bib). +# Prerequisites: +# LaTeX 2e, <1999/06/01> will work (earlier ones might) +# bibtex 0.99b +# package listbib, version 2.0 or later +# +# If we had bash, we could do some decent programming. However, listbib +# must also work with something as braindead as solaris 2.7 /bin/sh, +# so we won't... +# +# Copyright Volker Kuhlmann +# Released under the GNU General Public License (GPL) Version 2. +# +# Volker Kuhlmann +# 15, 16, 17 Mar; 12, 15 Apr; 30 Jul; 28 Aug 2000 +# + +VERSION="VK 1.2.3, 28 Aug 2000" + +# The root of the filenames generated by latex etc. +#outfile="listbib-$$" # numbers are awkward +#outfile="listbib" # not good! +outfile="listedbibs" + + +#### +#### Usage +# +usage() { + echo " +Usage: `basename $0` [OPTIONS] [BIBFILE[.bib] ..] BIBFILE_N[.bib] +Version $VERSION + +Options: + -h|--help shows help + -o|--output FILE generates FILE.dvi / FILE.ps (default $outfile) + -O|--same as -o, but generate FILE.dvi and BIBFILE_N.ps + -p|--ps|--postscript generate PostScript as well as dvi + -d|--deltemp delete all generated files but .dvi + -P|--psonly generate only PostScript (delete all generated files + but .ps) + -- stop option processing; only .bib files remain + +Examples: + List contents of mystrings.bib and mybib.bib, generating $outfile.dvi: + listbib -d mystrings.bib mybib.bib + As before, but only generate $outfile.ps: + listbib -P mystrings.bib mybib.bib + Generate mybib.ps instead: + listbib -P -O mystrings.bib mybib.bib +" + exitwith ErrUsage +} + +#### +#### Error/Exit codes +# +exitwith() { + exec 1>&2 # write stdout on stderr instead + case "$1" in + ErrUsage|ErrHelp) + # usage already displayed + exit 1;; + ErrTex) + echo "File '$2' already exists." + exit 2;; + ErrListbibtex) + echo "Refusing to create temp file 'listbib.tex'. That file already" + echo "exists, and an infinite loop would result." + exit 3;; + ErrCall) + echo "An error occured." + echo "Investigate by running $2 on '$3'," + echo "or by examining log file '$outfile$4'." + exit 4;; + ErrStop) + exit 8;; + ErrMissingParameter) + echo "A required parameter for option $2 is missing." + echo "Call with -h for help." + exit 9;; + *) + echo "Error: exitwith() was called with illegal error code '$1'." + exit 19;; + esac +} + +#### +#### Parse command line +# +checkargmm() { + test "$1" != "--" -a "$2" != "--" + #true # uncomment this to allow "--" as argument to an option +} +checkarg2() { + test $# -ge 2 && checkargmm "$2" && return + exitwith ErrMissingParameter "$1" +} +parse_cmd_line() { + unset -v ps deltmp psonly outfileps + if [ $# -eq 0 ]; then usage; fi + while [ -n "$1" ]; do + case "$1" in + -h|--help) + usage;; + -o|--output) + checkarg2 "$@"; outfile="$2"; shift;; + -O|--same) + test -z "$2" && usage + eval outfileps=\${$#} + # strip trailing ".bib": + concat_bibnames "$outfileps"; outfileps="$listbibs";; + -p|--ps|--postscript) + ps="1";; + -d|--deltemp) + deltmp="1";; + -P|--psonly) + psonly="1";; + -PO|-OP) + shift; set FILL -P -O "$@";; + -po) + shift; set FILL -p -o "$@";; + -dpo|-pdo) + shift; set FILL -d -p -o "$@";; + --) shift;; + *) break;; + esac + shift + done + #fileargs=("$@") + fileargs="$@" +} + +#### +#### Functions +# +concat_bibnames() { + listbibs= + while [ -n "$1" ]; do + #listbibs="$listbibs,$1" + if [ -n "$listbibs" ]; then listbibs="$listbibs,"; fi + listbibs="$listbibs`echo $1 | sed -e 's,\.$,,' -e 's,.bib$,,'`" + shift + done +} + +idstring="% listbib $VERSION" +check_tex_is_ours() { + # exit with error if existing .tex is not a listbib one + test -f "$outfile".tex || return + awk "/$idstring/ {exit 0}; {exit 1}" "$outfile".tex \ + || exitwith ErrTex "$outfile".tex +} + +create_latexfile() { + test "$outfile" = "listbib" && exitwith ErrListbibtex + + cat >"$outfile".tex - </dev/null /dev/null /dev/null "LaTeX Warning: ($warn1|$warn2|$warn3)" "$outfile".log \ + && { + #cp "$outfile".log debug.log + echo "Again" + run_latex + } + true +} + +run_dvips() { + [ -z "$outfileps" ] && outfileps="$outfile" + if [ -n "$ps" -o -n "$psonly" ]; then + echo "Running dvips ..." + dvips >/dev/null 2>&1 -o "$outfileps.ps" "$outfile" + fi +} + +rm_temp() { + if [ -n "$deltmp" -o -n "$psonly" ]; then + rm >/dev/null 2>&1 "$outfile".aux "$outfile".bbl "$outfile".blg \ + "$outfile".log "$outfile".tex + fi + test -n "$psonly" && rm >/dev/null 2>&1 "$outfile".dvi + test -n "$signal" && rm >/dev/null 2>&1 "$outfileps".ps + true +} + +#### +#### Main + +parse_cmd_line "$@" +concat_bibnames $fileargs +echo "listbib $VERSION" +echo "Listing bibliographies:" $listbibs +check_tex_is_ours +signal="" +trap "echo >&2 'Deleting temp files';\ + psonly=1 signal=1 rm_temp; exitwith ErrStop" HUP INT QUIT PIPE TERM +create_latexfile +make_dvi || exit $? +run_dvips || exit $? +rm_temp || exit $? diff --git a/Build/source/texk/texlive/linked_scripts/pax/pdfannotextractor.pl b/Build/source/texk/texlive/linked_scripts/pax/pdfannotextractor.pl index a26ae11c23c..085dc43c5d3 100755 --- a/Build/source/texk/texlive/linked_scripts/pax/pdfannotextractor.pl +++ b/Build/source/texk/texlive/linked_scripts/pax/pdfannotextractor.pl @@ -2,7 +2,7 @@ use strict; $^W=1; -# Copyright (C) 2008, 2011 Heiko Oberdiek +# Copyright (C) 2008, 2011, 2012 Heiko Oberdiek # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,19 +24,21 @@ $^W=1; my $name = 'PDFAnnotExtractor'; my $program = "\L$name\E"; my $file = "$program.pl"; -my $version = "0.1k"; -my $date = "2011/07/06"; +my $version = "0.1l"; +my $date = "2012/04/18"; my $author = "Heiko Oberdiek"; -my $copyright = "Copyright (c) 2008, 2011 by $author."; +my $copyright = "Copyright (c) 2008, 2011, 2012 by $author."; # History: # 2008/10/01 v0.1i: First version of the wrapper script. +# 2012/04/18 v0.1l: Option --version added. my $title = "$name $version, $date - $copyright\n"; my $usage = <<"END_OF_USAGE"; ${title}Syntax: $program [options] Options: --help print usage + --version print version number --install try installing PDFBox library --debug debug informations END_OF_USAGE @@ -44,13 +46,19 @@ END_OF_USAGE my $help = 0; my $debug = 0; my $install = 0; +my $opt_version = 0; use Getopt::Long; GetOptions( 'debug!' => \$debug, 'install!' => \$install, - 'help!' => \$help + 'help!' => \$help, + 'version!' => \$opt_version, ) or die $usage; !$help or die $usage; +if ($opt_version) { + print "$name $date v$version\n"; + exit(0); +} !$install and (@ARGV >= 1 or die $usage); print $title; diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 5ea1ff2deb0..e075ac8acf9 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,13 +1,14 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 26026 2012-04-18 05:54:24Z preining $ +# $Id: tlmgr.pl 26063 2012-04-20 00:18:04Z preining $ # # Copyright 2008, 2009, 2010, 2011, 2012 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 26026 $'; -my $datrev = '$Date: 2012-04-18 07:54:24 +0200 (Wed, 18 Apr 2012) $'; +my $svnrev = '$Revision: 26063 $'; +my $datrev = '$Date: 2012-04-20 02:18:04 +0200 (Fri, 20 Apr 2012) $'; my $tlmgrrevision; +my $prg; if ($svnrev =~ m/: ([0-9]+) /) { $tlmgrrevision = $1; } else { @@ -87,6 +88,10 @@ TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname mkdirhier copy log debug tlcmp)); use TeXLive::TLPaper; +# +# set up $prg for warning messages +$prg = TeXLive::TLUtils::basename($0); + binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); @@ -149,6 +154,7 @@ sub main { "gui" => { "load" => 1 }, "install" => { "no-depends" => 1, "no-depends-at-all" => 1, + "file" => 1, "reinstall" => 1, "force" => 1, "dry-run|n" => 1 }, @@ -265,7 +271,7 @@ sub main { } if ((!defined($action) || !$action) && !$opts{"help"} && !$opts{"h"}) { - die "$0: missing action; try --help if you need it.\n"; + die "$prg: missing action; try --help if you need it.\n"; } if ($opts{"help"} || $opts{"h"}) { @@ -296,12 +302,12 @@ sub main { # give a short message about usage print " tlmgr revision $tlmgrrevision -usage: tlmgr -where is one of:\n"; +usage: tlmgr OPTION... ACTION ARGUMENT... +where ACTION is one of:\n"; for my $k (sort keys %actionoptions) { print " $k\n"; } - print "\nUse\n tlmgr --help + print "\nUse\n tlmgr ACTION --help for more details on a specific option, and tlmgr --help for the full story.\n"; @@ -557,7 +563,7 @@ sub execute_action { action_recreate_tlpdb(); finish(0); } else { - die "$0: unknown action: $action; try --help if you need it.\n"; + die "$prg: unknown action: $action; try --help if you need it.\n"; } # close the special log file @@ -2298,7 +2304,7 @@ sub action_update { if ( !$dry_run_cont && !$opts{"self"} && @critical) { critical_updates_warning(); if ($opts{"force"}) { - tlwarn("$0: Continuing due to --force.\n"); + tlwarn("$prg: Continuing due to --force.\n"); } elsif ($opts{"list"}) { # do not warn here } else { @@ -2306,7 +2312,7 @@ sub action_update { # return here and don't do any updates return; } else { - die "$0: Exiting, please read above warning.\n"; + die "$prg: Exiting, please read above warning.\n"; } } } @@ -2905,7 +2911,7 @@ sub action_update { "__BACKUP_${pkg}.r" . $tlp->revision, $tlp->relocated); if ($s <= 0) { - tlwarn("\n$0: Creation of backup container of $pkg failed.\n"); + tlwarn("\n$prg: Creation of backup container of $pkg failed.\n"); tlwarn("Continuing to update other packages, please retry...\n"); # we should try to update other packages at least next; @@ -3044,7 +3050,7 @@ sub action_update { logpackage("auto-install new: $pkg ($mediarevstr)"); $nrupdated++; } else { - tlwarn("$0: couldn't install new package $pkg\n"); + tlwarn("$prg: couldn't install new package $pkg\n"); } } } @@ -3253,6 +3259,12 @@ sub action_install { } } + # + # installation from a .tar.xz + if ($opts{"file"}) { + return $localtlpdb->install_package_files(@ARGV); + } + $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"}; info("install: dry run, no changes will be made\n") if $opts{"dry-run"}; @@ -3518,13 +3530,13 @@ sub action_repository { if ($what eq "add") { my $p = shift @ARGV; if (!defined($p)) { - tlwarn("You need to give a new repository aas argument to add\n"); + tlwarn("$prg: you need to give a new repository as argument to add\n"); return; } my $t = shift @ARGV; $t = $p if (!defined($t)); if (defined($repos{$t})) { - tlwarn("This repository or its tag is already defined, no action\n"); + tlwarn("$prg: this repository or its tag is already defined, no action\n"); return; } # TODO more checks needed? @@ -3543,6 +3555,11 @@ sub action_repository { $repos{$t} = $p; $localtlpdb->option("location", array_to_repository(%repos)); $localtlpdb->save; + if ($t eq $p) { + print "$prg: added repository $p\n"; + } else { + print "$prg: added repository `$t' for `$p'\n"; + } return; } if ($what eq "remove") { @@ -3563,6 +3580,7 @@ sub action_repository { } else { $localtlpdb->option("location", array_to_repository(%repos)); $localtlpdb->save; + print "$prg: removed repository `$p'\n"; } return; } @@ -3962,7 +3980,7 @@ sub action_generate { $dest .= ".dat.lua" if $append_extension; my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/tex/generic/config/language-local.dat.lua"; - debug("$0: writing language.dat.lua data to $dest\n"); + debug("$prg: writing language.dat.lua data to $dest\n"); TeXLive::TLUtils::create_language_lua($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --byhyphen $dest"); @@ -3977,7 +3995,7 @@ sub action_generate { $dest .= ".dat" if $append_extension; my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/tex/generic/config/language-local.dat"; - debug ("$0: writing language.dat data to $dest\n"); + debug ("$prg: writing language.dat data to $dest\n"); TeXLive::TLUtils::create_language_dat($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --byhyphen $dest"); @@ -3992,7 +4010,7 @@ sub action_generate { $dest .= ".def" if $append_extension; my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/tex/generic/config/language-local.def"; - debug("$0: writing language.def data to $dest\n"); + debug("$prg: writing language.def data to $dest\n"); TeXLive::TLUtils::create_language_def($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { do_cmd_and_check("fmtutil-sys --byhyphen $dest"); @@ -4005,7 +4023,7 @@ sub action_generate { } elsif ($what =~ m/^fmtutil$/i) { my $dest = $opts{"dest"} || "$TEXMFSYSVAR/web2c/fmtutil.cnf"; my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/web2c/fmtutil-local.cnf"; - debug("$0: writing new fmtutil.cnf to $dest\n"); + debug("$prg: writing new fmtutil.cnf to $dest\n"); TeXLive::TLUtils::create_fmtutil($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { @@ -4018,7 +4036,7 @@ sub action_generate { } elsif ($what =~ m/^updmap$/i) { my $dest = $opts{"dest"} || "$TEXMFSYSCONFIG/web2c/updmap.cfg"; my $localcfg = $opts{"localcfg"} || "$TEXMFLOCAL/web2c/updmap-local.cfg"; - debug("$0: writing new updmap.cfg to $dest\n"); + debug("$prg: writing new updmap.cfg to $dest\n"); TeXLive::TLUtils::create_updmap($localtlpdb, $dest, $localcfg); if ($opts{"rebuild-sys"}) { @@ -4029,7 +4047,7 @@ sub action_generate { } } else { - die "$0: Unknown option for generate: $what; try --help if you need it.\n"; + die "$prg: Unknown option for generate: $what; try --help if you need it.\n"; } return; @@ -4701,7 +4719,7 @@ sub check_depends { # on a client system or overriding global settings. # # tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] -# [install|remove] [shortcut|fileassoc|script] [ ...] +# [install|remove] [shortcut|fileassoc|script] [...] sub action_postaction { my $how = shift @ARGV; @@ -4995,7 +5013,7 @@ sub init_tlmedia # check that there is a main repository if (!TeXLive::TLUtils::member('main', @tags)) { - tldie("Cannot find main repository, you have to tag one as main!\n"); + tldie("$prg: Cannot find main repository, you have to tag one as main!\n"); } # TODO TODO @@ -5166,13 +5184,15 @@ END_NO_INTERNET my $texlive_release = $remotetlpdb->config_release; my $texlive_minrelease = $remotetlpdb->config_minrelease; if (!defined($texlive_release)) { - tldie "The installation repository does not specify a release year for which it was prepared, bailing out.\n"; + tldie("$prg: The installation repository does not specify a " + . "release year for which it was prepared, goodbye.\n"); } # still here, so we have $texlive_release defined my $texlive_release_year = $texlive_release; $texlive_release_year =~ s/^(....).*$/$1/; if ($texlive_release_year !~ m/^[1-9][0-9][0-9][0-9]$/) { - tldie "The installation repository does not specify a release year: $texlive_release, bailing out.\n"; + tldie("$prg: The installation repository does not specify a " + . "valid release year, goodbye: $texlive_release\n"); } # so $texlive_release_year is numeric, good if (defined($texlive_minrelease)) { @@ -5180,13 +5200,14 @@ END_NO_INTERNET my $texlive_minrelease_year = $texlive_minrelease; $texlive_minrelease_year =~ s/^(....).*$/$1/; if ($texlive_minrelease_year !~ m/^[1-9][0-9][0-9][0-9]$/) { - tldie "The installation repository does not specify a valid minimal release year: $texlive_minrelease, bailing out.\n"; + tldie("The installation repository does not specify a " + . "valid minimal release year, goodbye: $texlive_minrelease\n"); } # ok, all numeric and fine, check for range if ($TeXLive::TLConfig::ReleaseYear < $texlive_minrelease_year || $TeXLive::TLConfig::ReleaseYear > $texlive_release_year) { tldie < I +=item C I -Display detailed information about I, such as the installation +Display detailed information about I, such as the installation status and description. =back @@ -6294,19 +6315,19 @@ Print the TeX Live identifier for the detected platform C<--print-arch> is a synonym. -=head2 search [I] I +=head2 search [I