From 69a920a5f52adeb2b16dcbf3ca92d174531b02e0 Mon Sep 17 00:00:00 2001 From: Toby Fleming Date: Mon, 20 Jul 2015 21:07:43 +0100 Subject: [PATCH] Homebrew: Allow colons, direct check for outdated formula --- packaging/os/homebrew.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packaging/os/homebrew.py b/packaging/os/homebrew.py index 91888ba6bca..6d295375ede 100644 --- a/packaging/os/homebrew.py +++ b/packaging/os/homebrew.py @@ -119,6 +119,7 @@ class Homebrew(object): / # slash (for taps) \+ # plusses - # dashes + : # colons (for URLs) ''' INVALID_PATH_REGEX = _create_regex_group(VALID_PATH_CHARS) @@ -394,18 +395,17 @@ class Homebrew(object): return False - def _outdated_packages(self): - rc, out, err = self.module.run_command([ - self.brew_path, - 'outdated', - ]) - return [line.split(' ')[0].strip() for line in out.split('\n') if line] - def _current_package_is_outdated(self): if not self.valid_package(self.current_package): return False - return self.current_package in self._outdated_packages() + rc, out, err = self.module.run_command([ + self.brew_path, + 'outdated', + self.current_package, + ]) + + return rc != 0 def _current_package_is_installed_from_head(self): if not Homebrew.valid_package(self.current_package):