diff options
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -26,15 +26,17 @@ def get_executable_hint(prog, hint, optional=False): | |||
26 | '''Search for @prog in system PATH. Print @hint if no binary is found. | 26 | '''Search for @prog in system PATH. Print @hint if no binary is found. |
27 | Die if not @optional.''' | 27 | Die if not @optional.''' |
28 | try: | 28 | try: |
29 | prog = get_executable(prog) | 29 | full_path = get_executable(prog) |
30 | except IOError: | 30 | except IOError: |
31 | if not optional: | 31 | if not optional: |
32 | sys.stderr.write(("Cannot find executable '%s' in PATH. This is " +\ | 32 | sys.stderr.write(("Cannot find executable '%s' in PATH. This is " +\ |
33 | "a part of '%s' which should be added to PATH.\n")\ | 33 | "a part of '%s' which should be added to PATH.\n")\ |
34 | % (prog, hint)) | 34 | % (prog, hint)) |
35 | sys.exit(1) | 35 | sys.exit(1) |
36 | else: | ||
37 | full_path = None | ||
36 | 38 | ||
37 | return prog | 39 | return full_path |
38 | 40 | ||
39 | def get_config_option(option): | 41 | def get_config_option(option): |
40 | '''Search for @option in installed kernel config (if present). | 42 | '''Search for @option in installed kernel config (if present). |