Commit 56faccad authored by Kirill Smelkov's avatar Kirill Smelkov

X neotest/info-local: Don't crash if a prog could not be found

Similary to f2932247 (X neotest/info-local: Don't crash if an egg could
not be found)

before:

    # Fri, 03 Nov 2017 10:47:37 +0300
    # kirr@deco.navytux.spb.ru (2401:5180:0:37::1 192.168.0.2)
    # Linux deco 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux
    # cpu: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
    # cpu[0-3]: freq: intel_pstate/powersave [.40GHz - 3.40GHz]
    # cpu[0-3]: idle: intel_idle/menu: POLL(0μs) C1(2μs) C1E(10μs) C3(70μs) C6(85μs) C7s(124μs) C8(200μs) C9(480μs) C10(890μs)
    # cpu: WARNING: frequency not fixed - benchmark timings won't be stable
    # cpu: WARNING: C-state exit-latency is max 890μs - up to that can add to networked and IPC request-reply latency
    # sda: SanDisk X400 M.2  rev 0012  477G
    # wlan0: Intel Corporation Wireless 8260 rev 3a
    # wlan0: features: !rx !tx sg !tso !ufo gso gro !lro !rxvlan !txvlan !ntuple !rxhash ...
    # wlan0: coalesce: rxc: ?,  txc: ?
    # wlan0: down, speed=?, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # wlan0: WARNING: TSO not enabled - TCP latency with packets > MSS will be poor
    # eth0: Intel Corporation Ethernet Connection I219-LM rev 21
    # eth0: features: rx tx sg tso !ufo gso gro !lro rxvlan txvlan !ntuple rxhash ...
    # eth0: coalesce: rxc: 3μs/0f/0μs-irq/0f-irq,  txc: 0μs/0f/0μs-irq/0f-irq
    # eth0: up, speed=1000, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # Python 2.7.14
    # go version go1.9.2 linux/amd64
    # sqlite 3.20.1 (py mod 2.6.0)
    # ./neotest: строка 733: mysqld: команда не найдена

after:

    # Fri, 03 Nov 2017 10:44:12 +0300
    # kirr@deco.navytux.spb.ru (2401:5180:0:37::1 192.168.0.2)
    # Linux deco 4.13.0-1-amd64 #1 SMP Debian 4.13.4-2 (2017-10-15) x86_64 GNU/Linux
    # cpu: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
    # cpu[0-3]: freq: intel_pstate/powersave [.40GHz - 3.40GHz]
    # cpu[0-3]: idle: intel_idle/menu: POLL(0μs) C1(2μs) C1E(10μs) C3(70μs) C6(85μs) C7s(124μs) C8(200μs) C9(480μs) C10(890μs)
    # cpu: WARNING: frequency not fixed - benchmark timings won't be stable
    # cpu: WARNING: C-state exit-latency is max 890μs - up to that can add to networked and IPC request-reply latency
    # sda: SanDisk X400 M.2  rev 0012  477G
    # wlan0: Intel Corporation Wireless 8260 rev 3a
    # wlan0: features: !rx !tx sg !tso !ufo gso gro !lro !rxvlan !txvlan !ntuple !rxhash ...
    # wlan0: coalesce: rxc: ?,  txc: ?
    # wlan0: down, speed=?, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # wlan0: WARNING: TSO not enabled - TCP latency with packets > MSS will be poor
    # eth0: Intel Corporation Ethernet Connection I219-LM rev 21
    # eth0: features: rx tx sg tso !ufo gso gro !lro rxvlan txvlan !ntuple rxhash ...
    # eth0: coalesce: rxc: 3μs/0f/0μs-irq/0f-irq,  txc: 0μs/0f/0μs-irq/0f-irq
    # eth0: up, speed=1000, mtu=1500, txqlen=1000, gro_flush_timeout=0.000µs
    # Python 2.7.14
    # go version go1.9.2 linux/amd64
    # sqlite 3.20.1 (py mod 2.6.0)
    # mysqld          : ø
    # neo             : ø
    # zodb            : ø
    # zeo             : ø
    # mysqlclient     : ø
    # wendelin.core   : ø
parent 2c03f1f6
...@@ -457,6 +457,13 @@ else: ...@@ -457,6 +457,13 @@ else:
printf "# %-16s: %s\n" "$showas" "$ver" printf "# %-16s: %s\n" "$showas" "$ver"
} }
# proginfo <prog> ... - run `prog ...` or print that prog is missing
proginfo() {
prog=$1
shift
which $prog >/dev/null 2>&1 && $prog "$@" || printf "%-16s: ø\n" "$prog"
}
# fkghz file - extract value from file (in KHz) and render it as GHz # fkghz file - extract value from file (in KHz) and render it as GHz
fkghz() { fkghz() {
v=$(echo "scale=2; `cat $1` / 1000000" |bc -l) v=$(echo "scale=2; `cat $1` / 1000000" |bc -l)
...@@ -720,10 +727,10 @@ system_info() { ...@@ -720,10 +727,10 @@ system_info() {
done done
echo -n "# "; python --version echo -n "# "; proginfo python --version
echo -n "# "; go version echo -n "# "; proginfo go version
echo -n "# "; python -c 'import sqlite3 as s; print "sqlite %s (py mod %s)" % (s.sqlite_version, s.version)' echo -n "# "; proginfo python -c 'import sqlite3 as s; print "sqlite %s (py mod %s)" % (s.sqlite_version, s.version)'
echo -n "# "; mysqld --version echo -n "# "; proginfo mysqld --version
pyver neoppod neo pyver neoppod neo
pyver zodb pyver zodb
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment