[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
trans-coord/gnun/server/gnun gnun-validate-html.in
From: |
Pavel Kharitonov |
Subject: |
trans-coord/gnun/server/gnun gnun-validate-html.in |
Date: |
Thu, 26 Apr 2012 08:50:39 +0000 |
CVSROOT: /sources/trans-coord
Module name: trans-coord
Changes by: Pavel Kharitonov <ineiev> 12/04/26 08:50:39
Modified files:
gnun/server/gnun: gnun-validate-html.in
Log message:
Fail when some SSI files are missing.
(TMP3): New variable.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/trans-coord/gnun/server/gnun/gnun-validate-html.in?cvsroot=trans-coord&r1=1.14&r2=1.15
Patches:
Index: gnun-validate-html.in
===================================================================
RCS file:
/sources/trans-coord/trans-coord/gnun/server/gnun/gnun-validate-html.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- gnun-validate-html.in 30 Jan 2012 08:49:13 -0000 1.14
+++ gnun-validate-html.in 26 Apr 2012 08:50:39 -0000 1.15
@@ -99,7 +99,8 @@
# Create two tempfiles and mark them for deletion on exit.
TMP1=`mktemp -t gnun.1.XXXXXX`
TMP2=`mktemp -t gnun.2.XXXXXX`
-trap "rm -f $TMP1 $TMP2" EXIT
+TMP3=`mktemp -t gnun.3.XXXXXX`
+trap "rm -f $TMP1 $TMP2 $TMP3" EXIT
# Use $TMP1 if no $OUTPUT is specified.
OUTPUT="${OUTPUT:-${TMP1}}"
@@ -109,6 +110,7 @@
cat > $TMP2 <<"EOF"
# Limitations: CGI includes would be expanded in a wrong way
BEGIN {
+ exit_val = 0
relative_dir_name = ARGV[1];
if (relative_dir_name ~ /\//)
sub (/[^\/]*$/, "", relative_dir_name);
@@ -147,9 +149,12 @@
name = relative_dir_name name;
# Invoke the script recursively
- system ("@AWK@ -v script_name='" script_name "' -v root='" \
+ val = system ("@AWK@ -v script_name='" script_name "' -v root='" \
root "' -f '" script_name "' " name);
+ if (!exit_val)
+ exit_val = val
+
# Output the part remaining after the include directive
print (substr (names[i], m + 3));
}
@@ -157,9 +162,16 @@
}
{ print; }
+
+END { exit exit_val }
EOF
address@hidden@ -v script_name=$TMP2 -v root="${ROOT}" -f $TMP2 $1 > "${OUTPUT}"
+if ! @AWK@ -v script_name=$TMP2 -v root="${ROOT}" -f $TMP2 $1 > "${OUTPUT}" \
+ 2> $TMP3; then
+ echo Failed to expand SSIs:
+ cat $TMP3
+ exit 1
+fi
if @AWK@ '
# Check whether we are validating HTML5 or some other flavor of HTML
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- trans-coord/gnun/server/gnun gnun-validate-html.in,
Pavel Kharitonov <=