Commit 0fbfdf4b authored by Michael Elizabeth Chastain's avatar Michael Elizabeth Chastain Committed by Linus Torvalds

[PATCH] fix xconfig for new help system

Here is a patch to enhance xconfig to read the new Config.help files.
Olaf Dietsche wrote this, and Steven Cole passed it on to me.

Testing: Steven Cole tested it, and I tested it.
parent 1c9eee2c
...@@ -449,29 +449,24 @@ proc dohelp {w var parent} { ...@@ -449,29 +449,24 @@ proc dohelp {w var parent} {
catch {destroy $w} catch {destroy $w}
toplevel $w -class Dialog toplevel $w -class Dialog
set filefound 0
set found 0 set found 0
set lineno 0
# First escape sed regexp special characters in var:
if { [file readable Documentation/Configure.help] == 1} then { set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g]
set filefound 1 # Now pick out right help text:
# First escape sed regexp special characters in var: set message [exec find . -name Config.help | xargs sed -n "
set var [exec echo "$var" | sed s/\[\]\[\/.^$*\]/\\\\&/g] /^$var\[ \]*\$/,\${
# Now pick out right help text: /^$var\[ \]*\$/c\\
set message [exec sed -n "
/^$var\[ \]*\$/,\${
/^$var\[ \]*\$/c\\
${var}:\\ ${var}:\\
/^#/b /^#/b
/^\[^ \]/q /^\[^ \]/q
s/^ // s/^ //
/<file:\\(\[^>\]*\\)>/s//\\1/g /<file:\\(\[^>\]*\\)>/s//\\1/g
p p
} }
" Documentation/Configure.help] " /dev/null ]
set found [expr [string length "$message"] > 0] set found [expr [string length "$message"] > 0]
}
frame $w.f1 frame $w.f1
pack $w.f1 -fill both -expand on pack $w.f1 -fill both -expand on
...@@ -494,13 +489,8 @@ ${var}:\\ ...@@ -494,13 +489,8 @@ ${var}:\\
pack $w.f1.canvas -side right -fill y -expand on pack $w.f1.canvas -side right -fill y -expand on
if { $found == 0 } then { if { $found == 0 } then {
if { $filefound == 0 } then {
message $w.f1.f.m -width 750 -aspect 300 -relief flat -text \
"No help available - unable to open file Documentation/Configure.help. This file should have come with your kernel."
} else {
message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \ message $w.f1.f.m -width 400 -aspect 300 -relief flat -text \
"No help available for $var" "No help available for $var"
}
label $w.f1.bm -bitmap error label $w.f1.bm -bitmap error
wm title $w "RTFM" wm title $w "RTFM"
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment