diff --git a/puppet/zulip/manifests/postgresql_base.pp b/puppet/zulip/manifests/postgresql_base.pp index d167f2b057..bf24fc2726 100644 --- a/puppet/zulip/manifests/postgresql_base.pp +++ b/puppet/zulip/manifests/postgresql_base.pp @@ -75,7 +75,14 @@ class zulip::postgresql_base { $pgroonga = zulipconf('machine', 'pgroonga', '') if $pgroonga == 'enabled' { # Needed for optional our full text search system + + # Removed 2020-12 in version 4.0; these lines can be removed when + # we drop support for upgrading from Zulip 3 or older. package{"${postgresql}-pgroonga": + ensure => 'purged', + } + + package{"${postgresql}-pgdg-pgroonga": ensure => 'installed', require => [Package[$postgresql], Exec[$setup_system_deps]], @@ -83,7 +90,7 @@ class zulip::postgresql_base { file { $pgroonga_setup_sql_path: ensure => file, - require => Package["${postgresql}-pgroonga"], + require => Package["${postgresql}-pgdg-pgroonga"], owner => 'postgres', group => 'postgres', mode => '0640', diff --git a/scripts/lib/setup-apt-repo b/scripts/lib/setup-apt-repo index af6423fdbf..ee99e8c276 100755 --- a/scripts/lib/setup-apt-repo +++ b/scripts/lib/setup-apt-repo @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -x set -e +set -u +set -o pipefail # Ensure the directory for LAST_DEPENDENCIES_HASH exists mkdir -p /var/lib/zulip @@ -27,16 +29,17 @@ touch "$SOURCES_FILE" # Hash it to check if the sources file is changed by the script later. zulip_source_hash=$(sha1sum "$SOURCES_FILE") -pre_setup_deps=(lsb-release apt-transport-https ca-certificates gnupg) +pre_setup_deps=(lsb-release apt-transport-https ca-certificates gnupg wget) if ! apt-get -dy install "${pre_setup_deps[@]}"; then apt-get update fi apt-get -y install "${pre_setup_deps[@]}" -SCRIPTS_PATH="$(dirname "$(dirname "$0")")" +SCRIPTS_PATH="$(cd "$(dirname "$(dirname "$0")")" && pwd)" release=$(lsb_release -sc) if [[ "$release" =~ ^(bionic|cosmic|disco|eoan|focal)$ ]]; then + distribution=ubuntu apt-key add "$SCRIPTS_PATH"/setup/pgdg.asc apt-key add "$SCRIPTS_PATH"/setup/pgroonga-ppa.asc cat >$SOURCES_FILE <$SOURCES_FILE <