diff --git a/scripts/lib/setup-apt-repo b/scripts/lib/setup-apt-repo index fcdc19e55c..6821055f74 100755 --- a/scripts/lib/setup-apt-repo +++ b/scripts/lib/setup-apt-repo @@ -52,6 +52,8 @@ if ! [ -d "$LIST_PATH" ]; then exit 1 fi +release="$(. /etc/os-release && printf '%s' "$VERSION_CODENAME")" + DEPENDENCIES_HASH=$(sha1sum "$LIST_PATH/"*.asc "$0") DEPENDENCIES_HASH_FILE="/var/lib/zulip/setup-repositories-state-$LIST" # Ensure that DEPENDENCIES_HASH_FILE exists before hashing it. @@ -78,7 +80,6 @@ if ! apt-get -dy install "${pre_setup_deps[@]}"; then fi apt-get -y install "${pre_setup_deps[@]}" -release=$(lsb_release -sc) if [ -f "$LIST_PATH/$release.list" ]; then apt-key add "$LIST_PATH/"*.asc cp "$LIST_PATH/$release.list" "$SOURCES_FILE" diff --git a/scripts/setup/apt-repos/zulip/custom.sh b/scripts/setup/apt-repos/zulip/custom.sh index c6dc9abd1b..b8508fb9bc 100755 --- a/scripts/setup/apt-repos/zulip/custom.sh +++ b/scripts/setup/apt-repos/zulip/custom.sh @@ -19,8 +19,11 @@ if [[ ! -e /usr/share/doc/groonga-apt-source/copyright ]]; then | cut --delimiter=: --fields=10 \ | head --lines=1 ) - release=$(lsb_release -sc) - distribution=$(lsb_release -si | tr '[:upper:]' '[:lower:]') + os_info="$(. /etc/os-release && printf '%s\n' "$ID" "$VERSION_CODENAME")" + { + read -r distribution + read -r release + } <<<"$os_info" groonga_apt_source_deb="groonga-apt-source-latest-$release.deb" groonga_apt_source_deb_sign="$groonga_apt_source_deb.asc.$pgroonga_apt_sign_key_fingerprint" curl -fLO "https://packages.groonga.org/$distribution/$groonga_apt_source_deb"