Skip to content

Command tidyups #22

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

Merged
merged 2 commits into from
Jan 13, 2018
Merged

Command tidyups #22

merged 2 commits into from
Jan 13, 2018

Conversation

PeterJCLaw
Copy link
Contributor

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.

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.
@PeterJCLaw PeterJCLaw merged commit 945066c into master Jan 13, 2018
@PeterJCLaw PeterJCLaw deleted the command-tidyups branch January 13, 2018 17:13
stdout=subprocess.PIPE,
)
subprocess.check_call(
['xz', '-3', '-'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

Use apt-get
3 participants