File: lbdbq-detect-lbdbq.diff

package info (click to toggle)
vim-scripts 20210124.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,100 kB
  • sloc: perl: 420; xml: 95; makefile: 24
file content (19 lines) | stat: -rw-r--r-- 787 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## lbdbq-detect-lbdbq.diff by Stefano Zacchiroli <zack@debian.org>
##
## detect (the absence of) the lbdbq executable

Index: vim-scripts/lbdbq/plugin/lbdbq.vim
===================================================================
--- vim-scripts.orig/lbdbq/plugin/lbdbq.vim
+++ vim-scripts/lbdbq/plugin/lbdbq.vim
@@ -14,6 +14,10 @@
 " queries lbdb with a query string and return a list of pairs:
 " [['full name', 'email'], ['full name', 'email'], ...]
 function! LbdbQuery(qstring)
+  if !executable("lbdbq")
+    echoerr "Cannot find 'lbdbq' executable, please install it (usually, it comes with the 'lbdb' package)"
+    return []
+  endif
   let output = system("lbdbq '" . a:qstring . "'")
   let results = []
   for line in split(output, "\n")[1:] " skip first line (lbdbq summary)