same package with multiple distributions

1,280 views
Skip to first unread message

woyto...@gmail.com

unread,
Dec 3, 2015, 9:41:36 AM12/3/15
to aptly-discuss
I've been looking through the documentation and have found many similar examples but not exactly right. I want to publish the same package to multiple distributions using local repos.

Here's what I'm doing

$ aptly repo create -distribution=trusty -component=main -architectures=amd64 my-trusty
$ aptly repo create -distribution=wily -component=main -architectures=amd64 my-wily

$ aptly publish repo -architectures=amd64 my-trusty
$ aptly publish repo -architectures=amd64 my-wily

$ aptly repo add my-trusty trusty/my-pkg_30xyz0_amd64.deb
$ aptly repo add my-wily wily/my-pkg_30xyz0_amd64.deb

$ aptly publish update trusty
$ aptly publish update wily
ERROR: unable to publish: unable to process packages: error linking file to public/pool/main/m/my-pkg/my-pkg_30xyz0_amd64.deb: file already exists and is different

The two packages are the same name, but different binaries since they are built with different distributions.

Why isn't the "distribution" name in the pool directory path like it is in
the public/dists/<name>/... path? This would solve the problem.

public
├── dists
│   ├── trusty
│   │   ├── main
│   │   │   └── binary-amd64
│   │   │   ├── Packages
│   │   │   ├── Packages.bz2
│   │   │   ├── Packages.gz
│   │   │   └── Release
│   │   └── Release
│   └── wily
│   ├── main
│   │   └── binary-amd64
│   │   ├── Packages
│   │   ├── Packages.bz2
│   │   ├── Packages.gz
│   │   └── Release
│   └── Release
└── pool
└── main


Frederic Van Espen

unread,
Dec 3, 2015, 10:40:05 AM12/3/15
to woyto...@gmail.com, aptly-discuss
Hi,

On Thu, Dec 3, 2015 at 3:41 PM, <woyto...@gmail.com> wrote:
I've been looking through the documentation and have found many similar examples but not exactly right. I want to publish the same package to multiple distributions using local repos.
ERROR: unable to publish: unable to process packages: error linking file to public/pool/main/m/my-pkg/my-pkg_30xyz0_amd64.deb: file already exists and is different

The two packages are the same name, but different binaries since they are built with different distributions.

The only way I found is to have the name of the distribution in the file name. You can handle this in your debian/rules build file by overriding the dh_gencontrol target and setting e.g. a different version string.

Cheers,

Frederic

Woytowitz Family

unread,
Dec 3, 2015, 7:45:08 PM12/3/15
to aptly-discuss
Hello,
I was hoping for a solution with the aptly package, rather than having to hack something in the debian build.
I think my use case would be fairly common, and changing the debian name is not possible if you are not building the packages.

I noticed that when you create the local repo the pool directory has a two level "hash" of some sort for the deb package,
I assume this is based on the binary contents of the file.

Local repo
pool
├── 00
│   └── bf
│       └── dbus-api_36bay0_amd64.deb

However the public pool has directories based on the package name

public/pool/
└── main
    ├── d
    │   ├── dbus-api
    │   │   └── dbus-api_36bay0_amd64.deb

If the public pool used the "hash" approach it would also solve the problem.

Does anyone know why the local/public pool directories are structured differently?
Is there some overall aptly configuration that I can set to change the way the public pool directories are generated?

Thanks
December 3, 2015 at 10:40 AM
Hi,
December 3, 2015 at 9:41 AM
I've been looking through the documentation and have found many similar examples but not exactly right. I want to publish the same package to multiple distributions using local repos.

Here's what I'm doing

$ aptly repo create -distribution=trusty -component=main -architectures=amd64 my-trusty
$ aptly repo create -distribution=wily -component=main -architectures=amd64 my-wily

$ aptly publish repo -architectures=amd64 my-trusty
$ aptly publish repo -architectures=amd64 my-wily

$ aptly repo add my-trusty trusty/my-pkg_30xyz0_amd64.deb
$ aptly repo add my-wily wily/my-pkg_30xyz0_amd64.deb

$ aptly publish update trusty
$ aptly publish update wily
ERROR: unable to publish: unable to process packages: error linking file to public/pool/main/m/my-pkg/my-pkg_30xyz0_amd64.deb: file already exists and is different

The two packages are the same name, but different binaries since they are built with different distributions.

Frederic Van Espen

unread,
Dec 4, 2015, 2:09:25 AM12/4/15
to Woytowitz Family, aptly-discuss
On Fri, Dec 4, 2015 at 1:45 AM, Woytowitz Family <woyto...@gmail.com> wrote:
Hello,
I was hoping for a solution with the aptly package, rather than having to hack something in the debian build.
I think my use case would be fairly common, and changing the debian name is not possible if you are not building the packages.

I agree that this is a common use case. I haven't found a proper way to fix it other than changing the filename. You can still do that by simply renaming the file if no better way exists right now. That does not change the package content in any way.
 
