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 exit 1
fi fi
release="$(. /etc/os-release && printf '%s' "$VERSION_CODENAME")"
DEPENDENCIES_HASH=$(sha1sum "$LIST_PATH/"*.asc "$0") DEPENDENCIES_HASH=$(sha1sum "$LIST_PATH/"*.asc "$0")
DEPENDENCIES_HASH_FILE="/var/lib/zulip/setup-repositories-state-$LIST" DEPENDENCIES_HASH_FILE="/var/lib/zulip/setup-repositories-state-$LIST"
# Ensure that DEPENDENCIES_HASH_FILE exists before hashing it. # Ensure that DEPENDENCIES_HASH_FILE exists before hashing it.
@ -78,7 +80,6 @@ if ! apt-get -dy install "${pre_setup_deps[@]}"; then
fi fi
apt-get -y install "${pre_setup_deps[@]}" apt-get -y install "${pre_setup_deps[@]}"
release=$(lsb_release -sc)
if [ -f "$LIST_PATH/$release.list" ]; then if [ -f "$LIST_PATH/$release.list" ]; then
apt-key add "$LIST_PATH/"*.asc apt-key add "$LIST_PATH/"*.asc
cp "$LIST_PATH/$release.list" "$SOURCES_FILE" 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 \ | cut --delimiter=: --fields=10 \
| head --lines=1 | head --lines=1
) )
release=$(lsb_release -sc) os_info="$(. /etc/os-release && printf '%s\n' "$ID" "$VERSION_CODENAME")"
distribution=$(lsb_release -si | tr '[:upper:]' '[:lower:]') {
read -r distribution
read -r release
} <<<"$os_info"
groonga_apt_source_deb="groonga-apt-source-latest-$release.deb" 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" 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" curl -fLO "https://packages.groonga.org/$distribution/$groonga_apt_source_deb"