From 9f698e9f2de0ec7ec4f94523bd4194c2b057bc00 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 22 May 2017 14:32:00 +0200 Subject: [PATCH] bin/doctor: better tar detection on MacOS --- bin/doctor | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/bin/doctor b/bin/doctor index fb718c24c..d179479b1 100755 --- a/bin/doctor +++ b/bin/doctor @@ -141,19 +141,23 @@ (explain! "DOOM was designed for MacOS and Linux. Expect a bumpy ride!")) ;; bsd vs gnu tar -(if (executable-find "tar") - (check! (not (string-match-p "(GNU tar)" (shell-command-to-string "tar --version"))) - (warn! "Warning: BSD tar detected") +(let ((tar-bin (or (executable-find "gtar") + (executable-find "tar")))) + (if tar-bin + (check! (not (string-match-p "(GNU tar)" (shell-command-to-string (format "%s --version" tar-bin)))) + (warn! "Warning: BSD tar detected") + (explain! + "QUELPA (through package-build) uses the system tar to build plugins, but it " + "expects GNU tar. BSD tar *could* cause errors during package installation or " + "updating from non-ELPA sources." + (when (eq system-type 'darwin) + (concat "\nMacOS users can install gnu-tar via homebrew:\n" + " brew install gnu-tar")))) + (check! t ; very unlikely + (error! "Important: Couldn't find tar") (explain! - "QUELPA (through package-build) uses the system tar to build plugins." - "BSD tar *could* cause errors during package installation or updating from" - "non-ELPA sources." - (when (eq system-type 'darwin) - (concat "\nMacOS users can install gnu-tar via homebrew:\n" - " brew install gnu-tar")))) - (check! t ; very unlikely - (error! "Important: Couldn't find tar") - (explain! "This is required by package.el and QUELPA to build packages."))) + "This is required by package.el and QUELPA to build packages and will " + "prevent you from installing & updating packages.")))) ;; --- report! ------------------------------------------------