Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

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

Anders Kaseorgc8bb98554e13
diff --git a/scripts/lib/setup-apt-repo b/scripts/lib/setup-apt-repo
index fcdc19e55cf..6821055f74f 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 c6dc9abd1b6..b8508fb9bc7 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"