From 260ba06f4475a3c7998a4ac43a339203dd0f43b4 Mon Sep 17 00:00:00 2001
From: Christoph Berg <christoph.berg@credativ.de>
Date: Mon, 27 Nov 2017 12:45:25 +0100
Subject: [PATCH] debian/maintscripts-functions: bump update-alternatives
 priority of version 1x to 1x0.

---
 debian/changelog              | 2 ++
 debian/maintscripts-functions | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 2a4a877f..1178bf84 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,8 @@ postgresql-common (189) UNRELEASED; urgency=medium
     reflects if the postmaster process is running.
     https://www.postgresql.org/message-id/20171111205316.u56lkmkakdmcx6zm%40msg.df7cb.de
   * supported-versions: Version 10 on Ubuntu 18.04 (bionic). (Closes: #881501)
+  * debian/maintscripts-functions: bump update-alternatives priority of
+    version 1x to 1x0.
 
  -- Christoph Berg <myon@debian.org>  Fri, 10 Nov 2017 17:45:10 +0100
 
diff --git a/debian/maintscripts-functions b/debian/maintscripts-functions
index f0eb1e86..084a9c4f 100644
--- a/debian/maintscripts-functions
+++ b/debian/maintscripts-functions
@@ -31,9 +31,13 @@ _link_manpages() {
     # user might have removed the directories, allow u-a to succeed
     mkdir -p /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man7
     section=$(echo "$2" | sed -e 's/.*\.\(.*\)\..*/man\1/')
+    case $1 in
+        [89]*) priority=$(echo "$1" | tr -cd 0-9) ;;
+        *) priority="${1}0" ;;
+    esac
     update-alternatives --install /usr/share/man/$section/$2 \
 	$2 /usr/share/postgresql/$1/man/$section/$2 \
-	$(echo "$1" | tr -cd 0-9) $SLAVES
+	$priority $SLAVES
 }
 
 # arguments: version master
-- 
GitLab