From 75f59b16312523ab3deb995c48e8c8ae07586c23 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 4 May 2020 12:23:50 +0200 Subject: Reinstate * wildcards Reinstate * wildcards as they are safe to use, but do not allow any other special characters such as ? or []. Notably, ? would overlap with patterns, and [] might overlap with future pattern extensions (alternative bracketing style), it's also hard to explain. Closes: #953531 LP: #1872200 --- test/integration/test-apt-patterns | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') diff --git a/test/integration/test-apt-patterns b/test/integration/test-apt-patterns index b55caf35b..b091c8729 100755 --- a/test/integration/test-apt-patterns +++ b/test/integration/test-apt-patterns @@ -233,3 +233,37 @@ testsuccessequal "Listing..." apt list '?x-name-fnmatch(1)' testsuccessequal "Listing... automatic1/now 1.0 i386 [installed,local] manual1/now 1.0 i386 [installed,local]" apt list '?x-name-fnmatch(*1)' + + +# * wildcards should still work +testsuccessequal "Listing... +automatic1/now 1.0 i386 [installed,local] +automatic2/now 1.0 i386 [installed,local]" apt list 'automatic*' + +testfailureequal "Reading package lists... +Building dependency tree... +Reading state information... +Note, selecting 'automatic1' for glob 'automatic*' +Note, selecting 'automatic2' for glob 'automatic*' +automatic1 is already the newest version (1.0). +automatic1 set to manually installed. +automatic2 is already the newest version (1.0). +automatic2 set to manually installed. +You might want to run 'apt --fix-broken install' to correct these. +The following packages have unmet dependencies: + broken : Depends: does-not-exist but it is not installable +E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)." apt install -s 'automatic*' + +# other wildcards should fail + +# FIXME: This should fail +testsuccessequal "Listing... +automatic1/now 1.0 i386 [installed,local] +automatic2/now 1.0 i386 [installed,local]" apt list 'automatic?' + + + +testfailureequal "Reading package lists... +Building dependency tree... +Reading state information... +E: Unable to locate package automatic?" apt install -s 'automatic?' -- cgit v1.2.3