Bug#990224: [Pkg-pascal-devel] Bug#990224: leaves diversion after upgrade from sid to experimental

2021-12-11 Thread Abou Al Montacir
Hi Paul,

Thank you for spotting this out, I did not notice it during my tests before
uploading.

On Thu, 2021-12-09 at 08:50 +0100, Paul Gevers wrote:
> Hi
> 
> As a note, this doesn't look pretty during upgrade:
> 
> Unpacking lazarus-src-2.0 (2.0.12+dfsg-6) over (2.0.12+dfsg-5) ...
> Removing 'diversion of 
> /usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk to 
> /usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk.orig by 
> lazarus-src-2.0'
> dpkg-divert: error: rename involves overwriting 
> '/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk' with
>    different file 
> '/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk.orig', not 
> allowed
> dpkg: warning: old lazarus-src-2.0 package post-removal script 
> subprocess returned error exit status 2
> dpkg: trying script from the new package instead ...
> dpkg: ... it looks like that went OK
It looks like the logic does not account for upgrading for the same upstream
version. 
This is really annoying and I'll appreciate any help for it.
I'm more and more convinced that using arch:all packages for distributing the
.lpk files is the right solution for this problem.
This diversion stuff looks really ugly.
-- 
Cheers,
Abou Al Montacir



signature.asc
Description: This is a digitally signed message part


Bug#990224: leaves diversion after upgrade from sid to experimental

2021-12-08 Thread Paul Gevers

Hi

As a note, this doesn't look pretty during upgrade:

Unpacking lazarus-src-2.0 (2.0.12+dfsg-6) over (2.0.12+dfsg-5) ...
Removing 'diversion of 
/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk to 
/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk.orig by 
lazarus-src-2.0'
dpkg-divert: error: rename involves overwriting 
'/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk' with
  different file 
'/usr/lib/lazarus/2.0.12/components/codetools/ide/cody.lpk.orig', not 
allowed
dpkg: warning: old lazarus-src-2.0 package post-removal script 
subprocess returned error exit status 2

dpkg: trying script from the new package instead ...
dpkg: ... it looks like that went OK

Paul


OpenPGP_signature
Description: OpenPGP digital signature


Bug#990224: [Pkg-pascal-devel] Bug#990224: Bug#990224: Bug#990224: leaves diversion after upgrade from sid to experimental

2021-11-21 Thread Abou Al Montacir
Hi Paul and All,

On Wed, 2021-11-03 at 10:15 +0100, Abou Al Montacir wrote:
> On Tue, 2021-11-02 at 22:52 +0100, Paul Gevers wrote:
> > My point is that even if we replace the mechanism, we still need to
> > remove the existing diversions from the version in testing, when
> > upgrading to the version in unstable.
> Sorry, you are right, I totally missed the main point here, that the 2.0.10 is
> in stable and in testing, and that we need a solution for the next release
> upgrade.
> Then, indeed your solution is the way to go, unless it is possible to get the
> list of diverted files for 2.0.10 from /var/lib/dpkg/diversions or any other
> mean as per example grep lazarus/2.0.10 /var/lib/dpkg/diversions.

Can you please have a look at [1] and verify that it fixes this issue. I think
I've covered all the cases.

[1] 
https://salsa.debian.org/pascal-team/lazarus/-/commit/471acbe3b95857815a19fe127e7c43429b272b29
-- 
Cheers,
Abou Al Montacir


signature.asc
Description: This is a digitally signed message part


Bug#990224: [Pkg-pascal-devel] Bug#990224: Bug#990224: leaves diversion after upgrade from sid to experimental

2021-11-03 Thread Abou Al Montacir
Hi Paul

On Tue, 2021-11-02 at 22:52 +0100, Paul Gevers wrote:
> My point is that even if we replace the mechanism, we still need to
> remove the existing diversions from the version in testing, when
> upgrading to the version in unstable.
Sorry, you are right, I totally missed the main point here, that the 2.0.10 is
in stable and in testing, and that we need a solution for the next release
upgrade.
Then, indeed your solution is the way to go, unless it is possible to get the
list of diverted files for 2.0.10 from /var/lib/dpkg/diversions or any other
mean as per example grep lazarus/2.0.10 /var/lib/dpkg/diversions.
-- 
Cheers,
Abou Al Montacir


signature.asc
Description: This is a digitally signed message part


Bug#990224: [Pkg-pascal-devel] Bug#990224: leaves diversion after upgrade from sid to experimental

2021-11-02 Thread Paul Gevers
Hi Abou,

On 02-11-2021 22:37, Abou Al Montacir wrote:
> On Tue, 2021-11-02 at 21:22 +0100, Paul Gevers wrote:
>> I don't follow at all.
> Sorry, I don't catch what do you mean here, probably due to my non
> native English.

