]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/cdrom.cc
Change InternalReadLine to always use buffer.read() return value
[apt.git] / apt-pkg / cdrom.cc
index ffbf86735dda971f9909e61f69217257bb2bc0a8..5613459e73a657d9b63e8609c302be08b0933be4 100644 (file)
@@ -22,6 +22,9 @@
 #include <stdio.h>
 #include <algorithm>
 #include <dlfcn.h>
 #include <stdio.h>
 #include <algorithm>
 #include <dlfcn.h>
+#include <iostream>
+#include <sstream>
+#include <fstream>
 
 #include<apti18n.h>
 
 
 #include<apti18n.h>
 
@@ -58,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
       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.
    }
 
    // Don't look into directories that have been marked to ingore.
@@ -153,10 +156,7 @@ bool pkgCdrom::FindPackages(string CD,
       // Skip some files..
       if (strcmp(Dir->d_name,".") == 0 ||
          strcmp(Dir->d_name,"..") == 0 ||
       // 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,".disk") == 0 ||
-         strcmp(Dir->d_name,"experimental") == 0 ||
-         strcmp(Dir->d_name,"binary-all") == 0 ||
           strcmp(Dir->d_name,"debian-installer") == 0)
         continue;
 
           strcmp(Dir->d_name,"debian-installer") == 0)
         continue;
 
@@ -426,8 +426,8 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
 {
    string DFile = _config->FindFile("Dir::State::cdroms");
    string NewFile = DFile + ".new";
 {
    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",
    ofstream Out(NewFile.c_str());
    if (!Out)
       return _error->Errno("ofstream::ofstream",
@@ -468,7 +468,7 @@ bool pkgCdrom::WriteSourceList(string Name,vector<string> &List,bool Source)
       return _error->Errno("ifstream::ifstream","Opening %s",File.c_str());
 
    string NewFile = File + ".new";
       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",
    ofstream Out(NewFile.c_str());
    if (!Out)
       return _error->Errno("ofstream::ofstream",