diff options
author | Michael Vogt <egon@bottom> | 2007-05-02 13:54:10 +0200 |
---|---|---|
committer | Michael Vogt <egon@bottom> | 2007-05-02 13:54:10 +0200 |
commit | 8171c75b9939a13aa22a3f45d436a6305af561ff (patch) | |
tree | 2bd4f97cb013b56642a845873f54d49f94b92e51 /methods | |
parent | 3bc9f25de62f59cf5d4f90d1c1aaccc9ba23439b (diff) | |
parent | 3036f1e491ec1c71fb8fe9ff35954cebb2574320 (diff) |
* merged with the apt--mvo branch
Diffstat (limited to 'methods')
-rw-r--r-- | methods/cdrom.cc | 12 | ||||
-rw-r--r-- | methods/makefile | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc index d6b8eae75..601bc11c9 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -30,7 +30,7 @@ class CDROMMethod : public pkgAcqMethod ::Configuration Database; string CurrentID; string CDROM; - bool Mounted; + bool MountedByApt; virtual bool Fetch(FetchItem *Itm); string GetID(string Name); @@ -48,7 +48,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | SendConfig | NeedsCleanup | Removable), DatabaseLoaded(false), - Mounted(false) + MountedByApt(false) { }; /*}}}*/ @@ -57,7 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | /* */ void CDROMMethod::Exit() { - if (Mounted == true) + if (MountedByApt == true) UnmountCdrom(CDROM); } /*}}}*/ @@ -139,7 +139,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm) while (CurrentID.empty() == true) { bool Hit = false; - Mounted = MountCdrom(CDROM); + if(!IsMounted(CDROM)) + MountedByApt = MountCdrom(CDROM); for (unsigned int Version = 2; Version != 0; Version--) { if (IdentCdrom(CDROM,NewID,Version) == false) @@ -160,7 +161,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm) break; // I suppose this should prompt somehow? - if (UnmountCdrom(CDROM) == false) + if (_config->FindB("APT::CDROM::NoMount",false) == false && + UnmountCdrom(CDROM) == false) return _error->Error(_("Unable to unmount the CD-ROM in %s, it may still be in use."), CDROM.c_str()); if (MediaFail(Get.Host,CDROM) == false) diff --git a/methods/makefile b/methods/makefile index d9cee9649..f178cbbea 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods # FIXME.. -LIB_APT_PKG_MAJOR = 4.3 +LIB_APT_PKG_MAJOR = 4.4 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method |