Browse Source

* apt-pkg/cdrom.cc, methods/cdrom.cc:

- only unmount if APT::CDROM::NoMount is false
debian/1.8.y
Michael Vogt 15 years ago
parent
commit
509598772f
  1. 12
      apt-pkg/cdrom.cc
  2. 2
      debian/changelog
  3. 5
      methods/cdrom.cc
  4. 18
      po/apt-all.pot

12
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");
}

2
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

5
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)

18
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 ""

Loading…
Cancel
Save