Hi Frederic,
I'm not sure if I understand you correct regarding your repository
setup, let me try to rephrase it...
0) your use-case would be an archive of self build packages
1) first you create a (aptly) `repo`, optional already with a
"distribution" and "component"
2) this `repo` can be published (if your aptly repo is configured with
distribution and component, then the publish can take this info from the
repo, otherwise you need to set it for the publish)
3) that's all.
An aptly repo has only one distribution and one component. To mimic i.e.
Debian Buster, you would need three (3) aptly repos, each with
distribution=buster, but each one would have only one of "main",
"contrib", or "non-free" used as component.
If you now have for example a package which is build one time for ubuntu
xenial and one time for debian buster, so booth packages are different,
you would have to create TWO `repo` and each `repo` would be published
on its own. (The default component "main" could be used for booth.)
Then there is this one special case, where the package is identical for
all distributions (read as buster, xenial and so on...) then you COULD
just setup one `repo` and only `publish`. But most package builds have
different dependencies, so you should/have to use one `repo` for each of
your target distributions.
MAYBE there a good use-case to use components for "stable", "testing",
and "unstable", but I would recommend to do it like debian does it:
Each one is a different distribution. So in aptly terms, you would have
three repos and three publishes. (Every time I'm stumpled upon archives
in the wild which used components for their internal versioning some
issues where involved, so personally dislike it.)
I try to pickup your example....
aptly repo create -distribution="stable" -component="main" my_corp_stable
aptly repo create -distribution="testing" -component="main" my_corp_testing
aptly repo create -distribution="unstable" -component="main"
my_corp_unstable
and then you would add i.e. a new version of a package to the unstable
repo, and then you publish one or all three
aptly pubish repo my_corp_stable
aptly pubish repo my_corp_testing
aptly pubish repo my_corp_unstable
Later, If your confirmed everything is cool, and you like to add this
version to stable, you could either just add the deb-file to the stable
repo or you can use aptly repo copy to copy one or more packages from
one aptly repo to another. Then again you need to update the publish.
(For many aptly operations you can use dpkg-filter-querys! Make use of
them!)
The components used by Debian and Ubuntu are mainly to separate software
in terms of free-ness or quality. So there is no technical reason, but
users of Debian for instance are free to have a system with only free
software, so these users would not include contrib and/or non-free, just
main.
TL;DR; Do not use components for versioning. Use different distributions
instead.
I hope I could help a bit.
Feel free to ask again if thinks are still unclear.
Bernd
On 20.01.21 14:38, Frederic NAUDEAU wrote:
> Many thanks for your answers.
> Adding a package can only be repository wide ?
> I mean if I have:
> repository: *test_repository*, that contains 2 distributions: *distrib1*
> and *distrib2*, and each distribution contains 2 components: *stable* and
> *test:*
>
> test_repository
> distrib1
> stable
> test
> distrib2
> stable
> test
>
> If I do an add:
>
> *aptly repo add test_repository mypackage_1.0.0.deb*
> *aptly repo add test_repository mypackage_2.0.0.deb*
>
> *How can I do to only propose mypackage v2.0.0 in the test component, as I
> don't want it yet in my stable component ?*
>
> test_repository
> distrib1
> stable
> *mypackage_1.0.0.deb*
> test
> *mypackage_1.0.0.deb*
> *mypackage_2.0.0.deb*
> Like this, on a *test machine* I can only use *testing packages* and on the *field
> machines* I will use the *stable packages*.