I noticed that when you create the local repo the pool directory has a two level "hash" of some sort for the deb package,
I assume this is based on the binary contents of the file.

Correct, it seems to be based on the md5sum:
:/var/lib/aptly# stat pool/cf/ce/libmagic1_5.03-5ubuntu1_i386.deb
  File: `pool/cf/ce/libmagic1_5.03-5ubuntu1_i386.deb'
  Size: 391770     Blocks: 768        IO Block: 4096   regular file
Device: fc04h/64516d Inode: 3805349     Links: 2
/var/lib/aptly# md5sum public/upstream/pool/main/f/file/libmagic1_5.03-5ubuntu1_i386.deb
cfce29401f186fa69ab986ba036414dc  public/upstream/pool/main/f/file/libmagic1_5.03-5ubuntu1_i386.deb

Does anyone know why the local/public pool directories are structured differently?

The top level pool directory is where actually all files are stored. The public pool are simply hardlinks to the same file. I fail to see a reason why they are structured differently.
 
Is there some overall aptly configuration that I can set to change the way the public pool directories are generated?

Not that I know of.

Cheers,

Frederic

Woytowitz Family

unread,
Dec 4, 2015, 7:17:53 AM12/4/15
to aptly-discuss

I've come up with a workaround using prefixes that requires a change to the URL in sources.list for each distribution, not too bad.


$ aptly repo create -distribution=trusty  -component=main -architectures=amd64 my-trusty
$ aptly repo create
-distribution=wily
-component=main -architectures=amd64 my-wily

$ aptly publish repo 
-architectures=amd64 my-trusty trusty
$ aptly publish repo
-architectures=amd64 my-wily wily


$ aptly repo add my-trusty trusty/my-pkg_30xyz0_amd64.deb
$ aptly repo add my-wily wily/my-pkg_30xyz0_amd64.deb

$ aptly publish update trusty trusty
$ aptly publish update wily wily


December 4, 2015 at 2:09 AM
December 3, 2015 at 7:45 PM
Hello,
I was hoping for a solution with the aptly package, rather than having to hack something in the debian build.
I think my use case would be fairly common, and changing the debian name is not possible if you are not building the packages.

I noticed that when you create the local repo the pool directory has a two level "hash" of some sort for the deb package,
I assume this is based on the binary contents of the file.

Local repo
pool
├── 00
│   └── bf
│       └── dbus-api_36bay0_amd64.deb

However the public pool has directories based on the package name

public/pool/
└── main
    ├── d
    │   ├── dbus-api
    │   │   └── dbus-api_36bay0_amd64.deb

If the public pool used the "hash" approach it would also solve the problem.

Does anyone know why the local/public pool directories are structured differently?
Is there some overall aptly configuration that I can set to change the way the public pool directories are generated?

Thanks

iknd

unread,
Nov 24, 2022, 1:54:41 AM11/24/22
to aptly-discuss
Hi,

the thread is old but trying to figure out exactly the same issue as @Woytowitz

What seems to have changed is that you can publish a repo with the same file(name) under a different distro:

    $ aptly repo create -architectures=amd64 -distribution=trusty -component=main -architectures=amd64 my-trusty
    $ aptly repo create -architectures=amd64 -distribution=wily -component=main -architectures=amd64 my-wily


    $ aptly repo add my-trusty trusty/my-pkg_30xyz0_amd64.deb
    $ aptly repo add my-wily wily/my-pkg_30xyz0_amd64.deb

    $ aptly snapshot create my-trusty-snapshot from repo my-trusty
    $ aptly snapshot create my-wily-snapshot from repo my-wily

    $ aptly publish snapshot -architectures=amd64 my-trusty-snapshot filesystem:test1:multi_dist_test
    $ aptly publish snapshot -architectures=amd64 my-wily-snapshot filesystem:test1:multi_dist_test



├── dists
│   ├── trusty
│   │   ├── Contents-amd64.gz

│   │   ├── main
│   │   │   ├── binary-amd64
│   │   │   │   ├── Packages
│   │   │   │   ├── Packages.bz2
│   │   │   │   ├── Packages.gz
│   │   │   │   └── Release
│   │   │   └── Contents-amd64.gz
│   │   └── Release
│   └── wily
│       ├── Contents-amd64.gz

│       ├── main
│       │   ├── binary-amd64
│       │   │   ├── Packages
│       │   │   ├── Packages.bz2
│       │   │   ├── Packages.gz
│       │   │   └── Release
│       │   └── Contents-amd64.gz
│       └── Release
└── pool
    └── main
        └── q
            └── <sub_folder>
                └── libqt6.2.2openglwidgets6_6.2.2-1_amd64.deb -> /home/iikka/.aptly/pool/dd/cf/4205268df5c826204ce05a0d010b_libqt6.2.2openglwidgets6_6.2.2-1_amd64.deb
Reply all
Reply to author
Forward
0 new messages