aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorEitan Adler <eadler@FreeBSD.org>2013-07-07 16:06:28 +0000
committerEitan Adler <eadler@FreeBSD.org>2013-07-07 16:06:28 +0000
commit5cebd68fe0d47699671f0fe33f002fde4379b2e9 (patch)
tree73332e5796804e23fc3a8a5ab66585018521df36 /Tools
parent3dc69257c2a295b7a1f166a677b043edd9929009 (diff)
downloadports-5cebd68fe0d47699671f0fe33f002fde4379b2e9.tar.gz
ports-5cebd68fe0d47699671f0fe33f002fde4379b2e9.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/dialogwrapper.sh77
-rw-r--r--Tools/scripts/dialogwrapper.txt69
2 files changed, 0 insertions, 146 deletions
diff --git a/Tools/scripts/dialogwrapper.sh b/Tools/scripts/dialogwrapper.sh
deleted file mode 100755
index 2e8b4bbb363d..000000000000
--- a/Tools/scripts/dialogwrapper.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-# $FreeBSD$
-
-# dialog wrapper script
-
-AWK="/usr/bin/awk"
-DIALOG="/usr/bin/dialog"
-ECHO="/bin/echo"
-SED="/usr/bin/sed"
-STTY="/bin/stty"
-
-# get terminal size
-size=$( ${STTY} size )
-visheight="${size%%[$IFS]*}"
-visheight=$(($visheight-3))
-listheight=$(($visheight-6))
-viswidth="${size#*[$IFS]}"
-viswidth=$(($viswidth-10))
-descwidth=$(($viswidth-22))
-
-# test for a minimum version of dialog(1)
-DIALOG_VER="0"
-DIALOG_MIN="1.1-20100428"
-dialogout=$( ${DIALOG} --print-version 2>&1 )
-if [ $? -eq 0 ]; then
- DIALOG_VER=$( ${ECHO} "$dialogout" | ${SED} -e 's/^[^0-9]*//' )
- # only newer versions of dialog have --item-help
- HAS_ITEM_HELP="1"
-fi
-
-# escape the menu title
-TITLE=$( ${AWK} -v title="$2" \
- 'BEGIN { gsub(/'\''/, "'\''\\'\'\''", title); print title }' )
-
-cmdstr=""
-[ "${HAS_ITEM_HELP}" ] && cmdstr="--item-help"
-cmdstr="$cmdstr $1 '$2' $visheight $viswidth $listheight"
-shift 5
-
-menulist=$(
- varlist=
- _maxvarlen=0
- while [ $# -gt 0 ]; do
- var="$1"
- [ ${#var} -gt $_maxvarlen ] && export _maxvarlen=${#var}
- varlist="$varlist${varlist:+
-}$var"
- # build hashed environment variables
- export _${var}_desc="$2"
- export _${var}_val="$3"
- shift 3
- done
- ${ECHO} "$varlist" \
- | ${AWK} -v hasitemhelp="${HAS_ITEM_HELP}" -v viswid="$viswidth" '
- {
- var = $1
- desc = ENVIRON["_" var "_desc"]
- val = ENVIRON["_" var "_val"]
- descwid = viswid -(ENVIRON["_maxvarlen"] + 12)
- extdesc = ""
- if ( length(desc) > descwid ) {
- extdesc = substr(desc, descwid)
- gsub(/'\''/, "'\''\\'\'\''", extdesc)
- desc = substr(desc, 1, descwid - 1) "+"
- }
- gsub(/'\''/, "'\''\\'\'\''", desc)
- printf "'\''%s'\'' '\''%s'\'' '\''%s'\''", var, desc, val
- if ( hasitemhelp ) printf " '\''%s'\''", extdesc
- printf "\n"
- } '
-)
-
-eval ${DIALOG} $cmdstr $menulist
-status="$?"
-echo
-exit $status
diff --git a/Tools/scripts/dialogwrapper.txt b/Tools/scripts/dialogwrapper.txt
deleted file mode 100644
index 99d8b8d0ac18..000000000000
--- a/Tools/scripts/dialogwrapper.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-$FreeBSD$
-
-Updated August 6, 2012
-
-Bug fix for use on FreeBSD 8.x supplied by Devin Teske. Thanks!
-
-
-What is this?
-
-This is a sh/awk wrapper script to give the ports options setting screen
-more features:
-
- Extended descriptions for FreeBSD 8.3+ and 9.0+. Port maintainers can
- make descriptions longer and more explanatory.
-
- Auto-sizing of the option screen to fit the terminal window. Wider or
- taller windows can display more of the descriptions, or more options.
- Windows smaller than 80x24 also work.
-
- Older versions of dialog(1) had a bug in displaying descriptions that
- are longer than the available space. When an old version of dialog is
- detected, descriptions are cut to the available space. These earlier
- versions of dialog did not support the --item-help feature used to
- show extended descriptions, so only the trimmed description will be
- shown. Descriptions that have been trimmed will still end in a "+" to
- indicate that part of it has been trimmed.
-
-
-
-Installation
-
-Edit /etc/make.conf:
-
- DIALOG="/usr/ports/Tools/scripts/dialogwrapper.sh"
-
-
-Testing long descriptions
-
-Open a terminal window and resize it, making it narrower than the
-default 80 columns. Try 60 or 70 columns.
-
-su to root and run 'make config' for a port that uses long descriptions.
-For example:
-
- # cd /usr/ports/audio/xmms2
- # make config
-
-Descriptions that are too long to fit in the window are shown ending in
-a "+". Scroll downward through the settings to see that the missing
-part of the description is shown at the bottom of the screen.
-
-
-
-Testing auto-sizing
-
-Open a terminal window and resize it, making it taller than the default
-24 lines. print/ghostscript9 is a good example.
-
- # cd /usr/ports/print/ghostscript9
- # make config
-
-Work remaining to be done
-
-Cleanup of the code and additional comments.
-
-Testing.
-
-The trimming algorithm should break the description on whitespace to
-improve readability. fold(1) may be an easy way to do that.