Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[scripts/config] Input tolerance for leading space Google fail
Closes: hashbang#16 Post by @ubergeek77 with the details: > The [Factory Images page](https://developers.google.com/android/images) has some unfortunate inconsistencies with how it is displaying some of the image information. > > There are two main issues: > > * Starting with the January 2020 images, Google has been prepending the Build ID field with an unnecessary space. > > * `config` splits that string with a space already, so the index the script expects the build ID to be at will no longer be at that location unless that space is removed before splitting. > > * Google is now serving T-Mobile/Google Fi factory images. They are the last image in each section, so this "TMO/Fi" image will be considered "latest." However, not everyone has a T-Mobile/Google Fi device. If you were to fix the above issue, you'd still have the issue of determining whether or not the user wants a T-Mobile/Fi image or not (I'd imagine you wouldn't in ~80% of cases) > > > For clarity, consider the following excerpt from the images HTML source: > > ``` > <tr id="crosshatchqq1a.191205.008"> > <td>10.0.0 (QQ1A.191205.008, Dec 2019)</td> > <td><a href="https://dl.google.com/dl/android/aosp/crosshatch-qq1a.191205.008-factory-ff62c022.zip" > class="gc-analytics-event" data-category="Android Images" > data-label="crosshatch for Pixel 3 XL [QQ1A.191205.008]">Link</a></td> > <td>ff62c0224a3cffe0dbcfd45adf0a42b4271bd907b3f0839fe2940bf41ba7b88b</td> > </tr> > <tr id="crosshatchqq1a.200105.002"> > <td> 10.0.0 (QQ1A.200105.002, Jan 2020)</td> > <td><a href="https://dl.google.com/dl/android/aosp/crosshatch-qq1a.200105.002-factory-853405e1.zip" > class="gc-analytics-event" data-category="Android Images" > data-label="crosshatch for Pixel 3 XL [QQ1A.200105.002]">Link</a></td> > <td>853405e1c585e2a5c28f8fdf9ea8b2a03a2868eb7cb3137dde5fc6ffa854caf4</td> > </tr> > <tr id="crosshatchqq1a.200105.003"> > <td> 10.0.0 (QQ1A.200105.003, Jan 2020, TMO/Fi)</td> > <td><a href="https://dl.google.com/dl/android/aosp/crosshatch-qq1a.200105.003-factory-6d235f47.zip" > class="gc-analytics-event" data-category="Android Images" > data-label="crosshatch for Pixel 3 XL [QQ1A.200105.003]">Link</a></td> > <td>6d235f477ac74153bf8bc23e69e30c81cb500ca2ac72a3d67731f916981dacea</td> > </tr> > ``` > > Look carefully at the last two sections' version strings - they have spaces, but every image before it does not (unless you count some of the 9.0 images, since a few of them did actually have spaces). > > You can fix this rather easily by adding the following below [config:45](https://github.com/hashbang/aosp-build/blob/master/scripts/config#L45): > > ``` > if data.startswith(' '): > data = data[1:] > ``` > > That does still leave the issue of the T-Mobile/Google Fi images, though.
- Loading branch information