[pkg-java] r13568 - trunk/ca-certificates-java/debian
Torsten Werner
twerner at alioth.debian.org
Sun Apr 24 22:59:26 UTC 2011
Author: twerner
Date: 2011-04-24 22:59:25 +0000 (Sun, 24 Apr 2011)
New Revision: 13568
Modified:
trunk/ca-certificates-java/debian/jks-keystore.hook
Log:
updating the jks-keystore.hook
Modified: trunk/ca-certificates-java/debian/jks-keystore.hook
===================================================================
--- trunk/ca-certificates-java/debian/jks-keystore.hook 2011-04-24 22:43:41 UTC (rev 13567)
+++ trunk/ca-certificates-java/debian/jks-keystore.hook 2011-04-24 22:59:25 UTC (rev 13568)
@@ -7,21 +7,20 @@
. /etc/default/cacerts
fi
-KEYSTORE=/etc/ssl/certs/java/cacerts
-
echo ""
if [ "$cacerts_updates" != yes ] || [ "$CACERT_UPDATES" = disabled ]; then
echo "updates of cacerts keystore disabled."
exit 0
fi
+# Do we still need it? TODO: check that.
if ! mountpoint -q /proc; then
echo >&2 "the keytool command requires a mounted proc fs (/proc)."
exit 1
fi
-for jvm in java-6-openjdk java-6-sun java-6-cacao; do
- if [ -x /usr/lib/jvm/$jvm/bin/keytool ]; then
+for jvm in java-6-openjdk java-7-openjdk java-6-sun; do
+ if [ -x /usr/lib/jvm/$jvm/bin/java ]; then
break
fi
done
@@ -36,73 +35,11 @@
printf -- "-server KNOWN\n" > $temp_jvm_cfg
fi
-# read lines of the form: [+-]/etc/ssl/certs/*.pem
+CLASSPATH=/usr/share/ca-certificates-java
+export CLASSPATH
-echo "updating keystore $KEYSTORE..."
+java UpdateCertificates -storepass "$storepass"
-errors=0
-log=$(tempfile)
-while read line; do
- pem=${line#[+-]*}
- alias=$(basename $pem .crt | tr A-Z a-z | tr -cs a-z0-9 _)
- alias=${alias%*_}
- LANG=C LC_ALL=C keytool -list -keystore $KEYSTORE \
- -storepass "$storepass" -alias "$alias" >/dev/null 2>&1 \
- && exists=yes || exists=no
- case "$line" in
- +*)
- if [ "$exists" = yes ]; then
- echo " already exists: ${line#+*}"
- else
- if LANG=C LC_ALL=C keytool -importcert -trustcacerts \
- -keystore $KEYSTORE -noprompt -storepass "$storepass" \
- -alias "$alias" -file "$pem" > $log 2>&1
- then
- echo " added: ${line#+*}"
- elif LANG=C LC_ALL=C keytool -importcert -trustcacerts \
- -keystore $KEYSTORE -noprompt -storepass "$storepass" \
- -providerClass sun.security.pkcs11.SunPKCS11 \
- -providerArg '${java.home}/lib/security/nss.cfg' \
- -alias "$alias" -file "$pem" > $log 2>&1
- then
- echo " added: ${line#+*} (using NSS provider)"
- elif grep -q 'Signature not available' $log; then
- echo " ignored import, signature not available: ${line#+*}"
- cat $log
- else
- echo >&2 " error adding ${line#+*}"
- errors=$(expr $errors + 1)
- fi;
- fi
- ;;
- -*)
- if [ "$exists" = yes ]; then
- if LANG=C LC_ALL=C keytool -delete -keystore $KEYSTORE \
- -noprompt -storepass "$storepass" \
- -alias "$alias"
- then
- echo " removed ${line#-*}"
- elif LANG=C LC_ALL=C keytool -delete -keystore $KEYSTORE \
- -noprompt -storepass "$storepass" \
- -providerClass sun.security.pkcs11.SunPKCS11 \
- -providerArg '${java.home}/lib/security/nss.cfg' \
- -alias "$alias"
- then
- echo " removed ${line#-*} (using NSS provider)"
- else
- echo >&2 " error removing ${line#+*}"
- errors=$(expr $errors + 1)
- fi
- else
- echo " does not exist: ${line#-*}"
- fi
- ;;
- *)
- echo >&2 " $0: Unknown line $line"
- esac
-done
-rm -f $log
-
[ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
if [ $errors -gt 0 ]; then
More information about the pkg-java-commits
mailing list