New function check_for_xorriso in releng_getopts.inc

This commit is contained in:
Thomas Schmitt 2011-07-15 11:30:30 +00:00
parent c394fe3ea2
commit 73cfce131d
2 changed files with 32 additions and 5 deletions

View File

@ -83,6 +83,37 @@ cleanup() {
fi
}
check_for_xorriso() {
# $1: if "-x" then check executability
if test -z "$RELENG_XORRISO" -o "$RELENG_XORRISO" = "0"
then
print_help
print_specific_help
echo "${SELF}: Need -x absolute or relative path to binary to be run."
echo
exit 31
fi
if [ x"$1" = x"-x" -a ! -x "$RELENG_XORRISO" ]
then
print_help
print_specific_help
echo "${SELF}: Path given by option -x does not lead to an executable file."
echo "Given is: '$RELENG_XORRISO'"
if test "$RELENG_XORRISO" = "xorriso"
then
xorriso=$(type -p xorriso)
if test -n "xorriso"
then
echo "Hint: Try '$xorriso'"
fi
fi
echo
exit 31
fi
}
#############################################
next_is=

View File

@ -62,11 +62,7 @@ do
done
# Insist in having a xorriso
if [ ! -x "$RELENG_XORRISO" ]; then
print_help
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
exit 31
fi
check_for_xorriso -x
#
get_speeds() {