From 982c7591f2c7dcf3d9d08fb1f1feff87a1e19c09 Mon Sep 17 00:00:00 2001 From: Jaromil Date: Sun, 16 Nov 2014 11:34:35 +0100 Subject: [PATCH] avoid gettext being a requirement and list optional tools found in version output --- tomb | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/tomb b/tomb index 85025d8..764279f 100755 --- a/tomb +++ b/tomb @@ -612,7 +612,7 @@ option_value() { # Messaging function with pretty coloring function _msg() { local msg="$2" - hash gettext && msg="$(gettext -s "$2")" + hash gettext 2>/dev/null && msg="$(gettext -s "$2")" for i in $(seq 3 ${#}); do msg=${(S)msg//::$(($i - 2))*::/$*[$i]} @@ -712,19 +712,24 @@ progress() { } +_list_optional_tools() { + typeset -a _deps + _deps=(gettext dcfldd wipe mkfs.ext4 steghide e2fsck) + _deps+=(resize2fs tomb-kdb-pbkdf2 qrencode swish-e unoconv) + for d in $_deps; do + _print "`which $d`" + done + return 0 +} + + # Check program dependencies # # Tomb depends on system utilities that must be present, and other # functionality that can be provided by various programs according to # what's available on the system. If some required commands are # missing, bail out. -_ensure_dependencies check_bin() { - - # The messages system requires gettext - command -v gettext >& - || { - print "Missing required dependency: gettext. Please install it." - exit 1 - } +_ensure_dependencies() { # Check for required programs for req in cryptsetup pinentry sudo gpg; do @@ -2661,13 +2666,17 @@ _print "\000" _print "System utils:" _print "\000" cat <