mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
Merge pull request #382 from Exy13/existing_commands
Fix unfailing CheckExternalCommands
This commit is contained in:
commit
58c682818c
1 changed files with 7 additions and 5 deletions
|
@ -9,14 +9,16 @@ class CheckExternalCommands(Task):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, info):
|
def run(cls, info):
|
||||||
from ..tools import log_check_call
|
|
||||||
from subprocess import CalledProcessError
|
|
||||||
import re
|
import re
|
||||||
|
import os
|
||||||
|
import logging
|
||||||
|
from distutils.spawn import find_executable
|
||||||
missing_packages = []
|
missing_packages = []
|
||||||
|
log = logging.getLogger(__name__)
|
||||||
for command, package in info.host_dependencies.items():
|
for command, package in info.host_dependencies.items():
|
||||||
try:
|
log.debug('Checking availability of ' + command)
|
||||||
log_check_call(['type', command], shell=True)
|
path = find_executable(command)
|
||||||
except CalledProcessError:
|
if path is None or not os.access(path, os.X_OK):
|
||||||
if re.match('^https?:\/\/', package):
|
if re.match('^https?:\/\/', package):
|
||||||
msg = ('The command `{command}\' is not available, '
|
msg = ('The command `{command}\' is not available, '
|
||||||
'you can download the software at `{package}\'.'
|
'you can download the software at `{package}\'.'
|
||||||
|
|
Loading…
Add table
Reference in a new issue