X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6e97e817f1082bc98a8f8bf4830d4e3a3bebfb61..84361defb573c52d9a5368069254d1e18105aa62:/methods/cdrom.cc diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 4bbc01c2c..74e2ecc6b 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -8,17 +8,20 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include #include +#include #include +#include +#include #include -#include -#include #include #include @@ -38,7 +41,7 @@ class CDROMMethod : public pkgAcqMethod pkgUdevCdromDevices UdevCdroms; bool IsCorrectCD(URI want, string MountPath, string& NewID); - bool AutoDetectAndMount(URI, string &NewID); + bool AutoDetectAndMount(const URI, string &NewID); virtual bool Fetch(FetchItem *Itm); string GetID(string Name); virtual void Exit(); @@ -54,11 +57,12 @@ class CDROMMethod : public pkgAcqMethod CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | SendConfig | NeedsCleanup | Removable), - DatabaseLoaded(false), + DatabaseLoaded(false), + Debug(false), MountedByApt(false) { UdevCdroms.Dlopen(); -}; +} /*}}}*/ // CDROMMethod::Exit - Unmount the disc if necessary /*{{{*/ // --------------------------------------------------------------------- @@ -92,7 +96,7 @@ string CDROMMethod::GetID(string Name) // CDROMMethod::AutoDetectAndMount /*{{{*/ // --------------------------------------------------------------------- /* Modifies class varaiable CDROM to the mountpoint */ -bool CDROMMethod::AutoDetectAndMount(URI Get, string &NewID) +bool CDROMMethod::AutoDetectAndMount(const URI Get, string &NewID) { vector v = UdevCdroms.Scan(); @@ -220,7 +224,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) } bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true); - CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); + CDROM = _config->FindDir("Acquire::cdrom::mount"); if (Debug) clog << "Looking for CDROM at " << CDROM << endl; @@ -264,7 +268,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) Hashes Hash; FileFd Fd(Res.Filename, FileFd::ReadOnly); - Hash.AddFD(Fd.Fd(), Fd.Size()); + Hash.AddFD(Fd); Res.TakeHashes(Hash); URIDone(Res);