diff options
author | Karl Berry <karl@freefriends.org> | 2013-02-08 00:38:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-02-08 00:38:37 +0000 |
commit | 532e95c1171566e596e733b2f12b60263d3773db (patch) | |
tree | a28c86920edec0518ca9d924a4dbe993099a0502 /Build | |
parent | 26d5dc00f5d6880985f5ae779b786f5ea001bb2f (diff) |
lua2dox 0.2 (7feb13)
git-svn-id: svn://tug.org/texlive/trunk@29053 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
3 files changed, 92 insertions, 10 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am index 3ed216c0fe4..67266c915b9 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.am +++ b/Build/source/texk/texlive/linked_scripts/Makefile.am @@ -67,7 +67,7 @@ texmf_dist_shell_scripts = \ listbib/listbib \ listings-ext/listings-ext.sh \ ltxfileinfo/ltxfileinfo \ - lua2dox/lua2dox_lua \ + lua2dox/lua2dox_filter \ pdfjam/pdf180 \ pdfjam/pdf270 \ pdfjam/pdf90 \ @@ -165,10 +165,6 @@ nobase_dist_texmf_dist_scripts_SCRIPTS = \ bin_links = \ epstopdf:repstopdf \ pdfcrop:rpdfcrop -if !WIN32 -bin_links += \ - lua2dox_lua:lua2dox_filter -endif !WIN32 ## Manpages dist_man_MANS = \ diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.in b/Build/source/texk/texlive/linked_scripts/Makefile.in index 26b80f1853f..f2d61a3fd54 100644 --- a/Build/source/texk/texlive/linked_scripts/Makefile.in +++ b/Build/source/texk/texlive/linked_scripts/Makefile.in @@ -48,9 +48,6 @@ POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -@WIN32_FALSE@am__append_1 = \ -@WIN32_FALSE@ lua2dox_lua:lua2dox_filter - subdir = linked_scripts DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(nobase_dist_texmf_dist_scripts_SCRIPTS) \ @@ -250,7 +247,7 @@ texmf_dist_shell_scripts = \ listbib/listbib \ listings-ext/listings-ext.sh \ ltxfileinfo/ltxfileinfo \ - lua2dox/lua2dox_lua \ + lua2dox/lua2dox_filter \ pdfjam/pdf180 \ pdfjam/pdf270 \ pdfjam/pdf90 \ @@ -347,7 +344,10 @@ nobase_dist_texmf_dist_scripts_SCRIPTS = \ $(texmf_dist_other_scripts) \ $(texmf_dist_context_scripts) -bin_links = epstopdf:repstopdf pdfcrop:rpdfcrop $(am__append_1) +bin_links = \ + epstopdf:repstopdf \ + pdfcrop:rpdfcrop + dist_man_MANS = \ context/context.1 \ context/mptopdf.1 \ diff --git a/Build/source/texk/texlive/linked_scripts/lua2dox/lua2dox_filter b/Build/source/texk/texlive/linked_scripts/lua2dox/lua2dox_filter new file mode 100755 index 00000000000..822fed7bea1 --- /dev/null +++ b/Build/source/texk/texlive/linked_scripts/lua2dox/lua2dox_filter @@ -0,0 +1,86 @@ +#!/bin/bash + +########################################################################### +# Copyright (C) 2012 by Simon Dales # +# simon@purrsoft.co.uk # +# # +# 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 # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program; if not, write to the # +# Free Software Foundation, Inc., # +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +########################################################################### + +##! \brief test executable to see if it exists +test_executable(){ + P_EXE="$1" + ######### + WHICH=`which ${P_EXE}` + if test -z "${WHICH}" + then + echo "not found \"${P_EXE}\"" + else + EXE="${P_EXE}" + fi + } + +##! \brief sets the lua interpreter +set_lua(){ + test_executable 'texlua' + if test -z "${EXE}" + then + test_executable 'lua' + fi + #echo "final EXE=\"${EXE}\"" + } + +##! \brief makes canonical name of file +##! +##! Note that "readlink -f" doesn't work in MacOSX +##! +do_readlink(){ + pushd . > /dev/null + TARGET_FILE=$1 + + cd `dirname $TARGET_FILE` + TARGET_FILE=`basename $TARGET_FILE` + + # Iterate down a (possible) chain of symlinks + while [ -L "$TARGET_FILE" ] + do + TARGET_FILE=`readlink $TARGET_FILE` + cd `dirname $TARGET_FILE` + TARGET_FILE=`basename $TARGET_FILE` + done + + PHYS_DIR=`pwd -P` + RESULT=$PHYS_DIR + popd > /dev/null + } + +##main +set_lua +if test -z "${EXE}" +then + echo "no lua interpreter available" +else + BASENAME=`basename "$0"` + do_readlink "$0" + DIRNAME="${RESULT}" + + LUASCRIPT="${DIRNAME}/lua2dox.lua ${BASENAME}" + #echo "lua[${LUASCRIPT}]" + + ${EXE} ${LUASCRIPT} $@ +fi +# +##eof
\ No newline at end of file |