summaryrefslogtreecommitdiff
path: root/methods/cdrom.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:10 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:10 +0000
commit281daf46d178d4fb6f43e8b13b9b51736db84d74 (patch)
tree236d9fb0f8b1fc26b22406ba6eab54967d69f253 /methods/cdrom.cc
parenta4e87467fe5c5d12a617a43f3115c89daa54b7cf (diff)
CD swapping support
Author: jgg Date: 1999-07-03 03:10:35 GMT CD swapping support
Diffstat (limited to 'methods/cdrom.cc')
-rw-r--r--methods/cdrom.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index c702e2dc5..e46fc97be 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cdrom.cc,v 1.11 1999/06/09 23:06:39 jgg Exp $
+// $Id: cdrom.cc,v 1.12 1999/07/03 03:10:36 jgg Exp $
/* ######################################################################
CDROM URI method for APT
@@ -114,7 +114,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
if (CDROM[0] == '.')
CDROM= SafeGetCWD() + '/' + CDROM;
string NewID;
- while (1)
+ while (CurrentID.empty() == true)
{
bool Hit = false;
for (unsigned int Version = 2; Version != 0; Version--)
@@ -142,6 +142,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
CDROM.c_str());
if (MediaFail(Get.Host,CDROM) == false)
{
+ clog << "M-Fail" << endl;
CurrentID = "FAIL";
Fail("Wrong CD",true);
return true;
@@ -156,7 +157,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
if (stat(Res.Filename.c_str(),&Buf) != 0)
return _error->Error("File not found");
- CurrentID = NewID;
+ if (NewID.empty() == false)
+ CurrentID = NewID;
Res.LastModified = Buf.st_mtime;
Res.IMSHit = true;
Res.Size = Buf.st_size;