setup-apt-repo: Use /etc/os-release instead of lsb_release.

But still install lsb-release for now since Puppet acts funny without
it.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-02-12 13:55:07 -08:00 committed by Tim Abbott
parent d1241be496
commit c8bb98554e
2 changed files with 7 additions and 3 deletions

View File

@ -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"

View File

@ -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"