Browse Source

outsmart gcc -O3 over-optimization in pkgCdrom::FindPackages

Seems like a simpler workaround than forcing a lower optimization
level just for this for all of apt.

See also:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1473674
debian/1.8.y
David Kalnischkies 7 years ago
parent
commit
0300f0077a
  1. 6
      apt-pkg/cdrom.cc
  2. 2
      test/libapt/cdromfindpackages_test.cc

6
apt-pkg/cdrom.cc

@ -61,10 +61,10 @@ bool pkgCdrom::FindPackages(string CD,
return _error->Errno("chdir","Unable to change to %s",CD.c_str());
// Look for a .disk subdirectory
if (DirectoryExists(".disk") == true)
if (InfoDir.empty() == true)
{
if (InfoDir.empty() == true)
InfoDir = CD + ".disk/";
if (DirectoryExists(".disk") == true)
InfoDir = InfoDir + CD + ".disk/";
}
// Don't look into directories that have been marked to ingore.

2
test/libapt/cdromfindpackages_test.cc

@ -24,7 +24,9 @@ class Cdrom : public pkgCdrom {
std::string &InfoDir) {
std::string const startdir = SafeGetCWD();
EXPECT_FALSE(startdir.empty());
EXPECT_TRUE(InfoDir.empty());
bool const result = pkgCdrom::FindPackages(CD, List, SList, SigList, TransList, InfoDir, NULL, 0);
EXPECT_FALSE(InfoDir.empty());
std::sort(List.begin(), List.end());
std::sort(SList.begin(), SList.end());
std::sort(SigList.begin(), SigList.end());

Loading…
Cancel
Save