CDROM.c_str());
log->Update(msg.str());
}
-
- if (_config->FindB("APT::CDROM::NoMount",false) == false)
- if (MountCdrom(CDROM) == false)
- return _error->Error("Failed to mount the cdrom.");
+ if (MountCdrom(CDROM) == false)
+ return _error->Error("Failed to mount the cdrom.");
// Hash the CD to get an ID
if(log)
// Unmount and finish
- if (_config->FindB("APT::CDROM::NoMount",false) == false &&
- _config->FindB("APT::CDROM::UnMountOnFinish",true) == true) {
+ if (_config->FindB("APT::CDROM::NoMount",false) == false) {
log->Update(_("Unmounting CD-ROM..."), STEP_LAST);
UnmountCdrom(CDROM);
}
##################################################################### */
/*}}}*/
#ifndef PKGLIB_CDROMUTL_H
-#define PKGLIB_ACQUIRE_METHOD_H
+#define PKGLIB_CDROMUTL_H
#include <string>
bool MountCdrom(string Path);
bool UnmountCdrom(string Path);
bool IdentCdrom(string CD,string &Res,unsigned int Version = 2);
+bool IsMounted(string &Path);
#endif
- send apt version in User-Agent
* apt-pkg/deb/debrecords.cc:
- fix SHA1Hash() return value
- * apt-pkg/cdrom.cc, methods/cdrom.cc:
- - added APT::CDROM::UnMountOnFinish to have more control over
- the umount/mount process
+ * 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
- -- Michael Vogt <michael.vogt@ubuntu.com> Wed, 7 Mar 2007 12:03:50 +0100
+ -- Michael Vogt <michael.vogt@ubuntu.com> Mon, 18 Dec 2006 19:39:05 +0100
apt (0.6.46.4) unstable; urgency=high
::Configuration Database;
string CurrentID;
string CDROM;
- bool Mounted;
+ bool MountedByApt;
virtual bool Fetch(FetchItem *Itm);
string GetID(string Name);
SendConfig | NeedsCleanup |
Removable),
DatabaseLoaded(false),
- Mounted(false)
+ MountedByApt(false)
{
};
/*}}}*/
/* */
void CDROMMethod::Exit()
{
- if (Mounted == true &&
- _config->FindB("APT::CDROM::UnMountOnFinish",true) == true)
+ if (MountedByApt == true)
UnmountCdrom(CDROM);
}
/*}}}*/
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)