From 2ca97490afd02e104ee989baaab779199b36651b Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Wed, 6 Apr 2016 01:45:02 +0200 Subject: brew.sh: fix HOMEBREW_OS_VERSION on Linux et al. On Linux (and other non-OS X platforms), `HOMEBREW_OS_VERSION` was *always* replaced with the product name, leading to less useful user agent. E.g., on a reasonably up-to-date Debian system: Linuxbrew/0.9.9 (Linux; unknown Linuxbrew) With this fix the user agent is instead (first if `lsb_release` is available and outputs something, second otherwise): Linuxbrew/0.9.9 (Linux; unknown Debian GNU/Linux 8.3 (jessie)) Linuxbrew/0.9.9 (Linux; unknown 3.16.0-4-amd64) --- Library/brew.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/brew.sh b/Library/brew.sh index d10c09958..1886c1cc1 100644 --- a/Library/brew.sh +++ b/Library/brew.sh @@ -93,7 +93,7 @@ then else HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew" [[ -n "$HOMEBREW_LINUX" ]] && HOMEBREW_OS_VERSION="$(lsb_release -sd 2>/dev/null)" - HOMEBREW_OS_VERSION="${HOMEBREW_PRODUCT:=$(uname -r)}" + : "${HOMEBREW_OS_VERSION:=$(uname -r)}" fi HOMEBREW_USER_AGENT="$HOMEBREW_PRODUCT/$HOMEBREW_VERSION ($HOMEBREW_SYSTEM; $HOMEBREW_PROCESSOR $HOMEBREW_OS_VERSION)" HOMEBREW_CURL_VERSION="$("$HOMEBREW_CURL" --version 2>/dev/null | head -n1 | awk '{print $1"/"$2}')" -- cgit v1.2.3