X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=openssl-c_rehash.sh;h=75a774945cf75a4a35f96cc548199e8c1270a68f;hb=55af98454b1ea8c10cf2e12070fe0d6b0a97f961;hp=2bddc5a24f830cef630c45b8218f425f8e3589e4;hpb=4d0769bb8487a7a99cf636d32fdf09e16f173495;p=packages%2Fopenssl.git diff --git a/openssl-c_rehash.sh b/openssl-c_rehash.sh index 2bddc5a..75a7749 100644 --- a/openssl-c_rehash.sh +++ b/openssl-c_rehash.sh @@ -106,7 +106,7 @@ link_hash() do if [ ${FINGERPRINT} = $( fingerprint ${LINKFILE} ${2} ) ] then - printf "WARNING: Skipping duplicate file ${1}\n" >&2 + echo "WARNING: Skipping duplicate file ${1}" >&2 return 1 fi @@ -114,7 +114,7 @@ link_hash() LINKFILE=${HASH}.${TAG}${SUFFIX} done - printf "${1} => ${LINKFILE}\n" + echo "${1} => ${LINKFILE}" # assume any system with a POSIX shell will either support symlinks or # do something to handle this gracefully @@ -127,18 +127,12 @@ link_hash() # hash_dir create hash links in a given directory hash_dir() { - printf "Doing ${1}\n" + echo "Doing ${1}" cd ${1} - for FILE in * + ls -1 * 2>/dev/null | while read FILE do - # no files in directory at all, no point in continuing - if ! [ -f ${FILE} ] - then - return 1 - fi - if echo ${FILE} | grep -q -E '^[[:xdigit:]]{8}\.r?[[:digit:]]+$' \ && [ -h "${FILE}" ] then @@ -146,14 +140,8 @@ hash_dir() fi done - for FILE in *.pem + ls -1 *.pem 2>/dev/null | while read FILE do - # no pem files so FILE gets set to the unexpanded *.pem - if ! [ -f ${FILE} ] - then - break - fi - check_file ${FILE} local FILE_TYPE=${?} local TYPE_STR='' @@ -165,7 +153,7 @@ hash_dir() then TYPE_STR='crl' else - printf "WARNING: ${FILE} does not contain a certificate or CRL: skipping\n" >&2 + echo "WARNING: ${FILE} does not contain a certificate or CRL: skipping" >&2 continue fi @@ -177,11 +165,11 @@ hash_dir() # choose the name of an ssl application if [ -n "${OPENSSL}" ] then - SSL_CMD=${OPENSSL} + SSL_CMD=$(which ${OPENSSL} 2>/dev/null) else - SSL_CMD=openssl + SSL_CMD=/usr/bin/openssl OPENSSL=${SSL_CMD} - export ${OPENSSL} + export OPENSSL fi # fix paths @@ -189,9 +177,9 @@ PATH=${PATH}:${DIR}/bin export PATH # confirm existance/executability of ssl command -if ! [ -x $( which ${SSL_CMD} ) ] +if ! [ -x ${SSL_CMD} ] then - printf "${0}: rehashing skipped ('openssl' program not available)\n" >&2 + echo "${0}: rehashing skipped ('openssl' program not available)" >&2 exit 0 fi