Package: postgis
Usertags: origin-ubuntu lucid ubuntu-patch
Version: 1.3.6-2
Severity: normal
Tags: patch

This report has also been filed here: https://bugs.launchpad.net/bugs/392143

postgis can't be removed if postgresql is not installed due to missing
"/usr/lib/postgresql/8.3/lib" directory

:: VERSION ::
   postgis | 1.3.3-3 | intrepid/universe | source, amd64, i386
   postgis | 1.3.3-3 | jaunty/universe | source, amd64, i386
   postgis | 1.3.5-1 | karmic/universe | source, amd64, i386
   postgis | 1.3.6-2 | lucid/universe | source, amd64, i386

:: TEST CASE ::
Check that postgresql is not installed then
$ sudo apt-get install postgis
$ sudo apt-get remove --purge postgis

Removing postgis ...
Purging configuration files for postgis ...
find: `/usr/lib/postgresql/8.3/lib': No such file or directory
dpkg: error processing postgis (--purge):
 subprocess post-removal script returned error exit status 1

:: WORKAROUND ::
$ sudo rm /var/lib/dpkg/info/postgis.postrm
$ sudo apt-get remove --purge postgis


In Ubuntu, we've applied the attached patch to achieve the following:

  * debian/postgis-generic.postrm.in : check if postgresql directory
exists before searching for postgis shared libs to purge (LP #392143)

We thought you might be interested in doing the same.

Thanks.
diff -u postgis-1.3.6/debian/control postgis-1.3.6/debian/control
--- postgis-1.3.6/debian/control
+++ postgis-1.3.6/debian/control
@@ -1,7 +1,8 @@
 Source: postgis
 Section: misc
 Priority: optional
-Maintainer: Debian GIS Project <pkg-grass-de...@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian GIS Project 
<pkg-grass-de...@lists.alioth.debian.org>
 Uploaders: Stephen Frost <sfr...@debian.org>, Fabio Tranchitella 
<kob...@debian.org>, Francesco Paolo Lovergine <fran...@debian.org>
 Build-Depends: debhelper (>= 5.0.0), autotools-dev, flex, bison, 
postgresql-server-dev-8.3, libgeos-dev, proj,
  libssl-dev, xsltproc, docbook, docbook-xsl, libpg-java, default-jdk, fastjar, 
libjts-java (>=1.7), dpatch
diff -u postgis-1.3.6/debian/postgis-generic.postrm.in 
postgis-1.3.6/debian/postgis-generic.postrm.in
--- postgis-1.3.6/debian/postgis-generic.postrm.in
+++ postgis-1.3.6/debian/postgis-generic.postrm.in
@@ -4,7 +4,8 @@
 
 # Removes all postgis shared libs links
 if [ "$1" = "purge" ]; then
-     find /usr/lib/postgresql/@POSTGRES_VERSION@/lib -type f -name 
"liblwgeom.so.*" -delete
+        [ -d /usr/lib/postgresql/@POSTGRES_VERSION@/lib ] && \
+                find /usr/lib/postgresql/@POSTGRES_VERSION@/lib -type f -name 
"liblwgeom.so.*" -delete
 fi
 
 #DEBHELPER#
diff -u postgis-1.3.6/debian/changelog postgis-1.3.6/debian/changelog
--- postgis-1.3.6/debian/changelog
+++ postgis-1.3.6/debian/changelog
@@ -1,3 +1,10 @@
+postgis (1.3.6-2ubuntu1) lucid; urgency=low
+
+  * debian/postgis-generic.postrm.in : check if postgresql directory exists 
+    before searching for postgis shared libs to purge (LP #392143)
+
+ -- Jean-Baptiste Lallement <jeanbaptiste.lallem...@gmail.com>  Thu, 10 Dec 
2009 23:40:18 +0100
+
 postgis (1.3.6-2) unstable; urgency=high
 
   * Fixed wrong obsolete version reference in debian/rules.

Reply via email to