Proposal for test ./manual_devices

This commit is contained in:
Thomas Schmitt 2011-07-13 19:05:06 +00:00
parent b5a93f2de7
commit a481f41d1c

View File

@ -19,8 +19,28 @@ else
exit 2
fi
# Interpret private options
dev=
next_is=
echo >&2
echo "args= ""$@" >&2
echo >&2
for i in "$@"
do
if test "$next_is" = "dev"
then
dev="$i"
next_is=""
elif test "$i" = "--outdev" -o "$i" = "--dev"
then
next_is="dev"
fi
done
# Insist in having a xorriso
if [ ! -x $RELENG_XORRISO ]; then
if [ ! -x "$RELENG_XORRISO" ]; then
print_help
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
exit 31
@ -28,8 +48,12 @@ fi
#
get_speeds() {
echo -e "\n${SELF}: Running: ${RELENG_XORRISO} -outdev ${1} -list_speeds"
${RELENG_XORRISO} -outdev ${1} -list_speeds
echo -e "\n${SELF}: Running: ${RELENG_XORRISO} -report_about WARNING -outdev ${1} -toc -list_formats -list_profiles out -list_speeds"
"$RELENG_XORRISO" -report_about WARNING -outdev "$1" \
-print '---toc :' -toc \
-print '---list_formats :' -list_formats \
-print '---list_profiles :' -list_profiles out \
-print '---list_speeds :' -list_speeds
}
cat_var() {
@ -40,7 +64,8 @@ $1
}
get_devices() {
# $1 =
# $1 = if not empty: device lines from xorriso -devices
# $2 = if not empty: suppress dialog and use $2 as input
if test -n "$1"
then
@ -67,14 +92,18 @@ get_devices() {
OUTDEV=$( cat_var "$DEVICES" | head -1 | \
sed -e "s/[0-9] *-dev '\//\//" -e "s/'.*$//" )
if test -n "$2"
then
x="$2"
else
echo >&2
echo "WARNING: The following tests might pull in the drive tray." >&2
echo " Best is if you now put in a suitable media and load it" >&2
echo " manually, so nobody gets surprised. :))" >&2
echo " Best is if you now put in a suitable media and" >&2
echo " load it manually, so nobody gets surprised. :))" >&2
echo >&2
echo "Which drive to examine ? (Empty input = ${OUTDEV})" >&2
read x
fi
if test -n "$x"
then
OUTDEV="$x"
@ -86,11 +115,11 @@ get_devices() {
# main
"$RELENG_XORRISO" -version
echo -e "\n${SELF}: Running: $RELENG_XORRISO -devices..."
devices=$("$RELENG_XORRISO" -devices 2>/dev/null | grep "\-dev")
devices=$("$RELENG_XORRISO" -report_about WARNING -devices | grep "\-dev")
RET="$?"
case ${RET} in
0)
get_devices "$devices"
get_devices "$devices" "$dev"
;;
*)
boldify