diff options
author | dteske <dteske@FreeBSD.org> | 2012-09-20 23:44:13 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2012-09-20 23:44:13 +0000 |
commit | f628c47944e7370c8d8c16cdcc6f98871a48be02 (patch) | |
tree | 6eb395555fa780676e51155e913c807210bdc403 /usr.sbin/bsdconfig/mouse | |
parent | 3a2b0e2811fa295dd198978ef2dcb53b37c2570d (diff) | |
download | FreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.zip FreeBSD-src-f628c47944e7370c8d8c16cdcc6f98871a48be02.tar.gz |
Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media.
Reviewed by: adrian (co-mentor)
Approved by: adrian (co-mentor)
Diffstat (limited to 'usr.sbin/bsdconfig/mouse')
-rwxr-xr-x | usr.sbin/bsdconfig/mouse/flags | 6 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/mouse/mouse | 9 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/mouse/port | 9 | ||||
-rwxr-xr-x | usr.sbin/bsdconfig/mouse/type | 9 |
4 files changed, 25 insertions, 8 deletions
diff --git a/usr.sbin/bsdconfig/mouse/flags b/usr.sbin/bsdconfig/mouse/flags index d763a6d..c989048 100755 --- a/usr.sbin/bsdconfig/mouse/flags +++ b/usr.sbin/bsdconfig/mouse/flags @@ -90,7 +90,7 @@ size=$( f_dialog_inputbox_size \ "$prompt" \ "$flags" \ "$hline" ) -eval $DIALOG \ +dialog_inputbox=$( eval $DIALOG \ --title \"\$title\" \ --backtitle \"\$btitle\" \ --hline \"\$hline\" \ @@ -98,8 +98,10 @@ eval $DIALOG \ --cancel-label \"\$msg_cancel\" \ --inputbox \"\$prompt\" $size \ \"\$flags\" \ - 2> "$DIALOG_TMPDIR/dialog.inputbox.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD +) retval=$? +setvar MENU_INPUTBOX_$$ "$dialog_inputbox" flags=$( f_dialog_inputstr ) [ $retval -eq $SUCCESS ] || f_die diff --git a/usr.sbin/bsdconfig/mouse/mouse b/usr.sbin/bsdconfig/mouse/mouse index 4c5d903..911ea95 100755 --- a/usr.sbin/bsdconfig/mouse/mouse +++ b/usr.sbin/bsdconfig/mouse/mouse @@ -67,7 +67,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -75,7 +76,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN diff --git a/usr.sbin/bsdconfig/mouse/port b/usr.sbin/bsdconfig/mouse/port index aed1917..4ab54a7 100755 --- a/usr.sbin/bsdconfig/mouse/port +++ b/usr.sbin/bsdconfig/mouse/port @@ -68,7 +68,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -76,7 +77,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN diff --git a/usr.sbin/bsdconfig/mouse/type b/usr.sbin/bsdconfig/mouse/type index 83a7122..f1e88fb 100755 --- a/usr.sbin/bsdconfig/mouse/type +++ b/usr.sbin/bsdconfig/mouse/type @@ -72,7 +72,8 @@ dialog_menu_main() \"\$hline\" \ $menu_list ) - eval $DIALOG \ + local dialog_menu + dialog_menu=$( eval $DIALOG \ --clear --title \"\$DIALOG_TITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \ --hline \"\$hline\" \ @@ -80,7 +81,11 @@ dialog_menu_main() --cancel-label \"\$msg_cancel\" \ --menu \"\$prompt\" $size \ $menu_list \ - 2> "$DIALOG_TMPDIR/dialog.menu.$$" + 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD + ) + local retval=$? + setvar DIALOG_MENU_$$ "$dialog_menu" + return $retval } ############################################################ MAIN |