diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2007-03-07 12:49:33 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2007-03-07 12:49:33 +0100 |
commit | 70dbf5f8f3e6e3526c82c72ed1795d9f2dad0338 (patch) | |
tree | b66dbe5f093cf7940593501e16e571f1f83c12ae /methods | |
parent | 25a04630d6eef123a62f50703b82cc62acf1fbfb (diff) |
* apt-pkg/cdrom.cc:
- only unmount if APT::CDROM::NoMount is false
* methods/cdrom.cc:
- only umount if it was mounted by the method before
Diffstat (limited to 'methods')
-rw-r--r-- | methods/cdrom.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 556d2c1a6..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,8 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | /* */ void CDROMMethod::Exit() { - if (Mounted == true && - _config->FindB("APT::CDROM::UnMountOnFinish",true) == true) + if (MountedByApt == true) UnmountCdrom(CDROM); } /*}}}*/ @@ -140,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) |