merged from the debian-sid branch
[ntk/apt.git] / apt-pkg / cdrom.cc
index 93deb49..04ace10 100644 (file)
@@ -198,7 +198,7 @@ int pkgCdrom::Score(string Path)
    // a symlink gets a big penalty
    struct stat Buf;
    string statPath = flNotFile(Path);
-   string cdromPath = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+   string cdromPath = _config->FindDir("Acquire::cdrom::mount");
    while(statPath != cdromPath && statPath != "./") {
       statPath.resize(statPath.size()-1);  // remove the trailing '/'
       if (lstat(statPath.c_str(),&Buf) == 0) {
@@ -229,7 +229,7 @@ bool pkgCdrom::DropBinaryArch(vector<string> &List)
       // Between Start and End is the architecture
       Start += 8;
       if ((End = strstr(Start,"/")) != 0 && Start != End &&
-          APT::Configuration::checkArchitecture(string(Start, --End)) == true)
+          APT::Configuration::checkArchitecture(string(Start, End)) == true)
         continue; // okay, architecture is accepted
 
       // not accepted -> Erase it
@@ -383,7 +383,7 @@ bool pkgCdrom::WriteDatabase(Configuration &Cnf)
 
    Out.close();
    
-   rename(DFile.c_str(),string(DFile + '~').c_str());
+   link(DFile.c_str(),string(DFile + '~').c_str());
    if (rename(NewFile.c_str(),DFile.c_str()) != 0)
       return _error->Errno("rename","Failed to rename %s.new to %s",
                           DFile.c_str(),DFile.c_str());
@@ -509,7 +509,7 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)            /*{{{*/
    stringstream msg;
 
    // Startup
-   string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+   string CDROM = _config->FindDir("Acquire::cdrom::mount");
    if (CDROM[0] == '.')
       CDROM= SafeGetCWD() + '/' + CDROM;
 
@@ -568,7 +568,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)                                     /*{{{*/
    stringstream msg;
 
    // Startup
-   string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+   string CDROM = _config->FindDir("Acquire::cdrom::mount");
    if (CDROM[0] == '.')
       CDROM= SafeGetCWD() + '/' + CDROM;