Introduce option -multi-dist
to the publish commands
#1292
Merged
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.
This change makes it possible to publish multiple distributions with packages named the same but with different content by changing structure of the generated pool hierarchy. The option not enabled by default as this changes the structure of the output which could break the expectations of other tools.
Fixes #486
Requirements
All new code should be covered with tests, documentation should be updated. CI should pass.
Description of the Change
Given #486 and and this discussion on aptly-discuss it seems I am not alone in using aptly to self-publish some packages for a handful different distributions and wanting to publish different packages with the same filename for different distributions. As it stands, due to aptly using the default directory structure for the
pool
hierarchy, aptly will currently fail to publish such packages.A casual look at the DebianRepository/Format page seems to indicate that the structure of the pool hierarchy is not specified, and as long as the
Filename
field in Packages references the relevant file any structure could be used.This change introduces a new option
-multi-dist
that will create per distribution subdirectories underpool
such that each distribution can have its own copy of some package and need not worry about two packages with the same name but different distributions colliding.One could argue that it would be better to change the default behaviour, rather than implementing a new option, but I feel I have limited visibility into all the implications here, so having this behaviour be enabled on an opt-in basis seems the choice with less risk of functionality regressions. This change can also have storage efficiency implications, so having it be optional seems preferable for that reason as well.
Checklist
AUTHORS