]> git.saurik.com Git - apt.git/commitdiff
* backported a fix from apt-cdrom so that it umounts it's cdrom again in case of...
authorMichael Vogt <michael.vogt@ubuntu.com>
Mon, 12 Sep 2005 13:51:58 +0000 (13:51 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Mon, 12 Sep 2005 13:51:58 +0000 (13:51 +0000)
Patches applied:

 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-55
   * fix apt-pkg/cdrom.cc to umount the cdrom again if anything fails

apt-pkg/cdrom.cc
debian/changelog

index ca74aa685c35d88716780603b35a19b88ea50626..d7ef844a2fa877cfcb3c449ff05eed94e0c69a3c 100644 (file)
@@ -564,7 +564,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    string DFile = _config->FindFile("Dir::State::cdroms");
    if (FileExists(DFile) == true)
    {
-      if (ReadConfigFile(Database,DFile) == false)
+      if (ReadConfigFile(Database,DFile) == false) 
         return _error->Error("Unable to read the cdrom database %s",
                              DFile.c_str());
    }
@@ -647,8 +647,11 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
       log->Update(msg.str(), STEP_SCAN);
    }
 
-   if (List.size() == 0 && SourceList.size() == 0)
+   if (List.size() == 0 && SourceList.size() == 0) 
+   {
+      UnmountCdrom(CDROM);
       return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
+   }
 
    // Check if the CD is in the database
    string Name;
@@ -684,7 +687,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
          Name.empty() == true)
       {
         if(!log) 
+         {
+           UnmountCdrom(CDROM);
            return _error->Error("No disc name found and no way to ask for it");
+        }
 
         while(true) {
            if(!log->AskCdromName(Name)) {
@@ -757,7 +763,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    {
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
+      {
+        UnmountCdrom(CDROM);
         return _error->Error("Internal error");
+      }
 
       if(log) {
         msg.str("");
@@ -771,7 +780,10 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
    {
       string::size_type Space = (*I).find(' ');
       if (Space == string::npos)
+      {
+        UnmountCdrom(CDROM);
         return _error->Error("Internal error");
+      }
 
       if(log) {
         msg.str("");
index 06a35766116221354a272a8ac7b8d3fb25c332b8..c1a625b97ac4752d10de691ea7ea803b3124840a 100644 (file)
@@ -2,6 +2,9 @@ apt (0.6.40.1ubuntu5) breezy; urgency=low
 
   * Cheery picked michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-{50,51}.
     This adds media-change reporting to the apt status-fd (ubuntu #15213)
+  * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-55:
+    apt-pkg/cdrom.cc:
+    - unmount the cdrom when apt failed to locate any package files
 
  -- Michael Vogt <michael.vogt@ubuntu.com>  Mon, 12 Sep 2005 15:44:26 +0200