summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-03-07 13:00:35 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-03-07 13:00:35 +0100
commite29dfa9ebfe9940089697fbb3e436e8ff95ecad6 (patch)
treeb8adbb7dc2d9927c94cc95911f1bb745739814fc /apt-pkg
parent07cf8a2fd6b6472ea8d98573c18b010ef8b66ed4 (diff)
parent70dbf5f8f3e6e3526c82c72ed1795d9f2dad0338 (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 'apt-pkg')
-rw-r--r--apt-pkg/cdrom.cc12
-rw-r--r--apt-pkg/contrib/cdromutl.h3
2 files changed, 10 insertions, 5 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index b42c82dd0..aefe9c9e9 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -679,7 +679,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
if (List.size() == 0 && SourceList.size() == 0)
{
- UnmountCdrom(CDROM);
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ UnmountCdrom(CDROM);
return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
}
@@ -718,7 +719,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
{
if(!log)
{
- UnmountCdrom(CDROM);
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ UnmountCdrom(CDROM);
return _error->Error("No disc name found and no way to ask for it");
}
@@ -796,7 +798,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
{
- UnmountCdrom(CDROM);
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ UnmountCdrom(CDROM);
return _error->Error("Internal error");
}
@@ -813,7 +816,8 @@ bool pkgCdrom::Add(pkgCdromStatus *log)
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
{
- UnmountCdrom(CDROM);
+ if (_config->FindB("APT::CDROM::NoMount",false) == false)
+ UnmountCdrom(CDROM);
return _error->Error("Internal error");
}
diff --git a/apt-pkg/contrib/cdromutl.h b/apt-pkg/contrib/cdromutl.h
index 3180a03c7..db140ec02 100644
--- a/apt-pkg/contrib/cdromutl.h
+++ b/apt-pkg/contrib/cdromutl.h
@@ -8,7 +8,7 @@
##################################################################### */
/*}}}*/
#ifndef PKGLIB_CDROMUTL_H
-#define PKGLIB_ACQUIRE_METHOD_H
+#define PKGLIB_CDROMUTL_H
#include <string>
@@ -21,5 +21,6 @@ using std::string;
bool MountCdrom(string Path);
bool UnmountCdrom(string Path);
bool IdentCdrom(string CD,string &Res,unsigned int Version = 2);
+bool IsMounted(string &Path);
#endif