[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#776840: marked as done (apt: Cannot install vera++ without other regex-matching packages)



Your message dated Thu, 9 Mar 2023 15:23:07 +0100
with message-id <[🔎] 20230309142307.xk5freap3d2syubw@crossbow>
and subject line Re: Bug#716763: apt: Man page of apt-cache dont mentions regex on operations with pkg argument , except from 'search'
has caused the Debian Bug report #776840,
regarding apt: Cannot install vera++ without other regex-matching packages
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
776840: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=776840
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Version: 1.0.9.6
Severity: normal
Tags: upstream

Dear Maintainer,

When installing vera++, it considers "vera++" as a regex, and selects a
lot of unrelated packages:

# apt-get install -s vera++
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libtest-pod-coverage-perl' for regex 'vera+'
Note, selecting 'libcoverart-dbg' for regex 'vera+'
Note, selecting 'vera++' for regex 'vera+'
Note, selecting 'libcoverart-dev' for regex 'vera+'
Note, selecting 'libpod-coverage-trustpod-perl' for regex 'vera+'
Note, selecting 'libcoverart-doc' for regex 'vera+'
Note, selecting 'ruby-coveralls' for regex 'vera+'
Note, selecting 'libcoverart0' for regex 'vera+'
Note, selecting 'python3-coverage' for regex 'vera+'
Note, selecting 'dict-vera' for regex 'vera+'
Note, selecting 'php-codecoverage' for regex 'vera+'
Note, selecting 'node-jscoverage' for regex 'vera+'
Note, selecting 'vera' for regex 'vera+'
Note, selecting 'python-coverage' for regex 'vera+'
Note, selecting 'ttf-bitstream-vera' for regex 'vera+'
Note, selecting 'ttf-adf-verana' for regex 'vera+'
Note, selecting 'python3-coverage-dbg' for regex 'vera+'
Note, selecting 'python-coverage-dbg' for regex 'vera+'
Note, selecting 'banshee-extension-liveradio' for regex 'vera+'
Note, selecting 'libpod-coverage-perl' for regex 'vera+'
Note, selecting 'python-coverage-test-runner' for regex 'vera+'

A trick is to add a '+', but this is odd:

# apt-get install -s vera+++


Also, escaping the '+' does not work:

# apt-get install -s 'vera\+\+'
…
E: Couldn't find any package by regex 'vera\+\'


However, this works:

# apt-get install -s 'vera\+\+$'


-- Package-specific info:

-- apt-config dump --

APT "";
APT::Architecture "amd64";
APT::Build-Essential "";
APT::Build-Essential:: "build-essential";
APT::Install-Recommends "true";
APT::Install-Suggests "0";
APT::Authentication "";
APT::Authentication::TrustCDROM "true";
APT::NeverAutoRemove "";
APT::NeverAutoRemove:: "^firmware-linux.*";
APT::NeverAutoRemove:: "^linux-firmware$";
APT::NeverAutoRemove:: "^linux-image-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-image-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^linux-headers-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-headers-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^linux-image-extra-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-image-extra-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^linux-signed-image-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-signed-image-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-image-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-image-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-headers-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^kfreebsd-headers-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^gnumach-image-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^gnumach-image-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^.*-modules-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^.*-modules-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^.*-kernel-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^.*-kernel-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-backports-modules-.*-3\.16-3-amd64$";
APT::NeverAutoRemove:: "^linux-tools-3\.16\.0-4-amd64$";
APT::NeverAutoRemove:: "^linux-tools-3\.16-3-amd64$";
APT::VersionedKernelPackages "";
APT::VersionedKernelPackages:: "linux-image";
APT::VersionedKernelPackages:: "linux-headers";
APT::VersionedKernelPackages:: "linux-image-extra";
APT::VersionedKernelPackages:: "linux-signed-image";
APT::VersionedKernelPackages:: "kfreebsd-image";
APT::VersionedKernelPackages:: "kfreebsd-headers";
APT::VersionedKernelPackages:: "gnumach-image";
APT::VersionedKernelPackages:: ".*-modules";
APT::VersionedKernelPackages:: ".*-kernel";
APT::VersionedKernelPackages:: "linux-backports-modules-.*";
APT::VersionedKernelPackages:: "linux-tools";
APT::Never-MarkAuto-Sections "";
APT::Never-MarkAuto-Sections:: "metapackages";
APT::Never-MarkAuto-Sections:: "restricted/metapackages";
APT::Never-MarkAuto-Sections:: "universe/metapackages";
APT::Never-MarkAuto-Sections:: "multiverse/metapackages";
APT::Never-MarkAuto-Sections:: "oldlibs";
APT::Never-MarkAuto-Sections:: "restricted/oldlibs";
APT::Never-MarkAuto-Sections:: "universe/oldlibs";
APT::Never-MarkAuto-Sections:: "multiverse/oldlibs";
APT::Update "";
APT::Update::Post-Invoke-Success "";
APT::Update::Post-Invoke-Success:: "[ ! -f /var/run/dbus/system_bus_socket ] || /usr/bin/dbus-send --system --dest=org.debian.apt --type=signal /org/debian/apt org.debian.apt.CacheChanged || true";
APT::Update::Post-Invoke-Success:: "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
APT::Architectures "";
APT::Architectures:: "amd64";
APT::Compressor "";
APT::Compressor::. "";
APT::Compressor::.::Name ".";
APT::Compressor::.::Extension "";
APT::Compressor::.::Binary "";
APT::Compressor::.::Cost "1";
APT::Compressor::gzip "";
APT::Compressor::gzip::Name "gzip";
APT::Compressor::gzip::Extension ".gz";
APT::Compressor::gzip::Binary "gzip";
APT::Compressor::gzip::Cost "2";
APT::Compressor::gzip::CompressArg "";
APT::Compressor::gzip::CompressArg:: "-9n";
APT::Compressor::gzip::UncompressArg "";
APT::Compressor::gzip::UncompressArg:: "-d";
APT::Compressor::bzip2 "";
APT::Compressor::bzip2::Name "bzip2";
APT::Compressor::bzip2::Extension ".bz2";
APT::Compressor::bzip2::Binary "bzip2";
APT::Compressor::bzip2::Cost "3";
APT::Compressor::bzip2::CompressArg "";
APT::Compressor::bzip2::CompressArg:: "-9";
APT::Compressor::bzip2::UncompressArg "";
APT::Compressor::bzip2::UncompressArg:: "-d";
APT::Compressor::xz "";
APT::Compressor::xz::Name "xz";
APT::Compressor::xz::Extension ".xz";
APT::Compressor::xz::Binary "xz";
APT::Compressor::xz::Cost "4";
APT::Compressor::xz::CompressArg "";
APT::Compressor::xz::CompressArg:: "-6";
APT::Compressor::xz::UncompressArg "";
APT::Compressor::xz::UncompressArg:: "-d";
APT::Compressor::lzma "";
APT::Compressor::lzma::Name "lzma";
APT::Compressor::lzma::Extension ".lzma";
APT::Compressor::lzma::Binary "xz";
APT::Compressor::lzma::Cost "5";
APT::Compressor::lzma::CompressArg "";
APT::Compressor::lzma::CompressArg:: "--format=lzma";
APT::Compressor::lzma::CompressArg:: "-9";
APT::Compressor::lzma::UncompressArg "";
APT::Compressor::lzma::UncompressArg:: "--format=lzma";
APT::Compressor::lzma::UncompressArg:: "-d";
Dir "/";
Dir::State "var/lib/apt/";
Dir::State::lists "lists/";
Dir::State::cdroms "cdroms.list";
Dir::State::mirrors "mirrors/";
Dir::State::extended_states "extended_states";
Dir::State::status "/var/lib/dpkg/status";
Dir::Cache "var/cache/apt/";
Dir::Cache::archives "archives/";
Dir::Cache::srcpkgcache "srcpkgcache.bin";
Dir::Cache::pkgcache "pkgcache.bin";
Dir::Etc "etc/apt/";
Dir::Etc::sourcelist "sources.list";
Dir::Etc::sourceparts "sources.list.d";
Dir::Etc::vendorlist "vendors.list";
Dir::Etc::vendorparts "vendors.list.d";
Dir::Etc::main "apt.conf";
Dir::Etc::netrc "auth.conf";
Dir::Etc::parts "apt.conf.d";
Dir::Etc::preferences "preferences";
Dir::Etc::preferencesparts "preferences.d";
Dir::Etc::trusted "trusted.gpg";
Dir::Etc::trustedparts "trusted.gpg.d";
Dir::Bin "";
Dir::Bin::methods "/usr/lib/apt/methods";
Dir::Bin::solvers "";
Dir::Bin::solvers:: "/usr/lib/apt/solvers";
Dir::Bin::dpkg "/usr/bin/dpkg";
Dir::Bin::bzip2 "/bin/bzip2";
Dir::Bin::xz "/usr/bin/xz";
Dir::Bin::lzma "/usr/bin/xz";
Dir::Media "";
Dir::Media::MountPath "/media/cdrom";
Dir::Log "var/log/apt";
Dir::Log::Terminal "term.log";
Dir::Log::History "history.log";
Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";
Acquire "";
Acquire::cdrom "";
Acquire::cdrom::mount "/media/cdrom";
Acquire::Languages "";
Acquire::Languages:: "en";
Acquire::Languages:: "none";
Acquire::Languages:: "zh";
Acquire::Languages:: "eo";
Acquire::Languages:: "nb";
Acquire::Languages:: "es";
Acquire::Languages:: "it";
Acquire::Languages:: "km";
Acquire::Languages:: "da";
Acquire::Languages:: "eu";
Acquire::Languages:: "ro";
Acquire::Languages:: "sr";
Acquire::Languages:: "sv";
Acquire::Languages:: "ru";
Acquire::Languages:: "ko";
Acquire::Languages:: "pt";
Acquire::Languages:: "hr";
Acquire::Languages:: "uk";
Acquire::Languages:: "sk";
Acquire::Languages:: "fi";
Acquire::Languages:: "pl";
Acquire::Languages:: "ca";
Acquire::Languages:: "hu";
Acquire::Languages:: "nl";
Acquire::Languages:: "fr";
Acquire::Languages:: "de";
Acquire::Languages:: "ja";
Acquire::Languages:: "vi";
Acquire::Languages:: "id";
Acquire::Languages:: "cs";
DPkg "";
DPkg::Pre-Install-Pkgs "";
DPkg::Pre-Install-Pkgs:: "/usr/bin/apt-listchanges --apt || test $? -ne 10";
DPkg::Pre-Install-Pkgs:: "/usr/sbin/dpkg-preconfigure --apt || true";
DPkg::Tools "";
DPkg::Tools::Options "";
DPkg::Tools::Options::/usr/bin/apt-listchanges "";
DPkg::Tools::Options::/usr/bin/apt-listchanges::Version "2";
DPkg::Post-Invoke "";
DPkg::Post-Invoke:: "/usr/bin/test -e /usr/share/dbus-1/system-services/org.freedesktop.PackageKit.service && /usr/bin/test -S /var/run/dbus/system_bus_socket && /usr/bin/gdbus call --system --dest org.freedesktop.PackageKit --object-path /org/freedesktop/PackageKit --timeout 4 --method org.freedesktop.PackageKit.StateHasChanged cache-update > /dev/null; /bin/echo > /dev/null";
Unattended-Upgrade "";
Unattended-Upgrade::Origins-Pattern "";
Unattended-Upgrade::Origins-Pattern:: "origin=Debian,archive=${distro_codename},label=Debian-Security";
CommandLine "";
CommandLine::AsString "apt-config dump";

-- (no /etc/apt/preferences present) --


-- /etc/apt/sources.list --

# 

# deb cdrom:[Debian GNU/Linux wheezy-DI-a1 _Wheezy_ - Official Snapshot amd64 xfce+lxde-CD Binary-1 20120511-17:57]/ wheezy main

#deb cdrom:[Debian GNU/Linux wheezy-DI-a1 _Wheezy_ - Official Snapshot amd64 xfce+lxde-CD Binary-1 20120511-17:57]/ wheezy main

#deb http://ftp.fr.debian.org/debian/ wheezy main non-free contrib
#deb-src http://ftp.fr.debian.org/debian/ wheezy main non-free contrib

#deb http://ftp.fr.debian.org/debian/ wheezy main
#deb http://ftp.fr.debian.org/debian/ testing main

deb http://ftp.fr.debian.org/debian/ sid main
deb-src http://ftp.fr.debian.org/debian/ sid main

#deb http://ftp.fr.debian.org/debian/ experimental main #non-free contrib

#deb http://security.debian.org/ wheezy/updates main contrib non-free
#deb-src http://security.debian.org/ wheezy/updates main contrib non-free

#deb http://www.deb-multimedia.org wheezy main non-free

#deb http://www.emdebian.org/debian/ wheezy main

-- System Information:
Debian Release: 8.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages apt depends on:
ii  debian-archive-keyring  2014.3
ii  gnupg                   1.4.18-6
ii  libapt-pkg4.12          1.0.9.6
ii  libc6                   2.19-13
ii  libgcc1                 1:4.9.2-10
ii  libstdc++6              4.9.2-10

apt recommends no packages.

Versions of packages apt suggests:
pn  apt-doc     <none>
ii  aptitude    0.6.11-1+b1
ii  dpkg-dev    1.17.23
ii  python-apt  0.9.3.11
ii  synaptic    0.81.3

-- no debconf information

--- End Message ---
--- Begin Message ---
On Wed, Mar 08, 2023 at 11:28:18PM +0100, Nis Martensen wrote:
> On 12 Jul 2013 Prekates Alexandros wrote:
> > Man page of apt-cache dont mentions regex on operations with pkg argument
> > ,except from 'search'
> > 
> > But i tested in wheezy and i see that using regex with operation like show ,
> > showpkg  works.

(For MultiArch – merged around 0.8 in 2010 – I rewrote the command line
 parsing for all tools to have them all behave somewhat similar. The
 bigger ones like 'show' "always" supported regex, but it e.g. didn't
 handle "foobar:armel/experimental" and I didn't want to write
 more or less the same thing 10+ times. The documentation always only
 speaks about package names for those commands even through you could
 even back than do a lot of other things as well… the docs never
 mentioned all of this all to explicitly in a lot of places. Honestly,
 I think most users couldn't handle the truth, but our docs are just
 in general in need of a revamp, so perhaps some day I am proven wrong
 by someone who rewrites them)


> Is there a recommended way to request a literal package name match from
> apt-cache show?

With apt-patterns nowadays, I presume the answer is:
apt-cache show '?exact-name(vera++)'

Note that in a Multi-Arch context multiple packages with that exact name
exist – e.g. vera++:amd64 and vera++:i386, so you might have to make
further selections with more patterns. I don't really use them, so not
really much of an expert on them. See apt-patterns(7).


That selection is done for you if you do 'apt-cache show vera++' as it
will assume that you are interested in information for the package
which would be installed if you were doing 'apt-get install vera++'.
(Yes, that is a recursive definition)

That works, because 'vera++' is a real binary package name and apt
checks if a package with that name exists before it tries regex matches
or assumes the postfix '+' is a modifier indication that this package
should be installed (aka: apt-get remove vera+++ # installs vera++).

That means that if what you provided is for whatever reason not a real
binary package name apt goes looking for what you could have possibly
meant, similar to how 'install' goes looking for what you might have
meant, like a package from another architecture with that name or
a glob, a regex, a task or a single-provider of a virtual package, …


> In reportbug we are parsing the output of apt-cache show to obtain
> information on available packages. This does not always work correctly
> if the package name includes "+" or ".", see #1031924 for an example bug
> report.

To use Simons examples from #1031924 (reordered for my benefit):

| freefem++ -> (correct)
| hello -> (correct)

is an existing binary package (that it is also a source
package name is of no concern for 'show')

| dbus-c++ -> dbus-cpp
| gtk+2.0 -> librcc
| lucene++ -> lucene-solr
| gtk+3.0 -> wxpython3.0

is a source package, no binary package with that name exists.  apt
interprets them hence as regexes and so likely multiple stanzas for
multiple matching packages are produced. Funnily enough gtk+3.0 doesn't
even produce binary packages which match (while gtk+2.0 does, but both
just as sidenote, it makes no difference for apt).

| gtk4 -> (correct)

Neither an existing binary nor a regex or anything else apt can
make sense of, so no package can be found. I presume reportbug has
a fallback or whatever which ends up doing the right thing for source
packages?


Arguably, providing a source package name to reportbug is incorrect
usage if I understand its man page right. In any case it is incorrect
usage for "apt-cache show" as it doesn't know source packages, you
would have to use "apt-cache showsrc" for those.


> Should we just re.escape() the package name before passing it to
> apt-cache show? Or is there a risk of this breaking with future versions
> of apt (e.g., if apt is changed to address #776840)?

#776840 was addressed years before it was reported with the code
I commented on in the beginning. Indeed, going back and compiling
1.0.9.6 and running it against ~todays data gives the intended result:

~$ apt-get -v | head -n 1
apt 1.0.9.6 for amd64 compiled on Mar  9 2023 13:27:46
~$ apt-get install -s vera++
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libboost-wave1.74.0
The following NEW packages will be installed:
  libboost-wave1.74.0 vera++
0 upgraded, 2 newly installed, 0 to remove and 1 not upgraded.
Inst libboost-wave1.74.0 (1.74.0+ds1-20 Debian:unstable [amd64])
Inst vera++ (1.2.1-2+b7 Debian:11.6/stable, Debian:unstable, Debian:testing [amd64])
Conf libboost-wave1.74.0 (1.74.0+ds1-20 Debian:unstable [amd64])
Conf vera++ (1.2.1-2+b7 Debian:11.6/stable, Debian:unstable, Debian:testing [amd64])

I am therefore taking the liberty to close this referenced bugreport
via a CC of this message. The rest of this message should shine some
light on why this might have happened back in the day and what could
possible be done (nowadays). In either case, its not really a bug,
"just" a communication mismatch between users and apt-* tools which
can not be changed even if we wanted to (= foreshadowing a comment
regarding 'apt').

Also, as a side note, be careful with your shell! It might interpret
things for you as well. If all else fails btw, you can just go full
regex btw as the initial message in the bugreport already said.


apt (not apt-*) has those unanchored regexes disabled by default,
so as it is Christmas^Wfreeze I suppose you could also workaround your
problem in reportbug with a little config option:

| $ apt-cache show dbus-c++ | grep -e ^Package: | wc -l
| 28
| $ apt-cache show dbus-c++ -o APT::Cmd::Pattern-Only=true
| N: Unable to locate package dbus-c++
| E: No packages found
| $ apt-cache show vera++ -o APT::Cmd::Pattern-Only=true
| Package: vera++
| Source: vera++ (1.2.1-2)
| […]

The option is undocumented, so we might drop it at some point, but
I guess its not very likely to happen now or anytime soon if at all,
so it should be good enough as a workaround until you fix the underlying
problem in reportbug.


> (For reportbug I think we could also solve it by making more use of
> python-apt.)

That is probably a good idea as, as you can see, the command line
interfaces are more concerned with trying to making sense of what the
user might have meant with its (incomplete) input rather than being 100%
machine predictable. That apt-* are used in a lot of scripts doesn't
change that, it makes it in fact worse, as changing the behaviour is
impossible without breaking others.


Best regards

David Kalnischkies

Attachment: signature.asc
Description: PGP signature


--- End Message ---

Reply to: