Ops, forgot to commit the changes entry in recent commit...
[openssl.git] / tools / c_rehash
index 007600152c5a78a5476f75bdb2bd1c7ae8b12061..60c28595bd026f2a5f84d986fa1ca7dbbfc9dfcb 100644 (file)
@@ -4,12 +4,26 @@
 # on the command line.
 #
 
 # on the command line.
 #
 
-if [ "$SSLEAY"x = "x" ]; then
+if [ "$SSLEAY"x = "x" -o ! -x "$SSLEAY" ]; then
        SSLEAY='ssleay'
        export SSLEAY
 fi
 DIR=/usr/local/ssl
        SSLEAY='ssleay'
        export SSLEAY
 fi
 DIR=/usr/local/ssl
-#PATH=$DIR/bin:$PATH
+PATH=$DIR/bin:$PATH
+
+if [ ! -f "$SSLEAY" ]; then
+    found=0
+    for dir in . `echo $PATH | sed -e 's/:/ /g'`; do
+        if [ -f "$dir/$SSLEAY" ]; then
+            found=1
+            break
+        fi
+    done
+    if [ $found = 0 ]; then
+        echo "c_rehash: rehashing skipped ('ssleay' program still not available)" 1>&2
+        exit 0
+    fi
+fi
 
 SSL_DIR=$DIR/certs
 
 
 SSL_DIR=$DIR/certs