]> git.saurik.com Git - apt.git/blobdiff - methods/cdrom.cc
merged from debian-sid
[apt.git] / methods / cdrom.cc
index b3f4618165ae8c3c4cf3f5b1c68481d9c2f812ab..bf4281e403586a9ef73838d49e780ac49de34df6 100644 (file)
@@ -116,23 +116,24 @@ bool CDROMMethod::AutoDetectAndMount(const URI Get, string &NewID)
       return false;
 
    // check if we have the mount point
-   if (!FileExists("/media/apt"))
-      mkdir("/media/apt", 0755);
+   string AptMountPoint = _config->FindDir("Dir::Media::MountPath");
+   if (!FileExists(AptMountPoint))
+      mkdir(AptMountPoint.c_str(), 0750);
 
    // now try mounting
    for (unsigned int i=0; i < v.size(); i++)
    {
       if (!v[i].Mounted)
       {
-        if(MountCdrom("/media/apt", v[i].DeviceName)) 
+        if(MountCdrom(AptMountPoint, v[i].DeviceName)) 
         {
-           if (IsCorrectCD(Get, "/media/apt", NewID))
+           if (IsCorrectCD(Get, AptMountPoint, NewID))
            {
               MountedByApt = true;
-              CDROM = "/media/apt";
+              CDROM = AptMountPoint;
               return true;
            } else {
-              UnmountCdrom("/media/apt");
+              UnmountCdrom(AptMountPoint);
            }
         }
       }
@@ -218,7 +219,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       return true;
    }
 
-   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", false);
+   bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true);
    CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
    if (Debug)
       clog << "Looking for CDROM at " << CDROM << endl;