Skip to content
Snippets Groups Projects
Commit 221b2fb9 authored by Christoph Berg's avatar Christoph Berg :satellite:
Browse files

preinst_check_catversion: Handle missing catalog version file.

parent 5630b12b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@ postgresql-common (173) UNRELEASED; urgency=medium
* README.Debian: Fix a typo.
* Updated nl translation, thanks Frans Spiesschaert! (Closes: #812353)
* preinst_check_catversion: Handle missing catalog version file.
-- Christoph Berg <christoph.berg@credativ.de> Wed, 10 Feb 2016 11:28:46 +0100
......
......@@ -162,8 +162,10 @@ preinst_check_catversion()
return ;;
esac
OLD_CATVERSION="$(cat /usr/share/postgresql/$MAJOR_VER/catalog_version || :)"
[ -z "$OLD_CATVERSION" ] && return # shouldn't happen, but bail out gracefully
CATFILE="/usr/share/postgresql/$MAJOR_VER/catalog_version"
[ -f "$CATFILE" ] || return 0 # file introduced in 9.6
OLD_CATVERSION="$(cat $CATFILE)"
[ -z "$OLD_CATVERSION" ] && return
[ "$OLD_CATVERSION" = "$NEW_CATVERSION" ] && return # no change, nothing to do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment