2008-05-15 Martin Sebor <sebor@roguewave.com>
Merged 656725 from 4.2.x:
2008-05-15 Martin Sebor <sebor@roguewave.com>
* bin/xbuildgen (mydir, rootdir): Added global constants defined
to the name of the directory the script is located in (assuming
it's invoked using a relative pathname) and the root directory
of the stdcxx source tree.
(xcomp): Defined relative to rootdir instead of using $HOME and
invoked directly instead of passing the name of the awk script
as an argument to awk.
* bin/xcomp.awk: Allowed script to be invoked directly.
git-svn-id: https://svn.apache.org/repos/asf/stdcxx/trunk@656727 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bin/xbuildgen b/bin/xbuildgen
index 374c7c1..78f0b67 100755
--- a/bin/xbuildgen
+++ b/bin/xbuildgen
@@ -86,6 +86,12 @@
# set program name (used in diagnostic messages)
readonly myname=`basename $0`
+# the directory where the script is located to get a hold of other
+# files at locations relative to this one (assumes the script resides
+# within the stdcxx source tree)
+readonly mydir=`dirname $0`
+readonly rootdir=$mydir/..
+
readonly today=`LC_ALL="C" date`
# URL to the ViewVC directory
@@ -98,7 +104,10 @@
readonly svnpath="$viewvc/stdcxx/trunk"
# expected failures
-readonly xfailfile=$HOME/stdcxx/etc/config/xfail.txt
+readonly xfailfile=$rootdir/etc/config/xfail.txt
+
+# xcross-component awk script
+readonly xcomp=$mydir/xcomp.awk
######################################################################
# global variables
@@ -931,11 +940,6 @@
######################################################################
-# xcross-component script
-xcomp=$HOME/stdcxx/bin/xcomp.awk
-
-######################################################################
-
# check to see
if [ -r $xfailfile ]; then
xfails=$xfailfile
@@ -943,7 +947,7 @@
xfails=""
fi
-awk -f $xcomp bodyonly=1 logdir=$logdir $xfails $textlogs | output
+$xcomp bodyonly=1 logdir=$logdir $xfails $textlogs | output
######################################################################
# output the rest of the HTML file
diff --git a/bin/xcomp.awk b/bin/xcomp.awk
index 7d502a4..7c97afe 100755
--- a/bin/xcomp.awk
+++ b/bin/xcomp.awk
@@ -1,4 +1,4 @@
-#!/bin/awk
+#!/usr/bin/awk -f
#
# $Id$
#