#1133353 pkg-perl-tools: dpt fixup: dependency order pingpong

#1133353#5
Date:
2026-04-12 10:48:03 UTC
From:
To:
Dear Maintainer,

when I run "dpt fixup" on a package, that's up to date, the following
two commits are (always) added:

commit 762559a45091bac8168b7d26299e58000340a537 (HEAD -> debian/latest)
Author: Roland Rosenfeld <roland@debian.org>
Date:   Sun Apr 12 10:18:55 2026 +0000

    (Re-)sort dependencies

    Gbp-Dch: ignore

diff --git a/debian/control b/debian/control
index e372adf..33eab79 100644
--- a/debian/control
+++ b/debian/control
@@ -24,12 +24,12 @@ Package: fig2dev
 Architecture: any
 Multi-Arch: foreign
 Depends:
+ ${misc:Depends},
+ ${shlibs:Depends},
  gawk,
  ghostscript,
  netpbm,
  x11-common,
- ${misc:Depends},
- ${shlibs:Depends},
 Suggests:
  xfig,
 Breaks:

commit 8999f9b6e4b80c281a591e90a324154cc5383fcd
Author: Roland Rosenfeld <roland@debian.org>
Date:   Sun Apr 12 10:18:48 2026 +0000

    Reformat debian/control.

    Gbp-Dch: ignore

diff --git a/debian/control b/debian/control
index 33eab79..e372adf 100644
--- a/debian/control
+++ b/debian/control
@@ -24,12 +24,12 @@ Package: fig2dev
 Architecture: any
 Multi-Arch: foreign
 Depends:
- ${misc:Depends},
- ${shlibs:Depends},
  gawk,
  ghostscript,
  netpbm,
  x11-common,
+ ${misc:Depends},
+ ${shlibs:Depends},
 Suggests:
  xfig,
 Breaks:

As you can see, first "Reformat debian/control." happens, which sorts
the ${...} dependencies to the bottom (this is
"wrap-and-sort -ast -f debian/control" from scripts/fixup line 23).
Then "(Re-)sort dependencies" sorts these entries to the top of the
Dependencies block (this is
"cme modify dpkg-control "binary:~/./ Depends:.sort Recommends:.sort Suggests:.sort Breaks:.sort Replaces:.sort Conflicts:.sort Provides:.sort"
from line 124 of the same script).

From my point of view these should not differ in their order but use
the same algorithm.  At least they should not trigger two commits in
dpt fixup, that's why I report it here

All this with current Debian sid:

devscripts                 2.26.7
pkg-perl-tools             0.85
cme                        1.047-1
libconfig-model-dpkg-perl  3.020

I'm sure, that this problem didn't exist in January, but don't see
what exact change triggered the issue.  As the version with ${...} is
in my git history for a longer time, the behavior of wrap-and-sort
must have changed, but wrap-and-sort from devscripts (2.25.15+deb13u1)
on my trixie system behaves in the same way.

So I'm out of ideas, what's going wrong, maybe someone else can
reproduce the issue...

Greetings
Roland

#1133353#16
Date:
2026-04-12 14:50:48 UTC
From:
To:
Control: retitle -1 pkg-perl-tools: dpt fixup: dependency order pingpong
Control: found -1 0.86

Yes, that's indeed annoying, and I'm the one (partially :))
responsible for it.

That would be ideal indeed.

 From pkg-perl-tools changelog:

pkg-perl-tools (0.86) unstable; urgency=medium

   * dpt-fixup: (temporarily) adjust to changes in
     libconfig-model-dpkg-perl (cf. #1125967).

wrap-and-sort wasn't used in dpt-fixup before pkg-perl-tools 0.86.

The (original) change was in libconfig-model-dpkg-perl.

Then I played around with various options and opted for using
wrap-and-sort for the time being, but this can lead to this double
change as wrap-and-sort/cme/debputy almost but not completely agree
on the formatting …

/*
In libconfig-model-dpkg-perl's git I found
b47f787095a12e708ac572dbfce245b212181ac8:

     Dpkg backend: use style like wrap-and-sort -ast

     See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=849498#32 for
     rationale
*/


So yeah, we could switch dpt-fixup back to use cme (instead of
wrap-and-sort); this would avoid _this_ annoyance but on the other
hand might introduce changes which are more than just reformatting
(that's #1125967).


Cheers,
gregor

#1133353#25
Date:
2026-04-13 14:38:06 UTC
From:
To:
Hi gregor!

If we define that "wrap-and-sort" does sorting the fields in our
preferred order, we could add another call of
 wrap-and-sort -ast -f debian/control
after the "cme modify dpkg-control" calls in lines 123/124.
This isn't a very clean solution, but avoids the pingpong, since it
always results in the order defined by wrap-and-sort.

(everything is better than the pingpong in the git history ;-)

Greetings
Roland

#1133353#30
Date:
2026-04-19 22:13:03 UTC
From:
To:
Probably because of the condition you mention:
"If we define that "wrap-and-sort" does sorting the fields"
and I personally tried to find something that sticks to cme's
ordering, as I find the order used by wrap-and-sort and debputy ugly
:)

I tried now to switch back from wrap-and-sort to
`cme modify dpkg-control -save` and run dpt-fixup on an "old"
package, and this looks good.

#1125967 still bites us for the next step, updating
Standards-Version; here cme will also drop Priority:optional; but we
can keep doing this with sed.


I've pushed this change so that you and others can try it as well but
will wait with an upload.


Cheers,
gregor

#1133353#33
Date:
2026-04-19 22:12:31 UTC
From:
To:
Hello,

Bug #1133353 in pkg-perl-tools reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/perl-team/modules/packages/pkg-perl-tools/-/commit/aee029cbc6ef2d3897c404c387d65753d16c3a1e
------------------------------------------------------------------------
dpt-fixup: let cme do the reformatting of debian/control again

to avoid changes in the sort order of fields.

Closes: #1133353
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1133353