]> git.saurik.com Git - apt.git/commitdiff
* methods/cdrom.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Fri, 22 Jan 2010 20:21:30 +0000 (21:21 +0100)
committerMichael Vogt <michael.vogt@ubuntu.com>
Fri, 22 Jan 2010 20:21:30 +0000 (21:21 +0100)
  - fixes in multi cdrom setup code

debian/changelog
methods/cdrom.cc

index 5bb90cc1dd55d453b4d7d833d5139acaf866d3e5..b499d729837a13020cc9ba60841cc4a43a489fe1 100644 (file)
@@ -8,6 +8,8 @@ apt (0.7.25.1) UNRELEASED; urgency=low
   * apt-pkg/contrib/cdromutl.cc:
     - fix UnmountCdrom() fails, give it a bit more time and try
       the umount again
+  * methods/cdrom.cc:
+    - fixes in multi cdrom setup code
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Fri, 18 Dec 2009 16:54:18 +0100
 
index 9802eb46ceb4ffd0ca7b9c33229216fde56e499b..7635470134c6d41a9eb68da010b1551b44d7eb03 100644 (file)
@@ -37,8 +37,8 @@ class CDROMMethod : public pkgAcqMethod
    bool MountedByApt;
    pkgUdevCdromDevices UdevCdroms;
  
-   bool IsCorrectCD(URI want, string MountPath);
-   bool AutoDetectAndMount(URI);
+   bool IsCorrectCD(URI want, string MountPath, string& NewID);
+   bool AutoDetectAndMount(URI, string &NewID);
    virtual bool Fetch(FetchItem *Itm);
    string GetID(string Name);
    virtual void Exit();
@@ -92,7 +92,7 @@ string CDROMMethod::GetID(string Name)
 // CDROMMethod::AutoDetectAndMount                                      /*{{{*/
 // ---------------------------------------------------------------------
 /* Modifies class varaiable CDROM to the mountpoint */
-bool CDROMMethod::AutoDetectAndMount(URI Get)
+bool CDROMMethod::AutoDetectAndMount(URI Get, string NewID)
 {
    vector<struct CdromDevice> v = UdevCdroms.Scan();
 
@@ -103,7 +103,7 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
       {
         if (Debug)
            clog << "Checking mounted cdrom device " << v[i].DeviceName << endl;
-        if (IsCorrectCD(Get, v[i].MountPath))
+        if (IsCorrectCD(Get, v[i].MountPath, NewID))
         {
            CDROM = v[i].MountPath;
            return true;
@@ -126,7 +126,7 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
       {
         if(MountCdrom("/media/apt", v[i].DeviceName)) 
         {
-           if (IsCorrectCD(Get, "/media/apt"))
+           if (IsCorrectCD(Get, "/media/apt", NewID))
            {
               MountedByApt = true;
               CDROM = "/media/apt";
@@ -144,10 +144,8 @@ bool CDROMMethod::AutoDetectAndMount(URI Get)
 // CDROMMethod::IsCorrectCD                                             /*{{{*/
 // ---------------------------------------------------------------------
 /* */
-bool CDROMMethod::IsCorrectCD(URI want, string MountPath)
+bool CDROMMethod::IsCorrectCD(URI want, string MountPath, string& NewID)
 {
-   string NewID;
-
    for (unsigned int Version = 2; Version != 0; Version--)
    {
       if (IdentCdrom(MountPath,NewID,Version) == false)
@@ -226,17 +224,17 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
 
    if (CDROM[0] == '.')
       CDROM= SafeGetCWD() + '/' + CDROM;
-   string NewID;
 
+   string NewID;
    while (CurrentID.empty() == true)
    {
       if (CDROM == "apt-udev-auto/") 
-        AutoDetectAndMount(Get);
+        AutoDetectAndMount(Get, NewID);
 
       if(!IsMounted(CDROM))
         MountedByApt = MountCdrom(CDROM);
       
-      if (IsCorrectCD(Get, CDROM))
+      if (IsCorrectCD(Get, CDROM, NewID))
         break;
         
       // I suppose this should prompt somehow?