SOURCES: openssl-c_rehash.sh - handle directories with spaces

baggins baggins at pld-linux.org
Mon Nov 3 14:04:08 CET 2008


Author: baggins                      Date: Mon Nov  3 13:04:08 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- handle directories with spaces

---- Files affected:
SOURCES:
   openssl-c_rehash.sh (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/openssl-c_rehash.sh
diff -u SOURCES/openssl-c_rehash.sh:1.1 SOURCES/openssl-c_rehash.sh:1.2
--- SOURCES/openssl-c_rehash.sh:1.1	Mon Nov  3 13:49:51 2008
+++ SOURCES/openssl-c_rehash.sh	Mon Nov  3 14:04:03 2008
@@ -196,23 +196,27 @@
 fi
 
 # determine which directories to process
-# XXX: can't handle directories with spaces in names
-# XXX: ...use \n as dir separator and manipulate IFS?
+old_IFS=$IFS
 if [ ${#} -gt 0 ]
 then
+    IFS=':'
     DIRLIST=${*}
 elif [ -n "${SSL_CERT_DIR}" ]
 then
-    DIRLIST=$( echo ${SSL_CERT_DIR} | tr ':' ' ' )
+    DIRLIST=$SSL_CERT_DIR
 else
     DIRLIST=${DIR}/certs
 fi
 
+IFS=':'
+
 # process directories
 for CERT_DIR in ${DIRLIST}
 do
     if [ -d ${CERT_DIR} -a -w ${CERT_DIR} ]
     then
+        IFS=$old_IFS
         hash_dir ${CERT_DIR}
+        IFS=':'
     fi
 done
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/openssl-c_rehash.sh?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list