]> git.saurik.com Git - apt.git/blobdiff - methods/cdrom.cc
Check the currently mounted cdrom, to see if it's the o...
[apt.git] / methods / cdrom.cc
index c367c99a1de435f78aac5bbddcc5e5a276dd1f64..c4fde2217f0c040d7c9dad6fbcd9bffb4829ff8c 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: cdrom.cc,v 1.17 2000/01/17 07:11:49 jgg Exp $
+// $Id: cdrom.cc,v 1.19 2002/11/22 07:26:10 doogie Exp $
 /* ######################################################################
 
    CDROM URI method for APT
 
 #include <sys/stat.h>
 #include <unistd.h>
+
+#include <iostream>
                                                                        /*}}}*/
 
+using namespace std;
+
 class CDROMMethod : public pkgAcqMethod
 {
    bool DatabaseLoaded;
@@ -133,6 +137,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
    while (CurrentID.empty() == true)
    {
       bool Hit = false;
+      Mounted = MountCdrom(CDROM);
       for (unsigned int Version = 2; Version != 0; Version--)
       {
         if (IdentCdrom(CDROM,NewID,Version) == false)
@@ -162,9 +167,6 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
         Fail("Wrong CD",true);
         return true;
       }
-      
-      MountCdrom(CDROM);
-      Mounted = true;
    }
    
    // Found a CD