]> git.saurik.com Git - apt.git/commitdiff
* merged from apt--cdrom-fallback--0
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 13 Sep 2005 14:09:50 +0000 (14:09 +0000)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 13 Sep 2005 14:09:50 +0000 (14:09 +0000)
Patches applied:

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--base-0
   tag of apt@packages.debian.org/apt--main--0--patch-110

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-1
   * initial patch to make falling back from cdrom possible

 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-2
   * fix in methods/cdrom.cc: don't call Fail() but return false so that apt can fallback to a differencent source

apt-pkg/acquire-method.cc
cmdline/acqprogress.cc
methods/cdrom.cc

index 04c62eaaa3997a06002b77c1ec863a790f1de701..41b832f3babe7fc106caec319ed6daf35e39e7f6 100644 (file)
@@ -277,7 +277,7 @@ bool pkgAcqMethod::MediaFail(string Required,string Drive)
            MyMessages.erase(MyMessages.begin());
         }
 
-        return !StringToBool(LookupTag(Message,"Fail"),false);
+        return !StringToBool(LookupTag(Message,"Failed"),false);
       }
       
       Messages.push_back(Message);
index 8b30b324b95a926c6489d17c4c5094872a12d703..a5fee1db52170688d3dbfee27e84d94ecd2dd3a0 100644 (file)
@@ -274,10 +274,16 @@ bool AcqTextStatus::MediaChange(string Media,string Drive)
            Media.c_str(),Drive.c_str());
 
    char C = 0;
+   bool bStatus = true;
    while (C != '\n' && C != '\r')
-      read(STDIN_FILENO,&C,1);
-   
-   Update = true;
-   return true;
+   {
+      int len = read(STDIN_FILENO,&C,1);
+      if(C == 'c' || len <= 0)
+        bStatus = false;
+   }
+
+   if(bStatus)
+      Update = true;
+   return bStatus;
 }
                                                                        /*}}}*/
index 41eb8a0ee7be3a02263dd9dfff4c8d42f1637477..d6b8eae75c0dd4d6c810f0ab720b997c09dfdb76 100644 (file)
@@ -166,8 +166,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
       if (MediaFail(Get.Host,CDROM) == false)
       {
         CurrentID = "FAIL";
-        Fail(_("Wrong CD-ROM"),true);
-        return true;
+        return _error->Error(_("Disk not found."));
       }
    }