mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 14:20:40 +01:00
Support conditional compilation.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
be7a6ec35d
commit
577db69719
@ -337,7 +337,7 @@ uptodate() {
|
|||||||
ifs="$IFS"
|
ifs="$IFS"
|
||||||
IFS=':'
|
IFS=':'
|
||||||
|
|
||||||
for dir in $CONFIG_PATH; do
|
for dir in $g_shorewalldir $CONFIG_PATH; do
|
||||||
if [ -n "$(find ${dir} -newer $1)" ]; then
|
if [ -n "$(find ${dir} -newer $1)" ]; then
|
||||||
IFS="$ifs"
|
IFS="$ifs"
|
||||||
return 1;
|
return 1;
|
||||||
@ -599,6 +599,7 @@ start_command() {
|
|||||||
compile_command() {
|
compile_command() {
|
||||||
local finished
|
local finished
|
||||||
finished=0
|
finished=0
|
||||||
|
local conditional
|
||||||
|
|
||||||
while [ $finished -eq 0 ]; do
|
while [ $finished -eq 0 ]; do
|
||||||
[ $# -eq 0 ] && break
|
[ $# -eq 0 ] && break
|
||||||
@ -629,6 +630,10 @@ compile_command() {
|
|||||||
g_debug=Yes;
|
g_debug=Yes;
|
||||||
option=${option#d}
|
option=${option#d}
|
||||||
;;
|
;;
|
||||||
|
c*)
|
||||||
|
conditional=Yes;
|
||||||
|
option=${option#c}
|
||||||
|
;;
|
||||||
T*)
|
T*)
|
||||||
g_confess=Yes
|
g_confess=Yes
|
||||||
option=${option#T}
|
option=${option#T}
|
||||||
@ -678,9 +683,14 @@ compile_command() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ "x$file" = x- ] || progress_message3 "Compiling..."
|
if [ -n "$conditional" ] && uptodate $file; then
|
||||||
|
echo "$file is up to date -- no compilation required"
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
[ "x$file" = x- ] || progress_message3 "Compiling..."
|
||||||
|
|
||||||
compiler $g_debugging compile $file && run_postcompile $file
|
compiler $g_debugging compile $file && run_postcompile $file
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -1579,7 +1589,7 @@ usage() # $1 = exit status
|
|||||||
echo " allow <address> ..."
|
echo " allow <address> ..."
|
||||||
echo " check [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]"
|
echo " check [ -e ] [ -r ] [ -p ] [ -r ] [ -T ] [ <directory> ]"
|
||||||
echo " clear"
|
echo " clear"
|
||||||
echo " compile [ -e ] [ -p ] [ -t ] [ -d ] [ -T ] [ <directory name> ] [ <path name> ]"
|
echo " compile [ -e ] [ -p ] [ -t ] [ -c ] [ -d ] [ -T ] [ <directory name> ] [ <path name> ]"
|
||||||
echo " delete <interface>[:<host-list>] ... <zone>"
|
echo " delete <interface>[:<host-list>] ... <zone>"
|
||||||
echo " disable <interface>"
|
echo " disable <interface>"
|
||||||
echo " drop <address> ..."
|
echo " drop <address> ..."
|
||||||
|
@ -92,6 +92,8 @@
|
|||||||
|
|
||||||
<arg><option>-e</option></arg>
|
<arg><option>-e</option></arg>
|
||||||
|
|
||||||
|
<arg><option>-c</option></arg>
|
||||||
|
|
||||||
<arg><option>-d</option></arg>
|
<arg><option>-d</option></arg>
|
||||||
|
|
||||||
<arg><option>-p</option></arg>
|
<arg><option>-p</option></arg>
|
||||||
@ -832,8 +834,9 @@
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Compiles the current configuration into the executable file
|
<para>Compiles the current configuration into the executable file
|
||||||
<emphasis>pathname</emphasis>. If a directory is supplied, Shorewall
|
<emphasis>pathname</emphasis>. If a
|
||||||
will look in that directory first for configuration files. If the
|
<replaceable>directory</replaceable> is supplied, Shorewall will
|
||||||
|
look in that directory first for configuration files. If the
|
||||||
<emphasis>pathname</emphasis> is omitted, the file
|
<emphasis>pathname</emphasis> is omitted, the file
|
||||||
<filename>firewall</filename> in the VARDIR (normally <filename
|
<filename>firewall</filename> in the VARDIR (normally <filename
|
||||||
class="directory">/var/lib/shorewall/</filename>) is assumed. A
|
class="directory">/var/lib/shorewall/</filename>) is assumed. A
|
||||||
@ -853,6 +856,16 @@
|
|||||||
capabilities</emphasis> on a system with Shorewall Lite
|
capabilities</emphasis> on a system with Shorewall Lite
|
||||||
installed</para>
|
installed</para>
|
||||||
|
|
||||||
|
<para>The <emphasis role="bold">-c</emphasis> option was added in
|
||||||
|
Shorewall 4.5.17 and causes conditional compilation of a script. The
|
||||||
|
script specified by <replaceable>pathname</replaceable> (or implied
|
||||||
|
if <emphasis role="bold">pathname</emphasis> is omitted) is compiled
|
||||||
|
if it doesn't exist or if there is any file in the
|
||||||
|
<replaceable>directory</replaceable> or in a directory on the
|
||||||
|
CONFIG_PATH that has a modification time later than the file to be
|
||||||
|
compiled. When no compilation is needed, a message is issued and an
|
||||||
|
exit status of zero is returned.</para>
|
||||||
|
|
||||||
<para>The <option>-d</option> option causes the compiler to be run
|
<para>The <option>-d</option> option causes the compiler to be run
|
||||||
under control of the Perl debugger.</para>
|
under control of the Perl debugger.</para>
|
||||||
|
|
||||||
|
@ -762,7 +762,17 @@
|
|||||||
which may be produced using the command <emphasis
|
which may be produced using the command <emphasis
|
||||||
role="bold">shorewall6-lite show -f capabilities >
|
role="bold">shorewall6-lite show -f capabilities >
|
||||||
capabilities</emphasis> on a system with Shorewall6 Lite
|
capabilities</emphasis> on a system with Shorewall6 Lite
|
||||||
installed</para>
|
installed.</para>
|
||||||
|
|
||||||
|
<para>The <emphasis role="bold">-c</emphasis> option was added in
|
||||||
|
Shorewall 4.5.17 and causes conditional compilation of a script. The
|
||||||
|
script specified by <replaceable>pathname</replaceable> (or implied
|
||||||
|
if <emphasis role="bold">pathname</emphasis> is omitted) is compiled
|
||||||
|
if it doesn't exist or if there is any file in the
|
||||||
|
<replaceable>directory</replaceable> or in a directory on the
|
||||||
|
CONFIG_PATH that has a modification time later than the file to be
|
||||||
|
compiled. When no compilation is needed, a message is issued and an
|
||||||
|
exit status of zero is returned.</para>
|
||||||
|
|
||||||
<para>The <option>-d</option> option causes the compiler to be run
|
<para>The <option>-d</option> option causes the compiler to be run
|
||||||
under control of the Perl debugger.</para>
|
under control of the Perl debugger.</para>
|
||||||
|
Loading…
Reference in New Issue
Block a user