stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From se...@apache.org
Subject svn commit: r539639 - /incubator/stdcxx/trunk/etc/config/run_locale_utils.sh
Date Fri, 18 May 2007 23:47:18 GMT
Author: sebor
Date: Fri May 18 16:47:17 2007
New Revision: 539639

URL: http://svn.apache.org/viewvc?view=rev&rev=539639
Log:
2007-05-18  Martin Sebor  <sebor@roguewave.com>

	STDCXX-421
	* run_locale_utils.sh: When installed, invoked Bash on AIX instead
	of the default system shell (/bin/sh -> /usr/bin/sh) to work around
	a bug (?) that prevents it from trapping SIGHUP (and invoking the
	signal handler).
	Removed binary locale database at each stage of testing instead
	of waiting until the end of the process to reduce the amount of
	wasted disk space.
	Replaced [ "$var" = "" ] syntax with the more concise [ -z "$var" ].
	Incorporated the name of the locale being tested in the name of the
	temporary directory.

Modified:
    incubator/stdcxx/trunk/etc/config/run_locale_utils.sh

Modified: incubator/stdcxx/trunk/etc/config/run_locale_utils.sh
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/run_locale_utils.sh?view=diff&rev=539639&r1=539638&r2=539639
==============================================================================
--- incubator/stdcxx/trunk/etc/config/run_locale_utils.sh (original)
+++ incubator/stdcxx/trunk/etc/config/run_locale_utils.sh Fri May 18 16:47:17 2007
@@ -47,12 +47,21 @@
 ##############################################################################
 
 
-if [ "`uname`" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then
+OSNAME=`uname`
+
+if [ "$OSNAME" = "OSF1" -a "$BIN_SH" != "xpg4" ]; then
     # make getopts work on Tru64 by setting the BIN_SH variable
     # and re-executing self with the same command line arguments
     BIN_SH=xpg4
     export BIN_SH
     exec $0 $*
+elif [ "$OSNAME" = "AIX" -a -z "$BASH_VERSION" ]; then
+    # use an alternate shell to work around a bug (?) in the AIX system
+    # shell that prevents it from trapping SIGHUP (and invoking the signal
+    # handler)
+    if [ -x /bin/bash ]; then
+        exec /bin/bash $0 $*
+    fi
 fi
 
 
@@ -374,6 +383,13 @@
     dump_charmap $stage_1/$fname $stage_1/charmaps/$charmap
     dump_locale $stage_1/$fname $stage_1/$source.src
 
+    if [ -z "$no_clean" ]; then
+        # remove stage 1 locale to free up disk space but keep
+        # the text dumps for later processing
+        debug_output "rm $stage_1/$fname"
+        rm $stage_1/$fname
+    fi
+
     # create a directory for stage 2 charmap source files
     debug_output "mkdir -p $stage_2/charmaps"
     mkdir -p $stage_2/charmaps
@@ -404,6 +420,13 @@
     dump_charmap $stage_2/$fname $stage_2/charmaps/$charmap
     dump_locale $stage_2/$fname $stage_2/$source.src
 
+    if [ -z "$no_clean" ]; then
+        # remove stage 2 locale to free up disk space but keep
+        # the text dumps for later processing
+        debug_output "rm $stage_2/$fname"
+        rm $stage_2/$fname
+    fi
+
     assertions=`expr $assertions + 1`
 
     # create a directory for stage 2 charmap source files
@@ -434,6 +457,13 @@
     dump_charmap $stage_3/$fname $stage_3/charmaps/$charmap
     dump_locale $stage_3/$fname $stage_3/$source.src
 
+    if [ -z "$no_clean" ]; then
+        # remove stage 3 locale to free up disk space but keep
+        # the text dumps for later processing
+        debug_output "rm $stage_3/$fname"
+        rm $stage_3/$fname
+     fi
+
     assertions=`expr $assertions + 1`
 
     # verify that stage 1 and stage 2 charmaps are the same
@@ -466,10 +496,10 @@
         failedassertions=`expr $failedassertions + 1`
     fi
 
-    if [ "$no_clean" = "" ]; then
+    if [ -z "$no_clean" ]; then
         # clean up
         debug_output "rm -rf $stage_1 $stage_2 $stage_3"
-        rm -rf rm -rf $stage_1 $stage_2 $stage_3
+        rm -rf $stage_1 $stage_2 $stage_3
     fi
 }
 
@@ -478,17 +508,20 @@
 #
 cleanup ()
 {
-    if [ "$no_clean" = "" ]; then
+    if [ -z "$no_clean" ]; then
         # clean up
         debug_output "rm -rf $tmpdir"
         rm -rf $tmpdir
     fi
+
+    exit
 }
 
 ##############################################################################
 #  Main code
 ##############################################################################
 
+
 ## assertions
 assertions=0
 failedassertions=0
@@ -503,10 +536,6 @@
 nlsdir=""
 locdir=""
 
-## Temporary (working) directory
-[ -z "$TMP" ] && TMP="/tmp";
-tmpdir=$TMP/locale.$$
-
 ## Get the options from the command line
 while getopts ":nsfdb:i:l:O:L:M:C:D:" opt_name; do
     case $opt_name in 
@@ -526,6 +555,14 @@
            exit 1;;
      esac;
 done
+
+## set temporary (working) directory
+if [ -z "$TMP" ]; then
+    TMP="/tmp";
+    export TMP;
+fi
+
+tmpdir=$TMP/${locale_db:-unnamed-locale}.$$
 
 ## Actual test
 if [ "$chk_sanity" = "yes" ]; then



Mime
View raw message