diff options
author | Vladimir Volovich <vvv@vsu.ru> | 2008-06-03 23:43:31 +0000 |
---|---|---|
committer | Vladimir Volovich <vvv@vsu.ru> | 2008-06-03 23:43:31 +0000 |
commit | a8abf8ac00fa5b2b21888bb2dd151fe33b97260b (patch) | |
tree | da9d185bfef2767ca98e91c6c5ce07e89ee26804 /Build/source/texk | |
parent | 3471eb3d90a83fd5b722a5b33ab9b9104a04ce14 (diff) |
LINKED_SCRIPTS: add texmf-dist/scripts/oberdiek/pdfatfi.pl
(per discussion with Norbert and Akira)
linked_scripts/pdfatfi.pl linked_scripts/texdoc.tlu linked_scripts/tlmgr.pl linked_scripts/dviasm.py:
synchronize with Master tree
git-svn-id: svn://tug.org/texlive/trunk@8531 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk')
-rw-r--r-- | Build/source/texk/texlive/Makefile.in | 1 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/dviasm.py | 11 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/pdfatfi.pl | 185 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/texdoc.tlu | 14 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/tlmgr.pl | 83 |
5 files changed, 269 insertions, 25 deletions
diff --git a/Build/source/texk/texlive/Makefile.in b/Build/source/texk/texlive/Makefile.in index 5a4cde2c56f..067822511c1 100644 --- a/Build/source/texk/texlive/Makefile.in +++ b/Build/source/texk/texlive/Makefile.in @@ -26,6 +26,7 @@ LINKED_SCRIPTS = \ texmf-dist/scripts/dviasm/dviasm.py \ texmf-dist/scripts/glossaries/makeglossaries \ texmf-dist/scripts/mkjobtexmf/mkjobtexmf.pl \ + texmf-dist/scripts/oberdiek/pdfatfi.pl \ texmf-dist/scripts/pdfcrop/pdfcrop.pl \ texmf-dist/scripts/perltex/perltex.pl \ texmf-dist/scripts/ppower4/pdfthumb.texlua \ diff --git a/Build/source/texk/texlive/linked_scripts/dviasm.py b/Build/source/texk/texlive/linked_scripts/dviasm.py index 4fadc21e6dc..adfe77c1609 100755 --- a/Build/source/texk/texlive/linked_scripts/dviasm.py +++ b/Build/source/texk/texlive/linked_scripts/dviasm.py @@ -864,7 +864,15 @@ class DVI(object): # Misc Functions for Main Routine ############################################################ def ProcessOptions(): - usage = "%prog [options] dvi_file|dvi_dump_file" + usage = """%prog [options] dvi_file|dvi_dump_file + +DVIasm is a Python script to support changing or creating DVI files +via disassembling into text, editing, and then reassembling into +binary format. It is fully documented at + +http://tug.org/TUGboat/Articles/tb28-2/tb89cho.pdf +http://ajt.ktug.kr/assets/2008/5/1/0201cho.pdf""" + version = """This is %prog-20080520 by Jin-Hwan Cho (Korean TeX Society) Copyright (C) 2007-2008 by Jin-Hwan Cho <chofchof@ktug.or.kr> @@ -873,6 +881,7 @@ This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.""" + parser = OptionParser(usage=usage, version=version) parser.add_option("-u", "--unit", action="store", type="string", dest="unit", diff --git a/Build/source/texk/texlive/linked_scripts/pdfatfi.pl b/Build/source/texk/texlive/linked_scripts/pdfatfi.pl new file mode 100755 index 00000000000..5c5500b74b1 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/pdfatfi.pl @@ -0,0 +1,185 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q' + if 0; +use strict; +$^W=1; # turn warning on +# +# pdfatfi.pl +# +# Copyright (C) 2005, 2006 Heiko Oberdiek. +# +# This work may be distributed and/or modified under the +# conditions of the LaTeX Project Public License, either version 1.3 +# of this license or (at your option) any later version. +# The latest version of this license is in +# http://www.latex-project.org/lppl.txt +# and version 1.3 or later is part of all distributions of LaTeX +# version 2005/12/01 or later. +# +# This work has the LPPL maintenance status "maintained". +# +# This Current Maintainer of this work is Heiko Oberdiek. +# +# See file "attachfile2.pdf" for a list of files that belong to this project. +# +# This file "pdfatfi.pl" may be renamed to "pdfatfi" +# for installation purposes. +# +my $file = "pdfatfi.pl"; +my $program = uc($&) if $file =~ /^\w+/; +my $version = "2.3"; +my $date = "2007/04/11"; +my $author = "Heiko Oberdiek"; +my $copyright = "Copyright (c) 2005, 2006 by $author."; +# +# History: +# 2005/05/21 v1.0: First release. +# 2006/08/16 v2.2: Included in DTX file of attachfile2.dtx. +# + +use POSIX qw(strftime); # %z is used (GNU) +use Digest::MD5; + +### program identification +my $title = "$program $version, $date - $copyright\n"; + +### error strings +my $Error = "!!! Error:"; # error prefix + +### variables +my $atfifile; + +### option variables +my @bool = ("false", "true"); +$::opt_help = 0; +$::opt_quiet = 0; +$::opt_debug = 0; +$::opt_verbose = 0; + +my $usage = <<"END_OF_USAGE"; +${title}Syntax: \L$program\E [options] <file[.atfi]> +Function: Help program for LaTeX package "attachfile2". +Options: (defaults:) + --help print usage + --(no)quiet suppress messages ($bool[$::opt_quiet]) + --(no)verbose verbose printing ($bool[$::opt_verbose]) + --(no)debug debug informations ($bool[$::opt_debug]) +END_OF_USAGE + +### process options +my @OrgArgv = @ARGV; +use Getopt::Long; +GetOptions( + "help!", + "quiet!", + "debug!", + "verbose!", +) or die $usage; +!$::opt_help or die $usage; +@ARGV == 1 or die "$usage$Error Missing jobname!\n"; + +$::opt_quiet = 0 if $::opt_verbose; + +print $title unless $::opt_quiet; + +### get jobname +$atfifile = $ARGV[0]; +if (!-f $atfifile && -f "$atfifile.atfi") { + $atfifile .= ".atfi"; +} +-f $atfifile or die "$Error File `$atfifile' not found!\n"; + +print "* job file = $atfifile\n" if $::opt_verbose; + +if ($::opt_debug) { + print <<"END_DEB"; +* OSNAME: $^O +* PERL_VERSION: $] +* ARGV: @OrgArgv +END_DEB +} + +my $tmpfile = $atfifile . ".tmp"; + +my $timezone = strftime "%z", localtime; +$timezone =~ s/^([+\-]\d\d)(\d\d)$/$1'$2'/; + +open(IN, $atfifile) or die "$Error Cannot open `$atfifile'!\n"; +open(OUT, ">$tmpfile") or die "$Error Cannot write `$tmpfile'!\n"; + +while(<IN>) { + # timezone + if (s/^(\\attachfile\@timezone\{).*(\})$/$1$timezone$2/) { + print "* timezone = $timezone\n" if $::opt_verbose; + } + + # file entry + if (/^\\attachfile\@file\[[^\]]*\]\{(.*)\}$/) { + my $hexfile = $1; + my $file = pack('H*', $hexfile); + my @s = stat($file); + if (@s == 0) { + print "!!! Warning: File `$file' not found!\n"; + } + else { + my $size = @s[7]; + my $mtime = @s[9]; + my $ctime = @s[10]; # inode change time + + my ($sec, $min, $hour, $mday, $mon, $year) = localtime($mtime); + my $moddate = sprintf("%04d%02d%02d%02d%02d%02d", + $year + 1900, $mon + 1, $mday, + $hour, $min, $sec); + + # Manual page "perlport" says that "ctime" is creation + # time instead of inode change time for "Win32" and + # "Mac OS", but it is unsupported for "Mac OS X". + my $creationdate = ""; + if ($^O eq 'MSWin32') { # cygwin? + ($sec, $min, $hour, $mday, $mon, $year) = localtime($ctime); + $creationdate = sprintf("%04d%02d%02d%02d%02d%02d", + $year + 1900, $mon + 1, $mday, + $hour, $min, $sec); + } + + # md5 checksum + my $checksum = ""; + my $ctx = Digest::MD5->new; + if (open(FILE, $file)) { + $ctx->addfile(*FILE); + $checksum = $ctx->hexdigest; + close(FILE); + } + else { + print "!!! Warning: File `$file' cannot be read," + . " dropping checksum!\n"; + } + + $_ = "\\attachfile\@file[" + . "ModDate=$moddate,Size=$size" + . (($checksum) ? ",CheckSum=$checksum" : "") + . (($creationdate) ? ",CreationDate=$creationdate" : "") + . "]{$hexfile}\n"; + if ($::opt_verbose) { + print "* file entry = $file\n"; + print " size = $size\n"; + print " moddate = $moddate\n"; + print " creationdate = $creationdate\n" if $creationdate; + print " checksum = $checksum\n" if $checksum; + } + } + } + + print OUT $_; +} + +close(IN); +close(OUT); + +unlink($atfifile) or die "$Error Cannot delete old `$atfifile'!\n"; +rename $tmpfile, $atfifile + or die "$Error Cannot move `$tmpfile' to `$atfifile'!\n"; + +print "*** ready. ***\n" unless $::opt_quiet; + +__END__ + diff --git a/Build/source/texk/texlive/linked_scripts/texdoc.tlu b/Build/source/texk/texlive/linked_scripts/texdoc.tlu index 6a747f7fa97..a8d6adf1751 100755 --- a/Build/source/texk/texlive/linked_scripts/texdoc.tlu +++ b/Build/source/texk/texlive/linked_scripts/texdoc.tlu @@ -1,5 +1,5 @@ #!/usr/bin/env texlua --- $Id: texdoc.tlu 8041 2008-05-11 08:58:09Z preining $ +-- $Id: texdoc.tlu 8423 2008-05-31 00:37:02Z mpg $ --[[ Written in lua by Frank Küster (2007) based on the shell script by Thomas Esser, David Aspinall, and Simon Wilkinson. Public domain.]] @@ -52,6 +52,18 @@ while table.maxn(arg) > 0 and string.match(arg[1],'^%-') do end end +--[[ aliases ]] +function alias_subs (name) + if name == "eg-live" or name == "eg-texlive" then + return "eg-texlive-en" + else + return name + end +end +for i, name in ipairs(arg) do + arg[i] = alias_subs(name) +end + --[[ function definitions ]] function list_iter (t) local i = 0 diff --git a/Build/source/texk/texlive/linked_scripts/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/tlmgr.pl index 84dd1cbc426..b8d38bf3224 100755 --- a/Build/source/texk/texlive/linked_scripts/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/tlmgr.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 6381 2008-01-23 17:50:54Z preining $ +# $Id: tlmgr.pl 8478 2008-06-02 12:45:52Z preining $ # # Copyright 2008 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -10,6 +10,10 @@ # - (?) removal does not remove created format files from TEXMFSYSVAR # - other features: dependency check?, ...? +my $svnrev = '$Revision: 8478 $'; +$svnrev =~ m/: ([0-9]+) /; +my $tlmgrrevision = $1; + my $Master; BEGIN { @@ -47,9 +51,11 @@ my $location; # option handling my $opt_location; my $opt_help = 0; +my $opt_version = 0; my $opt_netarchive; my $opt_diskarchive; my $opt_gui = 0; +my $opt_gui_lang; TeXLive::TLUtils::process_logging_options(); @@ -57,10 +63,21 @@ GetOptions("location=s" => \$opt_location, "netarchive=s" => \$opt_netarchive, "diskarchive=s" => \$opt_diskarchive, "gui" => \$opt_gui, + "gui-lang=s" => \$opt_gui_lang, + "version" => \$opt_version, "h|help|?" => \$opt_help) or pod2usage(2); my $action = shift; +if (!defined($action) && $opt_gui) { + $action = "gui"; +} + +if ($opt_version) { + print "tlmgr revision $tlmgrrevision\n"; + exit(0); +} + if (!defined($action) && !$opt_help) { print "missing action\ntry 'tlmgr help' for more information.\n"; exit 1; @@ -157,7 +174,7 @@ if (defined($ret{'format'})) { # system("texconfig-sys", "generate", "fmtutil"); # running fmtutil-sys only in case that at installation time the # option for building formats was selected - if ($localtlpdb->option_formats) { + if ($localtlpdb->option_create_formats) { print "running fmtutil-sys --missing\n"; system("fmtutil-sys", "--missing"); } @@ -575,10 +592,12 @@ sub action_update { } foreach my $pkg (@todo) { next if ($pkg =~ m/^00texlive/); - if (win32() && (($pkg eq "texlive-infra") || ($pkg eq "bin-texlive"))) { - info("We cannot upgrade $pkg on win32, since we are running it!\n"); - next; - } + # it looks like that can actually be done!!! + # It gives several warnings but afterwards the files are changed. Strange + #if (win32() && (($pkg eq "texlive-infra") || ($pkg eq "bin-texlive"))) { + # info("We cannot upgrade $pkg on win32, since we are running it!\n"); + # next; + #} my $tlp = $localtlpdb->get_package($pkg); if (!defined($tlp)) { printf STDERR "Strange, $pkg cannot be found!\n"; @@ -700,36 +719,36 @@ sub action_option { my $loc = shift @ARGV; if (defined($loc)) { print "Defaulting to", ($loc ? "" : " not"), " install documentation files!\n"; - $localtlpdb->option_docfiles($loc); + $localtlpdb->option_install_docfiles($loc); $localtlpdb->save; } else { - print "Install documentation files: ", $localtlpdb->option_docfiles, "\n"; + print "Install documentation files: ", $localtlpdb->option_install_docfiles, "\n"; } } elsif ($what =~ m/^srcfiles$/i) { # changes the default srcfiles my $loc = shift @ARGV; if (defined($loc)) { print "Defaulting to", ($loc ? "" : " not"), " install source files!\n"; - $localtlpdb->option_srcfiles($loc); + $localtlpdb->option_install_srcfiles($loc); $localtlpdb->save; } else { - print "Install source files: ", $localtlpdb->option_srcfiles, "\n"; + print "Install source files: ", $localtlpdb->option_install_srcfiles, "\n"; } } elsif ($what =~ m/^formats$/i) { # changes the default formats my $loc = shift @ARGV; if (defined($loc)) { print "Defaulting to", ($loc ? "" : " not"), " generate format files on installation!\n"; - $localtlpdb->option_formats($loc); + $localtlpdb->option_create_formats($loc); $localtlpdb->save; } else { - print "Create formats on installation: ", $localtlpdb->option_formats, "\n"; + print "Create formats on installation: ", $localtlpdb->option_create_formats, "\n"; } } elsif ($what =~ m/^show$/i) { print "Default installation source: ", $localtlpdb->option_location, "\n"; - print "Create formats on installation: ", ($localtlpdb->option_formats ? "yes": "no"), "\n"; - print "Install documentation files: ", ($localtlpdb->option_docfiles ? "yes": "no"), "\n"; - print "Install source files: ", ($localtlpdb->option_srcfiles ? "yes": "no"), "\n"; + print "Create formats on installation: ", ($localtlpdb->option_create_formats ? "yes": "no"), "\n"; + print "Install documentation files: ", ($localtlpdb->option_install_docfiles ? "yes": "no"), "\n"; + print "Install source files: ", ($localtlpdb->option_install_srcfiles ? "yes": "no"), "\n"; } else { warn "Setting other options currently not supported, please edit texlive.tlpdb!"; } @@ -809,9 +828,9 @@ sub action_arch { merge_into (\%ret, $tlmediasrc->install_package("bin-tlpsv.win32", $localtlpdb, 1, 0)); } # update the option_archs list of installed archs - my @larchs = $localtlpdb->option_archs; + my @larchs = $localtlpdb->option_available_archs; push @larchs, @todoarchs; - $localtlpdb->option_archs(@larchs); + $localtlpdb->option_available_archs(@larchs); $localtlpdb->save; } else { die "Unknown option for arch: $what"; @@ -826,24 +845,29 @@ sub action_generate { Getopt::Long::Configure(qw(no_pass_through)); GetOptions("localcfg=s" => \$localconf, "dest=s" => \$dest,) or pod2usage(2); init_local_db(); + if ($what =~ m/^language$/i) { $dest || ($dest = kpsewhich ("TEXMFSYSVAR") . "/tex/generic/config/language.dat"); $localconf || ($localconf = kpsewhich ("TEXMFLOCAL") . "/tex/generic/config/language-local.dat"); - info("$0: writing language data to $dest\n"); + debug("$0: writing language data to $dest\n"); TeXLive::TLUtils::create_language ($localtlpdb, $dest, $localconf); + } elsif ($what =~ m/^fmtutil$/i) { $dest || ($dest = kpsewhich("TEXMFSYSVAR") . "/web2c/fmtutil.cnf"); $localconf || ($localconf = kpsewhich("TEXMFLOCAL") . "/web2c/fmtutil-local.cnf"); - info("writing fmtutil.cnf data to $dest\n"); + debug("$0: writing fmtutil.cnf data to $dest\n"); TeXLive::TLUtils::create_fmtutil($localtlpdb, $dest, $localconf); + } elsif ($what =~ m/^updmap$/i) { $dest || ($dest = kpsewhich("TEXMFSYSVAR") . "/web2c/updmap.cfg"); $localconf || ($localconf = kpsewhich("TEXMFLOCAL") . "/web2c/updmap-local.cfg"); - info("$0: writing new updmap.cfg to $dest\n"); + debug("$0: writing new updmap.cfg to $dest\n"); TeXLive::TLUtils::create_updmap ($localtlpdb, $dest, $localconf); + } else { - die "Unknown option for generate: $what"; + die "$0: Unknown option for generate: $what (try --help if you need it)\n"; } + return; } @@ -881,6 +905,8 @@ sub action_gui { } my @cmdline; push @cmdline, $perlbinquote, $perlscript; + push @cmdline, "--lang", "$opt_gui_lang" + if (defined($opt_gui_lang)); push @cmdline, "--location", "$opt_location" if (defined($opt_location)); push @cmdline, "--netarchive", "$opt_netarchive" @@ -924,7 +950,7 @@ sub action_uninstall { $sys_bin = $tlpdb->option_sys_bin; $sys_man = $tlpdb->option_sys_man; $sys_info= $tlpdb->option_sys_info; - $opt_symlinks = $tlpdb->option_symlinks; + $opt_symlinks = $tlpdb->option_create_symlinks; $texdir = $Master; $texmfhome = `kpsewhich -var-value=TEXMFHOME`; chomp($texmfhome); $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`; chomp($texmfsysvar); @@ -1133,6 +1159,13 @@ into the respective screen of the GUI. So calling will bring you directly into the update screen. +=item B<--gui-lang> + +Normally the GUI tries to deduce your language from the environment +(on Windows via the registry, on Unix via LC_MESSAGES). If that fails +you can select a different language by giving this option a two-letter +language code. + =item B<--netarchive> I<dir> Overrides the default settings for netarchive. Should be used with care. @@ -1141,6 +1174,10 @@ Overrides the default settings for netarchive. Should be used with care. Overrides the default settings for diskarchive. Should be used with care. +=item B<--version> + +Echos the tlmgr.pl script's revision number and exits. + =back The standard options B<--help/-h/-?> and B<--debug> are also accepted. @@ -1155,7 +1192,7 @@ Gives this help page. =item B<gui> -Run using a graphical interface. +Start the graphical user interface. =item B<install [I<option>]... I<pkg>...> |