summaryrefslogtreecommitdiff
path: root/apt-pkg/cdrom.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-03-07 12:06:08 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-03-07 12:06:08 +0100
commit25a04630d6eef123a62f50703b82cc62acf1fbfb (patch)
tree9b1a557cde0fd91412c800a9b15879e1e9a0e4db /apt-pkg/cdrom.cc
parent509598772f0df89ea5e783a636fb941b1fc6675c (diff)
- added APT::CDROM::UnMountOnFinish to have more control over
the umount/mount process
Diffstat (limited to 'apt-pkg/cdrom.cc')
-rw-r--r--apt-pkg/cdrom.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index 4d45d38a2..241688785 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -508,8 +508,10 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
CDROM.c_str());
log->Update(msg.str());
}
- if (MountCdrom(CDROM) == false)
- return _error->Error("Failed to mount the cdrom.");
+
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ if (MountCdrom(CDROM) == false)
+ return _error->Error("Failed to mount the cdrom.");
// Hash the CD to get an ID
if(log)
@@ -803,7 +805,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
// Unmount and finish
- if (_config->FindB("APT::CDROM::NoMount",false) == false) {
+ if (_config->FindB("APT::CDROM::NoMount",false) == false &&
+ _config->FindB("APT::CDROM::UnMountOnFinish",true) == true) {
log->Update(_("Unmounting CD-ROM..."), STEP_LAST);
UnmountCdrom(CDROM);
}