projects
/
apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge with debian-sid
[apt.git]
/
apt-pkg
/
cdrom.cc
diff --git
a/apt-pkg/cdrom.cc
b/apt-pkg/cdrom.cc
index b42c82dd0f0e9fedbcb245668e505dd65a9535e6..370687f2485a632ecb6073d58a74bc7b340833d1 100644
(file)
--- a/
apt-pkg/cdrom.cc
+++ b/
apt-pkg/cdrom.cc
@@
-1,9
+1,6
@@
/*
*/
/*
*/
-#ifdef __GNUG__
-#pragma implementation "apt-pkg/cdrom.h"
-#endif
#include<apt-pkg/init.h>
#include<apt-pkg/error.h>
#include<apt-pkg/cdromutl.h>
#include<apt-pkg/init.h>
#include<apt-pkg/error.h>
#include<apt-pkg/cdromutl.h>
@@
-18,6
+15,7
@@
#include <dirent.h>
#include <unistd.h>
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#include <stdio.h>
+#include <algorithm>
#include "indexcopy.h"
#include "indexcopy.h"
@@
-562,10
+560,17
@@
bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log)
}
if(log) {
msg.str("");
}
if(log) {
msg.str("");
- ioprintf(msg, _("Stored label: %s
\n"),
-
Database.Find("CD::"+ident).c_str());
+ ioprintf(msg, _("Stored label: %s\n"),
+ Database.Find("CD::"+ident).c_str());
log->Update(msg.str());
}
log->Update(msg.str());
}
+
+ // Unmount and finish
+ if (_config->FindB("APT::CDROM::NoMount",false) == false) {
+ log->Update(_("Unmounting CD-ROM...\n"), STEP_LAST);
+ UnmountCdrom(CDROM);
+ }
+
return true;
}
return true;
}
@@
-670,8
+675,8
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
DropRepeats(TransList,"");
if(log) {
msg.str("");
DropRepeats(TransList,"");
if(log) {
msg.str("");
- ioprintf(msg, _("Found %
i package indexes, %i
source indexes, "
- "%
i translation indexes and %i
signatures\n"),
+ ioprintf(msg, _("Found %
zu package indexes, %zu
source indexes, "
+ "%
zu translation indexes and %zu
signatures\n"),
List.size(), SourceList.size(), TransList.size(),
SigList.size());
log->Update(msg.str(), STEP_SCAN);
List.size(), SourceList.size(), TransList.size(),
SigList.size());
log->Update(msg.str(), STEP_SCAN);
@@
-679,7
+684,8
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
if (List.size() == 0 && SourceList.size() == 0)
{
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");
}
return _error->Error("Unable to locate any package files, perhaps this is not a Debian Disc");
}
@@
-706,7
+712,7
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
if(log) {
msg.str("");
if(log) {
msg.str("");
- ioprintf(msg,
"Found label '%s'\n"
, Name.c_str());
+ ioprintf(msg,
_("Found label '%s'\n")
, Name.c_str());
log->Update(msg.str());
}
Database.Set("CD::" + ID + "::Label",Name);
log->Update(msg.str());
}
Database.Set("CD::" + ID + "::Label",Name);
@@
-718,7
+724,8
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
{
if(!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");
}
return _error->Error("No disc name found and no way to ask for it");
}
@@
-796,7
+803,8
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
{
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");
}
return _error->Error("Internal error");
}
@@
-813,7
+821,8
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
string::size_type Space = (*I).find(' ');
if (Space == string::npos)
{
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");
}
return _error->Error("Internal error");
}
@@
-829,7
+838,7
@@
bool pkgCdrom::Add(pkgCdromStatus *log)
// Unmount and finish
if (_config->FindB("APT::CDROM::NoMount",false) == false) {
// Unmount and finish
if (_config->FindB("APT::CDROM::NoMount",false) == false) {
- log->Update(_("Unmounting CD-ROM..."), STEP_LAST);
+ log->Update(_("Unmounting CD-ROM...
\n
"), STEP_LAST);
UnmountCdrom(CDROM);
}
UnmountCdrom(CDROM);
}