Package: postgresql-common
Version: 160

While troubleshooting a build failure of postgis on raspbian I discovered /usr/share/postgresql-common/supported-versions was returning 9.3. Further investigation showed that the script was failling to identify the distribution and falling back to an apparently unmaintained default.

/etc/os-release provides ID_LIKE for specifically this kind of scenario. It shows what distros a system was derived from. The general assumption is that if a deriviative is unknown it should be treated like the distro it is derived from.

The attatched patch makes /usr/share/postgresql-common/supported-versions check ID_LIKE for ubuntu and debian and use the settings for ubuntu or debian as appropriate in this case, Note: the script checks for ubuntu before checking for debian, this is important as ubuntu and it's derivatives will have both debian and ubuntu in ID_LIKE

Debdiff attatched and uploaded to raspbian, no intent to NMU in debian.


diff -Nru postgresql-common-160/debian/changelog 
postgresql-common-160+rpi1/debian/changelog
--- postgresql-common-160/debian/changelog      2014-08-11 13:40:51.000000000 
+0000
+++ postgresql-common-160+rpi1/debian/changelog 2014-09-10 00:05:09.000000000 
+0000
@@ -1,3 +1,9 @@
+postgresql-common (160+rpi1) jessie-staging; urgency=medium
+
+  * Use ID_LIKE to identify deriviatives of Debian and Ubuntu.
+
+ -- Peter Michael Green <plugw...@raspbian.org>  Tue, 09 Sep 2014 23:59:17 
+0000
+
 postgresql-common (160) unstable; urgency=medium
 
   [ Martin Pitt ]
diff -Nru postgresql-common-160/debian/supported-versions 
postgresql-common-160+rpi1/debian/supported-versions
--- postgresql-common-160/debian/supported-versions     2014-08-07 
13:56:29.000000000 +0000
+++ postgresql-common-160+rpi1/debian/supported-versions        2014-09-10 
00:07:03.000000000 +0000
@@ -61,8 +61,16 @@
             ;;
         *)
             echo "supported-versions: WARNING! Unknown distribution: $DISTRO" 
>&2
-            echo "Please submit this as a bug report to your distribution." >&2
-            /bin/echo -e "$DEFAULT"
+            if  echo $ID_LIKE | egrep  '(^| )ubuntu($| )' > /dev/null; then
+                echo "ubuntu found in ID_LIKE, treating as Ubuntu" >&2
+                ubuntu "$RELEASE"
+            elif echo $ID_LIKE | egrep  '(^| )debian($| )' > /dev/null; then
+                echo "debian found in ID_LIKE, treating as Debian" >&2
+                debian "$RELEASE"
+            else
+                echo "Please submit this as a bug report to your 
distribution." >&2
+                /bin/echo -e "$DEFAULT"
+            fi
             ;;
     esac
 }
_______________________________________________
Pkg-postgresql-public mailing list
Pkg-postgresql-public@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-postgresql-public

Reply via email to