cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog sanity.sh


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog sanity.sh
Date: Thu, 08 Jun 2006 20:23:20 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Changes by:     Derek Robert Price <dprice>     06/06/08 20:23:19

Modified files:
        src            : ChangeLog sanity.sh 

Log message:
        * sanity.sh: Look for the config file in more places and make it a
        fatal error if an explicitly specified file is not found.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&r1=1.3439&r2=1.3440
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&r1=1.1146&r2=1.1147

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.3439
retrieving revision 1.3440
diff -u -b -r1.3439 -r1.3440
--- ChangeLog   8 Jun 2006 20:20:13 -0000       1.3439
+++ ChangeLog   8 Jun 2006 20:23:19 -0000       1.3440
@@ -1,5 +1,8 @@
 2006-06-08  Derek Price  <address@hidden>
 
+       * sanity.sh: Look for the config file in more places and make it a
+       fatal error if an explicitly specified file is not found.
+
        * server.c (requests): Add "Empty-conflicts" marker.
        * client.c (send_fileproc): Send contents of all files with conflicts
        unless the server can handle the conflict marker in the Entry.

Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.1146
retrieving revision 1.1147
diff -u -b -r1.1146 -r1.1147
--- sanity.sh   8 Jun 2006 20:20:13 -0000       1.1146
+++ sanity.sh   8 Jun 2006 20:23:19 -0000       1.1147
@@ -329,20 +329,42 @@
     echo "directory on both this client and the CVS server." >&2
 fi
 
-# Read our config file if we can find it.
+# Read our config file if we can find it.  This sources, in order, when they
+# can be found:
 #
-# The config file should always be located in the same directory as the CVS
-# executable, unless we are testing an executable outside of the build
-# directory.  In this case, we echo a warning and attempt to assume the most
-# portable configuration.
-if test -z "$configfile"; then
-       configfile=`dirname $testcvs`/sanity.config.sh
-fi
-if test -r "$configfile"; then
+#   1.  The config file in the same directory as the sanity.sh script being
+#       run.
+#   2.  The config file in the same directory as the CVS executable.
+#   3.  The config file specified on the command line.
+#
+# So, if all three scripts are found, the last script sourced which set a
+# variable will take precedence over the previous config files, whether they
+# set it or not.
+#
+# If a config file is specified on the command line and it cannot be found,
+# this script will exit with an error message.
+#
+# If no config files are found, then this script will issue a warning and
+# attempt to assume the most portable configuration.
+foundaconfig=false
+for dir in `dirname $0` `dirname $testcvs`; do
+       if test -r "$dir/sanity.config.sh"; then
+               . "$dir/sanity.config.sh"
+               foundaconfig=:
+       fi
+done
+if test -n "$configfile"; then
+       if test -r "$configfile"; then
        . "$configfile"
-else
-       echo "WARNING: Failed to locate test suite config file" >&2
-       echo "         \`$configfile'." >&2
+               foundaconfig=:
+       else
+               echo "ERROR: config file \`$configfile' does not exist or" >&2
+               echo "      or is not readable." >&2
+               exit 1
+       fi      
+fi
+if $foundaconfig; then :; else
+       echo "WARNING: Failed to locate any test suite config files." >&2
 fi
 
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]