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

debian: Support downloading from a mirror in addition to having it locally #12

Merged
merged 13 commits into from Jul 28, 2016

Conversation

iainlane
Copy link
Collaborator

I tried not to break local mirror support, but I haven't actually tested that I didn't...

if (debFname.isRemote) {
immutable path = buildPath (tmpDir, debFname.baseName);

downloadFile (debFname, path);
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't that be downloadIfNecessary? Otherwise we might unnecessarily download multiple times...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

downloadFile itself avoids re-downloading if the dest exists. Here I have the entire path, so it's easier to download directly; downloadIfNecessary is easier to use if you're constructing the path yourself from a base and suffix.

(That reminds me that downloadIfNecessary's doc comment needs expanding...)

@ximion
Copy link
Owner

ximion commented Jul 27, 2016

Looks good to me, I will merge it when you report that it worked well on Ubuntu.
So far I can't spot any obvious problems though, so I think this will be fine :-)

@iainlane
Copy link
Collaborator Author

iainlane commented Jul 28, 2016

It finished last night without crashing again (need to try the extra changes to see if those fix the out of memory fork fails).

ubuntu@asgen:~/appstream-workdir/export/data/yakkety$ zgrep -c "ID*" */Components-*.gz
main/Components-amd64.yml.gz:968
main/Components-arm64.yml.gz:961
main/Components-armhf.yml.gz:971
main/Components-i386.yml.gz:973
main/Components-powerpc.yml.gz:961
main/Components-ppc64el.yml.gz:961
main/Components-s390x.yml.gz:919
multiverse/Components-amd64.yml.gz:164
multiverse/Components-arm64.yml.gz:154
multiverse/Components-armhf.yml.gz:149
multiverse/Components-i386.yml.gz:168
multiverse/Components-powerpc.yml.gz:154
multiverse/Components-ppc64el.yml.gz:149
multiverse/Components-s390x.yml.gz:154
universe/Components-amd64.yml.gz:9673
universe/Components-arm64.yml.gz:9554
universe/Components-armhf.yml.gz:9547
universe/Components-i386.yml.gz:9663
universe/Components-powerpc.yml.gz:9551
universe/Components-ppc64el.yml.gz:9522
universe/Components-s390x.yml.gz:9361

@ximion
Copy link
Owner

ximion commented Jul 28, 2016

Thanks a lot for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants