[petsc] 02/03: ensure deprecated alternative libpetsc.so.multiarch is removed

Drew Parsons dparsons at moszumanska.debian.org
Fri Apr 8 00:32:35 UTC 2016


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

dparsons pushed a commit to tag debian/3.6.3.dfsg2-2
in repository petsc.

commit f1bd2577bde84232bd9c04134e485ae0223ab54d
Author: Drew Parsons <dparsons at debian.org>
Date:   Mon Apr 4 23:23:17 2016 +0800

    ensure deprecated alternative libpetsc.so.multiarch is removed
    
    if libpetsc.so.multiarch is still in use then remove all petsc
    alternatives (both real and complex).
    
    Use Conflicts: to ensure older versions of libpetsc3.6.3-dev,
    (and libpetsc3.6.2-dev), real and complex, do not remain installed.
---
 debian/control                             |  6 ++++++
 debian/libpetsc-complex-3.6.3-dev.postinst | 14 ++++++++++++++
 debian/libpetsc3.6.3-dev.postinst          | 13 +++++++++++++
 3 files changed, 33 insertions(+)

diff --git a/debian/control b/debian/control
index 58590eb..9c1000f 100644
--- a/debian/control
+++ b/debian/control
@@ -46,6 +46,9 @@ Depends: libpetsc3.6.3 (= ${binary:Version}), mpi-default-dev (>= 1.0.2), libsui
  libhypre-dev (>= 2.0.0.dfsg-7), libptscotch-dev, libblacs-mpi-dev, libscalapack-mpi-dev,
  libmumps-dev, libfftw3-dev, libfftw3-mpi-dev, libssl-dev, libgfortran-5-dev,
  ${misc:Depends}, ${python:Depends}
+Conflicts: libpetsc3.6.3-dev (<< 3.6.3.dfsg2-2), libpetsc-complex-3.6.3-dev (<< 3.6.3.dfsg2-2),
+ libpetsc3.6.2-dev (<= 3.6.2.dfsg1-3), libpetsc-complex-3.6.2-dev (<= 3.6.2.dfsg1-3)
+Replaces: libpetsc3.6.3-dev (<< 3.6.3.dfsg2-2)
 Recommends: libhdf5-mpi-dev (>= 1.8.8),
  tcsh | csh | c-shell, ksh | mksh | pdksh | zsh
 Suggests: petsc-dev (= ${binary:Version}), libpetsc3.6.3-dbg (= ${binary:Version}), petsc3.6.3-doc (= ${binary:Version}), libluminate-dev
@@ -164,6 +167,9 @@ Depends: libpetsc-complex-3.6.3 (= ${binary:Version}), mpi-default-dev (>= 1.0.2
  libhypre-dev (>= 2.0.0.dfsg-7), libptscotch-dev, libblacs-mpi-dev, libscalapack-mpi-dev,
  libmumps-dev, libfftw3-dev, libfftw3-mpi-dev, libssl-dev, libgfortran-5-dev,
  ${misc:Depends}, ${python:Depends}
+Conflicts: libpetsc-complex-3.6.3-dev (<< 3.6.3.dfsg2-2), libpetsc3.6.3-dev (<< 3.6.3.dfsg2-2),
+ libpetsc3.6.2-dev (<= 3.6.2.dfsg1-3), libpetsc-complex-3.6.2-dev (<= 3.6.2.dfsg1-3)
+Replaces: libpetsc-complex-3.6.3-dev (<< 3.6.3.dfsg2-2)
 Recommends: libhdf5-mpi-dev (>= 1.8.8),
  tcsh | csh | c-shell, ksh | mksh | pdksh | zsh
 Suggests: petsc-dev (= ${binary:Version}), libpetsc-complex-3.6.3-dbg (= ${binary:Version}), petsc3.6.3-doc (= ${binary:Version}), libluminate-dev
diff --git a/debian/libpetsc-complex-3.6.3-dev.postinst b/debian/libpetsc-complex-3.6.3-dev.postinst
index 8b80443..0c7f486 100644
--- a/debian/libpetsc-complex-3.6.3-dev.postinst
+++ b/debian/libpetsc-complex-3.6.3-dev.postinst
@@ -12,6 +12,20 @@ PETSC_DIR_COMPLEX=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_COMPLEX_ARCH}
 # Make alternatives links
 if [ "$1" = "configure" ]; then
 
+# alternative libpetsc.so.multiarch is deprecated
+# test if libpetsc.so.multiarch is still in use
+if update-alternatives --query petsc | grep libpetsc.so.multiarch > /dev/null ; then
+  # if so, refresh the alternatives (remove libpetsc.so.multiarch) by removing the old definitions
+  # Show no mercy. Wipe them out. All of them..
+  # i.e. remove both real and complex alternatives for the old version
+  # This should be safe since Conflicts are set up with the package versions using deprecated libpetsc.so.multiarch.
+  echo Removing deprecated petsc alternatives using libpetsc.so.multiarch.
+  for alt in `update-alternatives --list petsc`; do
+    update-alternatives --remove petsc ${alt}
+  done
+fi
+
+
 # alternative default petsc (e.g. real or complex)
 update-alternatives --install /usr/lib/petsc petsc ${PETSC_DIR_COMPLEX} ${PETSC_VERSION_NUMBER}73 \
   --slave /usr/lib/${DEB_HOST_MULTIARCH}/libpetsc.so libpetsc.so /usr/lib/${DEB_HOST_MULTIARCH}/libpetsc_complex.so.${PETSC_VERSION} \
diff --git a/debian/libpetsc3.6.3-dev.postinst b/debian/libpetsc3.6.3-dev.postinst
index 374e6db..c720594 100644
--- a/debian/libpetsc3.6.3-dev.postinst
+++ b/debian/libpetsc3.6.3-dev.postinst
@@ -12,6 +12,19 @@ PETSC_DIR_REAL=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_REAL_ARCH}
 # Make alternatives links
 if [ "$1" = "configure" ]; then
 
+# alternative libpetsc.so.multiarch is deprecated
+# test if libpetsc.so.multiarch is still in use
+if update-alternatives --query petsc | grep libpetsc.so.multiarch > /dev/null ; then
+  # if so, refresh the alternatives (remove libpetsc.so.multiarch) by removing the old definitions
+  # Show no mercy. Wipe them out. All of them. 
+  # i.e. remove both real and complex alternatives for the old version
+  # This should be safe since Conflicts are set up with the package versions using deprecated libpetsc.so.multiarch.
+  echo Removing deprecated petsc alternatives using libpetsc.so.multiarch.
+  for alt in `update-alternatives --list petsc`; do
+    update-alternatives --remove petsc ${alt}
+  done
+fi
+
 # alternative default petsc (e.g. real or complex)
 update-alternatives --install /usr/lib/petsc petsc ${PETSC_DIR_REAL} ${PETSC_VERSION_NUMBER}77 \
   --slave /usr/lib/${DEB_HOST_MULTIARCH}/libpetsc.so libpetsc.so /usr/lib/${DEB_HOST_MULTIARCH}/libpetsc_real.so.${PETSC_VERSION} \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/petsc.git



More information about the debian-science-commits mailing list