It means that I didn't understand everything you were saying as the
problem at hand looked much simpler than your solution. I didn't
understand why you needed the current or future solution, I am just
trying to solve the actual bug in this report.

> Did you not accept the new solution, or is my explanation above not
> clear at all and confusing? 

I didn't try extremely hard to understand the real problem, but ...

> If you don't like the new solution, it is fine with me. We can try to
> fix the current one. Otherwise, please let me know and I can try to
> explain it a bit more.

If you come with a more elegant solution for the problem you try to
tackle, I think we *still* need to solve this particular bug report as
the problem is embedded in the package currently in testing.

>>  We're doing diversions in maintainer scripts and
>> we forget to properly keep track of our diversions.
> The list of diverted files is created automatically during the build
> process in  lazarus-src.preinst.[1]

I know.

> The very same list is created for lazarus-src.postrm.[2]

Yes, but the list for 2.0.12 is apparently not the same and missing
files compared to 2.0.10.

>>  With the new
>> upstream version, apparently some files got dropped and the knowledge of
>> the diversions got lost in the process.
> This means that somehow, the lazarus-src.postrm was not called.

Because 2.0.10 was upgraded to 2.0.12 and then 2.0.12 was removed.

>>  I think we can easily manually
>> drop the diversions now by adding them here [1], while contemplating a
>> saner and automated way of handling the underlying problem.

> In the current case,  lazarus-src.postrm is not called or is called but
> does not fall in the list of tests we are doing (called with upgrade?).

I understand the problem is that we first upgrade and then remove. The
embedded list in 2.0.12 is not listing all files we had in 2.0.10.

> However, in the past we did not remove the old lazarus when the new one
> is installed (we were able to have 2.0.10 and 2.0.12). Now we allow this
> only for major releases, not maintenance ones.

You're confusing me.

> So next time, soon, when
> 2.2 will be there, the upgrade will not happen in the same way.
> So if upgrading from 2.0.10 to 2.0.x we should remove diversions, but
> not if we go to from 2.0.10 to 2.y with y > 0.

> That was why I proposed to completely replace this mechanism with an
> other one that let it handled automatically with dpkg, but maybe we can
> just fix the logic in [3].

My point is that even if we replace the mechanism, we still need to
remove the existing diversions from the version in testing, when
upgrading to the version in unstable.

Paul



OpenPGP_signature
Description: OpenPGP digital signature


Bug#990224: leaves diversion after upgrade from sid to experimental

2021-11-02 Thread Abou Al Montacir
Hi Paul,

On Tue, 2021-11-02 at 21:22 +0100, Paul Gevers wrote:
> ...
> I don't follow at all.
Sorry, I don't catch what do you mean here, probably due to my non native
English.
Did you not accept the new solution, or is my explanation above not clear at all
and confusing? 
If you don't like the new solution, it is fine with me. We can try to fix the
current one. Otherwise, please let me know and I can try to explain it a bit
more.
>  We're doing diversions in maintainer scripts and
> we forget to properly keep track of our diversions.
The list of diverted files is created automatically during the build process in
 lazarus-src.preinst.[1]
The very same list is created for lazarus-src.postrm.[2]
>  With the new
> upstream version, apparently some files got dropped and the knowledge of
> the diversions got lost in the process.
This means that somehow, the lazarus-src.postrm was not called.
>  I think we can easily manually
> drop the diversions now by adding them here [1], while contemplating a
> saner and automated way of handling the underlying problem.
In the current case,  lazarus-src.postrm is not called or is called but does not
fall in the list of tests we are doing (called with upgrade?).
However, in the past we did not remove the old lazarus when the new one is
installed (we were able to have 2.0.10 and 2.0.12). Now we allow this only for
major releases, not maintenance ones. So next time, soon, when 2.2 will be
there, the upgrade will not happen in the same way.
So if upgrading from 2.0.10 to 2.0.x we should remove diversions, but not if we
go to from 2.0.10 to 2.y with y > 0.

That was why I proposed to completely replace this mechanism with an other one
that let it handled automatically with dpkg, but maybe we can just fix the logic
in [3].

[1] https://salsa.debian.org/pascal-team/lazarus/-/blob/master/debian/rules#L411
[2] https://salsa.debian.org/pascal-team/lazarus/-/blob/master/debian/rules#L423
[3] 
https://salsa.debian.org/pascal-team/lazarus/-/blob/master/debian/lazarus-src.postrm.in#L7
-- 
Cheers,
Abou Al Montacir


signature.asc
Description: This is a digitally signed message part