summaryrefslogtreecommitdiff
path: root/Master/bin
diff options
context:
space:
mode:
authorReinhard Kotucha <reinhard.kotucha@web.de>2006-11-26 20:35:29 +0000
committerReinhard Kotucha <reinhard.kotucha@web.de>2006-11-26 20:35:29 +0000
commit065e129d47bd651ee8636eb053a2e740637ebf50 (patch)
tree53f75a58c094434b3f9510314b09e24dd90cf1fa /Master/bin
parent09b5e127a07e9a9bb4b61622f741ff16a9099a11 (diff)
update getnonfreefonts, add wget binary and psf2dsc for win32.
git-svn-id: svn://tug.org/texlive/trunk@2545 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin')
-rwxr-xr-xMaster/bin/win32/getnonfreefonts-sys.bat211
-rwxr-xr-xMaster/bin/win32/getnonfreefonts.bat211
-rwxr-xr-xMaster/bin/win32/pdf2dsc.bat29
-rw-r--r--Master/bin/win32/wget.exebin0 -> 332800 bytes
4 files changed, 451 insertions, 0 deletions
diff --git a/Master/bin/win32/getnonfreefonts-sys.bat b/Master/bin/win32/getnonfreefonts-sys.bat
new file mode 100755
index 00000000000..269f3d5cba6
--- /dev/null
+++ b/Master/bin/win32/getnonfreefonts-sys.bat
@@ -0,0 +1,211 @@
+@rem = '--*-Perl-*--
+@echo off
+perl -x -S %0 %*
+goto endofperl
+@rem ';
+#!/usr/bin/env perl
+#line 8
+$^W=1;
+
+## getnonfreefonts
+## Copyright 2006 Reinhard Kotucha <reinhard.kotucha@web.de>
+#
+# 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
+#
+# The current maintainer is Reinhard Kotucha.
+
+my $TL_version='2006';
+
+my $getfont_url="ftp://tug.org/tex/getnonfreefonts/getfont2006";
+
+use File::Copy;
+use Getopt::Long;
+$Getopt::Long::autoabbrev=0;
+
+$opt_lsfonts=0;
+$opt_force=0;
+
+sub usage {
+ print <<'EOF';
+Usage:
+ getnonfreefonts[-sys] [-a|--all] [-f|--force] [-l|--lsfonts]
+ [-v|--verbose] [font1] [font2] ...
+
+ getnonfreefonts installs fonts in $TEXMFHOME.
+ getnonfreefonts-sys installs fonts in $TEXMFLOCAL.
+
+ Options:
+ -a|--all Install all fonts.
+
+ -f|--force Install fonts even if they are installed already.
+
+ -h|--help Print this message.
+
+ -l|--lsfonts List all fonts available.
+
+ -v|--verbose Be more verbose.
+
+EOF
+;
+}
+
+unless (@ARGV) {
+ usage;
+ exit 1;
+}
+
+GetOptions
+ "all|a",
+ "debug|d",
+ "force|f",
+ "help|h",
+ "lsfonts|l",
+ "verbose|v",
+ "sys";
+
+$^W=1 if $opt_debug;
+
+my $sys=($0=~/-sys$/)? 1:0;
+$sys=1 if $opt_sys;
+
+@allpackages=@ARGV;
+
+sub message {
+ my $message=shift;
+ if ($message=~/^\[/) {
+ print "$message\n";
+ } else {
+ printf "%-60s", $message;
+ }
+}
+
+sub expand_var {
+ my $var=shift;
+
+ if (-d "/usr/bin") {
+ open KPSEWHICH, 'kpsewhich --expand-var=\$' . "$var |";
+ } else {
+ open KPSEWHICH, 'kpsewhich --expand-var=$' . "$var |";
+ }
+ while (<KPSEWHICH>) {
+ chop;
+ return $_;
+ }
+ close KPSEWHICH;
+}
+
+if ($sys) {
+ $INSTALLROOT=expand_var 'TEXMFLOCAL';
+} else {
+ $INSTALLROOT=expand_var 'TEXMFHOME';
+}
+
+# get TMP|TEMP|TMPDIR environment variable
+
+if (defined $ENV{'TMP'}) {
+ $systmp="$ENV{'TMP'}";
+} elsif (defined $ENV{'TEMP'}) {
+ $systmp="$ENV{'TEMP'}";
+} elsif (defined $ENV{'TMPDIR'}) {
+ $systmp="$ENV{'SYSTMP'}";
+} else {
+ $systmp="/tmp";
+}
+
+# Windows usually uses backslashes though forward slashes are probably
+# allowed. Perl always needs forward slashes.
+
+# We convert backslashes to forward slashes if it looks like a Windows
+# directory.
+$systmp=~s/\\/\//g if ($systmp=~/^.:\\/); # c:\abc\def
+$systmp=~s/\\/\//g if ($systmp=~/^\\\\/); # \\abc\def
+
+die "! ERROR: The directory '$systmp' doesn't exist.\n"
+ unless (-d "$systmp");
+
+die "! ERROR: The directory '$systmp' is not writable.\n"
+ unless (-w "$systmp");
+
+$INSTALLROOT=~s/\\/\//g if ($INSTALLROOT=~/^.:\\/); # c:\abc\def
+$INSTALLROOT=~s/\\/\//g if ($INSTALLROOT=~/^\\\\/); # \\abc\def
+
+die "! ERROR: The directory '$INSTALLROOT' is not writable.\n"
+ unless (-w "$INSTALLROOT");
+
+if ($opt_help) {
+ usage;
+ print <<"ENDUSAGE";
+ Directories:
+ temporary: '$systmp/getfont-<PID>'
+ install: '$INSTALLROOT'
+
+ENDUSAGE
+exit 0;
+}
+
+
+my $tmpdir="$systmp/getfont-$$";
+mkdir "$tmpdir" or die "! ERROR: Can't mkdir '$tmpdir'.";
+chdir "$tmpdir" or die "! ERROR: Can't cd '$tmpdir'.";
+
+sub remove_tmpdir {
+ chdir "$systmp" or die "! ERROR: Can't cd '$systmp'.\n";
+ opendir TMPDIR, "$tmpdir"
+ or print "! ERROR: Can't read directory '$tmpdir'.\n";
+
+ @alltmps=readdir TMPDIR;
+ closedir TMPDIR;
+
+ foreach $file (@alltmps) {
+ next if $file=~/^\./;
+ unlink "$tmpdir/$file";
+ }
+ rmdir "$tmpdir" or die "! ERROR: Can't remove directory '$tmpdir'.\n";
+}
+
+# Signal handlers for UNIX, maybe ignored by Windows.
+
+$SIG{INT} =\&remove_tmpdir;
+$SIG{QUIT}=\&remove_tmpdir;
+$SIG{BUS} =\&remove_tmpdir;
+$SIG{PIPE}=\&remove_tmpdir;
+$SIG{TERM}=\&remove_tmpdir;
+$SIG{ABRT}=\&remove_tmpdir;
+$SIG{SEGV}=\&remove_tmpdir;
+
+system ('wget', "$getfont_url");
+
+my @getfont=('perl', "./getfont$TL_version", '--getnonfreefonts');
+push @getfont, "--installroot=$INSTALLROOT";
+push @getfont, '--lsfonts' if $opt_lsfonts;
+push @getfont, '--force' if $opt_force;
+push @getfont, '--verbose' if $opt_verbose;
+push @getfont, '--sys' if $sys;
+push @getfont, '--all' if $opt_all;
+push @getfont, @allpackages;
+
+system @getfont;
+my $exit_code=$?;
+my $exit_status=int($exit_code/256);
+
+
+if ($exit_status==2) {
+ print "\n";
+ system 'texhash', "$INSTALLROOT";
+ $updmap_command=($sys)? 'updmap-sys':'updmap';
+ @updmap=("$updmap_command");
+ push @updmap, '--quiet' unless $opt_verbose;
+ message "\nUpdating map files ($updmap_command)...";
+ system @updmap;
+
+ message $?? '[failed]':'[done]';
+}
+
+remove_tmpdir;
+
+__END__
+:endofperl
diff --git a/Master/bin/win32/getnonfreefonts.bat b/Master/bin/win32/getnonfreefonts.bat
new file mode 100755
index 00000000000..269f3d5cba6
--- /dev/null
+++ b/Master/bin/win32/getnonfreefonts.bat
@@ -0,0 +1,211 @@
+@rem = '--*-Perl-*--
+@echo off
+perl -x -S %0 %*
+goto endofperl
+@rem ';
+#!/usr/bin/env perl
+#line 8
+$^W=1;
+
+## getnonfreefonts
+## Copyright 2006 Reinhard Kotucha <reinhard.kotucha@web.de>
+#
+# 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
+#
+# The current maintainer is Reinhard Kotucha.
+
+my $TL_version='2006';
+
+my $getfont_url="ftp://tug.org/tex/getnonfreefonts/getfont2006";
+
+use File::Copy;
+use Getopt::Long;
+$Getopt::Long::autoabbrev=0;
+
+$opt_lsfonts=0;
+$opt_force=0;
+
+sub usage {
+ print <<'EOF';
+Usage:
+ getnonfreefonts[-sys] [-a|--all] [-f|--force] [-l|--lsfonts]
+ [-v|--verbose] [font1] [font2] ...
+
+ getnonfreefonts installs fonts in $TEXMFHOME.
+ getnonfreefonts-sys installs fonts in $TEXMFLOCAL.
+
+ Options:
+ -a|--all Install all fonts.
+
+ -f|--force Install fonts even if they are installed already.
+
+ -h|--help Print this message.
+
+ -l|--lsfonts List all fonts available.
+
+ -v|--verbose Be more verbose.
+
+EOF
+;
+}
+
+unless (@ARGV) {
+ usage;
+ exit 1;
+}
+
+GetOptions
+ "all|a",
+ "debug|d",
+ "force|f",
+ "help|h",
+ "lsfonts|l",
+ "verbose|v",
+ "sys";
+
+$^W=1 if $opt_debug;
+
+my $sys=($0=~/-sys$/)? 1:0;
+$sys=1 if $opt_sys;
+
+@allpackages=@ARGV;
+
+sub message {
+ my $message=shift;
+ if ($message=~/^\[/) {
+ print "$message\n";
+ } else {
+ printf "%-60s", $message;
+ }
+}
+
+sub expand_var {
+ my $var=shift;
+
+ if (-d "/usr/bin") {
+ open KPSEWHICH, 'kpsewhich --expand-var=\$' . "$var |";
+ } else {
+ open KPSEWHICH, 'kpsewhich --expand-var=$' . "$var |";
+ }
+ while (<KPSEWHICH>) {
+ chop;
+ return $_;
+ }
+ close KPSEWHICH;
+}
+
+if ($sys) {
+ $INSTALLROOT=expand_var 'TEXMFLOCAL';
+} else {
+ $INSTALLROOT=expand_var 'TEXMFHOME';
+}
+
+# get TMP|TEMP|TMPDIR environment variable
+
+if (defined $ENV{'TMP'}) {
+ $systmp="$ENV{'TMP'}";
+} elsif (defined $ENV{'TEMP'}) {
+ $systmp="$ENV{'TEMP'}";
+} elsif (defined $ENV{'TMPDIR'}) {
+ $systmp="$ENV{'SYSTMP'}";
+} else {
+ $systmp="/tmp";
+}
+
+# Windows usually uses backslashes though forward slashes are probably
+# allowed. Perl always needs forward slashes.
+
+# We convert backslashes to forward slashes if it looks like a Windows
+# directory.
+$systmp=~s/\\/\//g if ($systmp=~/^.:\\/); # c:\abc\def
+$systmp=~s/\\/\//g if ($systmp=~/^\\\\/); # \\abc\def
+
+die "! ERROR: The directory '$systmp' doesn't exist.\n"
+ unless (-d "$systmp");
+
+die "! ERROR: The directory '$systmp' is not writable.\n"
+ unless (-w "$systmp");
+
+$INSTALLROOT=~s/\\/\//g if ($INSTALLROOT=~/^.:\\/); # c:\abc\def
+$INSTALLROOT=~s/\\/\//g if ($INSTALLROOT=~/^\\\\/); # \\abc\def
+
+die "! ERROR: The directory '$INSTALLROOT' is not writable.\n"
+ unless (-w "$INSTALLROOT");
+
+if ($opt_help) {
+ usage;
+ print <<"ENDUSAGE";
+ Directories:
+ temporary: '$systmp/getfont-<PID>'
+ install: '$INSTALLROOT'
+
+ENDUSAGE
+exit 0;
+}
+
+
+my $tmpdir="$systmp/getfont-$$";
+mkdir "$tmpdir" or die "! ERROR: Can't mkdir '$tmpdir'.";
+chdir "$tmpdir" or die "! ERROR: Can't cd '$tmpdir'.";
+
+sub remove_tmpdir {
+ chdir "$systmp" or die "! ERROR: Can't cd '$systmp'.\n";
+ opendir TMPDIR, "$tmpdir"
+ or print "! ERROR: Can't read directory '$tmpdir'.\n";
+
+ @alltmps=readdir TMPDIR;
+ closedir TMPDIR;
+
+ foreach $file (@alltmps) {
+ next if $file=~/^\./;
+ unlink "$tmpdir/$file";
+ }
+ rmdir "$tmpdir" or die "! ERROR: Can't remove directory '$tmpdir'.\n";
+}
+
+# Signal handlers for UNIX, maybe ignored by Windows.
+
+$SIG{INT} =\&remove_tmpdir;
+$SIG{QUIT}=\&remove_tmpdir;
+$SIG{BUS} =\&remove_tmpdir;
+$SIG{PIPE}=\&remove_tmpdir;
+$SIG{TERM}=\&remove_tmpdir;
+$SIG{ABRT}=\&remove_tmpdir;
+$SIG{SEGV}=\&remove_tmpdir;
+
+system ('wget', "$getfont_url");
+
+my @getfont=('perl', "./getfont$TL_version", '--getnonfreefonts');
+push @getfont, "--installroot=$INSTALLROOT";
+push @getfont, '--lsfonts' if $opt_lsfonts;
+push @getfont, '--force' if $opt_force;
+push @getfont, '--verbose' if $opt_verbose;
+push @getfont, '--sys' if $sys;
+push @getfont, '--all' if $opt_all;
+push @getfont, @allpackages;
+
+system @getfont;
+my $exit_code=$?;
+my $exit_status=int($exit_code/256);
+
+
+if ($exit_status==2) {
+ print "\n";
+ system 'texhash', "$INSTALLROOT";
+ $updmap_command=($sys)? 'updmap-sys':'updmap';
+ @updmap=("$updmap_command");
+ push @updmap, '--quiet' unless $opt_verbose;
+ message "\nUpdating map files ($updmap_command)...";
+ system @updmap;
+
+ message $?? '[failed]':'[done]';
+}
+
+remove_tmpdir;
+
+__END__
+:endofperl
diff --git a/Master/bin/win32/pdf2dsc.bat b/Master/bin/win32/pdf2dsc.bat
new file mode 100755
index 00000000000..c81cc48d68e
--- /dev/null
+++ b/Master/bin/win32/pdf2dsc.bat
@@ -0,0 +1,29 @@
+@rem = '--*-Perl-*--
+@echo off
+perl -x -S %0 %*
+goto endofperl
+@rem ';
+#!/usr/bin/env perl
+#line 8
+$^W=1;
+
+@GS_CMD=(-d "/usr/bin")? ("gs"):("gswin32");
+
+die "usage: $0 pdffile [dscfile]\n" unless (@ARGV);
+
+$pdffile=shift @ARGV;
+
+if (@ARGV) {
+ $dscfile=shift @ARGV;
+} else {
+ ($dscfile=$pdffile)=~s/\.pdf$/\.dsc/;
+}
+
+push @GS_CMD, qw(-q -dNODISPLAY -dSAFER -dDELAYSAFER);
+push @GS_CMD, ("-sPDFname=$pdffile", "-sDSCname=$dscfile");
+push @GS_CMD, qw(pdf2dsc.ps -c quit);
+
+exec @GS_CMD or die $!;
+
+__END__
+:endofperl
diff --git a/Master/bin/win32/wget.exe b/Master/bin/win32/wget.exe
new file mode 100644
index 00000000000..ad974bfe5f8
--- /dev/null
+++ b/Master/bin/win32/wget.exe
Binary files differ