Closed Bug 923767 Opened 11 years ago Closed 6 years ago

Pick adb path from environment

Categories

(Firefox OS Graveyard :: GonkIntegration, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: arky, Unassigned)

Details

Try to figure out adb path from system environment. The following code is not ideal.  On my linux laptop the adb path is resolved to '/out/host/linux-x86/bin' which is incorrect. 

######flash.sh###########
if [ ! -f "`which \"$ADB\"`" ]; then
        ADB=out/host/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/bin/adb
fi
I don't understand where the leading / would be coming from.

Do you have the ADB variable set in your environment? If so, then that's what will be used.

If you don't have the ADB environment variable set, then it should calculate the path as out/host/linux-x86/bin/adb which should be correct (flash.sh assumes that you're running from the top of your B2G tree.
I don't have ADB variable set in my environment. Perhaps we have to notify the users to the ADB variable and also check if the adb is present at the path before failing.
So my point is that if you don't have ADB set, then the script will set ADB to out/host/something and you said it was set to /out/host/something (note leading slash).

This code:

if [ ! -f "`which \"$ADB\"`" ]; then
        ADB=out/host/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/bin/adb
fi

CAN'T resolve ADB to /out/host/something unless ADB was already set to /out/host/something.

If you're still seeing the problem, then if you could edit flash.sh and add the line:

set -x

on line 2 of flash.sh, and provide the output from running it, that would help to figure out what's going on.
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.