Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script cleanup and refinement #92

Merged
merged 6 commits into from May 26, 2016

Conversation

joshua-stone
Copy link
Contributor

The gist of this pull request:

  • Use higher strictness levels to catch bugs and program defensively
  • Add dependency checking for adb and fastboot so the script only runs if they're installed
  • Clean up some of the code formatting conventions

Bash by default is very lenient about catching errors, so a script should be set to halt for reasons including unset variables or failed commands. While a little extra work is required in making a script more defensive, it could save some headaches later when trying to catch a bug that slips by in testing but comes up in production.

Dependency checking is also used, because a new user might want to use this utility but might not know which packages need to be installed aside from the ones that ship with their distribution.

Code formatting is also cleaned up a bit, for instance $VAR is changed to "${VAR}". In Bash, everything is a string, and certain statements might evaluate differently because there was a space in a variable that wasn't escaped

That said, I haven't been able to run the entirety of this script since I have neither the .img files nor the hardware to flash them on, so there's likely a regression introduced due to reliance on certain behaviour that would've been caught as a bug. Please let me know if there are any bugs you've found and I can try to fix them.

@tmossey
Copy link
Contributor

tmossey commented May 26, 2016

Looks good to me at first pass.

This script was thrown together in about 20 min as a test run for the flounder/flounder_lte (hboot) OEM unlock process on n devices and as a proof of concept for the ROM zip flash process - which used to be a restore from a backup - on an untested version of TWRP.

It's also worth noting this script was intended for internal use, on a build box where checks for dependencies are not strictly needed.

That said, I see nothing but objective improvements at first pass. Some testing is needed but I'll merge this into develop and we can go from there.

@tmossey tmossey merged commit a07e389 into pwnieexpress:develop May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants