added also explicit stdout redirection to command -v

This commit is contained in:
Jaromil 2014-11-16 13:11:42 +01:00
parent 9f39d671a0
commit a0db66b18e

26
tomb
View File

@ -612,7 +612,7 @@ option_value() {
# Messaging function with pretty coloring # Messaging function with pretty coloring
function _msg() { function _msg() {
local msg="$2" local msg="$2"
command -v gettext 2>/dev/null && msg="$(gettext -s "$2")" command -v gettext 1>/dev/null 2>/dev/null && msg="$(gettext -s "$2")"
for i in $(seq 3 ${#}); for i in $(seq 3 ${#});
do do
msg=${(S)msg//::$(($i - 2))*::/$*[$i]} msg=${(S)msg//::$(($i - 2))*::/$*[$i]}
@ -733,7 +733,7 @@ _ensure_dependencies() {
# Check for required programs # Check for required programs
for req in cryptsetup pinentry sudo gpg; do for req in cryptsetup pinentry sudo gpg; do
command -v $req 2>/dev/null || { command -v $req 1>/dev/null 2>/dev/null || {
_failure "Missing required dependency ::1 command::. Please install it." $req } _failure "Missing required dependency ::1 command::. Please install it." $req }
done done
@ -741,24 +741,24 @@ _ensure_dependencies() {
path+=(/sbin /usr/sbin) # zsh magic path+=(/sbin /usr/sbin) # zsh magic
# Which dd command to use # Which dd command to use
command -v dcfldd 2>/dev/null && DD=(dcfldd statusinterval=1) command -v dcfldd 1>/dev/null 2>/dev/null && DD=(dcfldd statusinterval=1)
# Which wipe command to use # Which wipe command to use
command -v wipe 2>/dev/null && WIPE=(wipe -f -s) command -v wipe 1>/dev/null 2>/dev/null && WIPE=(wipe -f -s)
# Check for filesystem creation programs # Check for filesystem creation programs
command -v mkfs.ext4 2>/dev/null && MKFS=(mkfs.ext4 -q -F -j -L) command -v mkfs.ext4 1>/dev/null 2>/dev/null && MKFS=(mkfs.ext4 -q -F -j -L)
# Check for steghide # Check for steghide
command -v steghide 2>/dev/null || STEGHIDE=0 command -v steghide 1>/dev/null 2>/dev/null || STEGHIDE=0
# Check for resize # Check for resize
command -v e2fsck resize2fs 2>/dev/null || RESIZER=0 command -v e2fsck resize2fs 1>/dev/null 2>/dev/null || RESIZER=0
# Check for KDF auxiliary tools # Check for KDF auxiliary tools
command -v tomb-kdb-pbkdf2 2>/dev/null || KDF=0 command -v tomb-kdb-pbkdf2 1>/dev/null 2>/dev/null || KDF=0
# Check for Swish-E file content indexer # Check for Swish-E file content indexer
command -v swish-e 2>/dev/null || SWISH=0 command -v swish-e 1>/dev/null 2>/dev/null || SWISH=0
# Check for QREncode for paper backups of keys # Check for QREncode for paper backups of keys
command -v qrencode 2>/dev/null || QRENCODE=0 command -v qrencode 1>/dev/null 2>/dev/null || QRENCODE=0
} }
# }}} - Commandline interaction # }}} - Commandline interaction
@ -2011,7 +2011,7 @@ BEGIN { main="" }
# index files in all tombs for search # index files in all tombs for search
# $1 is optional, to specify a tomb # $1 is optional, to specify a tomb
index_tombs() { index_tombs() {
{ command -v updatedb 2>/dev/null } || { { command -v updatedb 1>/dev/null 2>/dev/null } || {
_failure "Cannot index tombs on this system: updatedb (mlocate) not installed." } _failure "Cannot index tombs on this system: updatedb (mlocate) not installed." }
updatedbver=`updatedb --version | grep '^updatedb'` updatedbver=`updatedb --version | grep '^updatedb'`
@ -2033,7 +2033,7 @@ index_tombs() {
_success "Creating and updating search indexes." _success "Creating and updating search indexes."
# start the LibreOffice document converter if installed # start the LibreOffice document converter if installed
{ command -v unoconv 2>/dev/null } && { { command -v unoconv 1>/dev/null 2>/dev/null } && {
unoconv -l 2>/dev/null & unoconv -l 2>/dev/null &
_verbose "unoconv listener launched." _verbose "unoconv listener launched."
sleep 1 } sleep 1 }
@ -2131,7 +2131,7 @@ EOF
done done
} }
search_tombs() { search_tombs() {
{ command -v locate 2>/dev/null } || { { command -v locate 1>/dev/null 2>/dev/null } || {
_failure "Cannot index tombs on this system: updatedb (mlocate) not installed." } _failure "Cannot index tombs on this system: updatedb (mlocate) not installed." }
updatedbver=`updatedb --version | grep '^updatedb'` updatedbver=`updatedb --version | grep '^updatedb'`