aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2017-11-24 21:26:11 +0000
committerGitHub2017-11-24 21:26:11 +0000
commit86305f7d817ac229d3a44f3b29f7f44cd4ec9cf7 (patch)
treedb28f89d8349e83c25421eff0fab5e96922171e5 /Library
parent6c23892d4115be2667e65f05367bc99bdba009e3 (diff)
parent5920c0b2aef955f4aa0538461a79c480364c8835 (diff)
downloadbrew-86305f7d817ac229d3a44f3b29f7f44cd4ec9cf7.tar.bz2
Merge pull request #3470 from sjackman/analytics
setup-analytics: Handle missing /proc/.../uuid
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils/analytics.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/utils/analytics.sh b/Library/Homebrew/utils/analytics.sh
index 00527fd9f..2ee43f5e8 100644
--- a/Library/Homebrew/utils/analytics.sh
+++ b/Library/Homebrew/utils/analytics.sh
@@ -35,12 +35,12 @@ setup-analytics() {
HOMEBREW_ANALYTICS_USER_UUID="$(git config --file="$git_config_file" --get homebrew.analyticsuuid 2>/dev/null)"
if [[ -z "$HOMEBREW_ANALYTICS_USER_UUID" ]]
then
- if [[ -n "$HOMEBREW_LINUX" ]]
- then
- HOMEBREW_ANALYTICS_USER_UUID="$(tr a-f A-F </proc/sys/kernel/random/uuid)"
- elif [[ -n "$HOMEBREW_MACOS" ]]
+ if [[ -x /usr/bin/uuidgen ]]
then
HOMEBREW_ANALYTICS_USER_UUID="$(/usr/bin/uuidgen)"
+ elif [[ -r /proc/sys/kernel/random/uuid ]]
+ then
+ HOMEBREW_ANALYTICS_USER_UUID="$(tr a-f A-F </proc/sys/kernel/random/uuid)"
else
HOMEBREW_ANALYTICS_USER_UUID="$(uuidgen)"
fi