aptly-dev / aptly

aptly - Debian repository management tool
https://www.aptly.info/
MIT License
2.57k stars 374 forks source link

filter on newest version? #957

Open eichin opened 3 years ago

eichin commented 3 years ago

Detailed Description

It's great that (for example) google's google-cloud-sdk apt repo has every version they've ever shipped. A little less great that this makes it 60G+ with 190 versions present... while it is an admirable reference, I would like to mirror it (and have been, with aptly) but only really need the newest version. Currently, I do a mirror search and find the newest version (since they all have a common build version) and then a mirror edit -filter="Version (>= $newest_version)" with that calculated value. Doesn't handle other repos that have disjoint versions in them, though.

Another way to look at it - can I make mirror update only populate the pool with what snapshot publish would put into the endpoint?

Context

Context is pre-building local mirrors for a build system VM that specifically doesn't have internet access.

Possible Implementation

Details above, but maybe just a config option to mirror create / mirror edit... or possibly there's some other tool that's a better fit? Note that all of the "excess"/"historical" packages are in the Packages file, they're not just in the pool filesystem.

Your Environment

r4co0n commented 3 years ago

This sounds like a aptly mirror update -latest … option and maybe even a sane default. If you want to sync an archive-style repository, which is the the unusual case, maybe that should be an create/edit option.

Though introducing this without changing the default and maybe emitting a warning if you have not decided on the behaviour would be the way to go for now.

The client does only consider the latest version unless explicitly told to do otherwise too, it seems the most expected outcome that aptly just behaves as APT does.

baldugus commented 2 years ago

Any news on whether this is planned to be implemented or not?

I stumbled upon this issue while looking for a way to mirror only the latest version of a package, in a repo that has thousands of versions of it.

devicenull commented 2 years ago

+1 I just hit this with hashicorp's consul repo