summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2018-11-29 22:15:28 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2018-11-29 22:15:28 +0100
commit64d7e1c568a7f9e7f32d1dee1ab771f924baa28d (patch)
treea62ca80d187e5fedbda0ea8fc665bfaadd0de53e /test
parentf313e09d167cc7a83846ac9d4d5d72ba10cc2638 (diff)
Use quoted tagnames in config dumps
Tagnames in configuration can include spaces (and other nasties) e.g. in repository-specific configuration options due to Origin/Label potentially containing a space. The configuration file format supports parsing quoted as well as encoded spaces, but the output generated by apt-config and other places which might be feedback into apt via parsing (e.g. before calling apt-key in our gpgv method) do not quote and hence produce invalid configuration files. Changing the default to be an encoded tagname ensures that the output of dump can be used as a config file, but other users might not expect this so that is technically a backward-breaking change.
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-config14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/test-apt-config b/test/integration/test-apt-config
index f2068b789..12df63de1 100755
--- a/test/integration/test-apt-config
+++ b/test/integration/test-apt-config
@@ -34,3 +34,17 @@ testsuccessequal 'nodoc
stage1' aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
unset DEB_BUILD_PROFILES
testempty aptconfig dump --no-empty --format='%v%n' APT::Build-Profiles
+
+cat > spaces.conf <<EOF
+Spaces::Test::"Foo Bar" "1 1";
+Spaces::Test2::" Bar Baz " "B B" {
+ A%20B "C C";
+ "B C" "A A";
+};
+EOF
+testsuccessequal 'Spaces::Test "";
+Spaces::Test::Foo%20Bar "1 1";
+Spaces::Test2 "";
+Spaces::Test2::%20Bar%20Baz%20 "B B";
+Spaces::Test2::%20Bar%20Baz%20::A%20B "C C";
+Spaces::Test2::%20Bar%20Baz%20::B%20C "A A";' aptconfig dump -c spaces.conf Spaces::Test Spaces::Test2