Closed Bug 924947 Opened 11 years ago Closed 11 years ago

flash_mac.sh does not use select statement correctly

Categories

(Firefox OS Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: armenzg, Unassigned)

Details

(Whiteboard: [from-geeksphone])

Attachments

(1 file)

Attached patch flash_mac.diffSplinter Review
Phone type: Keon
OS version 1.3.0.0-prerelease
Build Identifier: 20131007022957
Update channel: default

Steps to Reproduce:
1) Visit http://downloads.geeksphone.com/
2) Download image from "Latest nightly"
* http://downloads.geeksphone.com/keon_nightly/latest_master.html
3) unzip the file
4) run ./flash_mac.sh

Expected Result:
* You can answer "Yes" or "No" and carry forward with flashing

Actual Result:
* You can answer whatever you want as you will never get out of that loop

Is this issue sometimes or always reproducible: 
* Yes

###########################

I see the same issue for flash.sh

###########################

On another note, if you want your email to be on the CC field you should update your link from that page ("Click here to file a bug!") as well as adding the component that you want: "&component=General&cc=gp@geeksphone.com"

On yet another note, it would be cool if people could find the flashing instructions directly from that page. You could probably add a link to this page:
http://downloads.geeksphone.com/drivers/Manual_flash_geeksphone-eng.txt
Attachment #814931 - Flags: review?(gp)
Comment on attachment 814931 [details] [diff] [review]
flash_mac.diff

Review of attachment 814931 [details] [diff] [review]:
-----------------------------------------------------------------

::: flash_mac.sh
@@ +2,5 @@
>  adb reboot bootloader
>  fastboot flash boot boot.img
>  echo "Do you want to keep your user data ? (Some users has problems in first reboot, if you have, please reflash and select not to keep the data)"
>  select yn in "Yes" "No"; do
> +    case $REPLY in

In line 5, the variable is yn, if we change it to REPLY in line 6 it will not work
And i am sure that flash.sh works as should... i exec it at least twice a day.
(In reply to Geeksphone from comment #2)
> And i am sure that flash.sh works as should... i exec it at least twice a
> day.

Which version do you use of bash?
Which version of _Mac_ do you use?
I assume that Linux and Mac could behave differently and event different shells.

Armens-MacBook-Air 1.2 $ /bin/bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12)
Copyright (C) 2007 Free Software Foundation, Inc.

I see your syntax used in this post:
http://www.softpanorama.org/Scripting/Shellorama/Control_structures/select_statements.shtml

My sintax is mentioned in here:
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_06.html

See what happens on my machine:
Armens-MacBook-Air ~ $ select yn in "Yes" "No"; do
>     case $REPLY in
>         Yes ) break;;
>         No ) break;;
>     esac
> done
1) Yes
2) No
#? Y
#? N
#? No
Armens-MacBook-Air ~ $ select yn in "Yes" "No"; do     case $yn in         Yes ) break;;         No ) break;;     esac; done
1) Yes
2) No
#? Y
#? N  
#? No
#? Hey!
#? ^C
Flags: needinfo?(gp)
:).

You need to press 1 or 2, not Yes/No.
Flags: needinfo?(gp)
Attachment #814931 - Flags: review?(gp)
Replying 1 or 2 wfm
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: