Andrey,
On Tue, Mar 3, 2015 at 11:21 AM, Andrey Smirnov
<
smirnov...@gmail.com> wrote:
> Frederic,
>
> -force-overwrite is most probably the reason for the error message you see.
>
> I would not recommend using it unless you're really sure you need that.
We use force-overwrite only for the development repo's because these
are really testing packages and we should overwrite them when we add a
new build of the same version. Development repo's are also only
published in the dev prefix.
> Most probably you have conflicting packages (same name, version, arch, but
> different files) dpkg_1.15.8.12escaux1_i386. Such packages are handled
> successfully by aptly, but problem is that if you publish them to the same
> prefix, they end up using the same filename in pool/ directory (e.g.
> pool/escaux/d/dpkg/dpkg_1.15.8.12escaux1_i386.deb). If you publish two
> snapshots with conflicting packages like that, they would try to use the
> same path to store package file and aptly would complain about that. With
> -force-overwrite you would have one of the package files at that path, and
> you would have two Packages indexes referencing the same path, one of which
> would be wrong (like in your first message).
In this specific case of the dpkg package, I am fairly certain we only
have one package available (actually, this is my first attempt to
really start using aptly for our production hosts). I just today added
the dpkg package to the development repo (which adds it with
-force-overwrite, but there was nothing to overwrite), with the dev
prefix. Then I moved the package to the production repo with aptly
move. Then created a snapshot of the production repo and published it
in the prod prefix (without -force-overwrite).
Anyway, I did find the cause, and it was not aptly :-) We have a
daemon that looks for new files in a certain directory with inotify
and then adds those files. That daemon was adding the files even
before they were completely written. (watching the IN_CREATE event
instead of IN_CLOSE_WRITE).
Cheers,
Frederic
> On Tue, Mar 3, 2015 at 1:01 PM Frederic Van Espen <
frede...@gmail.com>
> wrote:
>>
>> On Tue, Mar 3, 2015 at 10:45 AM, Andrey Smirnov
>> <
smirnov...@gmail.com> wrote:
>> > Hi Frederic!
>>
>> Hello Andrey :-)
>>
>> > How have you added this package? Did it come from mirror? Manually to
>> > local
>> > repo? Have you used -force-overwrite while publishing?
>>
>> It is a package that was manually built and added to a local repo. It
>> was added to a development repo like this:
>> aptly repo -force-replace add baseline2-dev
>> /var/lib/aptly/incoming/baseline2-dev/dpkg_1.15.8.12escaux1_i386.deb
>>
>> Then a snapshot was created and published
>> aptly snapshot create baseline2-dev-20150303085519 from repo baseline2-dev
>> aptly publish -force-overwrite switch baseline2-dev dev
>> baseline2-dev-20150303085519
>>
>> Afterwards the package was moved to a "prod" repo:
>> aptly repo move baseline2-dev baseline2 'dpkg (= 1.15.8.12escaux1)'
>>
>> Then again a snapshot was created and published from the non-dev repo
>> and published in the same way as above, but with a prod prefix and
>> without force-overwrite:
>> aptly snapshot create baseline2-20150303090053 from repo baseline2
>> aptly publish switch baseline2 prod baseline2-20150303090053
>>
>>
>> Cheers,
>>
>> Frederic