Merged
Conversation
apt-get is designed for use in scripts and has a stable output; apt is designed for humans and tries to do things like progress bars. While we don't actually need to parse the output, apt-get is still the right thing to use here. This also moves to using the longer form of arguments for clarity. Fixes #20.
This reworks the way we call for the apt repo to be rescanned such that we don't change the current directory of our process and don't output the new packages file to disk until it's been compressed.
RealOrangeOne
approved these changes
Jan 13, 2018
kierdavis
reviewed
Jan 24, 2018
| stdout=subprocess.PIPE, | ||
| ) | ||
| subprocess.check_call( | ||
| ['xz', '-3', '-'], |
Member
There was a problem hiding this comment.
Python appears to have standard library support for xz, so compressing the Packages file could be done within the application, which saves spawning a child process. My minimal knowledge of Debian packaging suggests the file is probably so small that it's not worth worrying about this, but I could be wrong.
Member
There was a problem hiding this comment.
The chances of file size being an issue on this scale is very small. However, I think using libraries wherever possible is preferable to calling out to shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Note: I don't have a suitable pi image to hand to test this at the moment, so these changes are untested.
The first commit fixes #20.