summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2017-02-10 22:39:00 +0100
committerJulian Andres Klode <jak@debian.org>2017-02-10 23:12:52 +0100
commit85ee4036c68d8ecd2c973d413a17aca81380900b (patch)
tree103e5302ec379461ca91aa74f59e319b09f644d4 /test
parent89a2e40d14c29c66aead51df0d56c5c49776009a (diff)
downloadapt-85ee4036c68d8ecd2c973d413a17aca81380900b.tar.gz
Do not package names representing .dsc/.deb/... files
In the case of build-dep and other commands where a file can be passed we must make sure not to normalize the path name as that can have odd side effects, or well, cause the operation to do nothing. Test for build-dep-file is adjusted to perform the vcard check once as "vcard" and once as "VCard", thus testing that this solves the reported bug. We inline the std::transform() and optimize it a bit to not write anything in the common case (package names are defined to be lowercase, the whole transformation is just for names that should not exist...) to counter the performance hit of the added find() call (it's about 0.15% more instructions than with the existing transform, but we save about 0.67% in writes...). Closes: #854794
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-apt-get-build-dep-file19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/integration/test-apt-get-build-dep-file b/test/integration/test-apt-get-build-dep-file
index ed850fa40..07de8bb30 100755
--- a/test/integration/test-apt-get-build-dep-file
+++ b/test/integration/test-apt-get-build-dep-file
@@ -39,7 +39,8 @@ Files:
EOF
test2vcardbuilddep() {
- testsuccessequal "Note, using file './2vcard_0.5-3.dsc' to get the build dependencies
+ local name="$1"
+ testsuccessequal "Note, using file './$name' to get the build dependencies
Reading package lists...
Building dependency tree...
The following packages will be REMOVED:
@@ -51,14 +52,16 @@ Remv build-conflict [1]
Inst build-essential (1 stable [i386])
Inst debhelper (7 stable [i386])
Conf build-essential (1 stable [i386])
-Conf debhelper (7 stable [i386])" aptget build-dep -s ./2vcard_0.5-3.dsc
-testfailure aptget build-dep --simulate 2vcard_0.5-3.dsc
+Conf debhelper (7 stable [i386])" aptget build-dep -s ./$name
+testfailure aptget build-dep --simulate $name
cd downloaded
-testsuccess aptget build-dep --simulate ../2vcard_0.5-3.dsc
-testsuccess aptget build-dep --simulate "$(readlink -f ../2vcard_0.5-3.dsc)"
+testsuccess aptget build-dep --simulate ../$name
+testsuccess aptget build-dep --simulate "$(readlink -f ../$name)"
cd ..
}
-test2vcardbuilddep
+test2vcardbuilddep "2vcard_0.5-3.dsc"
+cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc"
+test2vcardbuilddep "2VCard_0.5-3.dsc"
msgmsg 'Test with' 'signed dsc'
cat > 2vcard_0.5-3.dsc <<EOF
@@ -93,7 +96,9 @@ z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
=4eRd
-----END PGP SIGNATURE-----
EOF
-test2vcardbuilddep
+test2vcardbuilddep "2vcard_0.5-3.dsc"
+cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc"
+test2vcardbuilddep "2VCard_0.5-3.dsc"
msgmsg 'Test with' 'unpacked source dir'