X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/9f5f0e60f1d3c997c8c2e794dee122829bdf142d..a9024b1be2e26c3c6b1f67093ddbf7602636ec9f:/apt-pkg/cdrom.cc diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index dea4a88c3..5613459e7 100644 --- a/apt-pkg/cdrom.cc +++ b/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. @@ -156,10 +156,7 @@ bool pkgCdrom::FindPackages(string CD, // Skip some files.. if (strcmp(Dir->d_name,".") == 0 || strcmp(Dir->d_name,"..") == 0 || - //strcmp(Dir->d_name,"source") == 0 || strcmp(Dir->d_name,".disk") == 0 || - strcmp(Dir->d_name,"experimental") == 0 || - strcmp(Dir->d_name,"binary-all") == 0 || strcmp(Dir->d_name,"debian-installer") == 0) continue; @@ -429,8 +426,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf) { string DFile = _config->FindFile("Dir::State::cdroms"); string NewFile = DFile + ".new"; - - unlink(NewFile.c_str()); + + RemoveFile("WriteDatabase", NewFile); ofstream Out(NewFile.c_str()); if (!Out) return _error->Errno("ofstream::ofstream", @@ -471,7 +468,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector &List,bool Source) return _error->Errno("ifstream::ifstream","Opening %s",File.c_str()); string NewFile = File + ".new"; - unlink(NewFile.c_str()); + RemoveFile("WriteDatabase", NewFile); ofstream Out(NewFile.c_str()); if (!Out) return _error->Errno("ofstream::ofstream",