Hi, thanks for the reply! Comments inline.
On 2015-05-14 00:36, Andrey Smirnov wrote:
> Hi Andreas!
>
> I believe this is the most frequently asked question about aptly :)
Maybe this topic should be a real FAQ entry on
http://www.aptly.info/doc/faq/ then? I know you discuss duplicate
packages in
http://www.aptly.info/doc/feature/duplicate/ and partly in
http://www.aptly.info/doc/feature/multi-component/ but it couldn't hurt
to discuss this kind of use-case specifically.
> If I pretend to be Debian guy, I would say that you're doing it wrong,
> you should never produce different packages with identical name, version
> and architecture. One of the options is to include Ubuntu codename into
> version, as in the foreseeable future next version (precise, trusty)
> would be "greater" than previous one. So something like
> package_1.0.1~precise.
I know
https://wiki.debian.org/RepositoryFormat#Duplicate_Packages says
(name, version, arch) must be unique in a repository but does that make
the use-case I describe invalid? Remember, that use-case is
custom-packaging software, such as Dovecot, for multiple Debian/Ubuntu
releases in the same version and arch. Many projects which provide
Debian packages also need to do this (e.g. PostgreSQL or Phusion Passenger).
Extending the version string is a workaround I can and probably will
use, and it seems repos such as
apt.postgresql.org have a similar
approach (see
http://apt.postgresql.org/pub/repos/apt/pool/main/p/pgadmin3/ for
example). Passenger does it as well:
https://oss-binaries.phusionpassenger.com/apt/passenger/4/pool/main/p/passenger/
I would then probably name our Dovecot packages something like this:
dovecot_2.2.16-1custom1~12.04_amd64.deb
dovecot_2.2.16-1custom1~14.04_amd64.deb
Using the numeric release versions/identifiers (12.04 and 14.04) also
lends itself better to version comparison (14.04 is newer than 12.04).
I should probably re-read
https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
to be safe.
> If you still want to have the same (name, version, architecture), you
> should be prepared that dist-upgrade might be tricky. But for publishing
> you should publish under different prefixes to get separate pools.
Dist-upgrading shouldn't be a problem when using the above approach of
appending the Ubuntu release version to the package version string,
should it?
I am not a fan of using different Aptly repo prefixes just to be able to
serve different Ubuntu releases.
For example this (in a machine's /etc/apt/sources.list):
deb
http://apt.example.com/custom trusty main
deb
http://apt.example.com/custom trusty release
deb
http://apt.example.com/custom precise main
deb
http://apt.example.com/custom precise devel
makes more sense to me than this:
deb
http://apt.example.com/custom-trusty trusty main
deb
http://apt.example.com/custom-trusty trusty release
deb
http://apt.example.com/custom-precise precise main
deb
http://apt.example.com/custom-precise precise devel
N.B.: here we also use components (main, release, devel, ...) which add
another layer of complexity.
Anyway, thanks for the feedback and pointers, I think I've got it now.
Andreas