这是indexloc提供的服务,不要输入任何密码

Debian Bug report logs - #1099825
`dpkg -l doesnotexist` runs pager with empty contents, with errors hidden by the pager

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg (PTS, buildd, popcon).

Reported by: Josh Triplett <josh@joshtriplett.org>

Date: Sat, 8 Mar 2025 15:33:02 UTC

Severity: normal

Found in version dpkg/1.22.17

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, josh@joshtriplett.org, Dpkg Developers <debian-dpkg@lists.debian.org>:
Bug#1099825; Package dpkg. (Sat, 08 Mar 2025 15:33:02 GMT) (full text, mbox, link).


Message #3 received at submit@bugs.debian.org (full text, mbox, reply):

From: Josh Triplett <josh@joshtriplett.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: `dpkg -l doesnotexist` runs pager with empty contents, with errors hidden by the pager
Date: Sat, 08 Mar 2025 07:28:26 -0800
Package: dpkg
Version: 1.22.17
Severity: normal
X-Debbugs-Cc: josh@joshtriplett.org

If you run `dpkg -l doesnotexist`, it launches a pager showing
completely empty output, while printing the error
`dpkg-query: no packages found matching doesnotexist`
outside of the pager, hidden until exiting the pager.

`dpkg -l dpkg doesnotexist` will show the output for `dpkg` in the
pager, while showing the error for `doesnotexist` outside the pager.
That's slightly less of an issue because the pager screen isn't
completely blank, but it still doesn't seem ideal.

In the case where there's *zero* output, I think dpkg shouldn't be
launching the pager at all.

In the case where there's *some* output, ideally I'd love to have the
error output sent to the pager as well when automatically launching a
pager, if stdout and stderr are both pointing to a terminal, and only
kept separate when *not* launching a pager or if stderr is going
somewhere else.

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 6.12.17-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dpkg depends on:
ii  libbz2-1.0   1.0.8-6
ii  libc6        2.41-3
ii  liblzma5     5.6.4-1
ii  libmd0       1.1.0-2+b1
ii  libselinux1  3.8-4
ii  libzstd1     1.5.6+dfsg-2
ii  tar          1.35+dfsg-3.1
ii  zlib1g       1:1.3.dfsg+really1.3.1-1+b1

dpkg recommends no packages.

Versions of packages dpkg suggests:
ii  apt            2.9.31
pn  debsig-verify  <none>

-- no debconf information



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Tue Jul 29 02:10:15 2025; Machine Name: berlioz

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.