[Debconf-devel] Bug#968814: debconf-utils: Sort the output of debconf-get-selections

Lisandro Damián Nicanor Pérez Meyer lisandro at debian.org
Fri Aug 21 16:00:01 BST 2020

Package: debconf-utils
Version: 1.5.74
Severity: wishlist
Tags: patch
X-Debbugs-Cc: jwilk at debian.org

Hi! While working with debconf-get-selections I've found the need to sort the
output to make it easier to diff it against other configurations.

Jakub Wilk (CCed) was kind enough to provide a patch which I'm attaching,
and he agreed to me forwarding it here.

Please consider applying it.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'buildd-unstable'), (500, 'testing'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64, armhf

Kernel: Linux 5.7.0-2-amd64 (SMP w/4 CPU threads)
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8), LANGUAGE=es_AR:es
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages debconf-utils depends on:
ii  debconf  1.5.74

debconf-utils recommends no packages.

debconf-utils suggests no packages.

-- no debconf information
-------------- next part --------------
--- unpacked/usr/bin/debconf-get-selections	2020-04-18 13:10:08.000000000 +0200
+++ /usr/bin/debconf-get-selections	2020-08-21 15:18:42.663503841 +0200
@@ -53,8 +53,11 @@
 my $qi = Debconf::Question->iterator;
+my @qs;
 while (my $q = $qi->iterate) {
+	push @qs, $q;
+for my $q (sort { $a->name cmp $b->name } @qs) {
 	my ($name, $type, $value) = ($q->name, $q->type, $q->value);
 	next if (! length $type || $type eq 'text' || $type eq 'title');
 	print "# ".$q->description."\n";

More information about the Debconf-devel mailing list