[csw-devel] SF.net SVN: gar:[2695] csw/mgar/pkg/ca_certificates/trunk

chninkel at users.sourceforge.net chninkel at users.sourceforge.net
Wed Dec 24 16:12:48 CET 2008


Revision: 2695
          http://gar.svn.sourceforge.net/gar/?rev=2695&view=rev
Author:   chninkel
Date:     2008-12-24 15:12:48 +0000 (Wed, 24 Dec 2008)

Log Message:
-----------
ca_certificates: handles the case where openssl_rt is not installed but openssl_utils is

Modified Paths:
--------------
    csw/mgar/pkg/ca_certificates/trunk/checksums
    csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates

Modified: csw/mgar/pkg/ca_certificates/trunk/checksums
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/checksums	2008-12-24 01:14:55 UTC (rev 2694)
+++ csw/mgar/pkg/ca_certificates/trunk/checksums	2008-12-24 15:12:48 UTC (rev 2695)
@@ -1,6 +1,6 @@
 4dabeaecfd46395da152e51d312107e4  download/certdata.txt
 77fe4c8feb1b341814a6ed03d4ff764a  download/certdata2pem.pl
-86f62a09c9a90d0257a738656a3ed9f3  download/update-ca-certificates
+8163827375c4cb08f9734930adb06ee2  download/update-ca-certificates
 b4f6772525da6772d51eb30f90605d60  download/ca-certificates.conf
 787d361f8d8b8ecf89e83bb813fdaec5  download/CSWcacertificates.gspec
 31227010faaad1c2b9893ba91d6b16bb  download/CSWcacertificates.depend

Modified: csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates
===================================================================
--- csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates	2008-12-24 01:14:55 UTC (rev 2694)
+++ csw/mgar/pkg/ca_certificates/trunk/files/update-ca-certificates	2008-12-24 15:12:48 UTC (rev 2695)
@@ -114,12 +114,33 @@
 
 # we create the hash links for certificate, openssl library need 
 # this link to be able to find a CA certificate
-if { openssl version; } >/dev/null 2>&1; then
-	c_rehash "$CERTSDIR" >/dev/null 2>&1
 
-elif { /opt/csw/bin/openssl version; } >/dev/null 2>&1; then
-	OPENSSL="/opt/csw/bin/openssl" /opt/csw/bin/c_rehash "$CERTSDIR" >/dev/null 2>&1
+PATH="$PATH:/opt/csw/bin:"
+OIFS="$IFS"; IFS=":"
+set -- $PATH
+IFS="$OIFS"
 
+OPENSSL=""
+while [ $# -ne 0 ]; do
+	if [ -x "$1/openssl" ] && [ -x "$1/c_rehash" ]; then
+
+		# update-ca-certificates might be called when openssl_rt is removed
+		# that would mean that openssl binary is present but wouldn't work
+		# because of missing libraries so we test that case
+		if LANG=C ldd /opt/csw/bin/openssl | grep "not found" >/dev/null; then
+			shift
+			continue
+		fi
+		OPENSSL="$1/openssl"
+		C_REHASH="$1/c_rehash"
+		break
+	fi
+	shift
+done
+
+if [ -n "$OPENSSL" ]; then
+	OPENSSL="$OPENSSL" "$C_REHASH" "$CERTSDIR" >/dev/null 2>&1
+
 # openssl binary isn't available, so we fall back our own provided file containing
 # hash value for certificates provided by this package
 # this way, we don't stricly depend on the openssl_utils package


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list