dunsmoreb/rvmsh — Issue #9: Resolution for issue #2 is probably not correct
Author: petervandenabeele
Created: 2011-12-31 15:40:37+00:00
State: open

Hi,

With reference to the resolution of

https://github.com/dunsmoreb/rvmsh/issues/2

with patch

https://github.com/dunsmoreb/rvmsh/commit/19a861ede7fa49b4952ca2d854c6156919c505a9

```bash
- which $app &> /dev/null
+ dpkg -l $app &> /dev/null

- if [ "$?" = "1" ]; then
+ if [ "$?" != "0" ]; then
sudo $installer install $app
fi
```

I am afraid this code will not work correctly.

E.g. the package openssl-doc is NOT installed here and still I get a
success (0) reaction from dpkg -l.

```bash
peterv@ASUS:~$ dpkg -l 'openssl*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii openssl 0.9.8k-7ubuntu Secure Socket Layer (SSL) binary and related
un openssl-doc (no description available)
peterv@ASUS:~$ echo $?
0
peterv@ASUS:~$ dpkg -l 'opensslsss*'
No packages found matching opensslsss*.
peterv@ASUS:~$ echo $?
1
peterv@ASUS:~$ dpkg -l 'openssl-doc*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
un openssl-doc (no description available)
peterv@ASUS:~$ echo $?
0
peterv@ASUS:~$
```

I always use `grep ^ii` for this use case.