| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# Extract server catalog and control file version numbers. |
| 4 |
# This information is stored in the packages and used at install time to |
| 5 |
# determine if an in-major-version pg_upgradecluster is required. |
| 6 |
|
| 7 |
set -eu |
| 8 |
|
| 9 |
CATVERSION=$(awk '/^#define CATALOG_VERSION_NO/ { print $3 }' src/include/catalog/catversion.h) |
| 10 |
CONTROLVERSION=$(awk '/^#define PG_CONTROL_VERSION/ { print $3 }' src/include/catalog/pg_control.h) |
| 11 |
|
| 12 |
case $CONTROLVERSION in |
| 13 |
# control file versions used in PG 9.6 .. 15 |
| 14 |
# don't append to catversion to avoid spurious warnings for users of existing packages |
| 15 |
960|1002|1100|1201|1300) echo "$CATVERSION" ;; |
| 16 |
*) echo "$CATVERSION-$CONTROLVERSION" ;; |
| 17 |
esac |