From 9c8d2b7be39314b41f04a1e1356942afe21ab223 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 12 Feb 2022 14:04:56 -0800 Subject: [PATCH] apt-repos: Downgrade PostgreSQL to dodge PGroonga regression. Signed-off-by: Anders Kaseorg --- scripts/lib/install | 4 ++-- scripts/lib/upgrade-zulip-stage-2 | 4 ++-- scripts/setup/apt-repos/zulip/bullseye.list | 3 +++ scripts/setup/apt-repos/zulip/buster.list | 3 +++ scripts/setup/apt-repos/zulip/focal.list | 3 +++ scripts/setup/apt-repos/zulip/zulip.pref | 19 +++++++++++++++++++ 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 scripts/setup/apt-repos/zulip/zulip.pref diff --git a/scripts/lib/install b/scripts/lib/install index 972f401173..e8ebf79360 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -334,7 +334,7 @@ fi # installation process more seamless. if [ -z "$NO_DIST_UPGRADE" ]; then if [ "$package_system" = apt ]; then - apt-get -y dist-upgrade "${APT_OPTIONS[@]}" + apt-get -y --allow-downgrades dist-upgrade "${APT_OPTIONS[@]}" elif [ "$package_system" = yum ]; then # On CentOS, there is no need to do `yum -y upgrade` because `yum -y # update` already does the same thing. @@ -452,7 +452,7 @@ fi "$ZULIP_PATH"/scripts/zulip-puppet-apply -f if [ "$package_system" = apt ]; then - apt-get -y upgrade + apt-get -y --allow-downgrades upgrade elif [ "$package_system" = yum ]; then # No action is required because `yum update` already does upgrade. : diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 5e0404d791..484ef23e7b 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -195,7 +195,7 @@ if glob.glob("/usr/share/postgresql/*/extension/tsearch_extras.control"): if not args.skip_puppet: logging.info("Upgrading system packages...") subprocess.check_call(["apt-get", "update"]) - subprocess.check_call(["apt-get", "-y", "upgrade"]) + subprocess.check_call(["apt-get", "-y", "--allow-downgrades", "upgrade"]) # To bootstrap zulip-puppet-apply, we need to install the system yaml # package; new installs get this, but old installs may not have it. @@ -372,7 +372,7 @@ if classes != new_classes: if not args.skip_puppet: logging.info("Applying Puppet changes...") subprocess.check_call(["./scripts/zulip-puppet-apply", "--force"]) - subprocess.check_call(["apt-get", "-y", "upgrade"]) + subprocess.check_call(["apt-get", "-y", "--allow-downgrades", "upgrade"]) if migrations_needed: logging.info("Applying database migrations...") diff --git a/scripts/setup/apt-repos/zulip/bullseye.list b/scripts/setup/apt-repos/zulip/bullseye.list index 4c6663d160..8e31cac25f 100644 --- a/scripts/setup/apt-repos/zulip/bullseye.list +++ b/scripts/setup/apt-repos/zulip/bullseye.list @@ -1,2 +1,5 @@ deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main deb-src http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main + +deb http://apt-archive.postgresql.org/pub/repos/apt/ bullseye-pgdg-archive main +deb-src http://apt-archive.postgresql.org/pub/repos/apt/ bullseye-pgdg-archive main diff --git a/scripts/setup/apt-repos/zulip/buster.list b/scripts/setup/apt-repos/zulip/buster.list index 777c6f33d7..cdbebe559e 100644 --- a/scripts/setup/apt-repos/zulip/buster.list +++ b/scripts/setup/apt-repos/zulip/buster.list @@ -1,2 +1,5 @@ deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main deb-src http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main + +deb http://apt-archive.postgresql.org/pub/repos/apt/ buster-pgdg-archive main +deb-src http://apt-archive.postgresql.org/pub/repos/apt/ buster-pgdg-archive main diff --git a/scripts/setup/apt-repos/zulip/focal.list b/scripts/setup/apt-repos/zulip/focal.list index 8578405cfe..595b2ad521 100644 --- a/scripts/setup/apt-repos/zulip/focal.list +++ b/scripts/setup/apt-repos/zulip/focal.list @@ -1,5 +1,8 @@ deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main deb-src http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main +deb http://apt-archive.postgresql.org/pub/repos/apt/ focal-pgdg-archive main +deb-src http://apt-archive.postgresql.org/pub/repos/apt/ focal-pgdg-archive main + deb http://ppa.launchpad.net/groonga/ppa/ubuntu focal main deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu focal main diff --git a/scripts/setup/apt-repos/zulip/zulip.pref b/scripts/setup/apt-repos/zulip/zulip.pref new file mode 100644 index 0000000000..5a5f47059a --- /dev/null +++ b/scripts/setup/apt-repos/zulip/zulip.pref @@ -0,0 +1,19 @@ +Package: postgresql-10 postgresql-client-10 postgresql-server-dev-10 +Pin: version 10.19-* +Pin-Priority: 1000 + +Package: postgresql-11 postgresql-client-11 postgresql-server-dev-11 +Pin: version 11.14-* +Pin-Priority: 1000 + +Package: postgresql-12 postgresql-client-12 postgresql-server-dev-12 +Pin: version 12.9-* +Pin-Priority: 1000 + +Package: postgresql-13 postgresql-client-13 postgresql-server-dev-13 +Pin: version 13.5-* +Pin-Priority: 1000 + +Package: postgresql-14 postgresql-client-14 postgresql-server-dev-14 +Pin: version 14.1-* +Pin-Priority: 1000