From 711078ae18df09ca4f0c371c071c59458fad3918 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 11 Dec 2011 00:58:35 +0100 Subject: use fileutl exists-functions instead of doing the stat'ing by hand --- apt-pkg/cdrom.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'apt-pkg/cdrom.cc') diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 026094a6e..f5c19a4d6 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -58,15 +58,14 @@ bool pkgCdrom::FindPackages(string CD, return _error->Errno("chdir","Unable to change to %s",CD.c_str()); // Look for a .disk subdirectory - struct stat Buf; - if (stat(".disk",&Buf) == 0) + if (DirectoryExists(".disk") == true) { if (InfoDir.empty() == true) InfoDir = CD + ".disk/"; } // Don't look into directories that have been marked to ingore. - if (stat(".aptignr",&Buf) == 0) + if (RealFileExists(".aptignr") == true) return true; @@ -74,7 +73,7 @@ bool pkgCdrom::FindPackages(string CD, under a Packages/Source file are in control of that file and stops the scanning */ - if (stat("Release.gpg",&Buf) == 0) + if (RealFileExists("Release.gpg") == true) { SigList.push_back(CD); } @@ -86,7 +85,7 @@ bool pkgCdrom::FindPackages(string CD, for (std::vector::const_iterator c = compressor.begin(); c != compressor.end(); ++c) { - if (stat(std::string("Packages").append(c->Extension).c_str(), &Buf) != 0) + if (RealFileExists(std::string("Packages").append(c->Extension).c_str()) == false) continue; if (_config->FindB("Debug::aptcdrom",false) == true) @@ -101,7 +100,7 @@ bool pkgCdrom::FindPackages(string CD, for (std::vector::const_iterator c = compressor.begin(); c != compressor.end(); ++c) { - if (stat(std::string("Sources").append(c->Extension).c_str(), &Buf) != 0) + if (RealFileExists(std::string("Sources").append(c->Extension).c_str()) == false) continue; if (_config->FindB("Debug::aptcdrom",false) == true) -- cgit v1.2.3