diff options
| -rw-r--r-- | apt-pkg/cacheset.cc | 3 | ||||
| -rwxr-xr-x | test/integration/test-bug-1053887-regex-return-failure | 21 |
2 files changed, 24 insertions, 0 deletions
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index e52f76272..ee0dcee28 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -491,10 +491,13 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci V = Match.Find(P); helper.setLastVersionMatcher(ver); if (V.end()) { + bool errors = true; + errors = helper.showErrors(true); if (verIsRel == true) V = helper.canNotGetVersion(CacheSetHelper::RELEASE, Cache, P); else V = helper.canNotGetVersion(CacheSetHelper::VERSIONNUMBER, Cache, P); + helper.showErrors(errors); } } if (V.end() == true) diff --git a/test/integration/test-bug-1053887-regex-return-failure b/test/integration/test-bug-1053887-regex-return-failure new file mode 100755 index 000000000..46a03792f --- /dev/null +++ b/test/integration/test-bug-1053887-regex-return-failure @@ -0,0 +1,21 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +rm -f rootdir/etc/apt/sources.list +rm -f rootdir/etc/apt/sources.list.d/* + +insertinstalledpackage 'foo' 'all' '1' + +testfailureequal "Reading package lists... +Building dependency tree... +Note, selecting 'foo' for regex '^foo$' +Package foo is not available, but is referred to by another package. +This may mean that the package is missing, has been obsoleted, or +is only available from another source + +E: Version '2' for 'foo' was not found" apt install '^foo$'=2 |
