libtool/gl/build-aux/inline-source
Gary V. Vaughan d98a30fbce syntax-check: fix violations and implement sc_old_style_quoting.
Modern GNU ASCII quoting in output and comments is done
'like this'.
* cfg.mk (sc_old_style_quoting): Try to catch most instances
of `old style quoting' so that it is not accidentally re-
introduced to the code.
* HACKING, Makefile.am, NEWS, PORTING, README, TODO, bootstrap,
bootstrap.conf, build-aux/edit-readme-alpha,
build-aux/git-hooks/commit-msg, build-aux/ltmain.in,
doc/libtool.texi, gl/build-aux/bootstrap.in,
gl/build-aux/extract-trace, gl/build-aux/funclib.sh,
gl/build-aux/inline-source, gl/build-aux/options-parser,
libltdl/libltdl/slist.h, libltdl/loaders/loadlibrary.c,
libltdl/ltdl.c, libltdl/slist.c, libtoolize.in, m4/argz.m4,
m4/libtool.m4, m4/ltdl.m4, m4/ltoptions.m4, m4/ltsugar.m4,
tests/cmdline_wrap.at, tests/configure-iface.at, tests/demo.at,
tests/depdemo.at, tests/deplib-in-subdir.at,
tests/deplibs-mingw.at, tests/destdir.at, tests/execute-mode.at,
tests/f77demo.at, tests/fail.at, tests/inherited_flags.at,
tests/libtool.at, tests/libtoolize.at, tests/lt_dladvise.at,
tests/lt_dlexit.at, tests/mdemo.at, tests/need_lib_prefix.at,
tests/old-ltdl-iface.at, tests/old-m4-iface.at, tests/static.at,
tests/stresstest.at, tests/testsuite.at, tests/versioning.at:
Convert to upright quotes.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
2012-10-22 00:01:13 +07:00

116 lines
3.1 KiB
Bash
Executable File

#! /bin/sh
# Output the contents of a shell script with sourced files inlined.
# Written by Gary V. Vaughan, 2012
# Copyright (C) 2012 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Source required external libraries:
. `echo "$0" |${SED-sed} 's|[^/]*$||'`"funclib.sh"
. `echo "$0" |${SED-sed} 's|[^/]*$||'`"options-parser"
# Set a version string for *this* script.
scriptversion=2012-10-11.10; # UTC
# 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 3 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, see <http://www.gnu.org/licenses/>.
# Please report bugs or propose patches to bug-libtool@gnu.org.
: ${AWK="awk"}
## ------ ##
## Usage. ##
## ------ ##
# Run 'build-aux/inline-source --help' for help with using this script
# from the command line.
# Recursively scan through a FILE passed on the command line, replacing
# either of the following:
# . "relative/file"
# . `echo "$0" |edit`"relative/file"
# with the contents of the referenced files.
## ---------------- ##
## Options parsing. ##
## ---------------- ##
usage='$progpath [OPTION]... FILE'
# Short help message in response to '-h'.
usage_message='Options:
--debug enable verbose shell tracing
--version print version information and exit
-h, --help print help message and exit
'
long_help_message="\
Report bugs to <bug-libtool@gnu.org>
General help using GNU software: <http://www.gnu.org/gethelp/>."
func_options ${1+"$@"}
eval set dummy "$func_options_result"; shift
## --------------- ##
## Core functions. ##
## --------------- ##
# func_include LINE
# -----------------
# Output the contents of file included by LINE.
func_include ()
{
test -f "$1" \
|| func_fatal_error "file '$1' not found"
_G_scriptdir=`echo "$1" |$SED 's|[^/]*$||'`
test -n "$_G_scriptdir" || _G_scriptdir="./"
$AWK '
/^\. ['\''"].*['\''"]$/ {
file = substr ($2, 2, length ($2) -2);
system (sprintf ("'$progpath' %s", file));
next;
}
/^\. `echo [^`]*`['\''"][^'\''"]*['\''"]$/ {
tail = substr ($0, match ($0, /`['\''"]/));
file = substr (tail, 3, length (tail) -3);
system (sprintf ("'$progpath' '"$_G_scriptdir"'%s", file));
next;
}
{ print; }
' < "$1"
}
func_include "$1"
exit 0
# Local variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End: