// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cdrom.cc,v 1.16 1999/10/18 00:37:36 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;
// CDROMMethod::CDROMethod - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
- SendConfig | NeedsCleanup),
+CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
+ SendConfig | NeedsCleanup |
+ Removable),
DatabaseLoaded(false),
Mounted(false)
{
while (CurrentID.empty() == true)
{
bool Hit = false;
+ Mounted = MountCdrom(CDROM);
for (unsigned int Version = 2; Version != 0; Version--)
{
if (IdentCdrom(CDROM,NewID,Version) == false)
Fail("Wrong CD",true);
return true;
}
-
- MountCdrom(CDROM);
- Mounted = true;
}
// Found a CD
if (NewID.empty() == false)
CurrentID = NewID;
Res.LastModified = Buf.st_mtime;
- Res.IMSHit = true;
Res.Size = Buf.st_size;
URIDone(Res);
return true;