Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This replaces tools/download-cleaner with tools/download-cleaner.py. Their intended purpose is the same, but the previous bash script had limitations. The main one is that it was cumbersome in considering multiple project/device/arches.
The replacement may consider all project/device/arch combinations (see builds_all), a limited portion of those with build directories (build.LibreELEC-RPi2.arm...), or the single build specified by PROJECT=X DEVICE=Y ARCH=Z ./download-cleaner.py. Each build combination takes around 30s to consider what packages are needed, so running --all by itself is around 30 minutes.
The way it works it by:
By default, it only prints out what it would remove.
scripts/genbuildplan.py is extended with two additional CLI options to assist with this:
--hide-header
prevents printing the statistics header in the output--list-packages
has it output only a list of packages - no depends or build stepsWork in progress because it doesn't consider packages removed from the tree yet. I'll add a commit to drop tools/download-cleaner when this replacement is ready. Probably still useful to someone else in the meantime, so sharing.