summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-07-16 17:08:10 +0000
committerKarl Berry <karl@freefriends.org>2007-07-16 17:08:10 +0000
commit18ea95383394cd5fabb9aaeb2c697a63ca4f7972 (patch)
tree0959231fe5ba505aaacb1860a5420febb4245dcf
parentd4c718b1f4d552c20d219b36b287015714be74b1 (diff)
check for builtin dialog/whiptail on any system (jukka salmi, 21 Jun 2007 14:49:48)
git-svn-id: svn://tug.org/texlive/trunk@4631 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/tetex/ChangeLog8
-rwxr-xr-xBuild/source/texk/tetex/texconfig54
-rwxr-xr-xBuild/source/texk/tetex/texconfig-dialog18
3 files changed, 32 insertions, 48 deletions
diff --git a/Build/source/texk/tetex/ChangeLog b/Build/source/texk/tetex/ChangeLog
index 64bc97d1a23..d5b3269cbf2 100644
--- a/Build/source/texk/tetex/ChangeLog
+++ b/Build/source/texk/tetex/ChangeLog
@@ -1,3 +1,11 @@
+2007-07-16 Karl Berry <karl@tug.org>
+
+ * texconfig (findDialogProg, runDialog): these fns not used here,
+ remove.
+ (findprog): new mode of operation, like which(1).
+ * texconfig-dialog (findDialog): check for whiptail/dialog on any
+ system, not just FreeBSD, Linux, cygwin.
+
2007-05-31 Karl Berry <karl@tug.org>
* fmtutil (run_initex): do not remove the log file.
diff --git a/Build/source/texk/tetex/texconfig b/Build/source/texk/tetex/texconfig
index d5e690a000f..3637daf8cd6 100755
--- a/Build/source/texk/tetex/texconfig
+++ b/Build/source/texk/tetex/texconfig
@@ -24,7 +24,7 @@ test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
progname=texconfig
# the version string
-version=1168907609 # seconds since `00:00:00 1970-01-01 UTC'
+version=1184605103 # seconds since `00:00:00 1970-01-01 UTC'
# date '+%s' (with GNU date)
envVars="
@@ -106,10 +106,14 @@ echoLocateBinary()
for elb
do
elbLoc=`checkForBinary "$elb"`
- case $elbLoc in
- "") echo "$elb: not found";;
- *) echo "$elb: $elbLoc";;
- esac
+ if test -n "$ELB_PATH_ONLY"; then
+ test -n "$elbLoc" && echo "$elbLoc"
+ else
+ case $elbLoc in
+ "") echo "$elb: not found";;
+ *) echo "$elb: $elbLoc";;
+ esac
+ fi
done
}
@@ -159,40 +163,6 @@ checkForBinary()
}
###############################################################################
-# findDialogProg(void)
-# Some systems have their own dialog. Use it then and do not use
-# faked TERM and TERMINFO variables when calling that dialog.
-###############################################################################
-findDialogProg()
-{
- { u=`uname -s`; } 2>/dev/null
- case "$u" in
- FreeBSD|Linux|cygwin*|CYGWIN*)
- test -f /usr/bin/whiptail && DIALOG_PROG=/usr/bin/whiptail
- test -f /usr/bin/dialog && DIALOG_PROG=/usr/bin/dialog
- test -f /bin/dialog && DIALOG_PROG=/bin/dialog
- ;;
- esac
-}
-
-###############################################################################
-# runDialog(args)
-# call either tcdialog or $DIALOG_PROG
-###############################################################################
-runDialog()
-{
- test -z "$NO_CLEAR" && tty -s && clear
- case "$DIALOG_PROG" in
- "")
- TERM=$DIALOG_TERM TERMINFO=$DIALOG_TERMINFO \
- tcdialog --title "$progname setup utility" ${1+"$@"};;
- *)
- $DIALOG_PROG --title "$progname setup utility" ${1+"$@"};;
- esac
-}
-
-
-###############################################################################
# cleanup()
# clean up the temp area and exit with proper exit status
###############################################################################
@@ -588,6 +558,7 @@ tcBatch()
$progname dvipdfm paper PAPER
$progname dvips [options]
$progname faq
+ $progname findprog
$progname font vardir DIR
$progname font ro
$progname font rw
@@ -927,6 +898,11 @@ Valid MODE settings:"
fi
;;
+ findprog)
+ shift
+ ELB_PATH_ONLY=1 echoLocateBinary "$@"
+ ;;
+
# handle "texconfig font"
font)
help="Usage: $progname font vardir DIR
diff --git a/Build/source/texk/tetex/texconfig-dialog b/Build/source/texk/tetex/texconfig-dialog
index 76e1f51eea6..8ccda930dd7 100755
--- a/Build/source/texk/tetex/texconfig-dialog
+++ b/Build/source/texk/tetex/texconfig-dialog
@@ -21,7 +21,7 @@ export PATH
test -n "${ZSH_VERSION+set}" && alias -g '${1+"$@"}'='"$@"'
# the version string
-version=1112981053 # seconds since `00:00:00 1970-01-01 UTC'
+version=1184605103 # seconds since `00:00:00 1970-01-01 UTC'
# date '+%s' (with GNU date)
: ${PAGER=more}
@@ -103,14 +103,14 @@ runDialog()
###############################################################################
findDialog()
{
- { u=`uname -s`; } 2>/dev/null
- case "$u" in
- FreeBSD|Linux|cygwin*|CYGWIN*)
- test -f /usr/bin/whiptail && DIALOG_PROG=/usr/bin/whiptail
- test -f /usr/bin/dialog && DIALOG_PROG=/usr/bin/dialog
- test -f /bin/dialog && DIALOG_PROG=/bin/dialog
- ;;
- esac
+ for bin in whiptail dialog
+ do
+ binLoc=`texconfig findprog $bin`
+ case $binLoc in
+ "") DIALOG_PROG="";;
+ *) DIALOG_PROG=$binLoc; break;;
+ esac
+ done
case $DIALOG_PROG in
"")
: ${DIALOG_TERMINFO=$TEXMFMAIN/texconfig}