summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbubulle@debian.org <>2007-03-29 21:59:55 +0200
committerbubulle@debian.org <>2007-03-29 21:59:55 +0200
commit6d0fcdb9250c8f5ffa8e499acc5423db39e0e342 (patch)
treeaa592479c21c1580fad691eea5bbc47c51540c90
parentb8334aa35b77f5b2299993433605420237564a46 (diff)
parent70dbf5f8f3e6e3526c82c72ed1795d9f2dad0338 (diff)
Sync with Michael
-rw-r--r--apt-pkg/cdrom.cc12
-rw-r--r--apt-pkg/contrib/cdromutl.h3
-rw-r--r--debian/changelog4
-rw-r--r--methods/cdrom.cc12
-rw-r--r--po/apt-all.pot40
5 files changed, 41 insertions, 30 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/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
diff --git a/debian/changelog b/debian/changelog
index 7893f2599..a2daa2d3a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,10 @@ 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:
+ - 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> Mon, 18 Dec 2006 19:39:05 +0100
diff --git a/methods/cdrom.cc b/methods/cdrom.cc
index d6b8eae75..601bc11c9 100644
--- a/methods/cdrom.cc
+++ b/methods/cdrom.cc
@@ -30,7 +30,7 @@ class CDROMMethod : public pkgAcqMethod
::Configuration Database;
string CurrentID;
string CDROM;
- bool Mounted;
+ bool MountedByApt;
virtual bool Fetch(FetchItem *Itm);
string GetID(string Name);
@@ -48,7 +48,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
SendConfig | NeedsCleanup |
Removable),
DatabaseLoaded(false),
- Mounted(false)
+ MountedByApt(false)
{
};
/*}}}*/
@@ -57,7 +57,7 @@ CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
/* */
void CDROMMethod::Exit()
{
- if (Mounted == true)
+ if (MountedByApt == true)
UnmountCdrom(CDROM);
}
/*}}}*/
@@ -139,7 +139,8 @@ bool CDROMMethod::Fetch(FetchItem *Itm)
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)
@@ -160,7 +161,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..981b0465a 100644
--- a/po/apt-all.pot
+++ b/po/apt-all.pot
@@ -1462,31 +1462,31 @@ msgstr ""
msgid "Unparsable control file"
msgstr ""
-#: methods/cdrom.cc:114
+#: methods/cdrom.cc:115
#, c-format
msgid "Unable to read the cdrom database %s"
msgstr ""
-#: methods/cdrom.cc:123
+#: methods/cdrom.cc:124
msgid ""
"Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update "
"cannot be used to add new CD-ROMs"
msgstr ""
-#: methods/cdrom.cc:131
+#: methods/cdrom.cc:132
msgid "Wrong CD-ROM"
msgstr ""
-#: methods/cdrom.cc:164
+#: methods/cdrom.cc:166
#, 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:171
msgid "Disk not found."
msgstr ""
-#: methods/cdrom.cc:177 methods/file.cc:79 methods/rsh.cc:264
+#: methods/cdrom.cc:179 methods/file.cc:79 methods/rsh.cc:264
msgid "File not found"
msgstr ""
@@ -2405,66 +2405,66 @@ msgid ""
"Mounting CD-ROM\n"
msgstr ""
-#: apt-pkg/cdrom.cc:516 apt-pkg/cdrom.cc:598
+#: apt-pkg/cdrom.cc:518 apt-pkg/cdrom.cc:600
msgid "Identifying.. "
msgstr ""
-#: apt-pkg/cdrom.cc:541
+#: apt-pkg/cdrom.cc:543
#, c-format
msgid "Stored label: %s \n"
msgstr ""
-#: apt-pkg/cdrom.cc:561
+#: apt-pkg/cdrom.cc:563
#, c-format
msgid "Using CD-ROM mount point %s\n"
msgstr ""
-#: apt-pkg/cdrom.cc:579
+#: apt-pkg/cdrom.cc:581
msgid "Unmounting CD-ROM\n"
msgstr ""
-#: apt-pkg/cdrom.cc:583
+#: apt-pkg/cdrom.cc:585
msgid "Waiting for disc...\n"
msgstr ""
#. Mount the new CDROM
-#: apt-pkg/cdrom.cc:591
+#: apt-pkg/cdrom.cc:593
msgid "Mounting CD-ROM...\n"
msgstr ""
-#: apt-pkg/cdrom.cc:609
+#: apt-pkg/cdrom.cc:611
msgid "Scanning disc for index files..\n"
msgstr ""
-#: apt-pkg/cdrom.cc:647
+#: apt-pkg/cdrom.cc:649
#, c-format
msgid "Found %i package indexes, %i source indexes and %i signatures\n"
msgstr ""
-#: apt-pkg/cdrom.cc:710
+#: apt-pkg/cdrom.cc:714
msgid "That is not a valid name, try again.\n"
msgstr ""
-#: apt-pkg/cdrom.cc:726
+#: apt-pkg/cdrom.cc:730
#, c-format
msgid ""
"This disc is called: \n"
"'%s'\n"
msgstr ""
-#: apt-pkg/cdrom.cc:730
+#: apt-pkg/cdrom.cc:734
msgid "Copying package lists..."
msgstr ""
-#: apt-pkg/cdrom.cc:754
+#: apt-pkg/cdrom.cc:758
msgid "Writing new source list\n"
msgstr ""
-#: apt-pkg/cdrom.cc:763
+#: apt-pkg/cdrom.cc:767
msgid "Source list entries for this disc are:\n"
msgstr ""
-#: apt-pkg/cdrom.cc:803
+#: apt-pkg/cdrom.cc:810
msgid "Unmounting CD-ROM..."
msgstr ""