cybozu-go / aptutil

Go utilities for Debian APT repositories
MIT License
124 stars 29 forks source link

[WIP] Mirror changes needed to reuse code for `apt-resource` usage. #20

Closed ringods closed 7 years ago

ringods commented 7 years ago

This is a work in progress pull request to discuss the changes I need to implement an apt resource type for Concourse.

After some understanding of the code base and a number of trial attempts, I guess I'm on the right track. I'm converting the code base to a more pipeline oriented approach using channels and goroutines.

The introduction of the strategy allows me to use a Complete update for go-apt-mirror and a custom implementation for my own work. In this custom implementation, I will only download the release files and indexes, ending with a channel containing the FileInfo structs of all packages in the release. Continuing on that, I can filter the results to the package I want to monitor for new releases.

ringods commented 7 years ago

@ymmt2005 I now bump into a limitation of your code: FileInfo only offers details of files. But I need more extensive package info like package name and package version. All files are processed alike and only return a collection of FileInfo objects.

Can I split the file handling and let the processing push the results on different channels?

ringods commented 7 years ago

Closing. It was too hard to reuse this code base for my purpose. I was able to implement it based on the smira/aptly codebase.

ymmt2005 commented 7 years ago

I see. Anyway, thank you for once using our code base.