X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=changer-src%2Fchg-lib.sh.in;h=a53c48a8cfff139732818a8be0e8b8d2ccbe148c;hb=d923a3f5bd691defcb8a7013e8ba6521ea2ecca0;hp=9c6632030fe2429d3a708406efc8774d63b7eeac;hpb=79cdc4b6ea8848b21ba4a0e7d2fd3bc401e0bebe;p=debian%2Famanda diff --git a/changer-src/chg-lib.sh.in b/changer-src/chg-lib.sh.in index 9c66320..a53c48a 100644 --- a/changer-src/chg-lib.sh.in +++ b/changer-src/chg-lib.sh.in @@ -28,21 +28,12 @@ amlibexecdir="@amlibexecdir@" # Eponymous functions to access various amanda apps # TODO: move to amanda-sh-lib.sh -if test "@USE_VERSION_SUFFIXES@" = "yes"; then - amgetconf() { - "${sbindir}/amgetconf-@VERSION@" "${@}" - } - amdevcheck() { - "${sbindir}/amdevcheck-@VERSION@" "${@}" - } -else - amgetconf() { - "${sbindir}/amgetconf" "${@}" - } - amdevcheck() { - "${sbindir}/amdevcheck" "${@}" - } -fi +amgetconf() { + "${sbindir}/amgetconf" "${@}" +} +amdevcheck() { + "${sbindir}/amdevcheck" "${@}" +} # This function tries to find a useable mt binary. If a fully-qualified path # was provided at configure time or via a config file, we check that it @@ -102,15 +93,13 @@ tape_device_filename() { # amdevcheck, suitable for use in higher-level error messages amdevcheck_status() { amdevcheck_message= - local amdevcheck_config_dir=`pwd` - local amdevcheck_config_name=`basename $amdevcheck_config_dir` - local amdevcheck_output=`amdevcheck $amdevcheck_config_name $@` + local amdevcheck_output=`amdevcheck . $@` local amdevcheck_status=$? test "$amdevcheck_status" -ne 0 && return 0 # extract any messages - amdevcheck_message=`echo "$amdevcheck_output" | sed '/^MESSAGE /{s/^MESSAGE //;p;}; d'` + amdevcheck_message=`echo "$amdevcheck_output" | sed -n -e '/^MESSAGE /{' -e 's/^MESSAGE //' -e 'p' -e 'q' -e '}'` # Return 1 if it's possible that the device is offline or busy; if the device cannot # distinguish this state from an error condition, then our caller will just have to