aboutsummaryrefslogtreecommitdiff
Fix check for dmenu (open file mode, dependency on which).

See <https://github.com/proxypoke/quickswitch-for-i3/pull/24>.

--- quickswitch-i3-2.2/quickswitch.py	2016-09-18 19:59:10.257765542 +0200
+++ quickswitch-i3-2.2/quickswitch.py	2016-09-21 10:43:01.277577819 +0200
@@ -24,9 +24,10 @@
 
 import argparse
 import subprocess
-import os
 import re
 
+from distutils.spawn import find_executable
+
 try:
     import i3
 except ImportError:
@@ -37,11 +38,8 @@
 
 def check_dmenu():
     '''Check if dmenu is available.'''
-    devnull = open(os.devnull)
-    retcode = subprocess.call(["which", "dmenu"],
-                              stdout=devnull,
-                              stderr=devnull)
-    return True if retcode == 0 else False
+    executable = find_executable("dmenu")
+    return executable != None
 
 
 def dmenu(options, dmenu):
stall-data-hook): Remove dependency on 'set-bootstrap-executable-permissions'. * gnu/packages/bootstrap: Remove directory. * tests/search-paths.scm ("evaluate-search-paths, separator is #f"): Adjust to match .../aux-files/linux-libre. Ludovic Courtès 2017-04-04tests: Adjust search-paths test following the introduction of aarch64....Fixes a regression introduced in 3b88f3767d9f3ad2cc64173525cd53d429bfe7e7. * tests/search-paths.scm ("evaluate-search-paths, separator is #f"): Change the expected result to "aarch64-linux". Ludovic Courtès 2017-01-23search-paths: Allow specs with #f as their separator....This adds support for single-entry search paths. Fixes <http://bugs.gnu.org/25422>. Reported by Leo Famulari <leo@famulari.name>. * guix/search-paths.scm (<search-path-specification>)[separator]: Document as string or #f. (evaluate-search-paths): Add case for SEPARATOR as #f. (environment-variable-definition): Handle SEPARATOR being #f. * guix/build/utils.scm (list->search-path-as-string): Add case for SEPARATOR as #f. (search-path-as-string->list): Likewise. * guix/build/profiles.scm (abstract-profile): Likewise. * tests/search-paths.scm: New file. * Makefile.am (SCM_TESTS): Add it. * tests/packages.scm ("--search-paths with single-item search path"): New test. * gnu/packages/version-control.scm (git)[native-search-paths](separator): New field. Ludovic Courtès