}
delete [] Added;
- return ShowList(out,_("WARNING: The following essential packages will be removed\n"
+ return ShowList(out,_("WARNING: The following essential packages will be removed.\n"
"This should NOT be done unless you know exactly what you are doing!"),List,VersionsList);
}
// Check that the system is OK
if (DCache->DelCount() != 0 || DCache->InstCount() != 0)
- return _error->Error("Internal Error, non-zero counts");
+ return _error->Error("Internal error, non-zero counts");
// Apply corrections for half-installed packages
if (pkgApplyStatus(*DCache) == false)
if (_config->FindB("APT::Get::AllowUnauthenticated",false) == true)
{
- c2out << "Authentication warning overridden.\n";
+ c2out << _("Authentication warning overridden.\n");
return true;
}
if (_config->FindI("quiet",0) < 2
&& _config->FindB("APT::Get::Assume-Yes",false) == false)
{
- c2out << _("Install these packages without verification? [y/N] ") << flush;
+ c2out << _("Install these packages without verification [y/N]? ") << flush;
if (!YnPrompt(false))
return _error->Error(_("Some packages could not be authenticated"));
if (Cache->BrokenCount() != 0)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal Error, InstallPackages was called with broken packages!");
+ return _error->Error(_("Internal error, InstallPackages was called with broken packages!"));
}
if (Cache->DelCount() == 0 && Cache->InstCount() == 0 &&
// No remove flag
if (Cache->DelCount() != 0 && _config->FindB("APT::Get::Remove",true) == false)
- return _error->Error(_("Packages need to be removed but Remove is disabled."));
+ return _error->Error(_("Packages need to be removed but remove is disabled."));
// Run the simulator ..
if (_config->FindB("APT::Get::Simulate") == true)
{
pkgSimulate PM(Cache);
- pkgPackageManager::OrderResult Res = PM.DoInstall();
+ int status_fd = _config->FindI("APT::Status-Fd",-1);
+ pkgPackageManager::OrderResult Res = PM.DoInstall(status_fd);
if (Res == pkgPackageManager::Failed)
return false;
if (Res != pkgPackageManager::Completed)
- return _error->Error("Internal Error, Ordering didn't finish");
+ return _error->Error(_("Internal error, Ordering didn't finish"));
return true;
}
if (DebBytes != Cache->DebSize())
{
c0out << DebBytes << ',' << Cache->DebSize() << endl;
- c0out << "How odd.. The sizes didn't match, email apt@packages.debian.org" << endl;
+ c0out << _("How odd.. The sizes didn't match, email apt@packages.debian.org") << endl;
}
// Number of bytes
struct statvfs Buf;
string OutputDir = _config->FindDir("Dir::Cache::Archives");
if (statvfs(OutputDir.c_str(),&Buf) != 0)
- return _error->Errno("statvfs","Couldn't determine free space in %s",
+ return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Error(_("You don't have enough free space in %s."),
const char *Prompt = _("Yes, do as I say!");
ioprintf(c2out,
- _("You are about to do something potentially harmful\n"
+ _("You are about to do something potentially harmful.\n"
"To continue type in the phrase '%s'\n"
" ?] "),Prompt);
c2out << flush;
if (_config->FindI("quiet",0) < 2 &&
_config->FindB("APT::Get::Assume-Yes",false) == false)
{
- c2out << _("Do you want to continue? [Y/n] ") << flush;
+ c2out << _("Do you want to continue [Y/n]? ") << flush;
if (YnPrompt() == false)
{
if (Failed == true && PM->FixMissing() == false)
{
cerr << _("Unable to correct missing packages.") << endl;
- return _error->Error(_("Aborting Install."));
+ return _error->Error(_("Aborting install."));
}
_system->UnLock();
- pkgPackageManager::OrderResult Res = PM->DoInstall();
+ int status_fd = _config->FindI("APT::Status-Fd",-1);
+ pkgPackageManager::OrderResult Res = PM->DoInstall(status_fd);
if (Res == pkgPackageManager::Failed || _error->PendingError() == true)
return false;
if (Res == pkgPackageManager::Completed)
if (pkgAllUpgrade(Cache) == false)
{
ShowBroken(c1out,Cache,false);
- return _error->Error(_("Internal Error, AllUpgrade broke stuff"));
+ return _error->Error(_("Internal error, AllUpgrade broke stuff"));
}
return InstallPackages(Cache,true);
/* Install named packages */
bool DoInstall(CommandLine &CmdL)
{
+ // Lock the list directory
+ FileFd Lock;
+ if (_config->FindB("Debug::NoLocking",false) == false)
+ {
+ Lock.Fd(GetLock(_config->FindDir("Dir::State::Lists") + "lock"));
+ if (_error->PendingError() == true)
+ return _error->Error(_("Unable to lock the list directory"));
+ }
+
CacheFile Cache;
if (Cache.OpenForInstall() == false ||
Cache.CheckDeps(CmdL.FileSize() != 1) == false)
// See if we need to prompt
if (Cache->InstCount() == ExpectedInst && Cache->DelCount() == 0)
return InstallPackages(Cache,false,false);
-
+
return InstallPackages(Cache,false);
}
/*}}}*/
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
- c0out << _("Calculating Upgrade... ") << flush;
+ c0out << _("Calculating upgrade... ") << flush;
if (pkgDistUpgrade(*Cache) == false)
{
c0out << _("Failed") << endl;
if (Fix.Resolve() == false)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal Error, problem resolver broke stuff");
+ return _error->Error(_("Internal error, problem resolver broke stuff"));
}
}
if (pkgAllUpgrade(Cache) == false)
{
ShowBroken(c1out,Cache,false);
- return _error->Error("Internal Error, problem resolver broke stuff");
+ return _error->Error(_("Internal error, problem resolver broke stuff"));
}
return InstallPackages(Cache,false);
struct statvfs Buf;
string OutputDir = ".";
if (statvfs(OutputDir.c_str(),&Buf) != 0)
- return _error->Errno("statvfs","Couldn't determine free space in %s",
+ return _error->Errno("statvfs",_("Couldn't determine free space in %s"),
OutputDir.c_str());
if (unsigned(Buf.f_bfree) < (FetchBytes - FetchPBytes)/Buf.f_bsize)
return _error->Error(_("You don't have enough free space in %s"),
if (_config->FindB("APT::Get::Simulate",false) == true)
{
for (unsigned I = 0; I != J; I++)
- ioprintf(cout,_("Fetch Source %s\n"),Dsc[I].Package.c_str());
+ ioprintf(cout,_("Fetch source %s\n"),Dsc[I].Package.c_str());
return true;
}
if (_config->FindB("version") == true)
{
- cout << _("Supported Modules:") << endl;
+ cout << _("Supported modules:") << endl;
for (unsigned I = 0; I != pkgVersioningSystem::GlobalListLen; I++)
{