🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.debian.bugs.dist
Article #6831

Bug#1155874: aptitude: Bugs in long-form package state/action fields with custom format string

#6831
From: Michael Vastola
Date: Mon, 30 Nov 2026 01:00
64 lines
7144 bytes
Source: aptitude
Version: 0.8.13-7ubuntu5
Severity: normal

Dear Maintainer,

I am attempting to write a script that parses the output of `aptitude 
search` formatted via a custom string passed alongside the `-F` argument.

For example, `aptitude  -F "%A %C %p" search '~b'` should list all 
broken packages, one per line, in three space-delimited columns (desired 
action, current state, and package name, respectively).

After seeing some weird output, I dug into the aptitude source code, and 
noticed at least two issues in `pkg_columnizer.cc` in the `debian-sid` 
(and `master`) branches of the aptitude source repository:

1) The first is that when showing the long-form version of the package's 
state (i.e. via `%C`), the state of a broken package is rendered as the 
single character `B`. The code for this is clearly seen at 
https://salsa.debian.org/apt-team/aptitude/-/blob/d24eb35bb7168169774b68b270b08f8079a2c9a5/src/pkg_columnizer.cc#L245-246.

2) The second is in the same source file when showing the long-form 
version of the pending action on the package (via `%A`). Particularly, 
while with the short-form `%a` (per lines 300-301), a package pending 
downgrade is rendered as a `w`, there is no equivalent conditional when 
using `%A`, which would seem to cause packages awaiting downgrade to 
render as 'none' in this column.

3) Lastly, in looking at the possible long-form outputs for these fields 
actions, I saw one more anomaly that probably doesn't rise to the level 
of "bug" but is nevertheless a departure from what is otherwise a 
convention: Specifically, |the pending ||action|| `||forbidden upgrade` 
is the sole action/state containing a whitespace character. All other 
values, (even, for example `||triggers-awaited`) contain hyphens in lieu 
of spaces even when a hyphen wouldn't be used in standard English. This, 
I imagine, was done to make the field easier when the output is used 
programmatically.|


Notes:
a) I'm an Ubuntu user, but this bug is clearly upstream in Debian, as 
seen in the source code.
b) I wasn't sure whether this should be prioritized as `minor` or 
`normal`. I opted for `normal`, even though these errors are arguably 
spelling errors because, since this feature is supported to allow the 
creation of machine-parsable output, spelling errors actually do impact 
basic functionality. (Also, at least in 2, the output is objectively 
incorrect.)
c) I do see that the git repo hasn't seen a commit to its main branches 
in over a year. I'm not sure if there's another VCS I should be looking 
at, but I at least see the error persists at 
https://sources.debian.org/src/aptitude/0.8.13-8.1/src/pkg_columnizer.cc

Thanks!
Mike Vastola


-- System Information:
Debian Release: forky/sid
APT prefers resolute-updates
APT policy: (500, 'resolute-updates'), (500, 'resolute-security'), (500, 
'resolute-proposed'), (500, 'resolute')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 6.17.0-41-generic (SMP w/32 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_CPU_OUT_OF_SPEC, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Thank you for using reportbug

Technical Details
Message-ID: <O4XUl-f1fH-1@gated-at.bofh.it>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.corradoroberto.it!diesel.cu.mi.it!bofh.it!news.nic.it!robomod
From: Michael Vastola <mike@vasto.la>
Newsgroups: linux.debian.bugs.dist
Subject: Bug#1155874: aptitude: Bugs in long-form package state/action fields with custom format string
Date: Mon, 30 Nov 2026 02:00:01 +0100
Message-ID: <O4XUl-f1fH-1@gated-at.bofh.it>
X-Original-To: submit@bugs.debian.org
X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org  Mon Nov 30 00:59:09 2026
Old-Return-Path: <debbugs@buxtehude.debian.org>
X-Spam-Flag: NO
X-Spam-Score: 0.858
Reply-To: Michael Vastola <mike@vasto.la>, 1155874@bugs.debian.org
Resent-To: debian-bugs-dist@lists.debian.org
Resent-Cc: aptitude-devel@lists.alioth.debian.org
X-Debian-Pr-Message: report 1155874
X-Debian-Pr-Package: src:aptitude
X-Debian-Pr-Source: aptitude
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Autocrypt: addr=mike@vasto.la; keydata=
 xjMEZV41iBYJKwYBBAHaRw8BAQdA7a97beDlLC6S7DfuTMHdqmXvjurdq562ZGFFQA4ayZrN
 K01pa2UgVmFzdG9sYSAoUGVyc29uYWwgVXNlKSA8bWlrZUB2YXN0by5sYT7CmQQTFgoAQRYh
 BL5blNPqnty78v1tHFmGPoTazIohBQJlXjWIAhsjBQkMbSN4BQsJCAcCAiICBhUKCQgLAgQW
 AgMBAh4HAheAAAoJEFmGPoTazIohCqUBAJT/NFSdzdEVo99KX/9qhuMuwlN17dhVUrPR6qwc
 e3sbAQCFhbnCgbNuTyh6C2lyToI3SFvTWoyWiMpWXTcTcaXQD844BGVeWE0SCisGAQQBl1UB
 BQEBB0DZ4b6lqhhFUFeEf+JXsFdWn/WBWz6tGoYZ8IL4tCxTLQMBCAfCfgQYFggAJhYhBL5b
 lNPqnty78v1tHFmGPoTazIohBQJlXlhNAhsMBQkJZgGAAAoJEFmGPoTazIohkt8BAJFXjrlA
 NxWaMmeSkj4hGr4/E2bs6sJRHIfpBJqeWPPqAQD81BXio7ZDu5fgWygRo7tSyiZ+NBIyuXcp
 tiEyjrMkCA==
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64
X-Virus-Status: Clean
Feedback-ID: ::1.us-east-1.u9+SD5BdFa3zuT9/7aG/caX5sf7TR5W8UK0R7DIXY+I=:AmazonSES
X-Ses-Outgoing: 2026.11.30-54.240.48.115
X-Greylist: delayed 1152 seconds by postgrey-1.37 at buxtehude; Mon, 30 Nov 2026 00:56:46 UTC
X-Debian-Message: from BTS
X-Mailing-List: <debian-bugs-dist@lists.debian.org> archive/latest/2006019
List-ID: <debian-bugs-dist.lists.debian.org>
List-URL: <https://lists.debian.org/debian-bugs-dist/>
Approved: robomod@news.nic.it
Lines: 64
Organization: linux.* mail to news gateway
Sender: robomod@news.nic.it
X-Original-Date: Mon, 30 Nov 2026 00:37:31 +0000
X-Original-Message-ID: <010001a229e2b09a-76f44a7b-9918-4027-b437-4a4c5dfbced8-000000@email.amazonses.com>