[SCM] Debian packaging of texlive-bin) branch, master, updated. debian/2012.20130315.29398-1-10-g88a1462
The following commit has been merged in the master branch:
commit 2006a8d2424af6c8f9ece9e13b071fdfb3136645
Author: Norbert Preining <preining@logic.at>
Date: Sun May 12 22:15:27 2013 +0900
import sources from svn rev 30417
diff --git a/Build b/Build
index 85fc367..dff4f2e 100755
--- a/Build
+++ b/Build
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: Build 29505 2013-03-25 23:46:26Z karl $
+# $Id$
# Public domain. Originally written many years ago by Sebastian Rahtz.
# To build again, try Build --no-clean.
# To build without optimization, try Build --debug.
diff --git a/README b/README
index 8631b15..81f7c3e 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-$Id: README 30204 2013-05-02 06:25:42Z peter $
+$Id$
Public domain. Originally written 2005 by Karl Berry.
For a high-level overview of building TeX Live, see
diff --git a/debian/sync-sources b/debian/sync-sources
index 125b588..6c51be9 100644
--- a/debian/sync-sources
+++ b/debian/sync-sources
@@ -1,5 +1,5 @@
-rsync -avz --delete \
+rsync -avz $1 --delete \
--exclude debian \
--exclude .git \
--exclude libs/freetype2 \
@@ -13,7 +13,8 @@ rsync -avz --delete \
--exclude Makefile.in \
--exclude aclocal.m4 \
--exclude configure \
- /src/TeX/texlive-svn/Build/source/ .
+ /src/TeX/TL-dvcs/texlive.git/Build/source/ .
+ #/src/TeX/texlive-svn/Build/source/ .
echo "removing ./inst"
rm -rf inst
echo "removing ./Work"
diff --git a/extra/README b/extra/README
index e7ce5f6..abfbca7 100644
--- a/extra/README
+++ b/extra/README
@@ -1,4 +1,4 @@
-$Id: README 25198 2012-01-26 00:42:37Z preining $
+$Id$
Public domain. Originally written 2010 by Karl Berry.
This directory contains things which are not part of the TeX Live build,
diff --git a/extra/epstopdf/Makefile b/extra/epstopdf/Makefile
index 9c17e9f..878b8ee 100644
--- a/extra/epstopdf/Makefile
+++ b/extra/epstopdf/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile 26570 2012-05-22 16:14:37Z karl $
+# $Id$
# This file is public domain. (Originally written by Karl Berry, 2009.)
e2p = ./epstopdf.pl #--debug
diff --git a/extra/epstopdf/README b/extra/epstopdf/README
index 8db8019..8d8eb58 100644
--- a/extra/epstopdf/README
+++ b/extra/epstopdf/README
@@ -1,4 +1,4 @@
-$Id: README 17507 2010-03-19 22:52:56Z karl $
+$Id$
This file is public domain. (Originally written by Karl Berry, 2009.)
This is the README for the epstopdf script distribution.
diff --git a/extra/epstopdf/epstopdf.1 b/extra/epstopdf/epstopdf.1
index ac57d1d..019548a 100644
--- a/extra/epstopdf/epstopdf.1
+++ b/extra/epstopdf/epstopdf.1
@@ -1,5 +1,5 @@
.TH EPSTOPDF 1 "18 March 2010"
-.\" $Id: epstopdf.1 18160 2010-05-09 00:02:00Z karl $
+.\" $Id$
.SH NAME
epstopdf, repstopdf \- convert an EPS file to PDF
.SH SYNOPSIS
diff --git a/extra/epstopdf/epstopdf.pl b/extra/epstopdf/epstopdf.pl
index 31dd474..0e3c551 100755
--- a/extra/epstopdf/epstopdf.pl
+++ b/extra/epstopdf/epstopdf.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: epstopdf.pl 26570 2012-05-22 16:14:37Z karl $
+# $Id$
# (Copyright lines below.)
#
# Redistribution and use in source and binary forms, with or without
@@ -154,7 +154,7 @@
### program identification
my $program = "epstopdf";
-my $ident = '($Id: epstopdf.pl 26570 2012-05-22 16:14:37Z karl $) 2.18';
+my $ident = '($Id$) 2.18';
my $copyright = <<END_COPYRIGHT ;
Copyright 2009-2012 Karl Berry et al.
Copyright 2002-2009 Gerben Wierda et al.
diff --git a/libs/README b/libs/README
index 56b7737..cf8ff4d 100644
--- a/libs/README
+++ b/libs/README
@@ -1,4 +1,4 @@
-$Id: README 29693 2013-04-06 11:02:44Z peter $
+$Id$
Public domain. Originally created by Karl Berry, 2005.
Libraries we compile for TeX Live.
diff --git a/reautoconf b/reautoconf
index 9af782a..dcb1b0e 100755
--- a/reautoconf
+++ b/reautoconf
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: reautoconf 15977 2009-11-10 10:34:20Z peter $
+# $Id$
# This "reautoconf" script found at the root of the TeX Live source tree
# runs aclocal and autoconf (from PATH) in all relevant directories.
#
diff --git a/texk/README b/texk/README
index de6f1b2..3cef136 100644
--- a/texk/README
+++ b/texk/README
@@ -1,4 +1,4 @@
-$Id: README 29858 2013-04-11 08:47:44Z peter $
+$Id$
Copyright 2006-2012 TeX Users Group.
You may freely use, modify and/or distribute this file.
diff --git a/texk/dvipng/dvipng.test b/texk/dvipng/dvipng.test
index 7a7f918..baaba3c 100755
--- a/texk/dvipng/dvipng.test
+++ b/texk/dvipng/dvipng.test
@@ -1,5 +1,5 @@
#! /bin/sh
-# $Id: dvipng.test 26589 2012-05-23 07:16:33Z peter $
+# $Id$
# Public domain. Originally written by Peter Breitenlohner, 2009.
get_val () {
diff --git a/texk/dvipsk/README b/texk/dvipsk/README
index 8f373b1..b97242c 100644
--- a/texk/dvipsk/README
+++ b/texk/dvipsk/README
@@ -1,4 +1,4 @@
-$Id: README 17566 2010-03-26 17:29:02Z karl $
+$Id$
This directory contains Dvips, Tom Rokicki's dvips, a DVI-to-PostScript
translator. It requires the Kpathsea library for path searching.
diff --git a/texk/dvipsk/afm2tfm-test.pl b/texk/dvipsk/afm2tfm-test.pl
index 1b3b787..69704ae 100755
--- a/texk/dvipsk/afm2tfm-test.pl
+++ b/texk/dvipsk/afm2tfm-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: afm2tfm-test.pl 17798 2010-04-11 00:54:05Z karl $
+# $Id$
# Public domain. Originally written 2010, Karl Berry.
# Check that afm2tfm functions at all.
diff --git a/texk/dvipsk/afm2tfm.c b/texk/dvipsk/afm2tfm.c
index 779adb9..6d3b989 100644
--- a/texk/dvipsk/afm2tfm.c
+++ b/texk/dvipsk/afm2tfm.c
@@ -1,4 +1,4 @@
-/* $Id: afm2tfm.c 29676 2013-04-05 21:26:54Z karl $ */
+/* $Id$ */
/* Public domain, originally written by Tom Rokicki.
* This program converts AFM files to TeX TFM files, and optionally
diff --git a/texk/dvipsk/config.ps b/texk/dvipsk/config.ps
index bd15a45..eca17e7 100644
--- a/texk/dvipsk/config.ps
+++ b/texk/dvipsk/config.ps
@@ -1,4 +1,4 @@
-% $Id: config.ps 18475 2010-05-25 15:55:00Z karl $
+% $Id$
% config.ps - configuration file for dvips.
% Tomas Rokicki, Thomas Esser, Karl Berry, et al., 1986ff, public domain.
diff --git a/texk/dvipsk/dvips.h b/texk/dvipsk/dvips.h
index 8fa83d0..daf7ff7 100644
--- a/texk/dvipsk/dvips.h
+++ b/texk/dvipsk/dvips.h
@@ -1,4 +1,4 @@
-/* $Id: dvips.h 29676 2013-04-05 21:26:54Z karl $
+/* $Id$
* Copyright 1986-2013 Tomas Rokicki.
* This is dvips, a freely redistributable PostScript driver
* for dvi files. You may freely use, modify and/or distribute this
diff --git a/texk/dvipsk/quotecmd-test.pl b/texk/dvipsk/quotecmd-test.pl
index 7dfc103..47ea252 100755
--- a/texk/dvipsk/quotecmd-test.pl
+++ b/texk/dvipsk/quotecmd-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: quotecmd-test.pl 21216 2011-01-29 00:32:02Z karl $
+# $Id$
# Public domain. Originally written 2010, Karl Berry.
# Check that dvips quotes external command arguments.
diff --git a/texk/dvipsk/squeeze/squeeze.c b/texk/dvipsk/squeeze/squeeze.c
index 07393a9..e3ce0d6 100644
--- a/texk/dvipsk/squeeze/squeeze.c
+++ b/texk/dvipsk/squeeze/squeeze.c
@@ -1,4 +1,4 @@
-/* $Id: squeeze.c 14277 2009-07-16 12:00:58Z peter $
+/* $Id$
* Copyright 1986-2008 Tomas Rokicki.
* You may freely use, modify and/or distribute this program or any
* portion thereof.
diff --git a/texk/kpathsea/cnf-to-paths.awk b/texk/kpathsea/cnf-to-paths.awk
index 939f54d..faae308 100644
--- a/texk/kpathsea/cnf-to-paths.awk
+++ b/texk/kpathsea/cnf-to-paths.awk
@@ -1,4 +1,4 @@
-# $Id: cnf-to-paths.awk 23442 2011-08-07 22:50:24Z karl $
+# $Id$
# cnf-to-paths.awk - convert texmf.cnf assignments to paths.h #define's.
# Public domain. Originally written 2011, Karl Berry.
diff --git a/texk/kpathsea/mktex.cnf b/texk/kpathsea/mktex.cnf
index 1642187..f137aa4 100644
--- a/texk/kpathsea/mktex.cnf
+++ b/texk/kpathsea/mktex.cnf
@@ -1,4 +1,4 @@
-# $Id: mktex.cnf 12069 2009-02-04 00:09:54Z karl $
+# $Id$
# Public domain.
#
# The mktex.cnf file, if it exists, can be used to tailor a setup to
diff --git a/texk/kpathsea/mktex.opt b/texk/kpathsea/mktex.opt
index bd5d0fb..b1bd143 100644
--- a/texk/kpathsea/mktex.opt
+++ b/texk/kpathsea/mktex.opt
@@ -2,7 +2,7 @@
# Meant to be sourced after $usage, $version, and $MT_TEXMFMAIN have been set.
#
# Originally written by Thomas Esser. Public domain.
-# $Id: mktex.opt 18383 2010-05-20 18:31:24Z karl $
+# $Id$
if test "x$1" = x--help || test "x$1" = x-help; then
echo "$usage"
diff --git a/texk/kpathsea/mktexdir b/texk/kpathsea/mktexdir
index e9c2100..93ec4db 100755
--- a/texk/kpathsea/mktexdir
+++ b/texk/kpathsea/mktexdir
@@ -6,7 +6,7 @@
# Modified for sticky directory creation, --help, --version, more,
# by Thomas Esser, Karl Berry, Olaf Weber, et al.
-version='$Id: mktexdir 18383 2010-05-20 18:31:24Z karl $'
+version='$Id$'
usage="Usage: $0 DIRS...
Create each DIR, including any missing leading directories."
mt_max_args=$#
diff --git a/texk/kpathsea/mktexdir.opt b/texk/kpathsea/mktexdir.opt
index 4d4345d..1420faa 100644
--- a/texk/kpathsea/mktexdir.opt
+++ b/texk/kpathsea/mktexdir.opt
@@ -3,7 +3,7 @@
#
# Originally written by Thomas Esser.
# Public domain.
-# $Id: mktexdir.opt 16497 2009-12-24 18:38:47Z karl $
+# $Id$
# Set append-only bit on created directories.
case "$MT_FEATURES" in
diff --git a/texk/kpathsea/mktexlsr b/texk/kpathsea/mktexlsr
index 7253d26..d3501ce 100755
--- a/texk/kpathsea/mktexlsr
+++ b/texk/kpathsea/mktexlsr
@@ -11,7 +11,7 @@
# <te@dbs.uni-hannover.de>, Okt., 1994.
# Public domain.
-version='$Id: mktexlsr 23151 2011-06-27 22:27:02Z karl $'
+version='$Id$'
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname [OPTION]... [DIR]...
diff --git a/texk/kpathsea/mktexmf b/texk/kpathsea/mktexmf
index d5c77a8..314b7af 100755
--- a/texk/kpathsea/mktexmf
+++ b/texk/kpathsea/mktexmf
@@ -7,7 +7,7 @@
# Originally written by Thomas Esser.
# Public domain.
-version='$Id: mktexmf 26569 2012-05-22 16:05:18Z karl $'
+version='$Id$'
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname FONT.
diff --git a/texk/kpathsea/mktexnam b/texk/kpathsea/mktexnam
index e895662..69a975c 100755
--- a/texk/kpathsea/mktexnam
+++ b/texk/kpathsea/mktexnam
@@ -3,7 +3,7 @@
# Primarily written by Thomas Esser, Karl Berry, and Olaf Weber.
# Public domain.
-version='$Id: mktexnam 16497 2009-12-24 18:38:47Z karl $'
+version='$Id$'
usage="Usage: $0 NAME [DPI MODE] [DESTDIR].
Output the PK, TFM, and MF names for a font NAME."
mt_max_args=4
diff --git a/texk/kpathsea/mktexnam.opt b/texk/kpathsea/mktexnam.opt
index a9eb4e5..32d98df 100644
--- a/texk/kpathsea/mktexnam.opt
+++ b/texk/kpathsea/mktexnam.opt
@@ -3,7 +3,7 @@
#
# Primarily written by Thomas Esser, Karl Berry, and Olaf Weber.
# Public domain.
-# $Id: mktexnam.opt 18383 2010-05-20 18:31:24Z karl $
+# $Id$
# Get 8.3 filenames like dpiNNN/NAME.pk.
case "$MT_FEATURES" in
diff --git a/texk/kpathsea/mktexpk b/texk/kpathsea/mktexpk
index 48a57bd..4488192 100755
--- a/texk/kpathsea/mktexpk
+++ b/texk/kpathsea/mktexpk
@@ -8,7 +8,7 @@
# Report bugs to tex-k@tug.org.
# Public domain.
-version='$Id: mktexpk 18407 2010-05-21 18:16:31Z karl $'
+version='$Id$'
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname [OPTIONS] NAME [REDIRECT],
Create a PK font.
diff --git a/texk/kpathsea/mktextfm b/texk/kpathsea/mktextfm
index bc65668..9a10a79 100755
--- a/texk/kpathsea/mktextfm
+++ b/texk/kpathsea/mktextfm
@@ -7,7 +7,7 @@
# Primarily written by Thomas Esser, Karl Berry, and Olaf Weber.
# Public domain.
-version='$Id: mktextfm 16497 2009-12-24 18:38:47Z karl $'
+version='$Id$'
progname=`echo $0 | sed 's%.*/%%'`
usage="Usage: $progname [--destdir DESTDIR] FONT.
diff --git a/texk/kpathsea/mktexupd b/texk/kpathsea/mktexupd
index 1636e68..54df6e0 100755
--- a/texk/kpathsea/mktexupd
+++ b/texk/kpathsea/mktexupd
@@ -3,9 +3,9 @@
#
# Primarily written by Thomas Esser, Karl Berry, and Olaf Weber.
# Public domain.
-# $Id: mktexupd 18383 2010-05-20 18:31:24Z karl $
+# $Id$
-version='$Id: mktexupd 18383 2010-05-20 18:31:24Z karl $'
+version='$Id$'
usage="Usage: $0 DIR FILE.
Update the ls-R file with an entry for FILE in DIR."
mt_min_args=2
diff --git a/texk/makeindexk/tests/nested-range-test.pl b/texk/makeindexk/tests/nested-range-test.pl
index 265b93e..4413282 100755
--- a/texk/makeindexk/tests/nested-range-test.pl
+++ b/texk/makeindexk/tests/nested-range-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: nested-range-test.pl 24153 2011-09-30 08:41:47Z peter $
+# $Id$
# Public domain. Originally written 2011, Karl Berry.
# Check that makeindex doesn't create spurious output from nested ranges.
# See nested-range.tex and -bb.tex.
diff --git a/texk/tests/TeXLive/TLUtils.pm b/texk/tests/TeXLive/TLUtils.pm
index fdcd482..fdc594d 100644
--- a/texk/tests/TeXLive/TLUtils.pm
+++ b/texk/tests/TeXLive/TLUtils.pm
@@ -5,7 +5,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 30127 $';
+my $svnrev = '$Revision: 30367 $';
my $_modulerevision;
if ($svnrev =~ m/: ([0-9]+) /) {
$_modulerevision = $1;
@@ -49,6 +49,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure
TeXLive::TLUtils::dirname($path);
TeXLive::TLUtils::basename($path);
TeXLive::TLUtils::dirname_and_basename($path);
+ TeXLive::TLUtils::tl_abs_path($path);
TeXLive::TLUtils::dir_writable($path);
TeXLive::TLUtils::dir_creatable($path);
TeXLive::TLUtils::mkdirhier($path);
@@ -136,6 +137,7 @@ BEGIN {
&dirname
&basename
&dirname_and_basename
+ &tl_abs_path
&dir_writable
&dir_creatable
&mkdirhier
@@ -542,26 +544,62 @@ sub run_cmd {
=over 4
-=item C<dirname($path)>
+=item C<dirname_and_basename($path)>
-Return C<$path> with its trailing C</component> removed.
+Return both C<dirname> and C<basename>. Example:
+
+ ($dirpart,$filepart) = dirname_and_basename ($path);
=cut
-sub dirname {
+sub dirname_and_basename {
my $path=shift;
+ my ($share, $base) = ("", "");
if (win32) {
$path=~s!\\!/!g;
}
+ # do not try to make sense of paths ending with /..
+ return (undef, undef) if $path =~ m!/\.\.$!;
if ($path=~m!/!) { # dirname("foo/bar/baz") -> "foo/bar"
- $path=~m!(.*)/.*!; # works because of greedy matching
- return $1;
+ # eliminate `/.' path components
+ while ($path =~ s!/\./!/!) {};
+ # UNC path? => first split in $share = //xxx/yy and $path = /zzzz
+ if (win32() and $path =~ m!^(//[^/]+/[^/]+)(.*)$!) {
+ ($share, $path) = ($1, $2);
+ if ($path =~ m!^/?$!) {
+ $path = $share;
+ $base = "";
+ } elsif ($path =~ m!(/.*)/(.*)!) {
+ $path = $share.$1;
+ $base = $2;
+ } else {
+ $base = $path;
+ $path = $share;
+ }
+ return ($path, $base);
+ }
+ # not a UNC path
+ $path=~m!(.*)/(.*)!; # works because of greedy matching
+ return ((($1 eq '') ? '/' : $1), $2);
} else { # dirname("ignore") -> "."
- return ".";
+ return (".", $path);
}
}
+=item C<dirname($path)>
+
+Return C<$path> with its trailing C</component> removed.
+
+=cut
+
+sub dirname {
+ my $path = shift;
+ my ($dirname, $basename) = dirname_and_basename($path);
+ return $dirname;
+}
+
+
=item C<basename($path)>
Return C<$path> with any leading directory components removed.
@@ -569,34 +607,51 @@ Return C<$path> with any leading directory components removed.
=cut
sub basename {
- my $path=shift;
- if (win32) {
- $path=~s!\\!/!g;
- }
- if ($path=~m!/!) { # basename("foo/bar") -> "bar"
- $path=~m!.*/(.*)!;
- return $1;
- } else { # basename("ignore") -> "ignore"
- return $path;
- }
+ my $path = shift;
+ my ($dirname, $basename) = dirname_and_basename($path);
+ return $basename;
}
-=item C<dirname_and_basename($path)>
-
-Return both C<dirname> and C<basename>. Example:
+=item C<tl_abs_path($path)>
- ($dirpart,$filepart) = dirname_and_basename ($path);
+# Other than Cwd::abs_path, tl_abs_path also works
+# if only the grandparent exists.
=cut
-sub dirname_and_basename {
- my $path=shift;
+sub tl_abs_path {
+ my $path = shift;
if (win32) {
$path=~s!\\!/!g;
}
- $path=~/(.*)\/(.*)/;
- return ("$1", "$2");
+ my $ret;
+ eval {$ret = Cwd::abs_path($path);}; # eval needed for w32
+ return $ret if defined $ret;
+ # $ret undefined: probably the parent does not exist.
+ # But we also want an answer if only the grandparent exists.
+ my ($parent, $base) = dirname_and_basename($path);
+ return undef unless defined $parent;
+ eval {$ret = Cwd::abs_path($parent);};
+ if (defined $ret) {
+ if ($ret =~ m!/$! or $base =~ m!^/!) {
+ $ret = "$ret$base";
+ } else {
+ $ret = "$ret/$base";
+ }
+ return $ret;
+ } else {
+ my ($pparent, $pbase) = dirname_and_basename($parent);
+ return undef unless defined $pparent;
+ eval {$ret = Cwd::abs_path($pparent);};
+ return undef unless defined $ret;
+ if ($ret =~ m!/$!) {
+ $ret = "$ret$pbase/$base";
+ } else {
+ $ret = "$ret/$pbase/$base";
+ }
+ return $ret;
+ }
}
@@ -614,14 +669,16 @@ sub dir_slash {
# test whether subdirectories can be created in the argument
sub dir_creatable {
- $path=shift;
+ my $path=shift;
#print STDERR "testing $path\n";
$path =~ s!\\!/!g if win32;
+ return 0 unless -d $path;
$path =~ s!/$!!;
- return 0 unless -d dir_slash($path);
#print STDERR "testing $path\n";
my $i = 0;
- while (-e $path . "/" . $i) { $i++; }
+ my $too_large = 100000;
+ while ((-e $path . "/" . $i) and $i<$too_large) { $i++; }
+ return 0 if $i>=$too_large;
my $d = $path."/".$i;
#print STDERR "creating $d\n";
return 0 unless mkdir $d;
@@ -652,12 +709,14 @@ a fileserver.
# real Program Files. Ugh.
sub dir_writable {
- $path=shift;
- return 0 unless -d dir_slash($path);
+ my $path=shift;
+ return 0 unless -d $path;
$path =~ s!\\!/!g if win32;
$path =~ s!/$!!;
my $i = 0;
- while (-e $path . "/" . $i) { $i++; }
+ my $too_large = 100000;
+ while ((-e $path . "/" . $i) and $i<$too_large) { $i++; }
+ return 0 if $i>=$too_large;
my $f = $path."/".$i;
return 0 unless open TEST, ">".$f;
my $written = 0;
@@ -3076,22 +3135,24 @@ Test whether installation with TEXDIR set to $texdir would succeed due to
writing permissions.
Writable or not, we will not allow installation to the root
-directory (Unix) or the root of the system drive (Windows).
+directory (Unix) or the root of a drive (Windows).
=cut
sub texdir_check {
my $texdir = shift;
+ return 0 unless defined $texdir;
+ # convert to absolute/canonical, for safer parsing
+ # tl_abs_path should work as long as grandparent exists
+ $texdir = tl_abs_path($texdir);
+ return 0 unless defined $texdir;
+ # also reject the root of a drive/volume,
+ # assuming that only the canonical form of the root ends with /
+ return 0 if $texdir =~ m!/$!;
my $texdirparent;
my $texdirpparent;
- $texdir =~ s!/$!!; # remove final slash
- #print STDERR "Checking $texdir".'[/]'."\n";
- # disallow unix root
- return 0 if $texdir eq "";
- # disallow w32 systemdrive root
- return 0 if (win32() and $texdir eq $ENV{SystemDrive});
-
- return dir_writable($texdir) if (-d dir_slash($texdir));
+
+ return dir_writable($texdir) if (-d $texdir);
($texdirparent = $texdir) =~ s!/[^/]*$!!;
#print STDERR "Checking $texdirparent".'[/]'."\n";
return dir_creatable($texdirparent) if -d dir_slash($texdirparent);
@@ -3401,16 +3462,16 @@ would be considered part of the filename.
sub conv_to_w32_path {
my $p = shift;
- $p =~ s!/!\\!g;
# we need absolute paths, too
- if ($p !~ m!^.:!) {
- my $cwd = `cd`;
- die "sorry, could not find current working directory via cd?!" if ! $cwd;
- chomp($cwd);
- $p = "$cwd\\$p";
- }
- $p = quotify_path_with_spaces($p);
- return($p);
+ my $pabs = tl_abs_path($p);
+ if (not defined $pabs) {
+ $pabs = $p;
+ tlwarn ("sorry, could not determine absolute path of $p!\n".
+ "using original path instead");
+ }
+ $pabs =~ s!/!\\!g;
+ $pabs = quotify_path_with_spaces($pabs);
+ return($pabs);
}
=pod
diff --git a/texk/tests/texmf/afmtest.afm b/texk/tests/texmf/afmtest.afm
index 9741c54..ab46eaa 100644
--- a/texk/tests/texmf/afmtest.afm
+++ b/texk/tests/texmf/afmtest.afm
@@ -1,5 +1,5 @@
StartFontMetrics 2.0
-Comment $Id: afmtest.afm 17798 2010-04-11 00:54:05Z karl $
+Comment $Id$
Comment Public domain. Originally written by Karl Berry.
Comment Creation Date: 11apr10
FontName Afmtest
diff --git a/texk/texlive/linked_scripts/Makefile.am b/texk/texlive/linked_scripts/Makefile.am
index f93f9d4..da488b1 100644
--- a/texk/texlive/linked_scripts/Makefile.am
+++ b/texk/texlive/linked_scripts/Makefile.am
@@ -85,6 +85,7 @@ texmf_other_scripts = \
cachepic/cachepic.tlu \
checkcites/checkcites.lua \
context/perl/mptopdf.pl \
+ convbkmk/convbkmk.rb \
ctanify/ctanify \
ctanupload/ctanupload.pl \
de-macro/de-macro \
@@ -148,7 +149,6 @@ texmf_other_scripts = \
texloganalyser/texloganalyser \
thumbpdf/thumbpdf.pl \
ulqda/ulqda.pl \
- uptex/convbkmk.rb \
urlbst/urlbst \
vpe/vpe.pl
texmf_context_scripts = \
diff --git a/texk/texlive/linked_scripts/README b/texk/texlive/linked_scripts/README
index 5a81739..d512a83 100644
--- a/texk/texlive/linked_scripts/README
+++ b/texk/texlive/linked_scripts/README
@@ -1,4 +1,4 @@
-$Id: README 25340 2012-02-09 08:05:12Z peter $
+$Id$
Copyright (C) 2012 Norbert Preining <tex-live@tug.org>
You may freely use, modify and/or distribute this file.
diff --git a/texk/texlive/linked_scripts/uptex/convbkmk.rb b/texk/texlive/linked_scripts/convbkmk/convbkmk.rb
similarity index 79%
rename from texk/texlive/linked_scripts/uptex/convbkmk.rb
rename to texk/texlive/linked_scripts/convbkmk/convbkmk.rb
index f78583d..2c566fe 100755
--- a/texk/texlive/linked_scripts/uptex/convbkmk.rb
+++ b/texk/texlive/linked_scripts/convbkmk/convbkmk.rb
@@ -3,13 +3,67 @@
=begin
-convbkmk Ver.0.07
+= convbkmk Ver.0.08
-= License
+ 2013.05.11
+ Takuji Tanaka
+ KXD02663 (at) nifty.ne.jp
+((<URL:http://homepage3.nifty.com/ttk/comp/tex/uptex_en.html>))
+
+
+== Abstract
+
+((*convbkmk*)) is a tiny utility for making correct bookmarks in pdf files
+typesetted by platex/uplatex with the hyperref package.
+platex/uplatex + hyperref outputs data of bookmarks
+in their internal encodings (EUC-JP, Shift_JIS or UTF-8).
+On the other hand, the PostScript/PDF format requests that
+the data is written in a certain syntax with UTF-16 or PDFDocEncoding.
+Thus, data conversion is required to create correct bookmarks.
+((*convbkmk*)) provides a function of
+the encoding conversion and formatting the bookmark data.
+
+== Requirement
+
+ruby 1.8.3 or later
+
+== Examples
+
+platex (internal kanji code: euc) + hyperref + dvips :
+ $ platex doc00.tex
+ $ platex doc00.tex
+ $ dvips doc00.dvi
+ $ convbkmk.rb -e doc00.ps
+ $ ps2pdf doc00-convbkmk.ps
+
+platex (internal kanji code: sjis) + hyperref + dvipdfmx :
+ $ platex doc01.tex
+ $ platex doc01.tex
+ $ convbkmk.rb -s -o doc01.out
+ $ platex doc01.tex
+ $ dvipdfmx doc01.dvi
+
+uplatex + hyperref + dvips :
+ $ uplatex doc02.tex
+ $ uplatex doc02.tex
+ $ dvips doc02.dvi
+ $ convbkmk.rb doc02.ps
+ $ ps2pdf doc02-convbkmk.ps
+
+uplatex + hyperref + dvipdfmx :
+ $ uplatex doc03.tex
+ $ uplatex doc03.tex
+ $ convbkmk.rb -o doc03.out
+ $ uplatex doc03.tex
+ $ dvipdfmx doc03.dvi
+
+More examples are included in the uptex source archive.
+
+== License
convbkmk
-Copyright (c) 2009-2012 Takuji Tanaka
+Copyright (c) 2009-2013 Takuji Tanaka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -29,29 +83,35 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-= History
-
-2009.08.02 0.00 Initial version.
-2011.05.02 0.01 Bug fix: BOM was not correct.
-2012.05.08 0.02 Bug fix: for a case of dvips with -z option and Ruby1.8.
- Add conversion of /Creator and /Producer .
-2012.05.12 0.03 Suppress halfwidth -> fullwidth katakana conversion
- and MIME decoding in Ruby1.8.
-2012.06.01 0.04 Support escape sequences: \n, \r, \t, \b, \f, \\,
- \ddd (octal, PDFDocEncoding) and \0xUUUU (Unicode UTF-16BE).
- Support sequences of end of line:
- '\' or other followed by "\n", "\r\n" or "\r" .
- Set file IO to binary mode.
-2012.07.26 0.05 Add -o option to support conversion of OUT files
- generated by dvipdfmx.
-2012.08.07 0.06 Bug fix: Ver.0.05 does not work with Ruby1.9
-2012.09.17 0.07 Bug fix: An infinite loop occurs in Ver.0.05, 0.06
- with -g option in some cases.
- Add reference for PDFDocEncoding.
+== History
+
+: 2009.08.02 0.00
+ * Initial version.
+: 2011.05.02 0.01
+ * Bug fix: BOM was not correct.
+: 2012.05.08 0.02
+ * Bug fix: for a case of dvips with -z option and Ruby1.8.
+ * Add conversion of /Creator and /Producer .
+: 2012.05.12 0.03
+ * Suppress halfwidth -> fullwidth katakana conversion and MIME decoding in Ruby1.8.
+: 2012.06.01 0.04
+ * Support escape sequences: \n, \r, \t, \b, \f, \\, \ddd (octal, PDFDocEncoding) and \0xUUUU (Unicode UTF-16BE).
+ * Support sequences of end of line: '\' or other followed by "\n", "\r\n" or "\r" .
+ * Set file IO to binary mode.
+: 2012.07.26 0.05
+ * Add -o option to support conversion of OUT files generated by dvipdfmx.
+: 2012.08.07 0.06
+ * Bug fix: Ver.0.05 does not work with Ruby1.9.
+: 2012.09.17 0.07
+ * Bug fix: An infinite loop occurs in Ver.0.05, 0.06 with -g option in some cases.
+ * Add reference for PDFDocEncoding.
+: 2013.05.11 0.08
+ * Add -O option: overwrite output files onto input files instead of creating foo-convbkmk.ps .
+ * Make comments rd/rdtool friendly.
=end
-Version = "0.07"
+Version = "0.08"
require "optparse"
@@ -196,6 +256,11 @@ OptionParser.new do |opt|
Opts[:mode] = 'out'
require "fileutils"
}
+ opt.on('-O', '--overwrite',
+ 'overwrite output files') {|v|
+ Opts[:mode] = 'overwrite'
+ require "fileutils"
+ }
opt.banner += " file0.ps [file1.ps ...]\n" \
+ opt.banner.sub('Usage:',' ') + " < in_file.ps > out_file.ps\n" \
+ opt.banner.sub('Usage:',' ') + ' -o file0.out [file1.out ...]'
@@ -429,7 +494,9 @@ else
file_treatment(ifile, ofile, enc)
}
}
- FileUtils.mv(fout, fin) if Opts[:mode] == 'out'
+ if (Opts[:mode] == 'out' || Opts[:mode] == 'overwrite')
+ FileUtils.mv(fout, fin)
+ end
}
end
diff --git a/texk/texlive/linked_scripts/texlive/tlmgr.pl b/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 2c7520d..a5931e6 100755
--- a/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,12 +1,12 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 30121 2013-04-26 06:51:26Z preining $
+# $Id: tlmgr.pl 30343 2013-05-09 02:11:32Z preining $
#
# Copyright 2008-2013 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-my $svnrev = '$Revision: 30121 $';
-my $datrev = '$Date: 2013-04-26 08:51:26 +0200 (Fri, 26 Apr 2013) $';
+my $svnrev = '$Revision: 30343 $';
+my $datrev = '$Date: 2013-05-09 04:11:32 +0200 (Thu, 09 May 2013) $';
my $tlmgrrevision;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
@@ -821,7 +821,7 @@ sub handle_execute_actions
}
if ($localtlpdb->option("create_formats")
&& !$::regenerate_all_formats) {
- $errors += do_cmd_and_check("fmtutil$sysmode --byhyphen $lang");
+ $errors += do_cmd_and_check("fmtutil$sysmode --byhyphen \"$lang\"");
}
}
}
@@ -4292,7 +4292,7 @@ sub action_generate {
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");
+ do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\"");
} else {
info("To make the newly-generated language.dat take effect,"
. " run fmtutil-sys --byhyphen $dest.\n");
@@ -4307,7 +4307,7 @@ sub action_generate {
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");
+ do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\"");
} else {
info("To make the newly-generated language.dat take effect,"
. " run fmtutil-sys --byhyphen $dest.\n");
@@ -4322,7 +4322,7 @@ sub action_generate {
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");
+ do_cmd_and_check("fmtutil-sys --byhyphen \"$dest\"");
} else {
info("To make the newly-generated language.def take effect,"
. " run fmtutil-sys --byhyphen $dest.\n");
diff --git a/texk/texlive/tests/updmap-cmdline-test.pl b/texk/texlive/tests/updmap-cmdline-test.pl
index 9b27f78..fa209c9 100755
--- a/texk/texlive/tests/updmap-cmdline-test.pl
+++ b/texk/texlive/tests/updmap-cmdline-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: updmap-cmdline-test.pl 30033 2013-04-19 07:07:46Z peter $
+# $Id$
# Public domain. Originally written 2011, Karl Berry.
# Check that updmap can parse various cmdline invocations.
diff --git a/texk/texlive/tl_scripts/README b/texk/texlive/tl_scripts/README
index 48e9039..26f62ee 100644
--- a/texk/texlive/tl_scripts/README
+++ b/texk/texlive/tl_scripts/README
@@ -1,4 +1,4 @@
-$Id: README 28922 2013-01-24 01:12:02Z karl $
+$Id$
Copyright 2013 TeX Users Group.
You may freely use, modify and/or distribute this file.
diff --git a/texk/texlive/tl_scripts/fmtutil.cnf b/texk/texlive/tl_scripts/fmtutil.cnf
index e6dab71..16ee26b 100644
--- a/texk/texlive/tl_scripts/fmtutil.cnf
+++ b/texk/texlive/tl_scripts/fmtutil.cnf
@@ -1,4 +1,4 @@
-# Generated by /home/texlive/karl/Master/bin/i386-linux/tlmgr on Mon Apr 8 21:17:02 2013
+# Generated by /home/texlive/karl/Master/bin/i386-linux/tlmgr on Fri May 3 03:37:00 2013
# Originally written by Thomas Esser, 1998. Public domain.
#
# As of TeX Live 2008, the final fmtutil.cnf is generated by
@@ -13,7 +13,7 @@
# The last "argument" must be the name of the file on which to run
# the ini-engine (such as initex). If the ini-engine is e-TeX, and the
# e-TeX extensions should be enabled, the filename must be prefixed with
-# a * character.
+# a * character; this is essentially equivalent to the -etex option.
#
# fmtutil always passes the -ini option to the engine.
# If no pattern-file is desired, use -.
@@ -23,7 +23,7 @@
# 1) tex and amstex just load hyphen.tex. No customization.
# You can have your own customized (via babel's hyphen.cfg)
# formats on top of plain by using "bplain.tex" instead of
-# plain.tex (see e.g. bplain.ini file for bplain format).
+# plain.tex (e.g., bplain.ini file for bplain format).
#
# 2) etex-based formats load language.def, not language.dat.
#
@@ -86,7 +86,7 @@ pdfmex pdftex mexconf.tex -translate-file=cp227.tcx *pdfmex.ini
utf8mex pdftex mexconf.tex -enc *utf8mex.ini
#
# from mltex:
-mllatex pdftex language.dat -translate-file=cp227.tcx -mltex mllatex.ini
+mllatex pdftex language.dat -translate-file=cp227.tcx -mltex *mllatex.ini
mltex pdftex - -translate-file=cp227.tcx -mltex mltex.ini
#
# from mptopdf:
diff --git a/texk/texlive/tl_scripts/fmtutil.sh b/texk/texlive/tl_scripts/fmtutil.sh
index f437e20..f360980 100755
--- a/texk/texlive/tl_scripts/fmtutil.sh
+++ b/texk/texlive/tl_scripts/fmtutil.sh
@@ -59,7 +59,7 @@ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
progname=fmtutil
argv0=$0
-version='$Id: fmtutil.sh 29349 2013-03-12 00:01:41Z karl $'
+version='$Id$'
cnf=fmtutil.cnf # name of the config file
export PATH
@@ -930,7 +930,7 @@ recreate_by_hyphenfile()
;;
esac
need_find_hyphenfile=true
- match_cmd="echo \"\$this_hyphenfile\" | grep $hyphenfile >/dev/null"
+ match_cmd="echo \"\$this_hyphenfile\" | grep \"$hyphenfile\" >/dev/null"
# No match before the loop:
setmatch false
diff --git a/texk/texlive/tl_scripts/tcfmgr b/texk/texlive/tl_scripts/tcfmgr
index db7b873..e79be96 100755
--- a/texk/texlive/tl_scripts/tcfmgr
+++ b/texk/texlive/tl_scripts/tcfmgr
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: tcfmgr 27343 2012-08-08 14:43:05Z peter $
+# $Id$
# invoke the right shell:
diff --git a/texk/texlive/tl_scripts/texconfig-dialog.sh b/texk/texlive/tl_scripts/texconfig-dialog.sh
index 965a7b1..bdf7ba2 100755
--- a/texk/texlive/tl_scripts/texconfig-dialog.sh
+++ b/texk/texlive/tl_scripts/texconfig-dialog.sh
@@ -21,7 +21,7 @@ export PATH
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
# the version string
-version='$Id: texconfig-dialog.sh 29349 2013-03-12 00:01:41Z karl $'
+version='$Id$'
: ${PAGER=more}
progname=texconfig-dialog
diff --git a/texk/texlive/tl_scripts/texconfig-sys.sh b/texk/texlive/tl_scripts/texconfig-sys.sh
index 1ef6a7c..dd58513 100755
--- a/texk/texlive/tl_scripts/texconfig-sys.sh
+++ b/texk/texlive/tl_scripts/texconfig-sys.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: texconfig-sys.sh 29349 2013-03-12 00:01:41Z karl $
+# $Id$
# texconfig-sys: Thomas Esser, public domain.
diff --git a/texk/texlive/tl_scripts/texlinks.sh b/texk/texlive/tl_scripts/texlinks.sh
index ee1be10..c6fd288 100755
--- a/texk/texlive/tl_scripts/texlinks.sh
+++ b/texk/texlive/tl_scripts/texlinks.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: texlinks.sh 29349 2013-03-12 00:01:41Z karl $
+# $Id$
# Thomas Esser, 1999, 2002, 2003. public domain.
@@ -39,7 +39,7 @@ export PATH
# hack around a bug in zsh:
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
-version='$Id: texlinks.sh 29349 2013-03-12 00:01:41Z karl $'
+version='$Id$'
progname=texlinks
cnf=fmtutil.cnf # name of the config file
diff --git a/texk/texlive/tl_scripts/updmap.help2man b/texk/texlive/tl_scripts/updmap.help2man
index 8519f4a..345e429 100644
--- a/texk/texlive/tl_scripts/updmap.help2man
+++ b/texk/texlive/tl_scripts/updmap.help2man
@@ -1,4 +1,4 @@
-# $Id: updmap.help2man 30135 2013-04-27 15:21:41Z karl $
+# $Id$
# This help2man auxiliary file is in the public domain.
# Originally created by Karl Berry.
# The FILES text from Claire Connelly.
diff --git a/texk/texlive/w32_wrapper/runscript.tlu b/texk/texlive/w32_wrapper/runscript.tlu
index e7c596d..6abcbdf 100755
--- a/texk/texlive/w32_wrapper/runscript.tlu
+++ b/texk/texlive/w32_wrapper/runscript.tlu
@@ -1,8 +1,8 @@
--- $Id: runscript.tlu 28777 2013-01-09 22:12:54Z preining $
+-- $Id$
-local svnrevision = string.match("$Revision: 28777 $", "%d+") or "0"
-local svndate = string.match("$Date: 2013-01-09 23:12:54 +0100 (Wed, 09 Jan 2013) $", "[-%d]+") or "2009-12-04"
+local svnrevision = string.match("$Revision$", "%d+") or "0"
+local svndate = string.match("$Date$", "[-%d]+") or "2009-12-04"
local bannerstr = "runscript wrapper utility (rev. " ..
svnrevision .. ", " .. svndate .. ")\n" ..
"usage: runscript script-name [arguments]\n" ..
@@ -230,6 +230,8 @@ local docstr = [[
(when not using external Perl)
2012/08/05
- added alias for fmtutil
+ 2013/05/09
+ - added alias mkluatexfontdb -> luaotfload-tool
]]
-- HELPER SUBROUTINES --
@@ -537,6 +539,8 @@ elseif progname == 'dviout' then
ARGV = {[0]=TEXDIR..'/tlpkg/dviout/dviout.exe', 'dviout', par}
elseif progname == 'fmtutil' and sysprog then
ARGV = {[0]=BINDIR..'/fmtutil.exe', 'fmtutil', argline}
+elseif progname == 'mkluatexfontdb' then
+ progname = 'luaotfload-tool'
elseif progname == 'psv' then
argline = '-sINPUT='..argline
ARGV = {[0]=TEXDIR..'/tlpkg/tlpsv/gswxlua.exe', 'gswxlua',
diff --git a/texk/web2c/tests/bibtex-openout-test.pl b/texk/web2c/tests/bibtex-openout-test.pl
index 0af36a6..a978854 100755
--- a/texk/web2c/tests/bibtex-openout-test.pl
+++ b/texk/web2c/tests/bibtex-openout-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: bibtex-openout-test.pl 29118 2013-02-15 10:06:11Z peter $
+# $Id$
# Public domain. Originally written 2010, Karl Berry.
# Check that bibtex respects openout_any.
diff --git a/texk/web2c/tests/longline.tex b/texk/web2c/tests/longline.tex
index 82c0102..44c7639 100644
--- a/texk/web2c/tests/longline.tex
+++ b/texk/web2c/tests/longline.tex
@@ -1,4 +1,4 @@
-% $Id: longline.tex 17617 2010-03-30 00:07:49Z karl $
+% $Id$
% Public domain. Originally written 2010, Karl Berry.
% Test for bibtex not breaking when longer than max_print_line.
diff --git a/texk/web2c/tests/write18-quote-test.pl b/texk/web2c/tests/write18-quote-test.pl
index fc50e5a..d0daabd 100755
--- a/texk/web2c/tests/write18-quote-test.pl
+++ b/texk/web2c/tests/write18-quote-test.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: write18-quote-test.pl 17085 2010-02-18 18:03:18Z karl $
+# $Id$
# Public domain. Originally written 2010, Karl Berry.
# Check that restricted shell invocation doesn't misquote.
diff --git a/texk/web2c/tests/write18-quote.tex b/texk/web2c/tests/write18-quote.tex
index 8baec26..dcfe6cb 100644
--- a/texk/web2c/tests/write18-quote.tex
+++ b/texk/web2c/tests/write18-quote.tex
@@ -1,4 +1,4 @@
-% $Id: write18-quote.tex 17085 2010-02-18 18:03:18Z karl $
+% $Id$
% Public domain. Originally written 2010, Karl Berry.
\catcode`\{=1 \catcode`\}=2 % allow for running with initex.
diff --git a/texk/web2c/web2c/coerce.h b/texk/web2c/web2c/coerce.h
index 717c32e..6b36130 100644
--- a/texk/web2c/web2c/coerce.h
+++ b/texk/web2c/web2c/coerce.h
@@ -1,6 +1,6 @@
/* Some definitions that get appended to the `coerce.h' file that web2c
outputs. */
-/* $Id: coerce.h 28758 2013-01-07 09:17:01Z peter $ */
+/* $Id$ */
/* The C compiler ignores most unnecessary casts (i.e., casts of
something to its own type). However, for structures, it doesn't.
diff --git a/texk/web2c/web2c/splitup.c b/texk/web2c/web2c/splitup.c
index 5702d15..eb3442e 100644
--- a/texk/web2c/web2c/splitup.c
+++ b/texk/web2c/web2c/splitup.c
@@ -2,7 +2,7 @@
and it produces several .c and .h files in the current directory
as its output.
- $Id: splitup.c 27708 2012-09-18 17:43:20Z peter $
+ $Id$
Tim Morgan September 19, 1987. */
diff --git a/utils/README b/utils/README
index 65975a5..3bd872f 100644
--- a/utils/README
+++ b/utils/README
@@ -1,4 +1,4 @@
-$Id: README 29855 2013-04-11 07:06:58Z peter $
+$Id$
Public domain. Originally written 2005 by Karl Berry.
Extra utilities we (optionally) compile for TeX Live.
diff --git a/utils/biber/TeXLive/TLUtils.pm b/utils/biber/TeXLive/TLUtils.pm
index fdcd482..fdc594d 100644
--- a/utils/biber/TeXLive/TLUtils.pm
+++ b/utils/biber/TeXLive/TLUtils.pm
@@ -5,7 +5,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 30127 $';
+my $svnrev = '$Revision: 30367 $';
my $_modulerevision;
if ($svnrev =~ m/: ([0-9]+) /) {
$_modulerevision = $1;
@@ -49,6 +49,7 @@ C<TeXLive::TLUtils> -- utilities used in the TeX Live infrastructure
TeXLive::TLUtils::dirname($path);
TeXLive::TLUtils::basename($path);
TeXLive::TLUtils::dirname_and_basename($path);
+ TeXLive::TLUtils::tl_abs_path($path);
TeXLive::TLUtils::dir_writable($path);
TeXLive::TLUtils::dir_creatable($path);
TeXLive::TLUtils::mkdirhier($path);
@@ -136,6 +137,7 @@ BEGIN {
&dirname
&basename
&dirname_and_basename
+ &tl_abs_path
&dir_writable
&dir_creatable
&mkdirhier
@@ -542,26 +544,62 @@ sub run_cmd {
=over 4
-=item C<dirname($path)>
+=item C<dirname_and_basename($path)>
-Return C<$path> with its trailing C</component> removed.
+Return both C<dirname> and C<basename>. Example:
+
+ ($dirpart,$filepart) = dirname_and_basename ($path);
=cut
-sub dirname {
+sub dirname_and_basename {
my $path=shift;
+ my ($share, $base) = ("", "");
if (win32) {
$path=~s!\\!/!g;
}
+ # do not try to make sense of paths ending with /..
+ return (undef, undef) if $path =~ m!/\.\.$!;
if ($path=~m!/!) { # dirname("foo/bar/baz") -> "foo/bar"
- $path=~m!(.*)/.*!; # works because of greedy matching
- return $1;
+ # eliminate `/.' path components
+ while ($path =~ s!/\./!/!) {};
+ # UNC path? => first split in $share = //xxx/yy and $path = /zzzz
+ if (win32() and $path =~ m!^(//[^/]+/[^/]+)(.*)$!) {
+ ($share, $path) = ($1, $2);
+ if ($path =~ m!^/?$!) {
+ $path = $share;
+ $base = "";
+ } elsif ($path =~ m!(/.*)/(.*)!) {
+ $path = $share.$1;
+ $base = $2;
+ } else {
+ $base = $path;
+ $path = $share;
+ }
+ return ($path, $base);
+ }
+ # not a UNC path
+ $path=~m!(.*)/(.*)!; # works because of greedy matching
+ return ((($1 eq '') ? '/' : $1), $2);
} else { # dirname("ignore") -> "."
- return ".";
+ return (".", $path);
}
}
+=item C<dirname($path)>
+
+Return C<$path> with its trailing C</component> removed.
+
+=cut
+
+sub dirname {
+ my $path = shift;
+ my ($dirname, $basename) = dirname_and_basename($path);
+ return $dirname;
+}
+
+
=item C<basename($path)>
Return C<$path> with any leading directory components removed.
@@ -569,34 +607,51 @@ Return C<$path> with any leading directory components removed.
=cut
sub basename {
- my $path=shift;
- if (win32) {
- $path=~s!\\!/!g;
- }
- if ($path=~m!/!) { # basename("foo/bar") -> "bar"
- $path=~m!.*/(.*)!;
- return $1;
- } else { # basename("ignore") -> "ignore"
- return $path;
- }
+ my $path = shift;
+ my ($dirname, $basename) = dirname_and_basename($path);
+ return $basename;
}
-=item C<dirname_and_basename($path)>
-
-Return both C<dirname> and C<basename>. Example:
+=item C<tl_abs_path($path)>
- ($dirpart,$filepart) = dirname_and_basename ($path);
+# Other than Cwd::abs_path, tl_abs_path also works
+# if only the grandparent exists.
=cut
-sub dirname_and_basename {
- my $path=shift;
+sub tl_abs_path {
+ my $path = shift;
if (win32) {
$path=~s!\\!/!g;
}
- $path=~/(.*)\/(.*)/;
- return ("$1", "$2");
+ my $ret;
+ eval {$ret = Cwd::abs_path($path);}; # eval needed for w32
+ return $ret if defined $ret;
+ # $ret undefined: probably the parent does not exist.
+ # But we also want an answer if only the grandparent exists.
+ my ($parent, $base) = dirname_and_basename($path);
+ return undef unless defined $parent;
+ eval {$ret = Cwd::abs_path($parent);};
+ if (defined $ret) {
+ if ($ret =~ m!/$! or $base =~ m!^/!) {
+ $ret = "$ret$base";
+ } else {
+ $ret = "$ret/$base";
+ }
+ return $ret;
+ } else {
+ my ($pparent, $pbase) = dirname_and_basename($parent);
+ return undef unless defined $pparent;
+ eval {$ret = Cwd::abs_path($pparent);};
+ return undef unless defined $ret;
+ if ($ret =~ m!/$!) {
+ $ret = "$ret$pbase/$base";
+ } else {
+ $ret = "$ret/$pbase/$base";
+ }
+ return $ret;
+ }
}
@@ -614,14 +669,16 @@ sub dir_slash {
# test whether subdirectories can be created in the argument
sub dir_creatable {
- $path=shift;
+ my $path=shift;
#print STDERR "testing $path\n";
$path =~ s!\\!/!g if win32;
+ return 0 unless -d $path;
$path =~ s!/$!!;
- return 0 unless -d dir_slash($path);
#print STDERR "testing $path\n";
my $i = 0;
- while (-e $path . "/" . $i) { $i++; }
+ my $too_large = 100000;
+ while ((-e $path . "/" . $i) and $i<$too_large) { $i++; }
+ return 0 if $i>=$too_large;
my $d = $path."/".$i;
#print STDERR "creating $d\n";
return 0 unless mkdir $d;
@@ -652,12 +709,14 @@ a fileserver.
# real Program Files. Ugh.
sub dir_writable {
- $path=shift;
- return 0 unless -d dir_slash($path);
+ my $path=shift;
+ return 0 unless -d $path;
$path =~ s!\\!/!g if win32;
$path =~ s!/$!!;
my $i = 0;
- while (-e $path . "/" . $i) { $i++; }
+ my $too_large = 100000;
+ while ((-e $path . "/" . $i) and $i<$too_large) { $i++; }
+ return 0 if $i>=$too_large;
my $f = $path."/".$i;
return 0 unless open TEST, ">".$f;
my $written = 0;
@@ -3076,22 +3135,24 @@ Test whether installation with TEXDIR set to $texdir would succeed due to
writing permissions.
Writable or not, we will not allow installation to the root
-directory (Unix) or the root of the system drive (Windows).
+directory (Unix) or the root of a drive (Windows).
=cut
sub texdir_check {
my $texdir = shift;
+ return 0 unless defined $texdir;
+ # convert to absolute/canonical, for safer parsing
+ # tl_abs_path should work as long as grandparent exists
+ $texdir = tl_abs_path($texdir);
+ return 0 unless defined $texdir;
+ # also reject the root of a drive/volume,
+ # assuming that only the canonical form of the root ends with /
+ return 0 if $texdir =~ m!/$!;
my $texdirparent;
my $texdirpparent;
- $texdir =~ s!/$!!; # remove final slash
- #print STDERR "Checking $texdir".'[/]'."\n";
- # disallow unix root
- return 0 if $texdir eq "";
- # disallow w32 systemdrive root
- return 0 if (win32() and $texdir eq $ENV{SystemDrive});
-
- return dir_writable($texdir) if (-d dir_slash($texdir));
+
+ return dir_writable($texdir) if (-d $texdir);
($texdirparent = $texdir) =~ s!/[^/]*$!!;
#print STDERR "Checking $texdirparent".'[/]'."\n";
return dir_creatable($texdirparent) if -d dir_slash($texdirparent);
@@ -3401,16 +3462,16 @@ would be considered part of the filename.
sub conv_to_w32_path {
my $p = shift;
- $p =~ s!/!\\!g;
# we need absolute paths, too
- if ($p !~ m!^.:!) {
- my $cwd = `cd`;
- die "sorry, could not find current working directory via cd?!" if ! $cwd;
- chomp($cwd);
- $p = "$cwd\\$p";
- }
- $p = quotify_path_with_spaces($p);
- return($p);
+ my $pabs = tl_abs_path($p);
+ if (not defined $pabs) {
+ $pabs = $p;
+ tlwarn ("sorry, could not determine absolute path of $p!\n".
+ "using original path instead");
+ }
+ $pabs =~ s!/!\\!g;
+ $pabs = quotify_path_with_spaces($pabs);
+ return($pabs);
}
=pod
diff --git a/utils/tpic2pdftex/tpic2pdftex b/utils/tpic2pdftex/tpic2pdftex
index cd67803..ecdf35d 100755
--- a/utils/tpic2pdftex/tpic2pdftex
+++ b/utils/tpic2pdftex/tpic2pdftex
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: tpic2pdftex 29534 2013-03-27 23:56:34Z karl $
+# $Id$
#
# Experimental awk-script for conversion of tpic \specials as produced
# by (groff-)pic into pdfTeX \pdfliteral sections for further processing
--
Debian packaging of texlive-bin)
Reply to: