[packages/openssl102: 303/432] - use echo in place of printf where possible to avoid weird format problems, like %20 in filenames

adwol adwol at pld-linux.org
Sat Sep 29 01:27:02 CEST 2018


commit 408d1966528e6aec9649d491aea6e52ffc62dd0e
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed May 5 11:08:54 2010 +0000

    - use echo in place of printf where possible to avoid weird format problems,
      like %20 in filenames
     (Updating certificates in /etc/openssl/certs... printf: %202007.p: invalid
      conversion specification)
    
    Changed files:
        openssl-c_rehash.sh -> 1.3

 openssl-c_rehash.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/openssl-c_rehash.sh b/openssl-c_rehash.sh
index 2bddc5a..14f7e4c 100644
--- a/openssl-c_rehash.sh
+++ b/openssl-c_rehash.sh
@@ -31,7 +31,7 @@ check_file()
 
     # make IFS a newline so we can process grep output line by line
     local OLDIFS=${IFS}
-    IFS=$( printf "\n" )
+    IFS="\n"
 
     # XXX: could be more efficient to have two 'grep -m' but is -m portable?
     for LINE in $( grep '^-----BEGIN .*-----' ${1} )
@@ -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,7 +127,7 @@ link_hash()
 # hash_dir create hash links in a given directory
 hash_dir()
 {
-    printf "Doing ${1}\n"
+    echo "Doing ${1}"
 
     cd ${1}
 
@@ -165,7 +165,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
 
@@ -191,7 +191,7 @@ export PATH
 # confirm existance/executability of ssl command
 if ! [ -x $( which ${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
 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openssl102.git/commitdiff/9fc1b1b87b259e8a327c99835865e91a391efc9e



More information about the pld-cvs-commit mailing list