From 8f418981337503ff7abedd872f788b51bcdbc886 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 22 Apr 2014 16:07:32 +0200 Subject: show upgradable packages after apt update Closes: 748389 --- cmdline/apt.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline') diff --git a/cmdline/apt.cc b/cmdline/apt.cc index 4813861a4..8a6f96aea 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -112,6 +112,7 @@ int main(int argc, const char *argv[]) /*{{{*/ _config->CndSet("DPkg::Progress-Fancy", "1"); _config->CndSet("Apt::Color", "1"); _config->CndSet("APT::Get::Upgrade-Allow-New", true); + _config->CndSet("APT::Cmd::Show-Update-Stats", true); // Parse the command line and initialize the package library CommandLine CmdL(Args.data(), _config); -- cgit v1.2.3 From d287a035e07030be13f72265d4d0812086c323f5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Sat, 17 May 2014 06:57:47 +0200 Subject: fix screen width detection for apt/apt-get lists 3163087b moved SigWinch(int) from apt-get.cc to private-output.cc without moving #include , making SigWinch a nop. Closes: 748430, 747942 --- cmdline/apt-get.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 566103f8c..0f18b0e7c 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -76,7 +76,6 @@ #include #include #include -#include #include #include #include -- cgit v1.2.3 From 81b3540d26b4f47785e6678e22d1312b8cd6d704 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 30 May 2014 16:52:19 +0200 Subject: print error stack on failure of 'apt' solver Git-Dch: ignore --- cmdline/apt-internal-solver.cc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index b85c07c33..e4cdf6381 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include /*}}}*/ @@ -56,6 +57,12 @@ static bool ShowHelp(CommandLine &) { return true; } /*}}}*/ +APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ + std::cerr << "ERROR: " << message << std::endl; + _error->DumpErrors(std::cerr); + exit(EXIT_FAILURE); +} + /*}}}*/ int main(int argc,const char *argv[]) /*{{{*/ { CommandLine::Args Args[] = { @@ -115,34 +122,29 @@ int main(int argc,const char *argv[]) /*{{{*/ EDSP::WriteProgress(0, "Start up solver…", output); - if (pkgInitSystem(*_config,_system) == false) { - std::cerr << "System could not be initialized!" << std::endl; - return 1; - } + if (pkgInitSystem(*_config,_system) == false) + DIE("System could not be initialized!"); EDSP::WriteProgress(1, "Read request…", output); if (WaitFd(input, false, 5) == false) - std::cerr << "WAIT timed out in the resolver" << std::endl; + DIE("WAIT timed out in the resolver"); std::list install, remove; bool upgrade, distUpgrade, autoRemove; - if (EDSP::ReadRequest(input, install, remove, upgrade, distUpgrade, autoRemove) == false) { - std::cerr << "Parsing the request failed!" << std::endl; - return 2; - } + if (EDSP::ReadRequest(input, install, remove, upgrade, distUpgrade, autoRemove) == false) + DIE("Parsing the request failed!"); EDSP::WriteProgress(5, "Read scenario…", output); pkgCacheFile CacheFile; - CacheFile.Open(NULL, false); + if (CacheFile.Open(NULL, false) == false) + DIE("Failed to open CacheFile!"); EDSP::WriteProgress(50, "Apply request on scenario…", output); - if (EDSP::ApplyRequest(install, remove, CacheFile) == false) { - std::cerr << "Failed to apply request to depcache!" << std::endl; - return 3; - } + if (EDSP::ApplyRequest(install, remove, CacheFile) == false) + DIE("Failed to apply request to depcache!"); pkgProblemResolver Fix(CacheFile); for (std::list::const_iterator i = remove.begin(); @@ -183,10 +185,8 @@ int main(int argc,const char *argv[]) /*{{{*/ EDSP::WriteProgress(95, "Write solution…", output); - if (EDSP::WriteSolution(CacheFile, output) == false) { - std::cerr << "Failed to output the solution!" << std::endl; - return 4; - } + if (EDSP::WriteSolution(CacheFile, output) == false) + DIE("Failed to output the solution!"); EDSP::WriteProgress(100, "Done", output); -- cgit v1.2.3 From a3f1d60cb75ab83f63a52a43c056a4752c8fdeb2 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 30 May 2014 14:47:56 +0200 Subject: Show unauthenticated warning for source packages as well This will show the same unauthenticated warning for source packages as for binary packages and will not download a source package if it is unauthenticated. This can be overridden with --allow-unauthenticated Closes: #749795 --- cmdline/apt-get.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0f18b0e7c..a58386eb0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -755,6 +756,7 @@ static bool DoSource(CommandLine &CmdL) // Load the requestd sources into the fetcher unsigned J = 0; + std::string UntrustedList; for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++) { string Src; @@ -763,6 +765,9 @@ static bool DoSource(CommandLine &CmdL) if (Last == 0) { return _error->Error(_("Unable to find a source package for %s"),Src.c_str()); } + + if (Last->Index().IsTrusted() == false) + UntrustedList += Src + " "; string srec = Last->AsStr(); string::size_type pos = srec.find("\nVcs-"); @@ -846,6 +851,10 @@ static bool DoSource(CommandLine &CmdL) Last->Index().SourceInfo(*Last,*I),Src); } } + + // check authentication status of the source as well + if (UntrustedList != "" && !AuthPrompt(UntrustedList, false)) + return false; // Display statistics unsigned long long FetchBytes = Fetcher.FetchNeeded(); -- cgit v1.2.3 From 0dd2cbc08aefb73421d5aa31bc62184181a28c32 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Jun 2014 11:24:44 +0200 Subject: cmdline/apt-helper.cc: use less generic description/short-description --- cmdline/apt-helper.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc index 2c1107d90..b0edafcbd 100644 --- a/cmdline/apt-helper.cc +++ b/cmdline/apt-helper.cc @@ -43,7 +43,8 @@ static bool DoDownloadFile(CommandLine &CmdL) std::string hash; if (CmdL.FileSize() > 3) hash = CmdL.FileList[3]; - new pkgAcqFile(&Fetcher, download_uri, hash, 0, "desc", "short-desc", + // we use download_uri as descr and targetfile as short-descr + new pkgAcqFile(&Fetcher, download_uri, hash, 0, download_uri, targetfile, "dest-dir-ignored", targetfile); Fetcher.Run(); bool Failed = false; -- cgit v1.2.3 From 4dde2b4285fc6288e44e915a0d7bc0faac114a2e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Jun 2014 14:12:12 +0200 Subject: support Acquire::GzipIndexes in dumpavail Closes: 742835 --- cmdline/apt-cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 84b775390..1414617eb 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -507,7 +507,7 @@ static bool DumpAvail(CommandLine &) break; } - FileFd PkgF(File.FileName(),FileFd::ReadOnly); + FileFd PkgF(File.FileName(),FileFd::ReadOnly, FileFd::Extension); if (_error->PendingError() == true) break; -- cgit v1.2.3