summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-pkg/cdrom.cc12
-rw-r--r--debian/changelog2
-rw-r--r--methods/cdrom.cc5
-rw-r--r--po/apt-all.pot18
4 files changed, 22 insertions, 15 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index ce1beb39b..4d45d38a2 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -652,7 +652,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");
}
@@ -691,7 +692,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");
}
@@ -767,7 +769,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");
}
@@ -784,7 +787,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/debian/changelog b/debian/changelog
index 7893f2599..2280c9fae 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,8 @@ apt (0.6.46.5) UNRELEASED; urgency=low
- send apt version in User-Agent
* apt-pkg/deb/debrecords.cc:
- fix SHA1Hash() return value
+ * apt-pkg/cdrom.cc, methods/cdrom.cc:
+ - only unmount if APT::CDROM::NoMount is false
-- Michael Vogt <michael.vogt@ubuntu.com> Mon, 18 Dec 2006 19:39:05 +0100
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index d6b8eae75..d662b7129 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -57,7 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
/* */
void CDROMMethod::Exit()
{
- if (Mounted == true)
+ if (Mounted == true && _config->FindB("APT::CDROM::NoMount",false) == false)
UnmountCdrom(CDROM);
}
/*}}}*/
@@ -160,7 +160,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/po/apt-all.pot b/po/apt-all.pot
index d2dbcb7a0..963f58a30 100644
--- a/po/apt-all.pot
+++ b/po/apt-all.pot
@@ -1477,16 +1477,16 @@ msgstr ""
msgid "Wrong CD-ROM"
msgstr ""
-#: methods/cdrom.cc:164
+#: methods/cdrom.cc:165
#, c-format
msgid "Unable to unmount the CD-ROM in %s, it may still be in use."
msgstr ""
-#: methods/cdrom.cc:169
+#: methods/cdrom.cc:170
msgid "Disk not found."
msgstr ""
-#: methods/cdrom.cc:177 methods/file.cc:79 methods/rsh.cc:264
+#: methods/cdrom.cc:178 methods/file.cc:79 methods/rsh.cc:264
msgid "File not found"
msgstr ""
@@ -2441,30 +2441,30 @@ msgstr ""
msgid "Found %i package indexes, %i source indexes and %i signatures\n"
msgstr ""
-#: apt-pkg/cdrom.cc:710
+#: apt-pkg/cdrom.cc:712
msgid "That is not a valid name, try again.\n"
msgstr ""
-#: apt-pkg/cdrom.cc:726
+#: apt-pkg/cdrom.cc:728
#, c-format
msgid ""
"This disc is called: \n"
"'%s'\n"
msgstr ""
-#: apt-pkg/cdrom.cc:730
+#: apt-pkg/cdrom.cc:732
msgid "Copying package lists..."
msgstr ""
-#: apt-pkg/cdrom.cc:754
+#: apt-pkg/cdrom.cc:756
msgid "Writing new source list\n"
msgstr ""
-#: apt-pkg/cdrom.cc:763
+#: apt-pkg/cdrom.cc:765
msgid "Source list entries for this disc are:\n"
msgstr ""
-#: apt-pkg/cdrom.cc:803
+#: apt-pkg/cdrom.cc:807
msgid "Unmounting CD-ROM..."
msgstr ""