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

debian/maintscripts-functions: Support "NN" major version numbers.

parent 732769f3
No related branches found
No related tags found
No related merge requests found
......@@ -659,7 +659,7 @@ sub get_versions {
next if $entry eq '.' || $entry eq '..';
my $pfx = '';
#redhat# $pfx = "pgsql-";
($entry) = $entry =~ /^$pfx(\d+\.\d+)$/; # untaint
($entry) = $entry =~ /^$pfx(\d+\.?\d+)$/; # untaint
push @versions, $entry if get_program_path ('psql', $entry);
}
closedir D;
......
postgresql-common (176) UNRELEASED; urgency=medium
* Support "NN" major version numbers, next version will be PostgreSQL 10.
* debian/postgresql-common.templates: Properly mark not-to-be-translated
shell code-only chunk as such using flag:translate. Thanks to Rhonda for
the pointer! (See: #820756, #832282)
......
......@@ -245,7 +245,7 @@ postinst_check_catversion()
# start debconf if we are in the server's postinst (can't run from a function)
if [ "${DPKG_MAINTSCRIPT_NAME:-}" = "postinst" ] && [ "$1" = "configure" ]; then
case $DPKG_MAINTSCRIPT_PACKAGE in
postgresql-?.?|postgresql-?.??)
postgresql-[89].?|postgresql-[1-9]?)
. /usr/share/debconf/confmodule
;;
esac
......
......@@ -282,7 +282,7 @@ if ($ownergid) {
error 'clusters must not be owned by root' unless $owneruid && $ownergid;
($version) = $ARGV[0] =~ /^(\d+\.\d+)$/;
($version) = $ARGV[0] =~ /^(\d+\.?\d+)$/;
error "invalid version '$ARGV[0]'" unless defined $version;
($cluster) = $ARGV[1] =~ /^([-.\w]+)$/;
error "invalid cluster name '$ARGV[1]'" unless defined $cluster;
......
......@@ -347,7 +347,7 @@ if (@ARGV < 2 or (@ARGV < 3 and $ARGV[0] !~ m![-/]!)) {
}
$version = shift @ARGV;
if ($version =~ m!^(\d+\.\d)[-/](.+)!) {
if ($version =~ m!^(\d+\.?\d)[-/](.+)!) {
($version, $cluster) = ($1, $2);
} else {
$cluster = shift @ARGV;
......@@ -359,7 +359,7 @@ foreach my $argv (@ARGV) {
push @pg_ctl_opts_from_cli, $argv =~ /(.*)/; # untaint
}
($version) = $version =~ /^(\d+\.\d+)$/; # untaint
($version) = $version =~ /^(\d+\.?\d+)$/; # untaint
($cluster) = $cluster =~ /^([^'"\s]+)$/; # untaint
error 'specified cluster does not exist' unless $version && $cluster && cluster_exists $version, $cluster;
%info = cluster_info ($version, $cluster);
......
......@@ -32,7 +32,7 @@ if ($#ARGV != 1) {
exit 1;
}
($version) = $ARGV[0] =~ /^(\d+\.\d+)$/;
($version) = $ARGV[0] =~ /^(\d+\.?\d+)$/;
($cluster) = $ARGV[1] =~ /^([-.\w]+)$/;
error 'invalid version' unless defined $version;
error 'invalid cluster name' unless defined $cluster;
......
......@@ -29,7 +29,7 @@ if (@ARGV != 3) {
exit 1;
}
my ($version) = $ARGV[0] =~ /^(\d+\.\d+)$/;
my ($version) = $ARGV[0] =~ /^(\d+\.?\d+)$/;
my ($oldcluster) = $ARGV[1] =~ /^([-.\w]+)$/;
my ($newcluster) = $ARGV[2] =~ /^([-.\w]+)$/;
if ($newcluster =~ /-/ and -t 1) {
......
......@@ -273,7 +273,7 @@ $method eq 'dump' or $method eq 'upgrade' or error 'method must be "dump" or "up
$link and $method eq 'dump' and error 'cannot use --link with --method=dump';
# untaint
($newversion) = $newversion =~ /^(\d+\.\d+)$/;
($newversion) = $newversion =~ /^(\d+\.?\d+)$/;
($locale) = $locale =~ /^([\w@._-]+)$/ if $locale;
($lc_collate) = $lc_collate =~ /^([\w@._-]+)$/ if $lc_collate;
($lc_ctype) = $lc_ctype =~ /^([\w@._-]+)$/ if $lc_ctype;
......@@ -289,7 +289,7 @@ if ($#ARGV < 1) {
exit 1;
}
($version) = $ARGV[0] =~ /^(\d+\.\d+)$/;
($version) = $ARGV[0] =~ /^(\d+\.?\d+)$/;
($cluster) = $ARGV[1] =~ /^([-.\w]+)$/;
$newcluster ||= $cluster; # use old cluster name by default
($newcluster) = $newcluster =~ /^([-.\w]+)$/;
......
......@@ -46,7 +46,7 @@ for (my $i = 0; $i <= $#ARGV; ++$i) {
splice @ARGV, $i, 2;
last;
} elsif ($ARGV[$i] =~ /^--cluster=(\d+\.\d)\/(.+)/) {
} elsif ($ARGV[$i] =~ /^--cluster=(\d+\.?\d)\/(.+)/) {
($version, $cluster) = ($1, $2);
$host = undef; # --cluster overrides $PGHOST env var
error 'Invalid version specified with --cluster' unless version_exists $version;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment