Hi,

sorry.
I connect to an Alix via serial console or directly via keyboard.
In both situation the network configuration via "stone -text" don't react
on my input "y".
Here the diff -u patch, followed by an explanation 

--------------------------
--- etc/stone.d/gui_text.sh     2015-02-16 17:18:28.000000000 +0100
+++ sa_gui_text.sh      2015-03-07 23:48:51.462270861 +0100
@@ -64,7 +64,7 @@
 
        while :; do
                echo -en "\r? $y\t$n"
-               read -sr -n 1 input
+               read -r input
 
                if   [ "$input" = ""  ]; then break
                elif [ "$input" = "y" ]; then y="[y]"; n=" n "
@@ -72,7 +72,7 @@
                fi
        done
 
-       [ "$input" = "[y]" ] && return 0
+       [ "$y" = "[y]" ] && return 0
        return 1
 }
 
--------------------------


an explanation :
================


# Use: gui_yesno "Text"
#
# [returns 0 if yes, 1 if no]
gui_yesno() {
        local input y="[y]" n=" n "

        echo ; echo "+---"; echo "$1" | fold -s -w66 | sed 's,^,|   ,'
        echo "+---" ; echo

        while :; do
                echo -en "\r? $y\t$n"
                read -sr -n 1 input

## => no reaction on my input, I don't know what "-s" and "-n 1" stands for
##    but without them it works.

                if   [ "$input" = ""  ]; then break
                elif [ "$input" = "y" ]; then y="[y]"; n=" n "
                elif [ "$input" = "n" ]; then y=" y "; n="[n]"
                fi
        done

        [ "$input" = "[y]" ] && return 0
        return 1

## the $input is always "" because of the "break" in the while loop
## => [ "$input" = "[y]" ] is always false
## ==> always return 1

}




At Sun, 8 Mar 2015 18:57:09 +0100,
René Rebe wrote:
> 
> Hi,
> 
> On Mar 7, 2015, at 23:58, Dan <[email protected]> wrote:
> 
> > the "stone -text" is buggy. The problem is in the "etc/stone.d/gui_text.sh”.
> 
> What exactly is buggy?
> 
> > patch-file:
> > ---------------------------------------------------
> > 67c67
> > <               read -sr -n 1 input
> > ---
> >>              read -r input
> > 75c75
> > <       [ "$input" = "[y]" ] && return 0
> > ---
> >>      [ "$y" = "[y]" ] && return 0
> > ---------------------------------------------------
> > 
> > and it works.
> 
> 
> Don’t see such style of patch often, could you send a unified-diff (diff -u) 
> so I get an better idea what edits are going on?
> 
>       René
> 
> -- 
>  ExactCODE GmbH, Lietzenburger Str. 42, DE-10789 Berlin
>  http://exactcode.com | http://exactscan.com | http://ocrkit.com | 
> http://t2-project.org | http://rene.rebe.de
> 

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[email protected] with a subject of: unsubscribe t2

Reply via email to