This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository ca-certificates-java.

commit da32c134b6b9a20ebeb2eeb1cc9e8799c274a97d
Author: Matthias Klose <[email protected]>
Date:   Tue May 31 13:28:37 2011 +0000

    ca-certificates-java (20110531) unstable; urgency=low
    
      * Prepare for multiarch libnss3 update.
    
     -- Matthias Klose <[email protected]>  Tue, 31 May 2011 15:20:52 +0200
---
 debian/changelog         |  6 ++++++
 debian/jks-keystore.hook | 25 ++++++++++++++++++++++---
 debian/postinst          | 25 ++++++++++++++++++++++---
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 6a53867..4041e70 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ca-certificates-java (20110531) unstable; urgency=low
+
+  * Prepare for multiarch libnss3 update.
+
+ -- Matthias Klose <[email protected]>  Tue, 31 May 2011 15:20:52 +0200
+
 ca-certificates-java (20110426) unstable; urgency=low
 
   * Test for existing file in postinst before copying it. (Closes: #624152)
diff --git a/debian/jks-keystore.hook b/debian/jks-keystore.hook
index cd97cc5..39ab9f7 100644
--- a/debian/jks-keystore.hook
+++ b/debian/jks-keystore.hook
@@ -34,11 +34,30 @@ if [ ! -f /etc/$jvm/jvm.cfg ]; then
     printf -- "-server KNOWN\n" > $temp_jvm_cfg
 fi
 
+if which dpkg-query --version >/dev/null; then
+    nsspkg=$(dpkg-query -L libnss3 | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+    nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' 
/etc/$jvm/security/nss.cfg)
+    if [ "$nsspkg" != "$nssjdk" ]; then
+       ln -sf $nsspkg/libnss3.so $nssjdk/libnss3.so
+    fi
+fi
+
+do_cleanup()
+{
+    [ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
+    if [ "$nsspkg" != "$nssjdk" ]; then
+       rm -f $nssjdk/libnss3.so
+    fi
+}
+
 CLASSPATH=/usr/share/ca-certificates-java
 export CLASSPATH
 
-java UpdateCertificates -storepass "$storepass"
-
-[ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
+if java UpdateCertificates -storepass "$storepass"; then
+    do_cleanup
+else
+    do_cleanup
+    exit 1
+fi
 
 echo "done."
diff --git a/debian/postinst b/debian/postinst
index 5a9bfae..fd4e96d 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -23,6 +23,14 @@ setup_path()
 
 first_install()
 {
+    if which dpkg-query --version >/dev/null; then
+       nsspkg=$(dpkg-query -L libnss3 | sed -n 's,\(.*\)/libnss3\.so$,\1,p')
+       nssjdk=$(sed -n '/nssLibraryDirectory/s/.*= *\(.*\)/\1/p' 
/etc/$jvm/security/nss.cfg)
+       if [ "$nsspkg" != "$nssjdk" ]; then
+           ln -sf $nsspkg/libnss3.so $nssjdk/libnss3.so
+       fi
+    fi
+
     find /etc/ssl/certs -name \*.pem | \
     while read filename; do
        alias=$(basename $filename .pem | tr A-Z a-z | tr -cs a-z0-9 _)
@@ -37,6 +45,14 @@ first_install()
     echo "done."
 }
 
+do_cleanup()
+{
+    [ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
+    if [ "$nsspkg" != "$nssjdk" ]; then
+       rm -f $nssjdk/libnss3.so
+    fi
+}
+
 case "$1" in
     configure)
         if dpkg --compare-versions "$2" le "20100412"; then
@@ -60,9 +76,12 @@ case "$1" in
                printf -- "-server KNOWN\n" > $temp_jvm_cfg
            fi
 
-           first_install
-
-           [ -z "$temp_jvm_cfg" ] || rm -f $temp_jvm_cfg
+           if first_install; then
+               do_cleanup
+           else
+               do_cleanup
+               exit 1
+           fi
        fi
        chmod 600 /etc/default/cacerts || true
     ;;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-java/ca-certificates-java.git

_______________________________________________
pkg-java-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to