summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/deb/deblistparser.cc15
-rwxr-xr-xtest/integration/test-apt-get-build-dep-file19
2 files changed, 25 insertions, 9 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index cf0a9a402..4e61f0fc2 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -72,8 +72,19 @@ string debListParser::Package() {
string Result = Section.Find(pkgTagSection::Key::Package).to_string();
// Normalize mixed case package names to lower case, like dpkg does
- // See Bug#807012 for details
- std::transform(Result.begin(), Result.end(), Result.begin(), tolower_ascii);
+ // See Bug#807012 for details.
+ // Only do this when the package name does not contain a / - as that
+ // indicates that the package name was derived from a filename given
+ // to install or build-dep or similar (Bug#854794)
+ if (likely(Result.find('/') == string::npos))
+ {
+ for (char &c: Result)
+ {
+ char l = tolower_ascii_inline(c);
+ if (unlikely(l != c))
+ c = l;
+ }
+ }
if(unlikely(Result.empty() == true))
_error->Error("Encountered a section with no Package: header");
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'