X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8e5fc8f5bea54e3c016a14fe4025dcb94864e874..f7dd079fa28e81d022cd3f502c493dbb1bf15eab:/methods/cdrom.cc diff --git a/methods/cdrom.cc b/methods/cdrom.cc index e2eddf19e..c4fde2217 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -1,6 +1,6 @@ // -*- 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 @@ -16,8 +16,12 @@ #include #include + +#include /*}}}*/ +using namespace std; + class CDROMMethod : public pkgAcqMethod { bool DatabaseLoaded; @@ -38,8 +42,9 @@ class CDROMMethod : public pkgAcqMethod // 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) { @@ -132,6 +137,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) while (CurrentID.empty() == true) { bool Hit = false; + Mounted = MountCdrom(CDROM); for (unsigned int Version = 2; Version != 0; Version--) { if (IdentCdrom(CDROM,NewID,Version) == false) @@ -161,9 +167,6 @@ bool CDROMMethod::Fetch(FetchItem *Itm) Fail("Wrong CD",true); return true; } - - MountCdrom(CDROM); - Mounted = true; } // Found a CD @@ -175,7 +178,6 @@ bool CDROMMethod::Fetch(FetchItem *Itm) if (NewID.empty() == false) CurrentID = NewID; Res.LastModified = Buf.st_mtime; - Res.IMSHit = true; Res.Size = Buf.st_size; URIDone(Res); return true;