From 4128c84679e54e2afda7913946facaf9c52cd3eb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 1 Apr 2011 16:14:24 +0200 Subject: add a small wrapper to use the internal apt solver as an external one --- cmdline/apt-internal-solver.cc | 129 +++++++++++++++++++++++++++++++++++++++++ cmdline/makefile | 7 +++ 2 files changed, 136 insertions(+) create mode 100644 cmdline/apt-internal-solver.cc (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc new file mode 100644 index 000000000..83d79e42a --- /dev/null +++ b/cmdline/apt-internal-solver.cc @@ -0,0 +1,129 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ##################################################################### + + cover around the internal solver to be able to run it like an external + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + /*}}}*/ + +// ShowHelp - Show a help screen /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool ShowHelp(CommandLine &CmdL) { + ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + COMMON_ARCH,__DATE__,__TIME__); + + std::cout << + _("Usage: apt-internal-resolver\n" + "\n" + "apt-internal-resolver is an interface to use the current internal\n" + "like an external resolver for the APT family for debugging or alike\n" + "\n" + "Options:\n" + " -h This help text.\n" + " -q Loggable output - no progress indicator\n" + " -c=? Read this configuration file\n" + " -o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp\n" + "apt.conf(5) manual pages for more information and options.\n" + " This APT has Super Cow Powers.\n"); + return true; +} + /*}}}*/ +int main(int argc,const char *argv[]) /*{{{*/ +{ + CommandLine::Args Args[] = { + {'h',"help","help",0}, + {'v',"version","version",0}, + {'q',"quiet","quiet",CommandLine::IntLevel}, + {'q',"silent","quiet",CommandLine::IntLevel}, + {0,0,0,0}}; + + CommandLine CmdL(Args,_config); + if (pkgInitConfig(*_config) == false || + CmdL.Parse(argc,argv) == false) { + _error->DumpErrors(); + return 2; + } + + // See if the help should be shown + if (_config->FindB("help") == true || + _config->FindB("version") == true) { + ShowHelp(CmdL); + return 1; + } + + // Deal with stdout not being a tty + if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1) + _config->Set("quiet","1"); + + if (_config->FindI("quiet", 0) < 1) + _config->Set("Debug::EDSP::WriteSolution", true); + + _config->Set("APT::Solver::Name", "internal"); + _config->Set("edsp::scenario", "stdin"); + int input = STDIN_FILENO; + FILE* output = stdout; + SetNonBlock(input, false); + + if (pkgInitSystem(*_config,_system) == false) { + std::cerr << "System could not be initialized!" << std::endl; + return 1; + } + + if (WaitFd(input, false, 5) == false) + std::cerr << "WAIT timed out in the resolver" << std::endl; + + 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; + } + + pkgCacheFile CacheFile; + CacheFile.Open(NULL, false); + + if (EDSP::ApplyRequest(install, remove, CacheFile) == false) { + std::cerr << "Failed to apply request to depcache!" << std::endl; + return 3; + } + for (std::list::const_iterator i = install.begin(); + i != install.end(); ++i) + CacheFile->MarkInstall(CacheFile->FindPkg(*i), true); + + pkgProblemResolver Fix(CacheFile); + if (Fix.Resolve() == false) { + EDSP::WriteError("An error occured", output); + return 0; + } + + if (EDSP::WriteSolution(CacheFile, output) == false) { + std::cerr << "Failed to output the solution!" << std::endl; + return 4; + } + + bool const Errors = _error->PendingError(); + if (_config->FindI("quiet",0) > 0) + _error->DumpErrors(); + else + _error->DumpErrors(GlobalError::DEBUG); + return Errors == true ? 100 : 0; +} + /*}}}*/ diff --git a/cmdline/makefile b/cmdline/makefile index 917ccc96a..4462ccaf4 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -64,3 +64,10 @@ include $(COPY_H) #TO=$(BIN) #TARGET=program #include $(COPY_H) + +# The internal solver acting as an external +PROGRAM=apt-internal-solver +SLIBS = -lapt-pkg $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile +SOURCE = apt-internal-solver.cc +include $(PROGRAM_H) -- cgit v1.2.3-70-g09d2 From 56d53b54e795479194eb653741c5a816698db43f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 2 Apr 2011 15:51:37 +0200 Subject: disable the error discarding as it destroyes the error reporting about failures with external solvers for now as long as i can't see a reason for it --- cmdline/apt-get.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6ffecd777..a1264f54a 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1887,7 +1887,7 @@ bool DoInstall(CommandLine &CmdL) // Call the scored problem resolver Fix->InstallProtect(); if (Fix->Resolve(true) == false) - _error->Discard(); + ; //FIXME: is there a valid reason for? _error->Discard(); delete Fix; } -- cgit v1.2.3-70-g09d2 From d9933172b31e21862b660c182f7c747802dbaa73 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 19 Apr 2011 11:52:47 +0200 Subject: set hint flags for the problem resolver according to request --- cmdline/apt-internal-solver.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 83d79e42a..83a671a96 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -104,11 +104,28 @@ int main(int argc,const char *argv[]) /*{{{*/ std::cerr << "Failed to apply request to depcache!" << std::endl; return 3; } + + pkgProblemResolver Fix(CacheFile); + for (std::list::const_iterator i = remove.begin(); + i != remove.end(); ++i) { + pkgCache::PkgIterator P = CacheFile->FindPkg(*i); + Fix.Clear(P); + Fix.Protect(P); + Fix.Remove(P); + } + + for (std::list::const_iterator i = install.begin(); + i != install.end(); ++i) { + pkgCache::PkgIterator P = CacheFile->FindPkg(*i); + Fix.Clear(P); + Fix.Protect(P); + } + for (std::list::const_iterator i = install.begin(); i != install.end(); ++i) CacheFile->MarkInstall(CacheFile->FindPkg(*i), true); - pkgProblemResolver Fix(CacheFile); + if (Fix.Resolve() == false) { EDSP::WriteError("An error occured", output); return 0; -- cgit v1.2.3-70-g09d2 From 904be3525223633721dc7b5bff22ae7d8db8cb95 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 25 Apr 2011 15:59:45 +0200 Subject: add scenario command to output a complete or limited scenario --- cmdline/apt-internal-solver.cc | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 83a671a96..68489e213 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -53,6 +53,8 @@ int main(int argc,const char *argv[]) /*{{{*/ {'v',"version","version",0}, {'q',"quiet","quiet",CommandLine::IntLevel}, {'q',"silent","quiet",CommandLine::IntLevel}, + {'c',"config-file",0,CommandLine::ConfigFile}, + {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; CommandLine CmdL(Args,_config); @@ -69,6 +71,25 @@ int main(int argc,const char *argv[]) /*{{{*/ return 1; } + if (CmdL.FileList[0] != 0 && strcmp(CmdL.FileList[0], "scenario") == 0) + { + if (pkgInitSystem(*_config,_system) == false) { + std::cerr << "System could not be initialized!" << std::endl; + return 1; + } + pkgCacheFile CacheFile; + CacheFile.Open(NULL, false); + APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1); + FILE* output = stdout; + if (pkgset.empty() == true) + EDSP::WriteScenario(CacheFile, output); + else + EDSP::WriteLimitedScenario(CacheFile, output, pkgset); + fclose(output); + _error->DumpErrors(std::cerr); + return 0; + } + // Deal with stdout not being a tty if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1) _config->Set("quiet","1"); @@ -138,9 +159,9 @@ int main(int argc,const char *argv[]) /*{{{*/ bool const Errors = _error->PendingError(); if (_config->FindI("quiet",0) > 0) - _error->DumpErrors(); + _error->DumpErrors(std::cerr); else - _error->DumpErrors(GlobalError::DEBUG); + _error->DumpErrors(std::cerr, GlobalError::DEBUG); return Errors == true ? 100 : 0; } /*}}}*/ -- cgit v1.2.3-70-g09d2 From e876223c704d8cac6246b4aff4bf683fb8b053e3 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 2 May 2011 11:51:44 +0200 Subject: implement optional Progress report in EDSP --- apt-pkg/edsp.cc | 21 +++++++++++++++++++-- apt-pkg/edsp.h | 1 + cmdline/apt-internal-solver.cc | 13 +++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index aec43c7e8..6343b57cd 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -242,8 +242,16 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache) { type = "Install"; else if (section.Exists("Remove") == true) type = "Remove"; - //FIXME: handle progress - else + else if (section.Exists("Progress") == true) { + ioprintf(std::clog, "[ %3d%% ] ", section.FindI("Percentage", 0)); + std::clog << section.FindS("Progress") << " - "; + string const msg = section.FindS("Message"); + if (msg.empty() == true) + std::clog << "Solver is still working on the solution" << std::endl; + else + std::clog << msg << std::endl; + continue; + } else continue; size_t const id = section.FindULL(type.c_str(), VersionCount); @@ -422,4 +430,13 @@ bool EDSP::WriteSolution(pkgDepCache &Cache, FILE* output) return true; } /*}}}*/ +// EDSP::WriteProgess - pulse to the given file descriptor /*{{{*/ +bool EDSP::WriteProgress(unsigned short const percent, const char* const message, FILE* output) { + fprintf(output, "Progress: %s\n", TimeRFC1123(time(NULL)).c_str()); + fprintf(output, "Percentage: %d\n", percent); + fprintf(output, "Message: %s\n\n", message); + fflush(output); + return true; +} + /*}}}*/ bool EDSP::WriteError(std::string const &message, FILE* output) { return false; } diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index db4f06a7c..a05de9448 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -49,6 +49,7 @@ public: std::list const &remove, pkgDepCache &Cache); bool static WriteSolution(pkgDepCache &Cache, FILE* output); + bool static WriteProgress(unsigned short const percent, const char* const message, FILE* output); bool static WriteError(std::string const &message, FILE* output); }; diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 68489e213..0aa218d52 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -103,11 +103,15 @@ int main(int argc,const char *argv[]) /*{{{*/ FILE* output = stdout; SetNonBlock(input, false); + EDSP::WriteProgress(0, "Start up solver…", output); + if (pkgInitSystem(*_config,_system) == false) { std::cerr << "System could not be initialized!" << std::endl; return 1; } + EDSP::WriteProgress(1, "Read request…", output); + if (WaitFd(input, false, 5) == false) std::cerr << "WAIT timed out in the resolver" << std::endl; @@ -118,9 +122,13 @@ int main(int argc,const char *argv[]) /*{{{*/ return 2; } + EDSP::WriteProgress(5, "Read scenario…", output); + pkgCacheFile CacheFile; CacheFile.Open(NULL, false); + 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; @@ -146,17 +154,22 @@ int main(int argc,const char *argv[]) /*{{{*/ i != install.end(); ++i) CacheFile->MarkInstall(CacheFile->FindPkg(*i), true); + EDSP::WriteProgress(60, "Call problemresolver on current scenario…", output); if (Fix.Resolve() == false) { EDSP::WriteError("An error occured", output); return 0; } + EDSP::WriteProgress(95, "Write solution…", output); + if (EDSP::WriteSolution(CacheFile, output) == false) { std::cerr << "Failed to output the solution!" << std::endl; return 4; } + EDSP::WriteProgress(100, "Done", output); + bool const Errors = _error->PendingError(); if (_config->FindI("quiet",0) > 0) _error->DumpErrors(std::cerr); -- cgit v1.2.3-70-g09d2 From 80699703b6015a8fe7707302f365020f9782cf2c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 10:38:49 +0200 Subject: work on requests with the correct upgrade/dist-upgrade/else resolver --- cmdline/apt-internal-solver.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 0aa218d52..df6a6f569 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -156,7 +156,17 @@ int main(int argc,const char *argv[]) /*{{{*/ EDSP::WriteProgress(60, "Call problemresolver on current scenario…", output); - if (Fix.Resolve() == false) { + if (upgrade == true) { + if (pkgAllUpgrade(CacheFile) == false) { + EDSP::WriteError("An upgrade error occured", output); + return 0; + } + } else if (distUpgrade == true) { + if (pkgDistUpgrade(CacheFile) == false) { + EDSP::WriteError("An dist-upgrade error occured", output); + return 0; + } + } else if (Fix.Resolve() == false) { EDSP::WriteError("An error occured", output); return 0; } -- cgit v1.2.3-70-g09d2 From df783e0aa69f70b7be2b7fb44cc593efd86f7730 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 14:17:29 +0200 Subject: add a --solver option to apt-get --- cmdline/apt-get.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a1264f54a..2312f5a10 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3253,6 +3253,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, {0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean}, {0,"fix-policy","APT::Get::Fix-Policy-Broken",0}, + {0,"solver","APT::Solver::Name",CommandLine::HasArg}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; -- cgit v1.2.3-70-g09d2 From 7f4713547665e12e032501228a98586e5add48f7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 3 May 2011 17:27:11 +0200 Subject: add a tiny dump solver to quickly output a scenario --- cmdline/apt-dump-solver.cc | 50 ++++++++++++++++++++++++++++++++++++++++++++++ cmdline/makefile | 7 +++++++ debian/apt-utils.install | 1 + debian/apt.dirs | 1 + debian/rules | 2 +- 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 cmdline/apt-dump-solver.cc (limited to 'cmdline') diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc new file mode 100644 index 000000000..5bcfe4f06 --- /dev/null +++ b/cmdline/apt-dump-solver.cc @@ -0,0 +1,50 @@ +// -*- mode: cpp; mode: fold -*- +// Description /*{{{*/ +/* ##################################################################### + + dummy solver to get quickly a scenario file out of APT + + ##################################################################### */ + /*}}}*/ +// Include Files /*{{{*/ +#include + +#include + +#include + /*}}}*/ + +// ShowHelp - Show a help screen /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool ShowHelp() { + + std::cout << + PACKAGE " " VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl << + "Usage: apt-dump-resolver\n" + "\n" + "apt-dump-resolver is a dummy solver who just dumps its input to the\n" + "file /tmp/dump.edsp and exists with a proper EDSP error.\n" + "\n" + " This dump has lost Super Cow Powers.\n"; + return true; +} + /*}}}*/ +int main(int argc,const char *argv[]) /*{{{*/ +{ + if (argc > 1 && (strcmp(argv[1], "--help") == 0 || strcmp(argv[1],"-h") == 0 || + strcmp(argv[1],"-v") == 0 || strcmp(argv[1],"--version") == 0)) { + ShowHelp(); + return 0; + } + + FILE* input = fdopen(STDIN_FILENO, "r"); + FILE* output = fopen("/tmp/dump.edsp", "w"); + char buffer[400]; + while (fgets(buffer, sizeof(buffer), input) != NULL) + fputs(buffer, output); + fclose(output); + fclose(input); + + EDSP::WriteError("I am too dumb, i can just dump!", stdout); +} diff --git a/cmdline/makefile b/cmdline/makefile index 4462ccaf4..aea5d1db5 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -71,3 +71,10 @@ SLIBS = -lapt-pkg $(INTLLIBS) LIB_MAKES = apt-pkg/makefile SOURCE = apt-internal-solver.cc include $(PROGRAM_H) + +# The internal solver acting as an external +PROGRAM=apt-dump-solver +SLIBS = -lapt-pkg $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile +SOURCE = apt-dump-solver.cc +include $(PROGRAM_H) diff --git a/debian/apt-utils.install b/debian/apt-utils.install index d947f26d4..0c72bfdc8 100644 --- a/debian/apt-utils.install +++ b/debian/apt-utils.install @@ -1 +1,2 @@ bin/libapt-inst*.so.* usr/lib/ +bin/apt-dump-solver usr/lib/apt/solvers/dump diff --git a/debian/apt.dirs b/debian/apt.dirs index 2770d79bb..f9c0b6c3e 100644 --- a/debian/apt.dirs +++ b/debian/apt.dirs @@ -1,5 +1,6 @@ usr/bin usr/lib/apt/methods +usr/lib/apt/solvers usr/lib/dpkg/methods/apt etc/apt etc/apt/apt.conf.d diff --git a/debian/rules b/debian/rules index c8aefee63..77a7b4fdb 100755 --- a/debian/rules +++ b/debian/rules @@ -182,7 +182,7 @@ apt: build build-doc dh_install -p$@ --sourcedir=$(BLD) # Remove the bits that are in apt-utils - rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS)) + rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver) # https has its own package rm debian/$@/usr/lib/apt/methods/https -- cgit v1.2.3-70-g09d2 From ebfeeaedf5bc357170cae971c0f6a1458ff65f65 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 7 May 2011 15:49:51 +0200 Subject: implement correct error reporting --- apt-pkg/edsp.cc | 14 ++++++++++++-- apt-pkg/edsp.h | 7 ++++++- cmdline/apt-dump-solver.cc | 2 +- cmdline/apt-internal-solver.cc | 6 +++--- 4 files changed, 22 insertions(+), 7 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index d604110ef..7ece92d2e 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -256,6 +256,11 @@ bool EDSP::ReadResponse(int const input, pkgDepCache &Cache) { else std::clog << msg << std::endl; continue; + } else if (section.Exists("Error") == true) { + std::cerr << "The solver encountered an error of type: " << section.FindS("Error") << std::endl; + std::cerr << "The following information might help you to understand what is wrong:" << std::endl; + std::cerr << SubstVar(SubstVar(section.FindS("Message"), "\n .\n", "\n\n"), "\n ", "\n") << std::endl << std::endl; + break; } else if (section.Exists("Autoremove") == true) type = "Autoremove"; else @@ -457,8 +462,13 @@ bool EDSP::WriteProgress(unsigned short const percent, const char* const message return true; } /*}}}*/ -bool EDSP::WriteError(std::string const &message, FILE* output) { return false; } - +// EDSP::WriteError - format an error message to be send to file descriptor /*{{{*/ +bool EDSP::WriteError(char const * const uuid, std::string const &message, FILE* output) { + fprintf(output, "Error: %s\n", uuid); + fprintf(output, "Message: %s\n\n", SubstVar(SubstVar(message, "\n\n", "\n.\n"), "\n", "\n ").c_str()); + return true; +} + /*}}}*/ // EDSP::ExecuteSolver - fork requested solver and setup ipc pipes {{{*/ bool EDSP::ExecuteSolver(const char* const solver, int *solver_in, int *solver_out) { std::vector const solverDirs = _config->FindVector("Dir::Bin::Solvers"); diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 98a70d7f6..210188d03 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -171,8 +171,13 @@ public: * * The first line of the message should be a short description * of the error so it can be used for dialog titles or alike + * + * \param uuid of this error message + * \param message is free form text to discribe the error + * \param output the front-end listens for error messages */ - bool static WriteError(std::string const &message, FILE* output); + bool static WriteError(char const * const uuid, std::string const &message, FILE* output); + /** \brief executes the given solver and returns the pipe ends * diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc index 5bcfe4f06..dab0cc6fd 100644 --- a/cmdline/apt-dump-solver.cc +++ b/cmdline/apt-dump-solver.cc @@ -46,5 +46,5 @@ int main(int argc,const char *argv[]) /*{{{*/ fclose(output); fclose(input); - EDSP::WriteError("I am too dumb, i can just dump!", stdout); + EDSP::WriteError("ERR_JUST_DUMPING", "I am too dumb, i can just dump!\nPlease use one of my friends instead!", stdout); } diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index df6a6f569..ad00a0e23 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -158,16 +158,16 @@ int main(int argc,const char *argv[]) /*{{{*/ if (upgrade == true) { if (pkgAllUpgrade(CacheFile) == false) { - EDSP::WriteError("An upgrade error occured", output); + EDSP::WriteError("ERR_UNSOLVABLE_UPGRADE", "An upgrade error occured", output); return 0; } } else if (distUpgrade == true) { if (pkgDistUpgrade(CacheFile) == false) { - EDSP::WriteError("An dist-upgrade error occured", output); + EDSP::WriteError("ERR_UNSOLVABLE_DIST_UPGRADE", "An dist-upgrade error occured", output); return 0; } } else if (Fix.Resolve() == false) { - EDSP::WriteError("An error occured", output); + EDSP::WriteError("ERR_UNSOLVABLE", "An error occured", output); return 0; } -- cgit v1.2.3-70-g09d2 From 98278a81bf554246b70b97852c9b8b92eac390ea Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 17:42:01 +0200 Subject: rename option APT::Solver::Name to simply APT::Solver --- apt-pkg/algorithms.cc | 8 ++++---- apt-pkg/depcache.cc | 4 ++-- apt-pkg/edsp.cc | 2 +- cmdline/apt-get.cc | 2 +- cmdline/apt-internal-solver.cc | 2 +- doc/external-dependency-solver-protocol.txt | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 6f1f82d50..47bdd4aba 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -330,7 +330,7 @@ bool pkgFixBroken(pkgDepCache &Cache) */ bool pkgDistUpgrade(pkgDepCache &Cache) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, &Prog); @@ -388,7 +388,7 @@ bool pkgDistUpgrade(pkgDepCache &Cache) to install packages not marked for install */ bool pkgAllUpgrade(pkgDepCache &Cache) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog); @@ -745,7 +745,7 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg) /* */ bool pkgProblemResolver::Resolve(bool BrokenFix) { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false, &Prog); @@ -1211,7 +1211,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix) system was non-broken previously. */ bool pkgProblemResolver::ResolveByKeep() { - std::string const solver = _config->Find("APT::Solver::Name", "internal"); + std::string const solver = _config->Find("APT::Solver", "internal"); if (solver != "internal") { OpTextProgress Prog(*_config); return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog); diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 5cb68804d..947435706 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1046,7 +1046,7 @@ void pkgDepCache::MarkInstall(PkgIterator const &Pkg,bool AutoInst, Update(Pkg); AddSizes(Pkg); - if (AutoInst == false || _config->Find("APT::Solver::Name", "internal") != "internal") + if (AutoInst == false || _config->Find("APT::Solver", "internal") != "internal") return; if (DebugMarker == true) @@ -1605,7 +1605,7 @@ bool pkgDepCache::MarkFollowsSuggests() // pkgDepCache::MarkRequired - the main mark algorithm /*{{{*/ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc) { - if (_config->Find("APT::Solver::Name", "internal") != "internal") + if (_config->Find("APT::Solver", "internal") != "internal") return true; bool follow_recommends; diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 218ce9f24..02ef7d04b 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -231,7 +231,7 @@ bool EDSP::WriteRequest(pkgDepCache &Cache, FILE* output, bool const Upgrade, if (_config->FindB("APT::Solver::Strict-Pinning", true) == false) fprintf(output, "Strict-Pinning: no\n"); string solverpref("APT::Solver::"); - solverpref.append(_config->Find("APT::Solver::Name", "internal")).append("::Preferences"); + solverpref.append(_config->Find("APT::Solver", "internal")).append("::Preferences"); if (_config->Exists(solverpref) == true) fprintf(output, "Preferences: %s\n", _config->Find(solverpref,"").c_str()); fprintf(output, "\n"); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index fdb1033a1..d48ca18f9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3270,7 +3270,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {0,"install-recommends","APT::Install-Recommends",CommandLine::Boolean}, {0,"install-suggests","APT::Install-Suggests",CommandLine::Boolean}, {0,"fix-policy","APT::Get::Fix-Policy-Broken",0}, - {0,"solver","APT::Solver::Name",CommandLine::HasArg}, + {0,"solver","APT::Solver",CommandLine::HasArg}, {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,0,0,0}}; diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index ad00a0e23..ef6c688fe 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -97,7 +97,7 @@ int main(int argc,const char *argv[]) /*{{{*/ if (_config->FindI("quiet", 0) < 1) _config->Set("Debug::EDSP::WriteSolution", true); - _config->Set("APT::Solver::Name", "internal"); + _config->Set("APT::Solver", "internal"); _config->Set("edsp::scenario", "stdin"); int input = STDIN_FILENO; FILE* output = stdout; diff --git a/doc/external-dependency-solver-protocol.txt b/doc/external-dependency-solver-protocol.txt index ae01fbc35..7a124d8f9 100644 --- a/doc/external-dependency-solver-protocol.txt +++ b/doc/external-dependency-solver-protocol.txt @@ -47,7 +47,7 @@ Several APT options can be used to affect dependency solving in APT. An overview of them is given below. Please refer to proper APT configuration documentation for more, and more up to date, information. -- **APT::Solver::Name**: the name of the solver to be used for +- **APT::Solver**: the name of the solver to be used for dependency solving. Defaults to `internal` - **APT::Solver::Strict-Pinning**: whether pinning must be strictly -- cgit v1.2.3-70-g09d2 From d953d210bb54accb416f2144104b79dcd29198ba Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 17 May 2011 20:20:46 +0200 Subject: * cmdline/apt-get.cc: - do not discard the error messages from the resolver and instead only show the general 'Broken packages' message if nothing else --- cmdline/apt-get.cc | 10 ++++++---- debian/changelog | 5 ++++- test/integration/test-handling-broken-orgroups | 4 ++-- test/integration/test-release-candidate-switching | 2 +- 4 files changed, 13 insertions(+), 8 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d48ca18f9..65eaef0d8 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1886,8 +1886,7 @@ bool DoInstall(CommandLine &CmdL) { // Call the scored problem resolver Fix->InstallProtect(); - if (Fix->Resolve(true) == false) - ; //FIXME: is there a valid reason for? _error->Discard(); + Fix->Resolve(true); delete Fix; } @@ -1913,8 +1912,11 @@ bool DoInstall(CommandLine &CmdL) c1out << _("The following information may help to resolve the situation:") << endl; c1out << endl; ShowBroken(c1out,Cache,false); - return _error->Error(_("Broken packages")); - } + if (_error->PendingError() == true) + return false; + else + return _error->Error(_("Broken packages")); + } } if (!DoAutomaticRemove(Cache)) return false; diff --git a/debian/changelog b/debian/changelog index 9fc6dc193..71f64dc23 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,12 +16,15 @@ apt (0.8.15) UNRELEASED; urgency=low - let the Mark methods return if their marking was successful - if a Breaks can't be upgraded, remove it. If it or a Conflict can't be removed the installation of the breaker fails. + * cmdline/apt-get.cc: + - do not discard the error messages from the resolver and instead + only show the general 'Broken packages' message if nothing else [ Stefano Zacchiroli ] * doc/external-dependency-solver-protocol.txt: - describe EDSP and the configuration interface around it - -- David Kalnischkies Tue, 17 May 2011 17:59:24 +0200 + -- David Kalnischkies Tue, 17 May 2011 18:43:21 +0200 apt (0.8.14.2) UNRELEASED; urgency=low diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index d88ad0000..20b314074 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -58,7 +58,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-broken : Depends: cool2 but it is not installable or stuff2 but it is not installable -E: Broken packages' aptget install coolstuff-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s testequal 'Reading package lists... Building dependency tree... @@ -105,4 +105,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-provided-broken : Depends: cool2 but it is not installable or stuff-abi-2 -E: Broken packages' aptget install coolstuff-provided-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s diff --git a/test/integration/test-release-candidate-switching b/test/integration/test-release-candidate-switching index b6dbe99db..0970cb935 100755 --- a/test/integration/test-release-candidate-switching +++ b/test/integration/test-release-candidate-switching @@ -416,4 +416,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: uninstallablepkg : Depends: libmtp8 (>= 10:0.20.1) but it is not going to be installed Depends: amarok-utils (= 2.3.2-2+exp) but 2.3.1-1+sid is to be installed -E: Broken packages" aptget install uninstallablepkg/experimental --trivial-only -V -q=0 +E: Unable to correct problems, you have held broken packages." aptget install uninstallablepkg/experimental --trivial-only -V -q=0 -- cgit v1.2.3-70-g09d2 From d4cfaed3d822b207f24ce11768ee14682a0c8f6b Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 14 Jul 2011 12:08:16 +0200 Subject: * cmdline/apt-get.cc: - add an --assume-no option for testing to say 'no' to everything --- cmdline/apt-get.cc | 8 +++++++- debian/changelog | 4 +++- doc/apt-get.8.xml | 5 +++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 66ebd30b8..94e078cb3 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -135,6 +135,11 @@ bool YnPrompt(bool Default=true) c1out << _("Y") << endl; return true; } + else if (_config->FindB("APT::Get::Assume-No",false) == true) + { + c1out << _("N") << endl; + return false; + } char response[1024] = ""; cin.getline(response, sizeof(response)); @@ -3245,7 +3250,8 @@ int main(int argc,const char *argv[]) /*{{{*/ {'s',"dry-run","APT::Get::Simulate",0}, {'s',"no-act","APT::Get::Simulate",0}, {'y',"yes","APT::Get::Assume-Yes",0}, - {'y',"assume-yes","APT::Get::Assume-Yes",0}, + {'y',"assume-yes","APT::Get::Assume-Yes",0}, + {0,"assume-no","APT::Get::Assume-No",0}, {'f',"fix-broken","APT::Get::Fix-Broken",0}, {'u',"show-upgraded","APT::Get::Show-Upgraded",0}, {'m',"ignore-missing","APT::Get::Fix-Missing",0}, diff --git a/debian/changelog b/debian/changelog index 7b1ca1df0..5686e02fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,13 +9,15 @@ apt (0.8.16~exp3) UNRELEASEDexperimental; urgency=low converting (hopefully) everything to 'long long' (Closes: #632271) * ftparchive/writer.cc: - generate all checksums in one run over the file for Release + * cmdline/apt-get.cc: + - add an --assume-no option for testing to say 'no' to everything [ Michael Vogt ] * merge fixes from the debian/unstable upload * merge lp:~mvo/apt/sha512-template to get fixes for the sha1/md5 verifiation (closes: #632520) - -- David Kalnischkies Wed, 13 Jul 2011 23:22:14 +0200 + -- David Kalnischkies Thu, 14 Jul 2011 12:01:53 +0200 apt (0.8.16~exp2) experimental; urgency=low diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index 11b53e5e7..23e682fd9 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -422,6 +422,11 @@ Configuration Item: APT::Get::Assume-Yes. + + Automatic "no" to all prompts. + Configuration Item: APT::Get::Assume-No. + + Show upgraded packages; Print out a list of all packages that are to be upgraded. -- cgit v1.2.3-70-g09d2 From dbbc549457825d5b6507fdd62bcf323ed3a3fb2a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 14 Jul 2011 15:54:25 +0200 Subject: replace the last standing double's with long long --- apt-pkg/acquire.cc | 9 ++++----- apt-pkg/acquire.h | 14 ++++++-------- cmdline/acqprogress.cc | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index fff487dc8..2064abc50 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -799,7 +799,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) } // Compute the current completion - unsigned long ResumeSize = 0; + unsigned long long ResumeSize = 0; for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0; I = Owner->WorkerStep(I)) if (I->CurrentItem != 0 && I->CurrentItem->Owner->Complete == false) @@ -838,7 +838,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) else CurrentCPS = ((CurrentBytes - ResumeSize) - LastBytes)/Delta; LastBytes = CurrentBytes - ResumeSize; - ElapsedTime = (unsigned long)Delta; + ElapsedTime = (unsigned long long)Delta; Time = NewTime; } @@ -849,8 +849,7 @@ bool pkgAcquireStatus::Pulse(pkgAcquire *Owner) char msg[200]; long i = CurrentItems < TotalItems ? CurrentItems + 1 : CurrentItems; - unsigned long ETA = - (unsigned long)((TotalBytes - CurrentBytes) / CurrentCPS); + unsigned long long const ETA = (TotalBytes - CurrentBytes) / CurrentCPS; // only show the ETA if it makes sense if (ETA > 0 && ETA < 172800 /* two days */ ) @@ -906,7 +905,7 @@ void pkgAcquireStatus::Stop() else CurrentCPS = FetchedBytes/Delta; LastBytes = CurrentBytes; - ElapsedTime = (unsigned int)Delta; + ElapsedTime = (unsigned long long)Delta; } /*}}}*/ // AcquireStatus::Fetched - Called when a byte set has been fetched /*{{{*/ diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h index 8fad91497..c9eaa67d1 100644 --- a/apt-pkg/acquire.h +++ b/apt-pkg/acquire.h @@ -650,8 +650,6 @@ struct pkgAcquire::MethodConfig /** \brief A monitor object for downloads controlled by the pkgAcquire class. {{{ * * \todo Why protected members? - * - * \todo Should the double members be uint64_t? */ class pkgAcquireStatus { @@ -669,34 +667,34 @@ class pkgAcquireStatus /** \brief The number of bytes fetched as of the previous call to * pkgAcquireStatus::Pulse, including local items. */ - double LastBytes; + unsigned long long LastBytes; /** \brief The current rate of download as of the most recent call * to pkgAcquireStatus::Pulse, in bytes per second. */ - double CurrentCPS; + unsigned long long CurrentCPS; /** \brief The number of bytes fetched as of the most recent call * to pkgAcquireStatus::Pulse, including local items. */ - double CurrentBytes; + unsigned long long CurrentBytes; /** \brief The total number of bytes that need to be fetched. * * \warning This member is inaccurate, as new items might be * enqueued while the download is in progress! */ - double TotalBytes; + unsigned long long TotalBytes; /** \brief The total number of bytes accounted for by items that * were successfully fetched. */ - double FetchedBytes; + unsigned long long FetchedBytes; /** \brief The amount of time that has elapsed since the download * started. */ - unsigned long ElapsedTime; + unsigned long long ElapsedTime; /** \brief The total number of items that need to be fetched. * diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index ba334ce05..d2db949ea 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -200,7 +200,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) // Add the current progress if (Mode == Long) - snprintf(S,End-S," %lu",I->CurrentSize); + snprintf(S,End-S," %llu",I->CurrentSize); else { if (Mode == Medium || I->TotalSize == 0) -- cgit v1.2.3-70-g09d2 From a2cba9cca24762c090ee6988f14ae40f92a6441f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 28 Jul 2011 10:19:30 +0200 Subject: cmdline/makefile: ajust comment --- cmdline/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/makefile b/cmdline/makefile index 6d988a8f5..07e9eb8ca 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -73,7 +73,7 @@ LIB_MAKES = apt-pkg/makefile SOURCE = apt-internal-solver.cc include $(PROGRAM_H) -# The internal solver acting as an external +# This just dumps out the state PROGRAM=apt-dump-solver SLIBS = -lapt-pkg $(INTLLIBS) LIB_MAKES = apt-pkg/makefile -- cgit v1.2.3-70-g09d2 From ea54214002c09eeb4dd498d97a564471ec9993c5 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 10:09:00 +0200 Subject: reorder includes: add if needed and include it at first --- apt-inst/contrib/arfile.cc | 5 ++++- apt-inst/contrib/extracttar.cc | 4 +++- apt-inst/database.cc | 2 ++ apt-inst/deb/debfile.cc | 2 ++ apt-inst/deb/dpkgdb.cc | 2 ++ apt-inst/dirstream.cc | 2 ++ apt-inst/extract.cc | 2 ++ apt-inst/filelist.cc | 2 ++ apt-pkg/acquire-item.cc | 6 ++++-- apt-pkg/acquire-method.cc | 2 ++ apt-pkg/acquire-worker.cc | 8 +++++--- apt-pkg/acquire.cc | 6 ++++-- apt-pkg/algorithms.cc | 6 ++++-- apt-pkg/aptconfiguration.cc | 2 ++ apt-pkg/cachefile.cc | 4 +++- apt-pkg/cachefilter.cc | 2 ++ apt-pkg/cacheset.cc | 6 ++++-- apt-pkg/cdrom.cc | 5 +++-- apt-pkg/clean.cc | 6 ++++-- apt-pkg/contrib/cdromutl.cc | 6 ++++-- apt-pkg/contrib/cmndline.cc | 4 +++- apt-pkg/contrib/configuration.cc | 5 ++++- apt-pkg/contrib/crc-16.cc | 2 ++ apt-pkg/contrib/error.cc | 5 +++-- apt-pkg/contrib/fileutl.cc | 7 ++++--- apt-pkg/contrib/hashes.cc | 4 +++- apt-pkg/contrib/hashsum.cc | 1 + apt-pkg/contrib/md5.cc | 3 ++- apt-pkg/contrib/mmap.cc | 9 +++++---- apt-pkg/contrib/netrc.cc | 1 + apt-pkg/contrib/progress.cc | 6 ++++-- apt-pkg/contrib/sha1.cc | 3 ++- apt-pkg/contrib/sha2_internal.cc | 1 + apt-pkg/contrib/strutl.cc | 6 +++--- apt-pkg/deb/debindexfile.cc | 2 ++ apt-pkg/deb/deblistparser.cc | 2 ++ apt-pkg/deb/debmetaindex.cc | 1 + apt-pkg/deb/debrecords.cc | 2 ++ apt-pkg/deb/debsrcrecords.cc | 2 ++ apt-pkg/deb/debsystem.cc | 5 ++++- apt-pkg/deb/debversion.cc | 1 + apt-pkg/deb/dpkgpm.cc | 3 ++- apt-pkg/depcache.cc | 6 ++++-- apt-pkg/edsp.cc | 6 ++++-- apt-pkg/edsp/edspindexfile.cc | 2 ++ apt-pkg/edsp/edsplistparser.cc | 2 ++ apt-pkg/edsp/edspsystem.cc | 5 ++++- apt-pkg/indexcopy.cc | 6 ++++-- apt-pkg/indexfile.cc | 2 ++ apt-pkg/indexrecords.cc | 4 +++- apt-pkg/init.cc | 6 ++++-- apt-pkg/orderlist.cc | 2 ++ apt-pkg/packagemanager.cc | 8 +++++--- apt-pkg/pkgcache.cc | 7 ++++--- apt-pkg/pkgcachegen.cc | 7 +++---- apt-pkg/pkgrecords.cc | 6 ++++-- apt-pkg/pkgsystem.cc | 2 ++ apt-pkg/policy.cc | 6 ++++-- apt-pkg/sourcelist.cc | 6 ++++-- apt-pkg/srcrecords.cc | 6 ++++-- apt-pkg/tagfile.cc | 6 ++++-- apt-pkg/vendor.cc | 2 ++ apt-pkg/vendorlist.cc | 2 ++ apt-pkg/version.cc | 2 ++ apt-pkg/versionmatch.cc | 4 ++-- cmdline/acqprogress.cc | 8 +++++--- cmdline/apt-cache.cc | 10 +++++----- cmdline/apt-cdrom.cc | 8 ++++---- cmdline/apt-config.cc | 7 ++++--- cmdline/apt-extracttemplates.cc | 5 +++-- cmdline/apt-get.cc | 7 ++++--- cmdline/apt-mark.cc | 7 ++++--- cmdline/apt-sortpkgs.cc | 7 ++++--- ftparchive/apt-ftparchive.cc | 11 ++++++----- ftparchive/cachedb.cc | 6 ++++-- ftparchive/contents.cc | 6 ++++-- ftparchive/multicompress.cc | 12 +++++++----- ftparchive/override.cc | 6 +++--- ftparchive/writer.cc | 10 ++++++---- methods/bzip2.cc | 2 ++ methods/cdrom.cc | 2 ++ methods/connect.cc | 4 +++- methods/copy.cc | 2 ++ methods/file.cc | 2 ++ methods/ftp.cc | 4 +++- methods/gpgv.cc | 6 ++++-- methods/gzip.cc | 2 ++ methods/http.cc | 6 ++++-- methods/http_main.cc | 2 ++ methods/https.cc | 5 +++-- methods/mirror.cc | 4 +++- methods/rfc2553emu.cc | 4 +++- methods/rred.cc | 2 ++ methods/rsh.cc | 5 ++++- 94 files changed, 291 insertions(+), 131 deletions(-) (limited to 'cmdline') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 8018f4d30..533c563f9 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -14,13 +14,16 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include - /*}}}*/ + #include + /*}}}*/ struct ARArchive::MemberHeader { diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 01b6b3836..487027c3d 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -16,8 +16,9 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include +#include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include #include + #include /*}}}*/ diff --git a/apt-inst/database.cc b/apt-inst/database.cc index a5020f3d7..0647959a9 100644 --- a/apt-inst/database.cc +++ b/apt-inst/database.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include /*}}}*/ diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index a40cd1ae8..e80d8c735 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -16,6 +16,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index a75cf59ca..3112acdbd 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc index 9b6a56848..bb0bf96c1 100644 --- a/apt-inst/dirstream.cc +++ b/apt-inst/dirstream.cc @@ -11,6 +11,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index cd8edb27a..d48ff63ac 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -44,6 +44,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-inst/filelist.cc b/apt-inst/filelist.cc index 060aa53d7..879c07855 100644 --- a/apt-inst/filelist.cc +++ b/apt-inst/filelist.cc @@ -32,6 +32,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index aa77824f8..d798c7107 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -24,8 +26,6 @@ #include #include -#include - #include #include #include @@ -33,6 +33,8 @@ #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc index 8c353beb2..69f7b1c57 100644 --- a/apt-pkg/acquire-method.cc +++ b/apt-pkg/acquire-method.cc @@ -15,6 +15,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 3e1fd98db..366879a57 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -12,6 +12,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -19,18 +21,18 @@ #include #include -#include - #include #include #include - + #include #include #include #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index 2064abc50..e33dbb5d5 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -21,8 +23,6 @@ #include #include -#include - #include #include #include @@ -30,6 +30,8 @@ #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 8737c5334..d5652791c 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -14,6 +14,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -22,13 +24,13 @@ #include #include -#include #include #include #include #include - #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/aptconfiguration.cc b/apt-pkg/aptconfiguration.cc index e8c8e73d0..71e0b8e73 100644 --- a/apt-pkg/aptconfiguration.cc +++ b/apt-pkg/aptconfiguration.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index 964c5bd8b..b60b1cc0f 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -12,6 +12,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -21,7 +23,7 @@ #include #include #include - + #include /*}}}*/ // CacheFile::CacheFile - Constructor /*{{{*/ diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc index 8f0725ea3..210a9a9ab 100644 --- a/apt-pkg/cachefilter.cc +++ b/apt-pkg/cachefilter.cc @@ -4,6 +4,8 @@ Collection of functor classes */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index a1de613e2..386ecfb5f 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -16,11 +18,11 @@ #include #include -#include - #include #include + +#include /*}}}*/ namespace APT { // FromTask - Return all packages in the cache from a specific task /*{{{*/ diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 2a914c665..c432cf509 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -1,5 +1,6 @@ /* */ +#include #include #include @@ -10,8 +11,6 @@ #include #include -#include -#include #include #include #include @@ -22,6 +21,8 @@ #include "indexcopy.h" +#include + using namespace std; // FindPackages - Find the package files on the CDROM /*{{{*/ diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index 629afd7cf..2e5fd675a 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -8,17 +8,19 @@ ##################################################################### */ /*}}}*/ // Includes /*{{{*/ +#include + #include #include #include #include #include -#include - #include #include #include + +#include /*}}}*/ // ArchiveCleaner::Go - Perform smart cleanup of the archive /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 821e6d688..7f30f132d 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -10,6 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -17,8 +19,6 @@ #include #include -#include - #include #include #include @@ -26,6 +26,8 @@ #include #include #include + +#include /*}}}*/ // IsMounted - Returns true if the mount point is mounted /*{{{*/ diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 5a9944096..34e90da20 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -11,11 +11,13 @@ ##################################################################### */ /*}}}*/ // Include files /*{{{*/ +#include + #include #include #include -#include +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 0664e3704..b3e9d8863 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -15,16 +15,19 @@ ##################################################################### */ /*}}}*/ // Include files /*{{{*/ +#include + #include #include #include #include -#include #include #include #include +#include + using namespace std; /*}}}*/ diff --git a/apt-pkg/contrib/crc-16.cc b/apt-pkg/contrib/crc-16.cc index b300ed67e..26ea1ba28 100644 --- a/apt-pkg/contrib/crc-16.cc +++ b/apt-pkg/contrib/crc-16.cc @@ -15,6 +15,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include /*}}}*/ diff --git a/apt-pkg/contrib/error.cc b/apt-pkg/contrib/error.cc index 18810d2a4..56bbd1c60 100644 --- a/apt-pkg/contrib/error.cc +++ b/apt-pkg/contrib/error.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include @@ -24,8 +26,7 @@ #include #include -#include "config.h" - /*}}}*/ + /*}}}*/ // Global Error Object /*{{{*/ /* If the implementation supports posix threads then the accessor function diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 50019872e..690e2403c 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -18,14 +18,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include -#include - #include #include #include @@ -43,10 +43,11 @@ #include #include -#include #ifdef WORDS_BIGENDIAN #include #endif + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 4407574fa..9c251e89f 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -11,12 +11,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include -#include +#include #include #include /*}}}*/ diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index 728747d7a..28f711176 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -1,4 +1,5 @@ // Cryptographic API Base +#include #include #include "hashsum_template.h" diff --git a/apt-pkg/contrib/md5.cc b/apt-pkg/contrib/md5.cc index 65e20e9bb..b53c4fbd2 100644 --- a/apt-pkg/contrib/md5.cc +++ b/apt-pkg/contrib/md5.cc @@ -35,6 +35,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -43,7 +45,6 @@ #include #include // For htonl #include -#include /*}}}*/ // byteSwap - Swap bytes in a buffer /*{{{*/ diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 19381ae47..3cd87eda4 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -17,20 +17,21 @@ /*}}}*/ // Include Files /*{{{*/ #define _BSD_SOURCE +#include + #include #include -#include - #include #include #include #include #include #include - #include - /*}}}*/ + +#include + /*}}}*/ // MMap::MMap - Constructor /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 34f472ee1..456ada950 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -11,6 +11,7 @@ ##################################################################### */ /*}}}*/ +#include #include #include diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 84ee4c124..6cd6134d3 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -8,15 +8,17 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include -#include - #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc index 4b0552102..9416895ac 100644 --- a/apt-pkg/contrib/sha1.cc +++ b/apt-pkg/contrib/sha1.cc @@ -29,6 +29,8 @@ */ /*}}} */ // Include Files /*{{{*/ +#include + #include #include #include @@ -36,7 +38,6 @@ #include #include #include -#include /*}}}*/ // SHA1Transform - Alters an existing SHA-1 hash /*{{{*/ diff --git a/apt-pkg/contrib/sha2_internal.cc b/apt-pkg/contrib/sha2_internal.cc index 565db2f91..ff995cdf2 100644 --- a/apt-pkg/contrib/sha2_internal.cc +++ b/apt-pkg/contrib/sha2_internal.cc @@ -31,6 +31,7 @@ * * $Id: sha2.c,v 1.1 2001/11/08 00:01:51 adg Exp adg $ */ +#include #include /* memcpy()/memset() or bcopy()/bzero() */ #include /* assert() */ diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 072dda3ac..6586ef17b 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -15,12 +15,12 @@ ##################################################################### */ /*}}}*/ // Includes /*{{{*/ +#include + #include #include #include -#include - #include #include #include @@ -31,7 +31,7 @@ #include #include -#include "config.h" +#include using namespace std; /*}}}*/ diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index c9e7f1176..303dab796 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index b708296d3..6b8fbce99 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -10,6 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 81afb22b6..aaae906dd 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -1,4 +1,5 @@ // ijones, walters +#include #include #include diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 1ca9ae1d2..db62d6c45 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 749305005..c9c20267b 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 7644bc66b..080af5659 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -10,6 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -17,11 +19,12 @@ #include #include #include -#include #include #include #include #include + +#include /*}}}*/ debSystem debSys; diff --git a/apt-pkg/deb/debversion.cc b/apt-pkg/deb/debversion.cc index 755ffbe96..ba32b2dd4 100644 --- a/apt-pkg/deb/debversion.cc +++ b/apt-pkg/deb/debversion.cc @@ -11,6 +11,7 @@ /*}}}*/ // Include Files /*{{{*/ #define APT_COMPATIBILITY 986 +#include #include #include diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 019b72bb8..7733390c0 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Includes /*{{{*/ +#include + #include #include #include @@ -40,7 +42,6 @@ #include #include -#include #include /*}}}*/ diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 72a0bb542..0fbd77fd8 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -23,12 +25,12 @@ #include #include -#include +#include #include #include -#include +#include /*}}}*/ // helper for Install-Recommends-Sections and Never-MarkAuto-Sections /*{{{*/ static bool diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 4d2230613..44f7dbfd6 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -5,6 +5,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -12,10 +14,10 @@ #include #include -#include #include - #include + +#include /*}}}*/ // we could use pkgCache::DepType and ::Priority, but these would be localized strings… diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index f5881e663..b417a7562 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -6,6 +6,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/edsp/edsplistparser.cc b/apt-pkg/edsp/edsplistparser.cc index 3349e8cce..e00abdbcc 100644 --- a/apt-pkg/edsp/edsplistparser.cc +++ b/apt-pkg/edsp/edsplistparser.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/edsp/edspsystem.cc b/apt-pkg/edsp/edspsystem.cc index ac0bb8beb..10d75771a 100644 --- a/apt-pkg/edsp/edspsystem.cc +++ b/apt-pkg/edsp/edspsystem.cc @@ -9,17 +9,20 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include #include -#include #include #include #include #include + +#include /*}}}*/ edspSystem edspSys; diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 31c577705..dcba78dce 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -10,7 +10,7 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "indexcopy.h" +#include #include #include @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -30,6 +29,9 @@ #include #include #include + +#include "indexcopy.h" +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc index 37be87055..b56d9dc6c 100644 --- a/apt-pkg/indexfile.cc +++ b/apt-pkg/indexfile.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 10e154ad2..00f520c4f 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -3,15 +3,17 @@ // $Id: indexrecords.cc,v 1.1.2.4 2003/12/30 02:11:43 mdz Exp $ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include -#include #include #include +#include /*}}}*/ string indexRecords::GetDist() const { diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 8f20c31df..97a39e96e 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -8,14 +8,16 @@ ##################################################################### */ /*}}}*/ // Include files /*{{{*/ +#include + #include #include #include -#include -#include #include #include + +#include /*}}}*/ #define Stringfy_(x) # x diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index 19661fc2d..4dcb31b7e 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -63,6 +63,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 1ae09347a..6f9f4748f 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -22,10 +24,10 @@ #include #include #include - -#include + +#include #include -#include +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc index 951caeb78..0a81cb791 100644 --- a/apt-pkg/pkgcache.cc +++ b/apt-pkg/pkgcache.cc @@ -20,6 +20,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -29,13 +31,12 @@ #include #include -#include - #include #include #include - #include + +#include /*}}}*/ using std::string; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index b89c8c0d3..1cae23134 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -11,6 +11,7 @@ /*}}}*/ // Include Files /*{{{*/ #define APT_COMPATIBILITY 986 +#include #include #include @@ -23,17 +24,15 @@ #include #include #include - #include -#include - #include - #include #include #include #include + +#include /*}}}*/ typedef vector::iterator FileIterator; template std::vector pkgCacheGenerator::Dynamic::toReMap; diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index e506de73a..9459f7def 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -9,12 +9,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include - -#include + +#include /*}}}*/ // Records::pkgRecords - Constructor /*{{{*/ diff --git a/apt-pkg/pkgsystem.cc b/apt-pkg/pkgsystem.cc index 6dd2d3ee4..f61c140fa 100644 --- a/apt-pkg/pkgsystem.cc +++ b/apt-pkg/pkgsystem.cc @@ -10,6 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index be96d4c84..372b58a7c 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -23,6 +23,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -31,10 +33,10 @@ #include #include -#include - #include #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 851eefdfe..d4eec5c8d 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -8,15 +8,17 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include #include -#include - #include + +#include /*}}}*/ using namespace std; diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 46a02b55c..b368322f5 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -11,12 +11,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include #include - -#include + +#include /*}}}*/ // SrcRecords::pkgSrcRecords - Constructor /*{{{*/ diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index a8f04b23a..3b491fcd2 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -11,15 +11,17 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include -#include - #include #include #include + +#include /*}}}*/ using std::string; diff --git a/apt-pkg/vendor.cc b/apt-pkg/vendor.cc index 2350afe69..eab6d448f 100644 --- a/apt-pkg/vendor.cc +++ b/apt-pkg/vendor.cc @@ -1,3 +1,5 @@ +#include + #include #include #include diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc index 48ac12cee..8432091e8 100644 --- a/apt-pkg/vendorlist.cc +++ b/apt-pkg/vendorlist.cc @@ -1,3 +1,5 @@ +#include + #include #include #include diff --git a/apt-pkg/version.cc b/apt-pkg/version.cc index 42e449d36..a9d4fb763 100644 --- a/apt-pkg/version.cc +++ b/apt-pkg/version.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index c40b1fdbc..c23b4c3bf 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -11,8 +11,9 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include +#include +#include #include #include @@ -21,7 +22,6 @@ #include #include #include - /*}}}*/ // VersionMatch::pkgVersionMatch - Constructor /*{{{*/ diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index d2db949ea..fd80ea126 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -8,19 +8,21 @@ ##################################################################### */ /*}}}*/ // Include files /*{{{*/ -#include "acqprogress.h" +#include + #include #include #include #include #include -#include - #include #include #include #include + +#include "acqprogress.h" +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 232bb93ec..588c3c409 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -13,8 +13,9 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include -#include #include #include #include @@ -31,17 +32,16 @@ #include #include -#include -#include - +#include #include #include #include #include #include #include - #include + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index d1268edf9..8608b1215 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -11,6 +11,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -21,10 +23,6 @@ #include #include #include -#include -#include - -//#include "indexcopy.h" #include #include @@ -36,6 +34,8 @@ #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 589ee7ada..df2958975 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -16,6 +16,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -23,13 +25,12 @@ #include #include -#include -#include - #include #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 07bc0c25d..5d7b76c23 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -28,7 +30,7 @@ #include #include #include - + #include #include #include @@ -36,7 +38,6 @@ #include #include -#include #include #include "apt-extracttemplates.h" /*}}}*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1a03acaa8..1bf4cf6f9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -25,6 +25,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE @@ -46,9 +48,6 @@ #include #include -#include -#include - #include "acqprogress.h" #include @@ -68,6 +67,8 @@ #include #include +#include + #define statfs statfs64 #define statvfs statvfs64 /*}}}*/ diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index b2c664979..8c9a47913 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -5,6 +5,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -12,10 +14,9 @@ #include #include -#include -#include - #include + +#include /*}}}*/ using namespace std; diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 171b0ba13..219e7ddff 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -12,6 +12,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -19,14 +21,13 @@ #include #include -#include -#include - #include #include #include #include + +#include /*}}}*/ using namespace std; diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 0762a2b28..6ad8ac572 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -10,24 +10,25 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "apt-ftparchive.h" - +#include + #include #include #include #include #include -#include -#include #include #include #include #include +#include "apt-ftparchive.h" #include "contents.h" #include "multicompress.h" -#include "writer.h" +#include "writer.h" + +#include /*}}}*/ using namespace std; diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index 7e4c2e9fe..a1d70f912 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -10,9 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "cachedb.h" +#include -#include #include #include #include @@ -21,6 +20,9 @@ #include #include // htonl, etc + +#include +#include "cachedb.h" /*}}}*/ // CacheDB::ReadyDB - Ready the DB2 /*{{{*/ diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index eadced626..adb590ed1 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -33,9 +33,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "contents.h" +#include -#include #include #include #include @@ -43,6 +42,9 @@ #include #include #include + +#include +#include "contents.h" /*}}}*/ // GenContents::~GenContents - Free allocated memory /*{{{*/ diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index f82879015..04560f4ab 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -14,18 +14,20 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "multicompress.h" - -#include +#include + #include #include #include - + #include #include #include #include -#include +#include + +#include "multicompress.h" +#include /*}}}*/ using namespace std; diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 3cf10b89b..045a8b113 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -10,14 +10,14 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "override.h" - +#include + #include #include #include #include - + #include "override.h" /*}}}*/ diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 60db8b990..65269c6ae 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -11,9 +11,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "writer.h" - -#include +#include + #include #include #include @@ -30,10 +29,13 @@ #include #include #include - + +#include "writer.h" #include "cachedb.h" #include "apt-ftparchive.h" #include "multicompress.h" + +#include /*}}}*/ using namespace std; FTWScanner *FTWScanner::Owner; diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 42932dded..eff83bda7 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/methods/cdrom.cc b/methods/cdrom.cc index b25fdf5a8..82d806e9d 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/methods/connect.cc b/methods/connect.cc index a5af1f1a6..16fb6e793 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -11,7 +11,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "connect.h" +#include + #include #include @@ -29,6 +30,7 @@ #include #include +#include "connect.h" #include "rfc2553emu.h" #include /*}}}*/ diff --git a/methods/copy.cc b/methods/copy.cc index a6bb372a3..94467e054 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/methods/file.cc b/methods/file.cc index 9cdd5bc2d..9fc4cd76c 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -13,6 +13,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/methods/ftp.cc b/methods/ftp.cc index 97248f900..a445d767c 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -15,6 +15,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -30,7 +32,6 @@ #include #include #include -#include // Internet stuff #include @@ -41,6 +42,7 @@ #include "rfc2553emu.h" #include "connect.h" #include "ftp.h" +#include /*}}}*/ using namespace std; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 960c06180..9de29ddf3 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -1,9 +1,10 @@ +#include + #include #include #include #include #include -#include #include #include @@ -12,9 +13,10 @@ #include #include #include - #include +#include + #define GNUPGPREFIX "[GNUPG:]" #define GNUPGBADSIG "[GNUPG:] BADSIG" #define GNUPGNOPUBKEY "[GNUPG:] NO_PUBKEY" diff --git a/methods/gzip.cc b/methods/gzip.cc index fc4e1ecfd..6202d73dc 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -9,6 +9,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include diff --git a/methods/http.cc b/methods/http.cc index 13f9cbe06..e505b816e 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -25,6 +25,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -41,8 +43,6 @@ #include #include #include -#include - // Internet stuff #include @@ -51,6 +51,8 @@ #include "connect.h" #include "rfc2553emu.h" #include "http.h" + +#include /*}}}*/ using namespace std; diff --git a/methods/http_main.cc b/methods/http_main.cc index 7815c2fc1..2ca91bfc9 100644 --- a/methods/http_main.cc +++ b/methods/http_main.cc @@ -1,3 +1,5 @@ +#include + #include #include #include diff --git a/methods/https.cc b/methods/https.cc index fc649d6c2..45bd2a367 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -10,6 +10,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -25,12 +27,11 @@ #include #include #include -#include #include #include "config.h" #include "https.h" - +#include /*}}}*/ using namespace std; diff --git a/methods/mirror.cc b/methods/mirror.cc index 713dc211a..768e6b3a3 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -8,6 +8,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include + #include #include #include @@ -33,7 +35,7 @@ using namespace std; #include "mirror.h" #include "http.h" -#include "apti18n.h" +#include /*}}}*/ /* Done: diff --git a/methods/rfc2553emu.cc b/methods/rfc2553emu.cc index 66bc906e9..f00e85889 100644 --- a/methods/rfc2553emu.cc +++ b/methods/rfc2553emu.cc @@ -14,12 +14,14 @@ ##################################################################### */ /*}}}*/ -#include "rfc2553emu.h" +#include + #include #include #include #include #include +#include "rfc2553emu.h" #ifndef HAVE_GETADDRINFO // getaddrinfo - Resolve a hostname /*{{{*/ diff --git a/methods/rred.cc b/methods/rred.cc index 849973e1a..80fc98ac5 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -1,4 +1,6 @@ // Includes /*{{{*/ +#include + #include #include #include diff --git a/methods/rsh.cc b/methods/rsh.cc index 21f0d0a22..10fe76dc3 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -11,7 +11,8 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ -#include "rsh.h" +#include + #include #include @@ -22,6 +23,8 @@ #include #include #include +#include "rsh.h" + #include /*}}}*/ -- cgit v1.2.3-70-g09d2 From 650faab01603caac04494d54cf6b10a65c00ea13 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 13 Sep 2011 17:46:48 +0200 Subject: Support large files in the complete toolset. Indexes of this size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895) --- apt-inst/contrib/arfile.h | 2 +- apt-pkg/acquire-worker.cc | 8 ++++---- apt-pkg/contrib/crc-16.cc | 2 +- apt-pkg/contrib/crc-16.h | 2 +- apt-pkg/contrib/fileutl.cc | 33 +++++++++++++++++---------------- apt-pkg/contrib/fileutl.h | 35 +++++++++++++++++++++++++---------- apt-pkg/contrib/hashes.cc | 10 +++++----- apt-pkg/contrib/hashes.h | 6 +++--- apt-pkg/contrib/hashsum.cc | 10 +++++----- apt-pkg/contrib/hashsum_template.h | 6 +++--- apt-pkg/contrib/md5.cc | 2 +- apt-pkg/contrib/md5.h | 2 +- apt-pkg/contrib/mmap.cc | 16 ++++++++-------- apt-pkg/contrib/mmap.h | 8 ++++---- apt-pkg/contrib/progress.cc | 8 ++++---- apt-pkg/contrib/progress.h | 16 ++++++++-------- apt-pkg/contrib/sha1.cc | 2 +- apt-pkg/contrib/sha1.h | 2 +- apt-pkg/contrib/sha2.h | 6 +++--- apt-pkg/contrib/strutl.cc | 28 ++++++++++++++++++++++++++++ apt-pkg/contrib/strutl.h | 1 + apt-pkg/depcache.cc | 4 ++-- apt-pkg/indexcopy.cc | 23 ++++++++++++----------- apt-pkg/indexcopy.h | 6 +++--- apt-pkg/indexrecords.cc | 6 +++--- apt-pkg/indexrecords.h | 4 ++-- apt-pkg/pkgrecords.h | 1 - apt-pkg/tagfile.cc | 18 +++++++++--------- apt-pkg/tagfile.h | 4 ++-- buildlib/config.h.in | 3 +++ cmdline/acqprogress.cc | 12 ++++++------ cmdline/apt-get.cc | 6 ------ configure.in | 6 +++++- debian/changelog | 9 +++++++++ ftparchive/apt-ftparchive.cc | 10 +++++----- ftparchive/cachedb.h | 6 +++--- ftparchive/contents.cc | 2 +- ftparchive/contents.h | 6 +++--- ftparchive/multicompress.cc | 6 +++--- ftparchive/multicompress.h | 2 +- ftparchive/override.cc | 16 ++++++++-------- ftparchive/writer.cc | 18 +++++++++--------- ftparchive/writer.h | 6 +++--- methods/ftp.cc | 12 ++++++------ methods/ftp.h | 4 ++-- methods/gzip.cc | 2 +- methods/http.cc | 32 ++++++++++++++++---------------- methods/http.h | 30 +++++++++++++++--------------- methods/https.cc | 2 +- methods/rred.cc | 2 +- methods/rsh.cc | 16 ++++++++-------- methods/rsh.h | 6 +++--- 52 files changed, 270 insertions(+), 215 deletions(-) (limited to 'cmdline') diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index 7f6c68302..e2063cd71 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -54,7 +54,7 @@ struct ARArchive::Member unsigned long UID; unsigned long GID; unsigned long Mode; - unsigned long Size; + unsigned long long Size; // Location of the data. unsigned long Start; diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index 366879a57..3bb977e14 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -258,9 +258,9 @@ bool pkgAcquire::Worker::RunMessages() CurrentItem = Itm; CurrentSize = 0; - TotalSize = atoi(LookupTag(Message,"Size","0").c_str()); - ResumePoint = atoi(LookupTag(Message,"Resume-Point","0").c_str()); - Itm->Owner->Start(Message,atoi(LookupTag(Message,"Size","0").c_str())); + TotalSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); + ResumePoint = strtoull(LookupTag(Message,"Resume-Point","0").c_str(), NULL, 10); + Itm->Owner->Start(Message,strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10)); // Display update before completion if (Log != 0 && Log->MorePulses == true) @@ -289,7 +289,7 @@ bool pkgAcquire::Worker::RunMessages() Log->Pulse(Owner->GetOwner()); OwnerQ->ItemDone(Itm); - unsigned long long const ServerSize = atoll(LookupTag(Message,"Size","0").c_str()); + unsigned long long const ServerSize = strtoull(LookupTag(Message,"Size","0").c_str(), NULL, 10); if (TotalSize != 0 && ServerSize != TotalSize) _error->Warning("Size of file %s is not what the server reported %s %llu", Owner->DestFile.c_str(), LookupTag(Message,"Size","0").c_str(),TotalSize); diff --git a/apt-pkg/contrib/crc-16.cc b/apt-pkg/contrib/crc-16.cc index 26ea1ba28..4058821f9 100644 --- a/apt-pkg/contrib/crc-16.cc +++ b/apt-pkg/contrib/crc-16.cc @@ -65,7 +65,7 @@ static unsigned short const crc16_table[256] = /* Recompute the FCS with one more character appended. */ #define CalcFCS(fcs, c) (((fcs) >> 8) ^ crc16_table[((fcs) ^ (c)) & 0xff]) unsigned short AddCRC16(unsigned short fcs, void const *Buf, - unsigned long len) + unsigned long long len) { unsigned char const *buf = (unsigned char const *)Buf; while (len--) diff --git a/apt-pkg/contrib/crc-16.h b/apt-pkg/contrib/crc-16.h index f30678bac..702de40b2 100644 --- a/apt-pkg/contrib/crc-16.h +++ b/apt-pkg/contrib/crc-16.h @@ -12,6 +12,6 @@ #define INIT_FCS 0xffff unsigned short AddCRC16(unsigned short fcs, void const *buf, - unsigned long len); + unsigned long long len); #endif diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index 690e2403c..2e62846d9 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -133,10 +133,10 @@ bool CopyFile(FileFd &From,FileFd &To) // Buffered copy between fds SPtrArray Buf = new unsigned char[64000]; - unsigned long Size = From.Size(); + unsigned long long Size = From.Size(); while (Size != 0) { - unsigned long ToRead = Size; + unsigned long long ToRead = Size; if (Size > 64000) ToRead = 64000; @@ -800,7 +800,7 @@ FileFd::~FileFd() // --------------------------------------------------------------------- /* We are carefull to handle interruption by a signal while reading gracefully. */ -bool FileFd::Read(void *To,unsigned long Size,unsigned long *Actual) +bool FileFd::Read(void *To,unsigned long long Size,unsigned long long *Actual) { int Res; errno = 0; @@ -839,13 +839,13 @@ bool FileFd::Read(void *To,unsigned long Size,unsigned long *Actual) } Flags |= Fail; - return _error->Error(_("read, still have %lu to read but none left"),Size); + return _error->Error(_("read, still have %llu to read but none left"), Size); } /*}}}*/ // FileFd::Write - Write to the file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool FileFd::Write(const void *From,unsigned long Size) +bool FileFd::Write(const void *From,unsigned long long Size) { int Res; errno = 0; @@ -872,13 +872,13 @@ bool FileFd::Write(const void *From,unsigned long Size) return true; Flags |= Fail; - return _error->Error(_("write, still have %lu to write but couldn't"),Size); + return _error->Error(_("write, still have %llu to write but couldn't"), Size); } /*}}}*/ // FileFd::Seek - Seek in the file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool FileFd::Seek(unsigned long To) +bool FileFd::Seek(unsigned long long To) { int res; if (gz) @@ -888,7 +888,7 @@ bool FileFd::Seek(unsigned long To) if (res != (signed)To) { Flags |= Fail; - return _error->Error("Unable to seek to %lu",To); + return _error->Error("Unable to seek to %llu", To); } return true; @@ -897,7 +897,7 @@ bool FileFd::Seek(unsigned long To) // FileFd::Skip - Seek in the file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool FileFd::Skip(unsigned long Over) +bool FileFd::Skip(unsigned long long Over) { int res; if (gz) @@ -907,7 +907,7 @@ bool FileFd::Skip(unsigned long Over) if (res < 0) { Flags |= Fail; - return _error->Error("Unable to seek ahead %lu",Over); + return _error->Error("Unable to seek ahead %llu",Over); } return true; @@ -916,7 +916,7 @@ bool FileFd::Skip(unsigned long Over) // FileFd::Truncate - Truncate the file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool FileFd::Truncate(unsigned long To) +bool FileFd::Truncate(unsigned long long To) { if (gz) { @@ -926,7 +926,7 @@ bool FileFd::Truncate(unsigned long To) if (ftruncate(iFd,To) != 0) { Flags |= Fail; - return _error->Error("Unable to truncate to %lu",To); + return _error->Error("Unable to truncate to %llu",To); } return true; @@ -935,7 +935,7 @@ bool FileFd::Truncate(unsigned long To) // FileFd::Tell - Current seek position /*{{{*/ // --------------------------------------------------------------------- /* */ -unsigned long FileFd::Tell() +unsigned long long FileFd::Tell() { off_t Res; if (gz) @@ -950,7 +950,7 @@ unsigned long FileFd::Tell() // FileFd::FileSize - Return the size of the file /*{{{*/ // --------------------------------------------------------------------- /* */ -unsigned long FileFd::FileSize() +unsigned long long FileFd::FileSize() { struct stat Buf; @@ -962,9 +962,9 @@ unsigned long FileFd::FileSize() // FileFd::Size - Return the size of the content in the file /*{{{*/ // --------------------------------------------------------------------- /* */ -unsigned long FileFd::Size() +unsigned long long FileFd::Size() { - unsigned long size = FileSize(); + unsigned long long size = FileSize(); // only check gzsize if we are actually a gzip file, just checking for // "gz" is not sufficient as uncompressed files will be opened with @@ -974,6 +974,7 @@ unsigned long FileFd::Size() /* unfortunately zlib.h doesn't provide a gzsize(), so we have to do * this ourselves; the original (uncompressed) file size is the last 32 * bits of the file */ + // FIXME: Size for gz-files is limited by 32bit… no largefile support off_t orig_pos = lseek(iFd, 0, SEEK_CUR); if (lseek(iFd, -4, SEEK_END) < 0) return _error->Errno("lseek","Unable to seek to end of gzipped file"); diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index cde288ad2..0f2dd4194 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -49,21 +49,36 @@ class FileFd enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp,ReadOnlyGzip, WriteAtomic}; - inline bool Read(void *To,unsigned long Size,bool AllowEof) + inline bool Read(void *To,unsigned long long Size,bool AllowEof) { - unsigned long Jnk; + unsigned long long Jnk; if (AllowEof) return Read(To,Size,&Jnk); return Read(To,Size); } - bool Read(void *To,unsigned long Size,unsigned long *Actual = 0); - bool Write(const void *From,unsigned long Size); - bool Seek(unsigned long To); - bool Skip(unsigned long To); - bool Truncate(unsigned long To); - unsigned long Tell(); - unsigned long Size(); - unsigned long FileSize(); + bool Read(void *To,unsigned long long Size,unsigned long long *Actual = 0); + bool Write(const void *From,unsigned long long Size); + bool Seek(unsigned long long To); + bool Skip(unsigned long long To); + bool Truncate(unsigned long long To); + unsigned long long Tell(); + unsigned long long Size(); + unsigned long long FileSize(); + + /* You want to use 'unsigned long long' if you are talking about a file + to be able to support large files (>2 or >4 GB) properly. + This shouldn't happen all to often for the indexes, but deb's might be… + And as the auto-conversation converts a 'unsigned long *' to a 'bool' + instead of 'unsigned long long *' we need to provide this explicitely - + otherwise applications magically start to fail… */ + __deprecated bool Read(void *To,unsigned long long Size,unsigned long *Actual) + { + unsigned long long R; + bool const T = Read(To, Size, &R); + *Actual = R; + return T; + } + bool Open(string FileName,OpenMode Mode,unsigned long Perms = 0666); bool OpenDescriptor(int Fd, OpenMode Mode, bool AutoClose=false); bool Close(); diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 9c251e89f..fd76bf229 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -108,18 +108,18 @@ string HashString::toStr() const // Hashes::AddFD - Add the contents of the FD /*{{{*/ // --------------------------------------------------------------------- /* */ -bool Hashes::AddFD(int const Fd,unsigned long Size, bool const addMD5, +bool Hashes::AddFD(int const Fd,unsigned long long Size, bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512) { unsigned char Buf[64*64]; - int Res = 0; + ssize_t Res = 0; int ToEOF = (Size == 0); while (Size != 0 || ToEOF) { - unsigned n = sizeof(Buf); - if (!ToEOF) n = min(Size,(unsigned long)n); + unsigned long long n = sizeof(Buf); + if (!ToEOF) n = min(Size, n); Res = read(Fd,Buf,n); - if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read + if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read return false; if (ToEOF && Res == 0) // EOF break; diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index e702fcca2..40c2ad064 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -62,14 +62,14 @@ class Hashes SHA256Summation SHA256; SHA512Summation SHA512; - inline bool Add(const unsigned char *Data,unsigned long Size) + inline bool Add(const unsigned char *Data,unsigned long long Size) { return MD5.Add(Data,Size) && SHA1.Add(Data,Size) && SHA256.Add(Data,Size) && SHA512.Add(Data,Size); }; inline bool Add(const char *Data) {return Add((unsigned char *)Data,strlen(Data));}; - inline bool AddFD(int const Fd,unsigned long Size = 0) + inline bool AddFD(int const Fd,unsigned long long Size = 0) { return AddFD(Fd, Size, true, true, true, true); }; - bool AddFD(int const Fd, unsigned long Size, bool const addMD5, + bool AddFD(int const Fd, unsigned long long Size, bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512); inline bool Add(const unsigned char *Beg,const unsigned char *End) {return Add(Beg,End-Beg);}; diff --git a/apt-pkg/contrib/hashsum.cc b/apt-pkg/contrib/hashsum.cc index 28f711176..0edcbb364 100644 --- a/apt-pkg/contrib/hashsum.cc +++ b/apt-pkg/contrib/hashsum.cc @@ -7,16 +7,16 @@ // Summation::AddFD - Add content of file into the checksum /*{{{*/ // --------------------------------------------------------------------- /* */ -bool SummationImplementation::AddFD(int const Fd, unsigned long Size) { +bool SummationImplementation::AddFD(int const Fd, unsigned long long Size) { unsigned char Buf[64 * 64]; - int Res = 0; + ssize_t Res = 0; int ToEOF = (Size == 0); while (Size != 0 || ToEOF) { - unsigned n = sizeof(Buf); - if (!ToEOF) n = min(Size,(unsigned long)n); + unsigned long long n = sizeof(Buf); + if (!ToEOF) n = min(Size, n); Res = read(Fd, Buf, n); - if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read + if (Res < 0 || (!ToEOF && Res != (ssize_t) n)) // error, or short read return false; if (ToEOF && Res == 0) // EOF break; diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h index 85d94c2af..9157754e3 100644 --- a/apt-pkg/contrib/hashsum_template.h +++ b/apt-pkg/contrib/hashsum_template.h @@ -87,8 +87,8 @@ class HashSumValue class SummationImplementation { public: - virtual bool Add(const unsigned char *inbuf, unsigned long inlen) = 0; - inline bool Add(const char *inbuf, unsigned long const inlen) + virtual bool Add(const unsigned char *inbuf, unsigned long long inlen) = 0; + inline bool Add(const char *inbuf, unsigned long long const inlen) { return Add((unsigned char *)inbuf, inlen); }; inline bool Add(const unsigned char *Data) @@ -101,7 +101,7 @@ class SummationImplementation inline bool Add(const char *Beg, const char *End) { return Add((const unsigned char *)Beg, End - Beg); }; - bool AddFD(int Fd, unsigned long Size = 0); + bool AddFD(int Fd, unsigned long long Size = 0); }; #endif diff --git a/apt-pkg/contrib/md5.cc b/apt-pkg/contrib/md5.cc index b53c4fbd2..4351aeb22 100644 --- a/apt-pkg/contrib/md5.cc +++ b/apt-pkg/contrib/md5.cc @@ -187,7 +187,7 @@ MD5Summation::MD5Summation() // MD5Summation::Add - 'Add' a data set to the hash /*{{{*/ // --------------------------------------------------------------------- /* */ -bool MD5Summation::Add(const unsigned char *data,unsigned long len) +bool MD5Summation::Add(const unsigned char *data,unsigned long long len) { if (Done == true) return false; diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h index e76428325..305cdb20d 100644 --- a/apt-pkg/contrib/md5.h +++ b/apt-pkg/contrib/md5.h @@ -45,7 +45,7 @@ class MD5Summation : public SummationImplementation public: - bool Add(const unsigned char *inbuf, unsigned long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen); using SummationImplementation::Add; MD5SumValue Result(); diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index 3cd87eda4..a110a7019 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -95,7 +95,7 @@ bool MMap::Map(FileFd &Fd) return false; } else - return _error->Errno("mmap",_("Couldn't make mmap of %lu bytes"), + return _error->Errno("mmap",_("Couldn't make mmap of %llu bytes"), iSize); } @@ -166,7 +166,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) return true; #ifdef _POSIX_SYNCHRONIZED_IO - unsigned long PSize = sysconf(_SC_PAGESIZE); + unsigned long long PSize = sysconf(_SC_PAGESIZE); if ((Flags & ReadOnly) != ReadOnly) { if (SyncToFd != 0) @@ -177,7 +177,7 @@ bool MMap::Sync(unsigned long Start,unsigned long Stop) } else { - if (msync((char *)Base+(int)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0) + if (msync((char *)Base+(unsigned long long)(Start/PSize)*PSize,Stop - Start,MS_SYNC) < 0) return _error->Errno("msync", _("Unable to synchronize mmap")); } } @@ -197,7 +197,7 @@ DynamicMMap::DynamicMMap(FileFd &F,unsigned long Flags,unsigned long const &Work if (_error->PendingError() == true) return; - unsigned long EndOfFile = Fd->Size(); + unsigned long long EndOfFile = Fd->Size(); if (EndOfFile > WorkSpace) WorkSpace = EndOfFile; else if(WorkSpace > 0) @@ -285,7 +285,7 @@ DynamicMMap::~DynamicMMap() return; } - unsigned long EndOfFile = iSize; + unsigned long long EndOfFile = iSize; iSize = WorkSpace; Close(false); if(ftruncate(Fd->Fd(),EndOfFile) < 0) @@ -295,9 +295,9 @@ DynamicMMap::~DynamicMMap() // DynamicMMap::RawAllocate - Allocate a raw chunk of unaligned space /*{{{*/ // --------------------------------------------------------------------- /* This allocates a block of memory aligned to the given size */ -unsigned long DynamicMMap::RawAllocate(unsigned long Size,unsigned long Aln) +unsigned long DynamicMMap::RawAllocate(unsigned long long Size,unsigned long Aln) { - unsigned long Result = iSize; + unsigned long long Result = iSize; if (Aln != 0) Result += Aln - (iSize%Aln); @@ -412,7 +412,7 @@ bool DynamicMMap::Grow() { if (GrowFactor <= 0) return _error->Error(_("Unable to increase size of the MMap as automatic growing is disabled by user.")); - unsigned long const newSize = WorkSpace + GrowFactor; + unsigned long long const newSize = WorkSpace + GrowFactor; if(Fd != 0) { Fd->Seek(newSize - 1); diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h index 2bf2c1540..e0ff8db95 100644 --- a/apt-pkg/contrib/mmap.h +++ b/apt-pkg/contrib/mmap.h @@ -41,7 +41,7 @@ class MMap protected: unsigned long Flags; - unsigned long iSize; + unsigned long long iSize; void *Base; // In case mmap can not be used, we keep a dup of the file @@ -60,8 +60,8 @@ class MMap // Simple accessors inline operator void *() {return Base;}; inline void *Data() {return Base;}; - inline unsigned long Size() {return iSize;}; - inline void AddSize(unsigned long const size) {iSize += size;}; + inline unsigned long long Size() {return iSize;}; + inline void AddSize(unsigned long long const size) {iSize += size;}; inline bool validData() const { return Base != (void *)-1 && Base != 0; }; // File manipulators @@ -99,7 +99,7 @@ class DynamicMMap : public MMap public: // Allocation - unsigned long RawAllocate(unsigned long Size,unsigned long Aln = 0); + unsigned long RawAllocate(unsigned long long Size,unsigned long Aln = 0); unsigned long Allocate(unsigned long ItemSize); unsigned long WriteString(const char *String,unsigned long Len = (unsigned long)-1); inline unsigned long WriteString(const string &S) {return WriteString(S.c_str(),S.length());}; diff --git a/apt-pkg/contrib/progress.cc b/apt-pkg/contrib/progress.cc index 6cd6134d3..317048845 100644 --- a/apt-pkg/contrib/progress.cc +++ b/apt-pkg/contrib/progress.cc @@ -37,7 +37,7 @@ OpProgress::OpProgress() : Current(0), Total(0), Size(0), SubTotal(1), /* Current is the Base Overall progress in units of Total. Cur is the sub progress in units of SubTotal. Size is a scaling factor that says what percent of Total SubTotal is. */ -void OpProgress::Progress(unsigned long Cur) +void OpProgress::Progress(unsigned long long Cur) { if (Total == 0 || Size == 0 || SubTotal == 0) Percent = 0; @@ -49,8 +49,8 @@ void OpProgress::Progress(unsigned long Cur) // OpProgress::OverallProgress - Set the overall progress /*{{{*/ // --------------------------------------------------------------------- /* */ -void OpProgress::OverallProgress(unsigned long Current, unsigned long Total, - unsigned long Size,const string &Op) +void OpProgress::OverallProgress(unsigned long long Current, unsigned long long Total, + unsigned long long Size,const string &Op) { this->Current = Current; this->Total = Total; @@ -67,7 +67,7 @@ void OpProgress::OverallProgress(unsigned long Current, unsigned long Total, // OpProgress::SubProgress - Set the sub progress state /*{{{*/ // --------------------------------------------------------------------- /* */ -void OpProgress::SubProgress(unsigned long SubTotal,const string &Op, +void OpProgress::SubProgress(unsigned long long SubTotal,const string &Op, float const Percent) { this->SubTotal = SubTotal; diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h index 3a914d17f..5344323f6 100644 --- a/apt-pkg/contrib/progress.h +++ b/apt-pkg/contrib/progress.h @@ -30,10 +30,10 @@ using std::string; class Configuration; class OpProgress { - unsigned long Current; - unsigned long Total; - unsigned long Size; - unsigned long SubTotal; + unsigned long long Current; + unsigned long long Total; + unsigned long long Size; + unsigned long long SubTotal; float LastPercent; // Change reduction code @@ -54,10 +54,10 @@ class OpProgress public: - void Progress(unsigned long Current); - void SubProgress(unsigned long SubTotal, const string &Op = "", float const Percent = -1); - void OverallProgress(unsigned long Current,unsigned long Total, - unsigned long Size,const string &Op); + void Progress(unsigned long long Current); + void SubProgress(unsigned long long SubTotal, const string &Op = "", float const Percent = -1); + void OverallProgress(unsigned long long Current,unsigned long long Total, + unsigned long long Size,const string &Op); virtual void Done() {}; OpProgress(); diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc index 9416895ac..31c576611 100644 --- a/apt-pkg/contrib/sha1.cc +++ b/apt-pkg/contrib/sha1.cc @@ -243,7 +243,7 @@ SHA1SumValue SHA1Summation::Result() // SHA1Summation::Add - Adds content of buffer into the checksum /*{{{*/ // --------------------------------------------------------------------- /* May not be called after Result() is called */ -bool SHA1Summation::Add(const unsigned char *data,unsigned long len) +bool SHA1Summation::Add(const unsigned char *data,unsigned long long len) { if (Done) return false; diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index 2701fc67e..916faec1b 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -34,7 +34,7 @@ class SHA1Summation : public SummationImplementation bool Done; public: - bool Add(const unsigned char *inbuf, unsigned long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen); using SummationImplementation::Add; SHA1SumValue Result(); diff --git a/apt-pkg/contrib/sha2.h b/apt-pkg/contrib/sha2.h index 386225889..51c921dbd 100644 --- a/apt-pkg/contrib/sha2.h +++ b/apt-pkg/contrib/sha2.h @@ -30,7 +30,7 @@ class SHA2SummationBase : public SummationImplementation protected: bool Done; public: - bool Add(const unsigned char *inbuf, unsigned long len) = 0; + bool Add(const unsigned char *inbuf, unsigned long long len) = 0; void Result(); }; @@ -41,7 +41,7 @@ class SHA256Summation : public SHA2SummationBase unsigned char Sum[32]; public: - bool Add(const unsigned char *inbuf, unsigned long len) + bool Add(const unsigned char *inbuf, unsigned long long len) { if (Done) return false; @@ -73,7 +73,7 @@ class SHA512Summation : public SHA2SummationBase unsigned char Sum[64]; public: - bool Add(const unsigned char *inbuf, unsigned long len) + bool Add(const unsigned char *inbuf, unsigned long long len) { if (Done) return false; diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 6586ef17b..04226f1b4 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -970,6 +970,34 @@ bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base) return true; } /*}}}*/ +// StrToNum - Convert a fixed length string to a number /*{{{*/ +// --------------------------------------------------------------------- +/* This is used in decoding the crazy fixed length string headers in + tar and ar files. */ +bool StrToNum(const char *Str,unsigned long long &Res,unsigned Len,unsigned Base) +{ + char S[30]; + if (Len >= sizeof(S)) + return false; + memcpy(S,Str,Len); + S[Len] = 0; + + // All spaces is a zero + Res = 0; + unsigned I; + for (I = 0; S[I] == ' '; I++); + if (S[I] == 0) + return true; + + char *End; + Res = strtoull(S,&End,Base); + if (End == S) + return false; + + return true; +} + /*}}}*/ + // Base256ToNum - Convert a fixed length binary to a number /*{{{*/ // --------------------------------------------------------------------- /* This is used in decoding the 256bit encoded fixed length fields in diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 89cbf0370..b32198f25 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -52,6 +52,7 @@ string LookupTag(const string &Message,const char *Tag,const char *Default = 0); int StringToBool(const string &Text,int Default = -1); bool ReadMessages(int Fd, vector &List); bool StrToNum(const char *Str,unsigned long &Res,unsigned Len,unsigned Base = 0); +bool StrToNum(const char *Str,unsigned long long &Res,unsigned Len,unsigned Base = 0); bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len); bool Hex2Num(const string &Str,unsigned char *Num,unsigned int Length); bool TokSplitString(char Tok,char *Input,char **List, diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 0fbd77fd8..8dde7c173 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -171,14 +171,14 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/ string const state = _config->FindFile("Dir::State::extended_states"); if(RealFileExists(state)) { state_file.Open(state, FileFd::ReadOnly); - int const file_size = state_file.Size(); + off_t const file_size = state_file.Size(); if(Prog != NULL) Prog->OverallProgress(0, file_size, 1, _("Reading state information")); pkgTagFile tagfile(&state_file); pkgTagSection section; - int amt = 0; + off_t amt = 0; bool const debug_autoremove = _config->FindB("Debug::pkgAutoRemove",false); while(tagfile.Step(section)) { string const pkgname = section.FindS("Package"); diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index dcba78dce..f52ecbbcb 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include "indexcopy.h" #include @@ -55,7 +56,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, bool Debug = _config->FindB("Debug::aptcdrom",false); // Prepare the progress indicator - unsigned long TotalSize = 0; + off_t TotalSize = 0; for (vector::iterator I = List.begin(); I != List.end(); I++) { struct stat Buf; @@ -66,14 +67,14 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, TotalSize += Buf.st_size; } - unsigned long CurrentSize = 0; + off_t CurrentSize = 0; unsigned int NotFound = 0; unsigned int WrongSize = 0; unsigned int Packages = 0; for (vector::iterator I = List.begin(); I != List.end(); I++) { string OrigPath = string(*I,CDROM.length()); - unsigned long FileSize = 0; + off_t FileSize = 0; // Open the package file FileFd Pkg; @@ -166,7 +167,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, if(Progress) Progress->Progress(Parser.Offset()); string File; - unsigned long Size; + unsigned long long Size; if (GetFile(File,Size) == false) { fclose(TargetFl); @@ -221,7 +222,7 @@ bool IndexCopy::CopyPackages(string CDROM,string Name,vector &List, } // Size match - if ((unsigned)Buf.st_size != Size) + if ((unsigned long long)Buf.st_size != Size) { if (Debug == true) clog << "Wrong Size: " << File << endl; @@ -455,7 +456,7 @@ bool IndexCopy::GrabFirst(string Path,string &To,unsigned int Depth) // PackageCopy::GetFile - Get the file information from the section /*{{{*/ // --------------------------------------------------------------------- /* */ -bool PackageCopy::GetFile(string &File,unsigned long &Size) +bool PackageCopy::GetFile(string &File,unsigned long long &Size) { File = Section->FindS("Filename"); Size = Section->FindI("Size"); @@ -481,7 +482,7 @@ bool PackageCopy::RewriteEntry(FILE *Target,string File) // SourceCopy::GetFile - Get the file information from the section /*{{{*/ // --------------------------------------------------------------------- /* */ -bool SourceCopy::GetFile(string &File,unsigned long &Size) +bool SourceCopy::GetFile(string &File,unsigned long long &Size) { string Files = Section->FindS("Files"); if (Files.empty() == true) @@ -504,7 +505,7 @@ bool SourceCopy::GetFile(string &File,unsigned long &Size) return _error->Error("Error parsing file record"); // Parse the size and append the directory - Size = atoi(sSize.c_str()); + Size = strtoull(sSize.c_str(), NULL, 10); File = Base + File; return true; } @@ -787,7 +788,7 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ bool Debug = _config->FindB("Debug::aptcdrom",false); // Prepare the progress indicator - unsigned long TotalSize = 0; + off_t TotalSize = 0; for (vector::iterator I = List.begin(); I != List.end(); I++) { struct stat Buf; @@ -798,14 +799,14 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ TotalSize += Buf.st_size; } - unsigned long CurrentSize = 0; + off_t CurrentSize = 0; unsigned int NotFound = 0; unsigned int WrongSize = 0; unsigned int Packages = 0; for (vector::iterator I = List.begin(); I != List.end(); I++) { string OrigPath = string(*I,CDROM.length()); - unsigned long FileSize = 0; + off_t FileSize = 0; // Open the package file FileFd Pkg; diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 277fb561c..60c90dd4a 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -37,7 +37,7 @@ class IndexCopy /*{{{*/ bool ReconstructChop(unsigned long &Chop,string Dir,string File); void ConvertToSourceList(string CD,string &Path); bool GrabFirst(string Path,string &To,unsigned int Depth); - virtual bool GetFile(string &Filename,unsigned long &Size) = 0; + virtual bool GetFile(string &Filename,unsigned long long &Size) = 0; virtual bool RewriteEntry(FILE *Target,string File) = 0; virtual const char *GetFileName() = 0; virtual const char *Type() = 0; @@ -53,7 +53,7 @@ class PackageCopy : public IndexCopy /*{{{*/ { protected: - virtual bool GetFile(string &Filename,unsigned long &Size); + virtual bool GetFile(string &Filename,unsigned long long &Size); virtual bool RewriteEntry(FILE *Target,string File); virtual const char *GetFileName() {return "Packages";}; virtual const char *Type() {return "Package";}; @@ -64,7 +64,7 @@ class SourceCopy : public IndexCopy /*{{{*/ { protected: - virtual bool GetFile(string &Filename,unsigned long &Size); + virtual bool GetFile(string &Filename,unsigned long long &Size); virtual bool RewriteEntry(FILE *Target,string File); virtual const char *GetFileName() {return "Sources";}; virtual const char *Type() {return "Source";}; diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 00f520c4f..932640764 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -80,7 +80,7 @@ bool indexRecords::Load(const string Filename) /*{{{*/ string Name; string Hash; - size_t Size; + unsigned long long Size; while (Start < End) { if (!parseSumData(Start, End, Name, Hash, Size)) @@ -147,7 +147,7 @@ vector indexRecords::MetaKeys() /*{{{*/ } /*}}}*/ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/ - string &Name, string &Hash, size_t &Size) + string &Name, string &Hash, unsigned long long &Size) { Name = ""; Hash = ""; @@ -184,7 +184,7 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/ if (EntryEnd == End) return false; - Size = strtol (Start, NULL, 10); + Size = strtoull (Start, NULL, 10); /* Skip over intermediate blanks */ Start = EntryEnd; diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index 5b532c1a5..0f933b93c 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -17,7 +17,7 @@ class indexRecords { bool parseSumData(const char *&Start, const char *End, string &Name, - string &Hash, size_t &Size); + string &Hash, unsigned long long &Size); public: struct checkSum; string ErrorText; @@ -53,7 +53,7 @@ struct indexRecords::checkSum { string MetaKeyFilename; HashString Hash; - size_t Size; + unsigned long long Size; }; #endif diff --git a/apt-pkg/pkgrecords.h b/apt-pkg/pkgrecords.h index 78e39e577..840454e18 100644 --- a/apt-pkg/pkgrecords.h +++ b/apt-pkg/pkgrecords.h @@ -19,7 +19,6 @@ #include -#include #include class pkgRecords /*{{{*/ diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 3b491fcd2..418e6bed8 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -29,7 +29,7 @@ using std::string; class pkgTagFilePrivate { public: - pkgTagFilePrivate(FileFd *pFd, unsigned long Size) : Fd(*pFd), Size(Size) + pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Size(Size) { } FileFd &Fd; @@ -37,14 +37,14 @@ public: char *Start; char *End; bool Done; - unsigned long iOffset; - unsigned long Size; + unsigned long long iOffset; + unsigned long long Size; }; // TagFile::pkgTagFile - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long Size) +pkgTagFile::pkgTagFile(FileFd *pFd,unsigned long long Size) { d = new pkgTagFilePrivate(pFd, Size); @@ -86,7 +86,7 @@ unsigned long pkgTagFile::Offset() bool pkgTagFile::Resize() { char *tmp; - unsigned long EndSize = d->End - d->Start; + unsigned long long EndSize = d->End - d->Start; // fail is the buffer grows too big if(d->Size > 1024*1024+1) @@ -138,8 +138,8 @@ bool pkgTagFile::Step(pkgTagSection &Tag) then fills the rest from the file */ bool pkgTagFile::Fill() { - unsigned long EndSize = d->End - d->Start; - unsigned long Actual = 0; + unsigned long long EndSize = d->End - d->Start; + unsigned long long Actual = 0; memmove(d->Buffer,d->Start,EndSize); d->Start = d->Buffer; @@ -180,12 +180,12 @@ bool pkgTagFile::Fill() // --------------------------------------------------------------------- /* This jumps to a pre-recorded file location and reads the record that is there */ -bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset) +bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long long Offset) { // We are within a buffer space of the next hit.. if (Offset >= d->iOffset && d->iOffset + (d->End - d->Start) > Offset) { - unsigned long Dist = Offset - d->iOffset; + unsigned long long Dist = Offset - d->iOffset; d->Start += Dist; d->iOffset += Dist; return Step(Tag); diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 23f5c57e6..87d070d28 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -94,9 +94,9 @@ class pkgTagFile bool Step(pkgTagSection &Section); unsigned long Offset(); - bool Jump(pkgTagSection &Tag,unsigned long Offset); + bool Jump(pkgTagSection &Tag,unsigned long long Offset); - pkgTagFile(FileFd *F,unsigned long Size = 32*1024); + pkgTagFile(FileFd *F,unsigned long long Size = 32*1024); virtual ~pkgTagFile(); }; diff --git a/buildlib/config.h.in b/buildlib/config.h.in index b3609a700..256911231 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -33,6 +33,9 @@ /* If there is no socklen_t, define this for the netdb shim */ #undef NEED_SOCKLEN_T_DEFINE +/* Define to the size of the filesize containing structures */ +#undef _FILE_OFFSET_BITS + /* Define the arch name string */ #undef COMMON_ARCH diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index fd80ea126..1ccb08804 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -163,7 +163,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) ScreenWidth = sizeof(Buffer)-1; // Put in the percent done - sprintf(S,"%ld%%",long(double((CurrentBytes + CurrentItems)*100.0)/double(TotalBytes+TotalItems))); + sprintf(S,"%.0f%%",((CurrentBytes + CurrentItems)*100.0)/(TotalBytes+TotalItems)); bool Shown = false; for (pkgAcquire::Worker *I = Owner->WorkersBegin(); I != 0; @@ -214,11 +214,11 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) if (I->TotalSize > 0 && I->CurrentItem->Owner->Complete == false) { if (Mode == Short) - snprintf(S,End-S," %lu%%", - long(double(I->CurrentSize*100.0)/double(I->TotalSize))); + snprintf(S,End-S," %.0f%%", + (I->CurrentSize*100.0)/I->TotalSize); else - snprintf(S,End-S,"/%sB %lu%%",SizeToStr(I->TotalSize).c_str(), - long(double(I->CurrentSize*100.0)/double(I->TotalSize))); + snprintf(S,End-S,"/%sB %.0f%%",SizeToStr(I->TotalSize).c_str(), + (I->CurrentSize*100.0)/I->TotalSize); } S += strlen(S); snprintf(S,End-S,"]"); @@ -238,7 +238,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) if (CurrentCPS != 0) { char Tmp[300]; - unsigned long ETA = (unsigned long)((TotalBytes - CurrentBytes)/CurrentCPS); + unsigned long long ETA = (TotalBytes - CurrentBytes)/CurrentCPS; sprintf(Tmp," %sB/s %s",SizeToStr(CurrentCPS).c_str(),TimeToStr(ETA).c_str()); unsigned int Len = strlen(Buffer); unsigned int LenT = strlen(Tmp); diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1bf4cf6f9..9b9c0f0b0 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -27,9 +27,6 @@ // Include Files /*{{{*/ #include -#define _LARGEFILE_SOURCE -#define _LARGEFILE64_SOURCE - #include #include #include @@ -68,9 +65,6 @@ #include #include - -#define statfs statfs64 -#define statvfs statvfs64 /*}}}*/ #define RAMFS_MAGIC 0x858458f6 diff --git a/configure.in b/configure.in index 3dde2fe47..965bcb5d1 100644 --- a/configure.in +++ b/configure.in @@ -31,6 +31,10 @@ AC_CHECK_TOOL_PREFIX AC_PROG_CC AC_ISC_POSIX +dnl check for large file support and enable it if possible +dnl do this early as other stuff might depend on it +AC_SYS_LARGEFILE + dnl Check for other programs AC_PROG_CXX AC_PROG_CPP @@ -151,7 +155,7 @@ if test "$cross_compiling" = "yes" -a "x$archline" = "x"; then AC_MSG_ERROR(When cross compiling, architecture must be present in sizetable) fi AC_C_BIGENDIAN - + dnl We do not need this if we have inttypes! HAVE_C9X=yes if test x"$apt_cv_c9x_ints" = x"no"; then diff --git a/debian/changelog b/debian/changelog index ce2a6a8fc..dd91d3aa8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +apt (0.8.16~exp3+nmu1) experimental; urgency=low + + [ David Kalnischkies ] + * Support large files in the complete toolset. Indexes of this + size are pretty unlikely for now, but we need it for deb + packages which could become bigger than 4GB now (LP: #815895) + + -- David Kalnischkies Tue, 13 Sep 2011 17:44:00 +0200 + apt (0.8.16~exp3) experimental; urgency=low [ David Kalnischkies ] diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index 6ad8ac572..5721fe409 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -206,7 +206,7 @@ bool PackageMap::GenPackages(Configuration &Setup,struct CacheDB::Stats &Stats) Packages.Output = 0; // Just in case // Finish compressing - unsigned long Size; + unsigned long long Size; if (Comp.Finalize(Size) == false) { c0out << endl; @@ -292,7 +292,7 @@ bool PackageMap::GenSources(Configuration &Setup,struct CacheDB::Stats &Stats) Sources.Output = 0; // Just in case // Finish compressing - unsigned long Size; + unsigned long long Size; if (Comp.Finalize(Size) == false) { c0out << endl; @@ -363,11 +363,11 @@ bool PackageMap::GenContents(Configuration &Setup, if (_error->PendingError() == true) return false; - unsigned long Size = Head.Size(); + unsigned long long Size = Head.Size(); unsigned char Buf[4096]; while (Size != 0) { - unsigned long ToRead = Size; + unsigned long long ToRead = Size; if (Size > sizeof(Buf)) ToRead = sizeof(Buf); @@ -401,7 +401,7 @@ bool PackageMap::GenContents(Configuration &Setup, Contents.Finish(); // Finish compressing - unsigned long Size; + unsigned long long Size; if (Comp.Finalize(Size) == false || _error->PendingError() == true) { c0out << endl; diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index 15e796325..6bd5aa36c 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -81,7 +81,7 @@ class CacheDB { uint32_t Flags; uint32_t mtime; - uint32_t FileSize; + uint64_t FileSize; uint8_t MD5[16]; uint8_t SHA1[20]; uint8_t SHA256[32]; @@ -114,7 +114,7 @@ class CacheDB double SHA512Bytes; unsigned long Packages; unsigned long Misses; - unsigned long DeLinkBytes; + unsigned long long DeLinkBytes; inline void Add(const Stats &S) { Bytes += S.Bytes; @@ -133,7 +133,7 @@ class CacheDB inline bool DBFailed() {return Dbp != 0 && DBLoaded == false;}; inline bool Loaded() {return DBLoaded == true;}; - inline off_t GetFileSize(void) {return CurStat.FileSize;} + inline unsigned long long GetFileSize(void) {return CurStat.FileSize;} bool SetFile(string const &FileName,struct stat St,FileFd *Fd); bool GetFileInfo(string const &FileName, bool const &DoControl, bool const &DoContents, bool const &GenContentsOnly, diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc index adb590ed1..65d8dd1ce 100644 --- a/ftparchive/contents.cc +++ b/ftparchive/contents.cc @@ -349,7 +349,7 @@ bool ContentsExtract::DoItem(Item &Itm,int &Fd) // ContentsExtract::TakeContents - Load the contents data /*{{{*/ // --------------------------------------------------------------------- /* */ -bool ContentsExtract::TakeContents(const void *NewData,unsigned long Length) +bool ContentsExtract::TakeContents(const void *NewData,unsigned long long Length) { if (Length == 0) { diff --git a/ftparchive/contents.h b/ftparchive/contents.h index 5b5092b66..f549ce17f 100644 --- a/ftparchive/contents.h +++ b/ftparchive/contents.h @@ -71,15 +71,15 @@ class ContentsExtract : public pkgDirStream // The Data Block char *Data; - unsigned long MaxSize; - unsigned long CurSize; + unsigned long long MaxSize; + unsigned long long CurSize; void AddData(const char *Text); bool Read(debDebFile &Deb); virtual bool DoItem(Item &Itm,int &Fd); void Reset() {CurSize = 0;}; - bool TakeContents(const void *Data,unsigned long Length); + bool TakeContents(const void *Data,unsigned long long Length); void Add(GenContents &Contents,string const &Package); ContentsExtract() : Data(0), MaxSize(0), CurSize(0) {}; diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc index 04560f4ab..a80d6a34d 100644 --- a/ftparchive/multicompress.cc +++ b/ftparchive/multicompress.cc @@ -215,7 +215,7 @@ bool MultiCompress::Die() // MultiCompress::Finalize - Finish up writing /*{{{*/ // --------------------------------------------------------------------- /* This is only necessary for statistics reporting. */ -bool MultiCompress::Finalize(unsigned long &OutSize) +bool MultiCompress::Finalize(unsigned long long &OutSize) { OutSize = 0; if (Input == 0 || Die() == false) @@ -383,7 +383,7 @@ bool MultiCompress::Child(int const &FD) stash a hash of the data to use later. */ SetNonBlock(FD,false); unsigned char Buffer[32*1024]; - unsigned long FileSize = 0; + unsigned long long FileSize = 0; MD5Summation MD5; while (1) { @@ -445,7 +445,7 @@ bool MultiCompress::Child(int const &FD) // Compute the hash MD5Summation OldMD5; - unsigned long NewFileSize = 0; + unsigned long long NewFileSize = 0; while (1) { int Res = read(CompFd,Buffer,sizeof(Buffer)); diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 19dede174..4839af47d 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -54,7 +54,7 @@ class MultiCompress FILE *Input; unsigned long UpdateMTime; - bool Finalize(unsigned long &OutSize); + bool Finalize(unsigned long long &OutSize); bool OpenOld(int &Fd,pid_t &Proc); bool CloseOld(int Fd,pid_t Proc); static bool GetStat(string const &Output,string const &Compress,struct stat &St); diff --git a/ftparchive/override.cc b/ftparchive/override.cc index 045a8b113..a101fa6d1 100644 --- a/ftparchive/override.cc +++ b/ftparchive/override.cc @@ -34,7 +34,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) return _error->Errno("fopen",_("Unable to open %s"),File.c_str()); char Line[500]; - unsigned long Counter = 0; + unsigned long long Counter = 0; while (fgets(Line,sizeof(Line),F) != 0) { Counter++; @@ -57,7 +57,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) for (; isspace(*End) == 0 && *End != 0; End++); if (*End == 0) { - _error->Warning(_("Malformed override %s line %lu #1"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #1"),File.c_str(), Counter); continue; } @@ -71,7 +71,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) for (; isspace(*End) == 0 && *End != 0; End++); if (*End == 0) { - _error->Warning(_("Malformed override %s line %lu #2"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #2"),File.c_str(), Counter); continue; } @@ -85,7 +85,7 @@ bool Override::ReadOverride(string const &File,bool const &Source) for (; isspace(*End) == 0 && *End != 0; End++); if (*End == 0) { - _error->Warning(_("Malformed override %s line %lu #3"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #3"),File.c_str(), Counter); continue; } @@ -142,7 +142,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source) return _error->Errno("fopen",_("Unable to open %s"),File.c_str()); char Line[500]; - unsigned long Counter = 0; + unsigned long long Counter = 0; while (fgets(Line,sizeof(Line),F) != 0) { Counter++; @@ -163,7 +163,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source) for (; isspace(*End) == 0 && *End != 0; End++); if (*End == 0) { - _error->Warning(_("Malformed override %s line %lu #1"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #1"),File.c_str(), Counter); continue; } @@ -175,7 +175,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source) for (; isspace(*End) == 0 && *End != 0; End++); if (*End == 0) { - _error->Warning(_("Malformed override %s line %lu #2"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #2"),File.c_str(), Counter); continue; } @@ -188,7 +188,7 @@ bool Override::ReadExtraOverride(string const &File,bool const &Source) for (; isspace(*(End-1)) && End > Value; End--); if (End == Value) { - _error->Warning(_("Malformed override %s line %lu #3"),File.c_str(), + _error->Warning(_("Malformed override %s line %llu #3"),File.c_str(), Counter); continue; } diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index 65269c6ae..c4e700b59 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -248,8 +248,8 @@ bool FTWScanner::LoadFileList(string const &Dir, string const &File) // --------------------------------------------------------------------- /* */ bool FTWScanner::Delink(string &FileName,const char *OriginalPath, - unsigned long &DeLinkBytes, - off_t const &FileSize) + unsigned long long &DeLinkBytes, + unsigned long long const &FileSize) { // See if this isn't an internaly prefix'd file name. if (InternalPrefix.empty() == false && @@ -379,7 +379,7 @@ bool PackagesWriter::DoPackage(string FileName) return false; } - off_t FileSize = Db.GetFileSize(); + unsigned long long FileSize = Db.GetFileSize(); if (Delink(FileName,OriginalPath,Stats.DeLinkBytes,FileSize) == false) return false; @@ -415,7 +415,7 @@ bool PackagesWriter::DoPackage(string FileName) } char Size[40]; - sprintf(Size,"%lu", (unsigned long) FileSize); + sprintf(Size,"%llu", (unsigned long long) FileSize); // Strip the DirStrip prefix from the FileName and add the PathPrefix string NewFileName; @@ -612,7 +612,7 @@ bool SourcesWriter::DoPackage(string FileName) if (St.st_size > 128*1024) return _error->Error("DSC file '%s' is too large!",FileName.c_str()); - if (BufSize < (unsigned)St.st_size+1) + if (BufSize < (unsigned long long)St.st_size+1) { BufSize = St.st_size+1; Buffer = (char *)realloc(Buffer,St.st_size+1); @@ -1067,7 +1067,7 @@ void ReleaseWriter::Finish() for(map::const_iterator I = CheckSums.begin(); I != CheckSums.end(); ++I) { - fprintf(Output, " %s %16ld %s\n", + fprintf(Output, " %s %16llu %s\n", (*I).second.MD5.c_str(), (*I).second.size, (*I).first.c_str()); @@ -1079,7 +1079,7 @@ void ReleaseWriter::Finish() for(map::const_iterator I = CheckSums.begin(); I != CheckSums.end(); ++I) { - fprintf(Output, " %s %16ld %s\n", + fprintf(Output, " %s %16llu %s\n", (*I).second.SHA1.c_str(), (*I).second.size, (*I).first.c_str()); @@ -1091,7 +1091,7 @@ void ReleaseWriter::Finish() for(map::const_iterator I = CheckSums.begin(); I != CheckSums.end(); ++I) { - fprintf(Output, " %s %16ld %s\n", + fprintf(Output, " %s %16llu %s\n", (*I).second.SHA256.c_str(), (*I).second.size, (*I).first.c_str()); @@ -1103,7 +1103,7 @@ void ReleaseWriter::Finish() I != CheckSums.end(); ++I) { - fprintf(Output, " %s %32ld %s\n", + fprintf(Output, " %s %16llu %s\n", (*I).second.SHA512.c_str(), (*I).second.size, (*I).first.c_str()); diff --git a/ftparchive/writer.h b/ftparchive/writer.h index c6026e954..a43b83876 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -48,7 +48,7 @@ class FTWScanner static int ScannerFile(const char *File, bool const &ReadLink); bool Delink(string &FileName,const char *OriginalPath, - unsigned long &Bytes,off_t const &FileSize); + unsigned long long &Bytes,unsigned long long const &FileSize); inline void NewLine(unsigned const &Priority) { @@ -159,7 +159,7 @@ class SourcesWriter : public FTWScanner Override BOver; Override SOver; char *Buffer; - unsigned long BufSize; + unsigned long long BufSize; public: @@ -198,7 +198,7 @@ protected: string SHA256; string SHA512; // Limited by FileFd::Size() - unsigned long size; + unsigned long long size; ~CheckSum() {}; }; map CheckSums; diff --git a/methods/ftp.cc b/methods/ftp.cc index a445d767c..87aa8d798 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -629,7 +629,7 @@ bool FTPConn::ExtGoPasv() // FTPConn::Size - Return the size of a file /*{{{*/ // --------------------------------------------------------------------- /* Grab the file size from the server, 0 means no size or empty file */ -bool FTPConn::Size(const char *Path,unsigned long &Size) +bool FTPConn::Size(const char *Path,unsigned long long &Size) { // Query the size unsigned int Tag; @@ -639,7 +639,7 @@ bool FTPConn::Size(const char *Path,unsigned long &Size) return false; char *End; - Size = strtol(Msg.c_str(),&End,10); + Size = strtoull(Msg.c_str(),&End,10); if (Tag >= 400 || End == Msg.c_str()) Size = 0; return true; @@ -841,7 +841,7 @@ bool FTPConn::Finalize() // --------------------------------------------------------------------- /* This opens a data connection, sends REST and RETR and then transfers the file over. */ -bool FTPConn::Get(const char *Path,FileFd &To,unsigned long Resume, +bool FTPConn::Get(const char *Path,FileFd &To,unsigned long long Resume, Hashes &Hash,bool &Missing) { Missing = false; @@ -1004,7 +1004,7 @@ bool FtpMethod::Fetch(FetchItem *Itm) // Get the files information Status(_("Query")); - unsigned long Size; + unsigned long long Size; if (Server->Size(File,Size) == false || Server->ModTime(File,FailTime) == false) { @@ -1026,7 +1026,7 @@ bool FtpMethod::Fetch(FetchItem *Itm) struct stat Buf; if (stat(Itm->DestFile.c_str(),&Buf) == 0) { - if (Size == (unsigned)Buf.st_size && FailTime == Buf.st_mtime) + if (Size == (unsigned long long)Buf.st_size && FailTime == Buf.st_mtime) { Res.Size = Buf.st_size; Res.LastModified = Buf.st_mtime; @@ -1036,7 +1036,7 @@ bool FtpMethod::Fetch(FetchItem *Itm) } // Resume? - if (FailTime == Buf.st_mtime && Size > (unsigned)Buf.st_size) + if (FailTime == Buf.st_mtime && Size > (unsigned long long)Buf.st_size) Res.ResumePoint = Buf.st_size; } diff --git a/methods/ftp.h b/methods/ftp.h index d7f1f7fbe..b4913ca57 100644 --- a/methods/ftp.h +++ b/methods/ftp.h @@ -53,9 +53,9 @@ class FTPConn bool ExtGoPasv(); // Query - bool Size(const char *Path,unsigned long &Size); + bool Size(const char *Path,unsigned long long &Size); bool ModTime(const char *Path, time_t &Time); - bool Get(const char *Path,FileFd &To,unsigned long Resume, + bool Get(const char *Path,FileFd &To,unsigned long long Resume, Hashes &MD5,bool &Missing); FTPConn(URI Srv); diff --git a/methods/gzip.cc b/methods/gzip.cc index 6202d73dc..f4bb052e2 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -64,7 +64,7 @@ bool GzipMethod::Fetch(FetchItem *Itm) while (1) { unsigned char Buffer[4*1024]; - unsigned long Count; + unsigned long long Count = 0; if (!From.Read(Buffer,sizeof(Buffer),&Count)) { diff --git a/methods/http.cc b/methods/http.cc index e505b816e..51fdaa0cd 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -65,15 +65,15 @@ bool AllowRedirect = false; bool Debug = false; URI Proxy; -unsigned long CircleBuf::BwReadLimit=0; -unsigned long CircleBuf::BwTickReadData=0; +unsigned long long CircleBuf::BwReadLimit=0; +unsigned long long CircleBuf::BwTickReadData=0; struct timeval CircleBuf::BwReadTick={0,0}; const unsigned int CircleBuf::BW_HZ=10; // CircleBuf::CircleBuf - Circular input buffer /*{{{*/ // --------------------------------------------------------------------- /* */ -CircleBuf::CircleBuf(unsigned long Size) : Size(Size), Hash(0) +CircleBuf::CircleBuf(unsigned long long Size) : Size(Size), Hash(0) { Buf = new unsigned char[Size]; Reset(); @@ -89,7 +89,7 @@ void CircleBuf::Reset() InP = 0; OutP = 0; StrPos = 0; - MaxGet = (unsigned int)-1; + MaxGet = (unsigned long long)-1; OutQueue = string(); if (Hash != 0) { @@ -104,7 +104,7 @@ void CircleBuf::Reset() is non-blocking.. */ bool CircleBuf::Read(int Fd) { - unsigned long BwReadMax; + unsigned long long BwReadMax; while (1) { @@ -119,7 +119,7 @@ bool CircleBuf::Read(int Fd) struct timeval now; gettimeofday(&now,0); - unsigned long d = (now.tv_sec-CircleBuf::BwReadTick.tv_sec)*1000000 + + unsigned long long d = (now.tv_sec-CircleBuf::BwReadTick.tv_sec)*1000000 + now.tv_usec-CircleBuf::BwReadTick.tv_usec; if(d > 1000000/BW_HZ) { CircleBuf::BwReadTick = now; @@ -133,7 +133,7 @@ bool CircleBuf::Read(int Fd) } // Write the buffer segment - int Res; + ssize_t Res; if(CircleBuf::BwReadLimit) { Res = read(Fd,Buf + (InP%Size), BwReadMax > LeftRead() ? LeftRead() : BwReadMax); @@ -182,7 +182,7 @@ void CircleBuf::FillOut() return; // Write the buffer segment - unsigned long Sz = LeftRead(); + unsigned long long Sz = LeftRead(); if (OutQueue.length() - StrPos < Sz) Sz = OutQueue.length() - StrPos; memcpy(Buf + (InP%Size),OutQueue.c_str() + StrPos,Sz); @@ -216,7 +216,7 @@ bool CircleBuf::Write(int Fd) return true; // Write the buffer segment - int Res; + ssize_t Res; Res = write(Fd,Buf + (OutP%Size),LeftWrite()); if (Res == 0) @@ -242,7 +242,7 @@ bool CircleBuf::Write(int Fd) bool CircleBuf::WriteTillEl(string &Data,bool Single) { // We cheat and assume it is unneeded to have more than one buffer load - for (unsigned long I = OutP; I < InP; I++) + for (unsigned long long I = OutP; I < InP; I++) { if (Buf[I%Size] != '\n') continue; @@ -260,7 +260,7 @@ bool CircleBuf::WriteTillEl(string &Data,bool Single) Data = ""; while (OutP < I) { - unsigned long Sz = LeftWrite(); + unsigned long long Sz = LeftWrite(); if (Sz == 0) return false; if (I - OutP < Sz) @@ -455,7 +455,7 @@ bool ServerState::RunData() return false; // See if we are done - unsigned long Len = strtol(Data.c_str(),0,16); + unsigned long long Len = strtoull(Data.c_str(),0,16); if (Len == 0) { In.Limit(-1); @@ -598,7 +598,7 @@ bool ServerState::HeaderLine(string Line) if (StartPos != 0) return true; - if (sscanf(Val.c_str(),"%lu",&Size) != 1) + if (sscanf(Val.c_str(),"%llu",&Size) != 1) return _error->Error(_("The HTTP server sent an invalid Content-Length header")); return true; } @@ -613,9 +613,9 @@ bool ServerState::HeaderLine(string Line) { HaveContent = true; - if (sscanf(Val.c_str(),"bytes %lu-%*u/%lu",&StartPos,&Size) != 2) + if (sscanf(Val.c_str(),"bytes %llu-%*u/%llu",&StartPos,&Size) != 2) return _error->Error(_("The HTTP server sent an invalid Content-Range header")); - if ((unsigned)StartPos > Size) + if ((unsigned long long)StartPos > Size) return _error->Error(_("This HTTP server has broken range support")); return true; } @@ -718,7 +718,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) if (stat(Itm->DestFile.c_str(),&SBuf) >= 0 && SBuf.st_size > 0) { // In this case we send an if-range query with a range header - sprintf(Buf,"Range: bytes=%li-\r\nIf-Range: %s\r\n",(long)SBuf.st_size - 1, + sprintf(Buf,"Range: bytes=%lli-\r\nIf-Range: %s\r\n",(long long)SBuf.st_size - 1, TimeRFC1123(SBuf.st_mtime).c_str()); Req += Buf; } diff --git a/methods/http.h b/methods/http.h index aa96c6810..b74740ab3 100644 --- a/methods/http.h +++ b/methods/http.h @@ -23,29 +23,29 @@ class HttpMethod; class CircleBuf { unsigned char *Buf; - unsigned long Size; - unsigned long InP; - unsigned long OutP; + unsigned long long Size; + unsigned long long InP; + unsigned long long OutP; string OutQueue; - unsigned long StrPos; - unsigned long MaxGet; + unsigned long long StrPos; + unsigned long long MaxGet; struct timeval Start; - static unsigned long BwReadLimit; - static unsigned long BwTickReadData; + static unsigned long long BwReadLimit; + static unsigned long long BwTickReadData; static struct timeval BwReadTick; static const unsigned int BW_HZ; - unsigned long LeftRead() + unsigned long long LeftRead() { - unsigned long Sz = Size - (InP - OutP); + unsigned long long Sz = Size - (InP - OutP); if (Sz > Size - (InP%Size)) Sz = Size - (InP%Size); return Sz; } - unsigned long LeftWrite() + unsigned long long LeftWrite() { - unsigned long Sz = InP - OutP; + unsigned long long Sz = InP - OutP; if (InP > MaxGet) Sz = MaxGet - OutP; if (Sz > Size - (OutP%Size)) @@ -67,7 +67,7 @@ class CircleBuf bool WriteTillEl(string &Data,bool Single = false); // Control the write limit - void Limit(long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;} + void Limit(long long Max) {if (Max == -1) MaxGet = 0-1; else MaxGet = OutP + Max;} bool IsLimit() {return MaxGet == OutP;}; void Print() {cout << MaxGet << ',' << OutP << endl;}; @@ -79,7 +79,7 @@ class CircleBuf void Reset(); void Stats(); - CircleBuf(unsigned long Size); + CircleBuf(unsigned long long Size); ~CircleBuf() {delete [] Buf; delete Hash;}; }; @@ -92,8 +92,8 @@ struct ServerState char Code[MAXLEN]; // These are some statistics from the last parsed header lines - unsigned long Size; - signed long StartPos; + unsigned long long Size; + signed long long StartPos; time_t Date; bool HaveContent; enum {Chunked,Stream,Closes} Encoding; diff --git a/methods/https.cc b/methods/https.cc index 45bd2a367..06a0e285a 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -52,7 +52,7 @@ HttpsMethod::progress_callback(void *clientp, double dltotal, double dlnow, { HttpsMethod *me = (HttpsMethod *)clientp; if(dltotal > 0 && me->Res.Size == 0) { - me->Res.Size = (unsigned long)dltotal; + me->Res.Size = (unsigned long long)dltotal; me->URIStart(me->Res); } return 0; diff --git a/methods/rred.cc b/methods/rred.cc index 80fc98ac5..57d9a8437 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -256,7 +256,7 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ #ifdef _POSIX_MAPPED_FILES MMap ed_cmds(MMap::ReadOnly); if (Patch.gzFd() != NULL) { - unsigned long mapSize = Patch.Size(); + unsigned long long mapSize = Patch.Size(); DynamicMMap* dyn = new DynamicMMap(0, mapSize, 0); if (dyn->validData() == false) { delete dyn; diff --git a/methods/rsh.cc b/methods/rsh.cc index 10fe76dc3..c95a4d3eb 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -251,7 +251,7 @@ bool RSHConn::WriteMsg(string &Text,bool Sync,const char *Fmt,...) // --------------------------------------------------------------------- /* Right now for successfull transfer the file size must be known in advance. */ -bool RSHConn::Size(const char *Path,unsigned long &Size) +bool RSHConn::Size(const char *Path,unsigned long long &Size) { // Query the size string Msg; @@ -263,7 +263,7 @@ bool RSHConn::Size(const char *Path,unsigned long &Size) // FIXME: Sense if the bad reply is due to a File Not Found. char *End; - Size = strtoul(Msg.c_str(),&End,10); + Size = strtoull(Msg.c_str(),&End,10); if (End == Msg.c_str()) return _error->Error(_("File not found")); return true; @@ -288,8 +288,8 @@ bool RSHConn::ModTime(const char *Path, time_t &Time) // RSHConn::Get - Get a file /*{{{*/ // --------------------------------------------------------------------- /* */ -bool RSHConn::Get(const char *Path,FileFd &To,unsigned long Resume, - Hashes &Hash,bool &Missing, unsigned long Size) +bool RSHConn::Get(const char *Path,FileFd &To,unsigned long long Resume, + Hashes &Hash,bool &Missing, unsigned long long Size) { Missing = false; @@ -314,7 +314,7 @@ bool RSHConn::Get(const char *Path,FileFd &To,unsigned long Resume, return false; // Copy loop - unsigned int MyLen = Resume; + unsigned long long MyLen = Resume; unsigned char Buffer[4096]; while (MyLen < Size) { @@ -428,7 +428,7 @@ bool RSHMethod::Fetch(FetchItem *Itm) Status(_("Connecting to %s"), Get.Host.c_str()); // Get the files information - unsigned long Size; + unsigned long long Size; if (Server->Size(File,Size) == false || Server->ModTime(File,FailTime) == false) { @@ -449,7 +449,7 @@ bool RSHMethod::Fetch(FetchItem *Itm) // See if the file exists struct stat Buf; if (stat(Itm->DestFile.c_str(),&Buf) == 0) { - if (Size == (unsigned)Buf.st_size && FailTime == Buf.st_mtime) { + if (Size == (unsigned long long)Buf.st_size && FailTime == Buf.st_mtime) { Res.Size = Buf.st_size; Res.LastModified = Buf.st_mtime; Res.ResumePoint = Buf.st_size; @@ -458,7 +458,7 @@ bool RSHMethod::Fetch(FetchItem *Itm) } // Resume? - if (FailTime == Buf.st_mtime && Size > (unsigned)Buf.st_size) + if (FailTime == Buf.st_mtime && Size > (unsigned long long)Buf.st_size) Res.ResumePoint = Buf.st_size; } diff --git a/methods/rsh.h b/methods/rsh.h index b06d5a94e..b4c76479a 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -41,10 +41,10 @@ class RSHConn void Close(); // Query - bool Size(const char *Path,unsigned long &Size); + bool Size(const char *Path,unsigned long long &Size); bool ModTime(const char *Path, time_t &Time); - bool Get(const char *Path,FileFd &To,unsigned long Resume, - Hashes &Hash,bool &Missing, unsigned long Size); + bool Get(const char *Path,FileFd &To,unsigned long long Resume, + Hashes &Hash,bool &Missing, unsigned long long Size); RSHConn(URI Srv); ~RSHConn(); -- cgit v1.2.3-70-g09d2 From 472ff00ef2e48383805d281c6364ec27839e3f4d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 19 Sep 2011 19:14:19 +0200 Subject: use forward declaration in headers if possible instead of includes --- apt-inst/contrib/arfile.cc | 1 + apt-inst/contrib/arfile.h | 3 +- apt-inst/contrib/extracttar.cc | 1 + apt-inst/contrib/extracttar.h | 5 +- apt-inst/database.cc | 7 + apt-inst/database.h | 8 +- apt-inst/deb/debfile.cc | 1 + apt-inst/deb/debfile.h | 5 +- apt-inst/deb/dpkgdb.cc | 2 + apt-inst/deb/dpkgdb.h | 5 + apt-inst/extract.cc | 1 + apt-inst/filelist.h | 3 +- apt-pkg/acquire-item.cc | 2 + apt-pkg/acquire-item.h | 238 ++++++++++++++--------------- apt-pkg/acquire-method.h | 6 +- apt-pkg/algorithms.cc | 3 + apt-pkg/algorithms.h | 3 +- apt-pkg/cachefile.cc | 1 + apt-pkg/cachefile.h | 9 +- apt-pkg/cacheiterators.h | 1 + apt-pkg/cacheset.cc | 7 +- apt-pkg/cacheset.h | 13 +- apt-pkg/cdrom.cc | 2 + apt-pkg/cdrom.h | 3 +- apt-pkg/clean.cc | 1 + apt-pkg/contrib/cmndline.cc | 1 + apt-pkg/contrib/cmndline.h | 4 +- apt-pkg/contrib/mmap.cc | 1 + apt-pkg/contrib/mmap.h | 3 +- apt-pkg/contrib/netrc.cc | 2 + apt-pkg/contrib/netrc.h | 4 +- apt-pkg/deb/deblistparser.cc | 1 + apt-pkg/deb/deblistparser.h | 1 - apt-pkg/deb/debmetaindex.cc | 3 + apt-pkg/deb/debmetaindex.h | 43 +++--- apt-pkg/deb/debrecords.cc | 2 + apt-pkg/deb/debrecords.h | 2 +- apt-pkg/deb/debsystem.h | 4 +- apt-pkg/depcache.cc | 2 +- apt-pkg/depcache.h | 5 +- apt-pkg/edsp.cc | 7 + apt-pkg/edsp.h | 11 +- apt-pkg/edsp/edspindexfile.cc | 1 + apt-pkg/edsp/edspindexfile.h | 1 - apt-pkg/edsp/edsplistparser.h | 5 +- apt-pkg/indexfile.h | 2 + apt-pkg/indexrecords.cc | 3 + apt-pkg/indexrecords.h | 1 - apt-pkg/init.cc | 2 + apt-pkg/init.h | 4 +- apt-pkg/metaindex.h | 3 - apt-pkg/packagemanager.h | 3 +- apt-pkg/pkgcachegen.cc | 2 + apt-pkg/pkgsystem.h | 6 +- apt-pkg/sourcelist.cc | 2 + apt-pkg/sourcelist.h | 6 +- apt-pkg/srcrecords.cc | 1 + apt-pkg/tagfile.cc | 1 + apt-pkg/tagfile.h | 6 +- apt-pkg/vendorlist.cc | 2 + apt-pkg/vendorlist.h | 5 +- apt-pkg/version.h | 3 +- cmdline/acqprogress.h | 4 +- cmdline/apt-cache.cc | 6 +- cmdline/apt-cdrom.cc | 2 + cmdline/apt-config.cc | 1 + cmdline/apt-dump-solver.cc | 1 + cmdline/apt-extracttemplates.cc | 1 + cmdline/apt-get.cc | 5 + cmdline/apt-internal-solver.cc | 2 + cmdline/apt-mark.cc | 1 + cmdline/apt-sortpkgs.cc | 2 + debian/changelog | 3 +- ftparchive/cachedb.cc | 1 + ftparchive/cachedb.h | 8 +- ftparchive/contents.h | 3 +- ftparchive/multicompress.h | 5 +- ftparchive/writer.h | 5 +- methods/bzip2.cc | 1 + methods/cdrom.cc | 1 + methods/connect.cc | 2 + methods/connect.h | 3 +- methods/copy.cc | 1 + methods/file.cc | 1 + methods/ftp.cc | 1 + methods/ftp.h | 4 + methods/gpgv.cc | 1 + methods/http.cc | 6 + methods/http.h | 7 +- methods/https.cc | 1 + methods/https.h | 3 +- methods/mirror.cc | 3 +- methods/mirror.h | 25 +-- methods/rred.cc | 1 + methods/rsh.cc | 3 + methods/rsh.h | 8 +- test/interactive-helper/extract-control.cc | 1 + test/interactive-helper/test_udevcdrom.cc | 1 + test/interactive-helper/testextract.cc | 2 + 99 files changed, 380 insertions(+), 232 deletions(-) (limited to 'cmdline') diff --git a/apt-inst/contrib/arfile.cc b/apt-inst/contrib/arfile.cc index 4e078349e..2dee1a40d 100644 --- a/apt-inst/contrib/arfile.cc +++ b/apt-inst/contrib/arfile.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/apt-inst/contrib/arfile.h b/apt-inst/contrib/arfile.h index bfc128ace..2be1323d1 100644 --- a/apt-inst/contrib/arfile.h +++ b/apt-inst/contrib/arfile.h @@ -17,7 +17,8 @@ #include -#include + +class FileFd; class ARArchive { diff --git a/apt-inst/contrib/extracttar.cc b/apt-inst/contrib/extracttar.cc index 487027c3d..12919a7cd 100644 --- a/apt-inst/contrib/extracttar.cc +++ b/apt-inst/contrib/extracttar.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/contrib/extracttar.h b/apt-inst/contrib/extracttar.h index 27c453d0d..8754e8dcc 100644 --- a/apt-inst/contrib/extracttar.h +++ b/apt-inst/contrib/extracttar.h @@ -15,9 +15,10 @@ #define PKGLIB_EXTRACTTAR_H #include -#include -#include +#include + +class pkgDirStream; class ExtractTar { diff --git a/apt-inst/database.cc b/apt-inst/database.cc index 1a94e1353..da7613491 100644 --- a/apt-inst/database.cc +++ b/apt-inst/database.cc @@ -11,6 +11,8 @@ #include #include +#include +#include /*}}}*/ // DataBase::GetMetaTmp - Get the temp dir /*{{{*/ @@ -26,3 +28,8 @@ bool pkgDataBase::GetMetaTmp(std::string &Dir) return true; } /*}}}*/ +pkgDataBase::~pkgDataBase() +{ + delete Cache; + delete FList; +} diff --git a/apt-inst/database.h b/apt-inst/database.h index cd0e310bc..ccfee3797 100644 --- a/apt-inst/database.h +++ b/apt-inst/database.h @@ -21,9 +21,13 @@ #ifndef PKGLIB_DATABASE_H #define PKGLIB_DATABASE_H -#include #include +#include + +class pkgFLCache; +class OpProgress; + class pkgDataBase { protected: @@ -46,7 +50,7 @@ class pkgDataBase virtual bool LoadChanges() = 0; pkgDataBase() : Cache(0), FList(0) {}; - virtual ~pkgDataBase() {delete Cache; delete FList;}; + virtual ~pkgDataBase(); }; #endif diff --git a/apt-inst/deb/debfile.cc b/apt-inst/deb/debfile.cc index 8ade547f5..4bd065cf8 100644 --- a/apt-inst/deb/debfile.cc +++ b/apt-inst/deb/debfile.cc @@ -18,6 +18,7 @@ // Include Files /*{{{*/ #include +#include #include #include #include diff --git a/apt-inst/deb/debfile.h b/apt-inst/deb/debfile.h index e404d81db..2c4734f9e 100644 --- a/apt-inst/deb/debfile.h +++ b/apt-inst/deb/debfile.h @@ -25,9 +25,12 @@ #include -#include #include #include +#include + +class FileFd; +class pkgDataBase; class debDebFile { diff --git a/apt-inst/deb/dpkgdb.cc b/apt-inst/deb/dpkgdb.cc index 3112acdbd..819c123f6 100644 --- a/apt-inst/deb/dpkgdb.cc +++ b/apt-inst/deb/dpkgdb.cc @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-inst/deb/dpkgdb.h b/apt-inst/deb/dpkgdb.h index 3656929aa..f28563a93 100644 --- a/apt-inst/deb/dpkgdb.h +++ b/apt-inst/deb/dpkgdb.h @@ -22,6 +22,11 @@ #include +#include + +class DynamicMMap; +class OpProgress; + class debDpkgDB : public pkgDataBase { protected: diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc index d48ff63ac..29e163028 100644 --- a/apt-inst/extract.cc +++ b/apt-inst/extract.cc @@ -49,6 +49,7 @@ #include #include #include +#include #include #include diff --git a/apt-inst/filelist.h b/apt-inst/filelist.h index 69c483e71..0405d61df 100644 --- a/apt-inst/filelist.h +++ b/apt-inst/filelist.h @@ -28,9 +28,10 @@ #ifndef PKGLIB_FILELIST_H #define PKGLIB_FILELIST_H +#include #include -#include +#include class pkgFLCache { diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b46489f87..453fce109 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 13be17a01..24f848f27 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -21,13 +21,9 @@ #define PKGLIB_ACQUIRE_ITEM_H #include -#include -#include -#include -#include -#include #include #include +#include /** \addtogroup acquire * @{ @@ -35,6 +31,10 @@ * \file acquire-item.h */ +class indexRecords; +class pkgRecords; +class pkgSourceList; + /** \brief Represents the process by which a pkgAcquire object should {{{ * retrieve a file or a collection of files. * @@ -74,7 +74,7 @@ class pkgAcquire::Item : public WeakPointable * \param To The new name of #From. If #To exists it will be * overwritten. */ - void Rename(string From,string To); + void Rename(std::string From,std::string To); public: @@ -109,7 +109,7 @@ class pkgAcquire::Item : public WeakPointable /** \brief Contains a textual description of the error encountered * if #Status is #StatError or #StatAuthError. */ - string ErrorText; + std::string ErrorText; /** \brief The size of the object to fetch. */ unsigned long long FileSize; @@ -143,7 +143,7 @@ class pkgAcquire::Item : public WeakPointable * download progress indicator's overall statistics. */ bool Local; - string UsedMirror; + std::string UsedMirror; /** \brief The number of fetch queues into which this item has been * inserted. @@ -158,7 +158,7 @@ class pkgAcquire::Item : public WeakPointable /** \brief The name of the file into which the retrieved object * will be written. */ - string DestFile; + std::string DestFile; /** \brief Invoked by the acquire worker when the object couldn't * be fetched. @@ -173,7 +173,7 @@ class pkgAcquire::Item : public WeakPointable * * \sa pkgAcqMethod */ - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); /** \brief Invoked by the acquire worker when the object was * fetched successfully. @@ -194,7 +194,7 @@ class pkgAcquire::Item : public WeakPointable * * \sa pkgAcqMethod */ - virtual void Done(string Message,unsigned long long Size,string Hash, + virtual void Done(std::string Message,unsigned long long Size,std::string Hash, pkgAcquire::MethodConfig *Cnf); /** \brief Invoked when the worker starts to fetch this object. @@ -206,7 +206,7 @@ class pkgAcquire::Item : public WeakPointable * * \sa pkgAcqMethod */ - virtual void Start(string Message,unsigned long long Size); + virtual void Start(std::string Message,unsigned long long Size); /** \brief Custom headers to be sent to the fetch process. * @@ -216,18 +216,18 @@ class pkgAcquire::Item : public WeakPointable * line, so they should (if nonempty) have a leading newline and * no trailing newline. */ - virtual string Custom600Headers() {return string();}; + virtual std::string Custom600Headers() {return std::string();}; /** \brief A "descriptive" URI-like string. * * \return a URI that should be used to describe what is being fetched. */ - virtual string DescURI() = 0; + virtual std::string DescURI() = 0; /** \brief Short item description. * * \return a brief description of the object being fetched. */ - virtual string ShortDesc() {return DescURI();} + virtual std::string ShortDesc() {return DescURI();} /** \brief Invoked by the worker when the download is completely done. */ virtual void Finished() {}; @@ -237,7 +237,7 @@ class pkgAcquire::Item : public WeakPointable * \return the HashSum of this object, if applicable; otherwise, an * empty string. */ - virtual string HashSum() {return string();}; + virtual std::string HashSum() {return std::string();}; /** \return the acquire process with which this item is associated. */ pkgAcquire *GetOwner() {return Owner;}; @@ -253,7 +253,7 @@ class pkgAcquire::Item : public WeakPointable * * \param FailCode A short failure string that is send */ - void ReportMirrorFailure(string FailCode); + void ReportMirrorFailure(std::string FailCode); /** \brief Initialize an item. @@ -278,10 +278,10 @@ class pkgAcquire::Item : public WeakPointable /** \brief Information about an index patch (aka diff). */ /*{{{*/ struct DiffInfo { /** The filename of the diff. */ - string file; + std::string file; /** The sha1 hash of the diff. */ - string sha1; + std::string sha1; /** The size of the diff. */ unsigned long size; @@ -308,12 +308,12 @@ class pkgAcqSubIndex : public pkgAcquire::Item public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Md5Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash, pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return Desc.URI;}; - virtual string Custom600Headers(); - virtual bool ParseIndex(string const &IndexFile); + virtual std::string DescURI() {return Desc.URI;}; + virtual std::string Custom600Headers(); + virtual bool ParseIndex(std::string const &IndexFile); /** \brief Create a new pkgAcqSubIndex. * @@ -327,8 +327,8 @@ class pkgAcqSubIndex : public pkgAcquire::Item * * \param ExpectedHash The list file's MD5 signature. */ - pkgAcqSubIndex(pkgAcquire *Owner, string const &URI,string const &URIDesc, - string const &ShortDesc, HashString const &ExpectedHash); + pkgAcqSubIndex(pkgAcquire *Owner, std::string const &URI,std::string const &URIDesc, + std::string const &ShortDesc, HashString const &ExpectedHash); }; /*}}}*/ /** \brief An item that is responsible for fetching an index file of {{{ @@ -352,7 +352,7 @@ class pkgAcqDiffIndex : public pkgAcquire::Item /** \brief The URI of the index file to recreate at our end (either * by downloading it or by applying partial patches). */ - string RealURI; + std::string RealURI; /** \brief The Hash that the real index file should have after * all patches have been applied. @@ -362,20 +362,20 @@ class pkgAcqDiffIndex : public pkgAcquire::Item /** \brief The index file which will be patched to generate the new * file. */ - string CurrentPackagesFile; + std::string CurrentPackagesFile; /** \brief A description of the Packages file (stored in * pkgAcquire::ItemDesc::Description). */ - string Description; + std::string Description; public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Md5Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash, pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return RealURI + "Index";}; - virtual string Custom600Headers(); + virtual std::string DescURI() {return RealURI + "Index";}; + virtual std::string Custom600Headers(); /** \brief Parse the Index file for a set of Packages diffs. * @@ -387,7 +387,7 @@ class pkgAcqDiffIndex : public pkgAcquire::Item * \return \b true if the Index file was successfully parsed, \b * false otherwise. */ - bool ParseDiffIndex(string IndexDiffFile); + bool ParseDiffIndex(std::string IndexDiffFile); /** \brief Create a new pkgAcqDiffIndex. @@ -402,8 +402,8 @@ class pkgAcqDiffIndex : public pkgAcquire::Item * * \param ExpectedHash The list file's MD5 signature. */ - pkgAcqDiffIndex(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesc, HashString ExpectedHash); + pkgAcqDiffIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc, + std::string ShortDesc, HashString ExpectedHash); }; /*}}}*/ /** \brief An item that is responsible for fetching all the patches {{{ @@ -460,7 +460,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item /** \brief The URI of the package index file that is being * reconstructed. */ - string RealURI; + std::string RealURI; /** \brief The HashSum of the package index file that is being * reconstructed. @@ -468,7 +468,7 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item HashString ExpectedHash; /** A description of the file being downloaded. */ - string Description; + std::string Description; /** The patches that remain to be downloaded, including the patch * being downloaded right now. This list should be ordered so @@ -478,10 +478,10 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item * dictionary instead of relying on ordering and stripping them * off the front? */ - vector available_patches; + std::vector available_patches; /** Stop applying patches when reaching that sha1 */ - string ServerSha1; + std::string ServerSha1; /** The current status of this patch. */ enum DiffState @@ -506,11 +506,11 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Md5Hash, + virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash, pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return RealURI + "Index";}; + virtual std::string DescURI() {return RealURI + "Index";}; /** \brief Create an index diff item. * @@ -534,10 +534,10 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item * should be ordered so that each diff appears before any diff * that depends on it. */ - pkgAcqIndexDiffs(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesc, HashString ExpectedHash, - string ServerSha1, - vector diffs=vector()); + pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc, + std::string ShortDesc, HashString ExpectedHash, + std::string ServerSha1, + std::vector diffs=std::vector()); }; /*}}}*/ /** \brief An acquire item that is responsible for fetching an index {{{ @@ -577,7 +577,7 @@ class pkgAcqIndex : public pkgAcquire::Item /** \brief The object that is actually being fetched (minus any * compression-related extensions). */ - string RealURI; + std::string RealURI; /** \brief The expected hashsum of the decompressed index file. */ HashString ExpectedHash; @@ -585,17 +585,17 @@ class pkgAcqIndex : public pkgAcquire::Item /** \brief The compression-related file extensions that are being * added to the downloaded file one by one if first fails (e.g., "gz bz2"). */ - string CompressionExtension; + std::string CompressionExtension; public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Md5Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash, pkgAcquire::MethodConfig *Cnf); - virtual string Custom600Headers(); - virtual string DescURI() {return Desc.URI;}; - virtual string HashSum() {return ExpectedHash.toStr(); }; + virtual std::string Custom600Headers(); + virtual std::string DescURI() {return Desc.URI;}; + virtual std::string HashSum() {return ExpectedHash.toStr(); }; /** \brief Create a pkgAcqIndex. * @@ -616,12 +616,12 @@ class pkgAcqIndex : public pkgAcquire::Item * default is ".lzma" or ".bz2" (if the needed binaries are present) * fallback is ".gz" or none. */ - pkgAcqIndex(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesc, HashString ExpectedHash, - string compressExt=""); + pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc, + std::string ShortDesc, HashString ExpectedHash, + std::string compressExt=""); pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target, HashString const &ExpectedHash, indexRecords const *MetaIndexParser); - void Init(string const &URI, string const &URIDesc, string const &ShortDesc); + void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); }; /*}}}*/ /** \brief An acquire item that is responsible for fetching a {{{ @@ -635,8 +635,8 @@ class pkgAcqIndexTrans : public pkgAcqIndex { public: - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual string Custom600Headers(); + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual std::string Custom600Headers(); /** \brief Create a pkgAcqIndexTrans. * @@ -649,8 +649,8 @@ class pkgAcqIndexTrans : public pkgAcqIndex * * \param ShortDesc A brief description of this index file. */ - pkgAcqIndexTrans(pkgAcquire *Owner,string URI,string URIDesc, - string ShortDesc); + pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc, + std::string ShortDesc); pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target, HashString const &ExpectedHash, indexRecords const *MetaIndexParser); }; @@ -660,18 +660,18 @@ class IndexTarget { public: /** \brief A URI from which the index file can be downloaded. */ - string URI; + std::string URI; /** \brief A description of the index file. */ - string Description; + std::string Description; /** \brief A shorter description of the index file. */ - string ShortDesc; + std::string ShortDesc; /** \brief The key by which this index file should be * looked up within the meta signature file. */ - string MetaKey; + std::string MetaKey; virtual bool IsOptional() const { return false; @@ -710,7 +710,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item { protected: /** \brief The last good signature file */ - string LastGoodSig; + std::string LastGoodSig; /** \brief The fetch request that is currently being processed. */ pkgAcquire::ItemDesc Desc; @@ -719,20 +719,20 @@ class pkgAcqMetaSig : public pkgAcquire::Item * never modified; it is used to determine the file that is being * downloaded. */ - string RealURI; + std::string RealURI; /** \brief The URI of the meta-index file to be fetched after the signature. */ - string MetaIndexURI; + std::string MetaIndexURI; /** \brief A "URI-style" description of the meta-index file to be * fetched after the signature. */ - string MetaIndexURIDesc; + std::string MetaIndexURIDesc; /** \brief A brief description of the meta-index file to be fetched * after the signature. */ - string MetaIndexShortDesc; + std::string MetaIndexShortDesc; /** \brief A package-system-specific parser for the meta-index file. */ indexRecords* MetaIndexParser; @@ -742,21 +742,21 @@ class pkgAcqMetaSig : public pkgAcquire::Item * * \todo Why a list of pointers instead of a list of structs? */ - const vector* IndexTargets; + const std::vector* IndexTargets; public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Md5Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash, pkgAcquire::MethodConfig *Cnf); - virtual string Custom600Headers(); - virtual string DescURI() {return RealURI; }; + virtual std::string Custom600Headers(); + virtual std::string DescURI() {return RealURI; }; /** \brief Create a new pkgAcqMetaSig. */ - pkgAcqMetaSig(pkgAcquire *Owner,string URI,string URIDesc, string ShortDesc, - string MetaIndexURI, string MetaIndexURIDesc, string MetaIndexShortDesc, - const vector* IndexTargets, + pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc, + std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc, + const std::vector* IndexTargets, indexRecords* MetaIndexParser); }; /*}}}*/ @@ -779,17 +779,17 @@ class pkgAcqMetaIndex : public pkgAcquire::Item /** \brief The URI that is actually being downloaded; never * modified by pkgAcqMetaIndex. */ - string RealURI; + std::string RealURI; /** \brief The file in which the signature for this index was stored. * * If empty, the signature and the md5sums of the individual * indices will not be checked. */ - string SigFile; + std::string SigFile; /** \brief The index files to download. */ - const vector* IndexTargets; + const std::vector* IndexTargets; /** \brief The parser for the meta-index file. */ indexRecords* MetaIndexParser; @@ -805,7 +805,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item * * \return \b true if no fatal errors were encountered. */ - bool VerifyVendor(string Message); + bool VerifyVendor(std::string Message); /** \brief Called when a file is finished being retrieved. * @@ -816,7 +816,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item * \param Message The message block received from the fetch * subprocess. */ - void RetrievalDone(string Message); + void RetrievalDone(std::string Message); /** \brief Called when authentication succeeded. * @@ -827,7 +827,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item * \param Message The message block received from the fetch * subprocess. */ - void AuthDone(string Message); + void AuthDone(std::string Message); /** \brief Starts downloading the individual index files. * @@ -842,17 +842,17 @@ class pkgAcqMetaIndex : public pkgAcquire::Item public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size, string Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size, std::string Hash, pkgAcquire::MethodConfig *Cnf); - virtual string Custom600Headers(); - virtual string DescURI() {return RealURI; }; + virtual std::string Custom600Headers(); + virtual std::string DescURI() {return RealURI; }; /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire *Owner, - string URI,string URIDesc, string ShortDesc, - string SigFile, - const vector* IndexTargets, + std::string URI,std::string URIDesc, std::string ShortDesc, + std::string SigFile, + const std::vector* IndexTargets, indexRecords* MetaIndexParser); }; /*}}}*/ @@ -860,33 +860,33 @@ class pkgAcqMetaIndex : public pkgAcquire::Item class pkgAcqMetaClearSig : public pkgAcqMetaIndex { /** \brief The URI of the meta-index file for the detached signature */ - string MetaIndexURI; + std::string MetaIndexURI; /** \brief A "URI-style" description of the meta-index file */ - string MetaIndexURIDesc; + std::string MetaIndexURIDesc; /** \brief A brief description of the meta-index file */ - string MetaIndexShortDesc; + std::string MetaIndexShortDesc; /** \brief The URI of the detached meta-signature file if the clearsigned one failed. */ - string MetaSigURI; + std::string MetaSigURI; /** \brief A "URI-style" description of the meta-signature file */ - string MetaSigURIDesc; + std::string MetaSigURIDesc; /** \brief A brief description of the meta-signature file */ - string MetaSigShortDesc; + std::string MetaSigShortDesc; public: - void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual string Custom600Headers(); + void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual std::string Custom600Headers(); /** \brief Create a new pkgAcqMetaClearSig. */ pkgAcqMetaClearSig(pkgAcquire *Owner, - string const &URI, string const &URIDesc, string const &ShortDesc, - string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc, - string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc, - const vector* IndexTargets, + std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc, + std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc, + std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc, + const std::vector* IndexTargets, indexRecords* MetaIndexParser); }; /*}}}*/ @@ -920,7 +920,7 @@ class pkgAcqArchive : public pkgAcquire::Item /** \brief A location in which the actual filename of the package * should be stored. */ - string &StoreFilename; + std::string &StoreFilename; /** \brief The next file for this version to try to download. */ pkgCache::VerFileIterator Vf; @@ -942,13 +942,13 @@ class pkgAcqArchive : public pkgAcquire::Item public: - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string Hash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string Hash, pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return Desc.URI;}; - virtual string ShortDesc() {return Desc.ShortDesc;}; + virtual std::string DescURI() {return Desc.URI;}; + virtual std::string ShortDesc() {return Desc.ShortDesc;}; virtual void Finished(); - virtual string HashSum() {return ExpectedHash.toStr(); }; + virtual std::string HashSum() {return ExpectedHash.toStr(); }; virtual bool IsTrusted(); /** \brief Create a new pkgAcqArchive. @@ -971,7 +971,7 @@ class pkgAcqArchive : public pkgAcquire::Item */ pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources, pkgRecords *Recs,pkgCache::VerIterator const &Version, - string &StoreFilename); + std::string &StoreFilename); }; /*}}}*/ /** \brief Retrieve an arbitrary file to the current directory. {{{ @@ -999,12 +999,12 @@ class pkgAcqFile : public pkgAcquire::Item public: // Specialized action members - virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf); - virtual void Done(string Message,unsigned long long Size,string CalcHash, + virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); + virtual void Done(std::string Message,unsigned long long Size,std::string CalcHash, pkgAcquire::MethodConfig *Cnf); - virtual string DescURI() {return Desc.URI;}; - virtual string HashSum() {return ExpectedHash.toStr(); }; - virtual string Custom600Headers(); + virtual std::string DescURI() {return Desc.URI;}; + virtual std::string HashSum() {return ExpectedHash.toStr(); }; + virtual std::string Custom600Headers(); /** \brief Create a new pkgAcqFile object. * @@ -1037,9 +1037,9 @@ class pkgAcqFile : public pkgAcquire::Item * is the absolute name to which the file should be downloaded. */ - pkgAcqFile(pkgAcquire *Owner, string URI, string Hash, unsigned long long Size, - string Desc, string ShortDesc, - const string &DestDir="", const string &DestFilename="", + pkgAcqFile(pkgAcquire *Owner, std::string URI, std::string Hash, unsigned long long Size, + std::string Desc, std::string ShortDesc, + const std::string &DestDir="", const std::string &DestFilename="", bool IsIndexFile=false); }; /*}}}*/ diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h index 8acec82ed..c3f042ee0 100644 --- a/apt-pkg/acquire-method.h +++ b/apt-pkg/acquire-method.h @@ -20,11 +20,11 @@ #ifndef PKGLIB_ACQUIRE_METHOD_H #define PKGLIB_ACQUIRE_METHOD_H -#include -#include - #include +#include +#include + class Hashes; class pkgAcqMethod { diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 40368c91f..919daefef 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include #include #include diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index f299f8189..948fe1103 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -33,10 +33,11 @@ #include #include -#include #include +class pkgAcquireStatus; + class pkgSimulate : public pkgPackageManager /*{{{*/ { protected: diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index f38dfc581..1b8d91a44 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -23,6 +23,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/cachefile.h b/apt-pkg/cachefile.h index 243061f0f..b56e42855 100644 --- a/apt-pkg/cachefile.h +++ b/apt-pkg/cachefile.h @@ -17,11 +17,12 @@ #ifndef PKGLIB_CACHEFILE_H #define PKGLIB_CACHEFILE_H - #include -#include -#include -#include +#include + +class pkgPolicy; +class pkgSourceList; +class OpProgress; class pkgCacheFile { diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index 464b2fdd8..5382f3838 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -32,6 +32,7 @@ #include #include + // abstract Iterator template /*{{{*/ /* This template provides the very basic iterator methods we need to have for doing some walk-over-the-cache magic */ diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 386ecfb5f..6b95eab70 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -12,11 +12,14 @@ #include #include +#include #include #include #include #include #include +#include +#include #include @@ -298,7 +301,7 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg, std::string ver; bool verIsRel = false; size_t const vertag = pkg.find_last_of("/="); - if (vertag != string::npos) { + if (vertag != std::string::npos) { ver = pkg.substr(vertag+1); verIsRel = (pkg[vertag] == '/'); pkg.erase(vertag); @@ -316,7 +319,7 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg, errors = helper.showErrors(false); for (PackageSet::const_iterator P = pkgset.begin(); P != pkgset.end(); ++P) { - if (vertag == string::npos) { + if (vertag == std::string::npos) { verset.insert(VersionSet::FromPackage(Cache, P, fallback, helper)); continue; } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 061d0a2f4..3b1118bdc 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -16,9 +16,12 @@ #include #include -#include +#include #include /*}}}*/ + +class pkgCacheFile; + namespace APT { class PackageSet; class VersionSet; @@ -37,10 +40,10 @@ public: /*{{{*/ ShowError(ShowError), ErrorType(ErrorType) {}; virtual ~CacheSetHelper() {}; - virtual void showTaskSelection(PackageSet const &pkgset, string const &pattern) {}; - virtual void showRegExSelection(PackageSet const &pkgset, string const &pattern) {}; + virtual void showTaskSelection(PackageSet const &pkgset, std::string const &pattern) {}; + virtual void showRegExSelection(PackageSet const &pkgset, std::string const &pattern) {}; virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, - string const &ver, bool const &verIsRel) {}; + std::string const &ver, bool const &verIsRel) {}; virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str); virtual PackageSet canNotFindTask(pkgCacheFile &Cache, std::string pattern); @@ -265,7 +268,7 @@ public: /*{{{*/ inline pkgCache::VerFileIterator FileList() const { return (**this).FileList(); }; inline bool Downloadable() const { return (**this).Downloadable(); }; inline const char *PriorityType() const { return (**this).PriorityType(); }; - inline string RelStr() const { return (**this).RelStr(); }; + inline std::string RelStr() const { return (**this).RelStr(); }; inline bool Automatic() const { return (**this).Automatic(); }; inline pkgCache::VerFileIterator NewestFile() const { return (**this).NewestFile(); }; }; diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 392cd890e..a9c63fd21 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/cdrom.h b/apt-pkg/cdrom.h index 2241f1eba..319254fd0 100644 --- a/apt-pkg/cdrom.h +++ b/apt-pkg/cdrom.h @@ -1,10 +1,11 @@ #ifndef PKGLIB_CDROM_H #define PKGLIB_CDROM_H -#include #include #include +class Configuration; +class OpProgress; class pkgCdromStatus /*{{{*/ { diff --git a/apt-pkg/clean.cc b/apt-pkg/clean.cc index f5a939968..ed8fa1aa9 100644 --- a/apt-pkg/clean.cc +++ b/apt-pkg/clean.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc index 34e90da20..997f26bc7 100644 --- a/apt-pkg/contrib/cmndline.cc +++ b/apt-pkg/contrib/cmndline.cc @@ -13,6 +13,7 @@ // Include files /*{{{*/ #include +#include #include #include #include diff --git a/apt-pkg/contrib/cmndline.h b/apt-pkg/contrib/cmndline.h index 7c0c71aa7..b201d9855 100644 --- a/apt-pkg/contrib/cmndline.h +++ b/apt-pkg/contrib/cmndline.h @@ -44,9 +44,7 @@ #ifndef PKGLIB_CMNDLINE_H #define PKGLIB_CMNDLINE_H - - -#include +class Configuration; class CommandLine { diff --git a/apt-pkg/contrib/mmap.cc b/apt-pkg/contrib/mmap.cc index a110a7019..f76169a92 100644 --- a/apt-pkg/contrib/mmap.cc +++ b/apt-pkg/contrib/mmap.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/apt-pkg/contrib/mmap.h b/apt-pkg/contrib/mmap.h index 387e9a170..2ed4a95f8 100644 --- a/apt-pkg/contrib/mmap.h +++ b/apt-pkg/contrib/mmap.h @@ -27,7 +27,8 @@ #include -#include + +class FileFd; /* This should be a 32 bit type, larger tyes use too much ram and smaller types are too small. Where ever possible 'unsigned long' should be used diff --git a/apt-pkg/contrib/netrc.cc b/apt-pkg/contrib/netrc.cc index 9aa1376dc..cb7d36088 100644 --- a/apt-pkg/contrib/netrc.cc +++ b/apt-pkg/contrib/netrc.cc @@ -14,7 +14,9 @@ #include #include +#include #include + #include #include #include diff --git a/apt-pkg/contrib/netrc.h b/apt-pkg/contrib/netrc.h index 86afa43d1..7b94eba88 100644 --- a/apt-pkg/contrib/netrc.h +++ b/apt-pkg/contrib/netrc.h @@ -14,11 +14,13 @@ #ifndef NETRC_H #define NETRC_H -#include +#include #define DOT_CHAR "." #define DIR_CHAR "/" +class URI; + // Assume: password[0]=0, host[0] != 0. // If login[0] = 0, search for login and password within a machine section // in the netrc. diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 95a2e6d47..3652f9e8b 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 09858d991..9519d9711 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -12,7 +12,6 @@ #define PKGLIB_DEBLISTPARSER_H #include -#include #include class debListParser : public pkgCacheGenerator::ListParser diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 1d3754b00..0d07725eb 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -4,9 +4,12 @@ #include #include #include +#include #include #include #include +#include +#include #include #include diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index 695cfa7cc..0cba2d8a8 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -3,9 +3,10 @@ #define PKGLIB_DEBMETAINDEX_H #include -#include #include +#include +#include class debReleaseIndex : public metaIndex { public: @@ -13,43 +14,43 @@ class debReleaseIndex : public metaIndex { class debSectionEntry { public: - debSectionEntry (string const &Section, bool const &IsSrc); - string const Section; + debSectionEntry (std::string const &Section, bool const &IsSrc); + std::string const Section; bool const IsSrc; }; private: /** \brief dpointer placeholder (for later in case we need it) */ void *d; - std::map > ArchEntries; + std::map > ArchEntries; enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted; public: - debReleaseIndex(string const &URI, string const &Dist); - debReleaseIndex(string const &URI, string const &Dist, bool const Trusted); + debReleaseIndex(std::string const &URI, std::string const &Dist); + debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); virtual ~debReleaseIndex(); - virtual string ArchiveURI(string const &File) const {return URI + File;}; + virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) const; - vector * ComputeIndexTargets() const; - string Info(const char *Type, string const &Section, string const &Arch="") const; - string MetaIndexInfo(const char *Type) const; - string MetaIndexFile(const char *Types) const; - string MetaIndexURI(const char *Type) const; - string IndexURI(const char *Type, string const &Section, string const &Arch="native") const; - string IndexURISuffix(const char *Type, string const &Section, string const &Arch="native") const; - string SourceIndexURI(const char *Type, const string &Section) const; - string SourceIndexURISuffix(const char *Type, const string &Section) const; - string TranslationIndexURI(const char *Type, const string &Section) const; - string TranslationIndexURISuffix(const char *Type, const string &Section) const; - virtual vector *GetIndexFiles(); + std::vector * ComputeIndexTargets() const; + std::string Info(const char *Type, std::string const &Section, std::string const &Arch="") const; + std::string MetaIndexInfo(const char *Type) const; + std::string MetaIndexFile(const char *Types) const; + std::string MetaIndexURI(const char *Type) const; + std::string IndexURI(const char *Type, std::string const &Section, std::string const &Arch="native") const; + std::string IndexURISuffix(const char *Type, std::string const &Section, std::string const &Arch="native") const; + std::string SourceIndexURI(const char *Type, const std::string &Section) const; + std::string SourceIndexURISuffix(const char *Type, const std::string &Section) const; + std::string TranslationIndexURI(const char *Type, const std::string &Section) const; + std::string TranslationIndexURISuffix(const char *Type, const std::string &Section) const; + virtual std::vector *GetIndexFiles(); void SetTrusted(bool const Trusted); virtual bool IsTrusted() const; - void PushSectionEntry(vector const &Archs, const debSectionEntry *Entry); - void PushSectionEntry(string const &Arch, const debSectionEntry *Entry); + void PushSectionEntry(std::vector const &Archs, const debSectionEntry *Entry); + void PushSectionEntry(std::string const &Arch, const debSectionEntry *Entry); void PushSectionEntry(const debSectionEntry *Entry); }; diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index ef6a7ca9d..1afa7b74d 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -14,6 +14,8 @@ #include #include #include +#include + #include /*}}}*/ diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index b75726859..9c7ea6b48 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -15,8 +15,8 @@ #define PKGLIB_DEBRECORDS_H #include -#include #include +#include class debRecordParser : public pkgRecords::Parser { diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index 232155256..855123516 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -11,10 +11,12 @@ #define PKGLIB_DEBSYSTEM_H #include +#include class debSystemPrivate; - class debStatusIndex; +class pkgDepCache; + class debSystem : public pkgSystem { // private d-pointer diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 529085b4a..529e9240d 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -16,13 +16,13 @@ #include #include #include - #include #include #include #include #include #include +#include #include #include diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 5798f0362..f6e6c0afc 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -40,12 +40,13 @@ #include #include -#include -#include #include #include #include +#include + +class OpProgress; class pkgDepCache : protected pkgCache::Namespace { diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 44f7dbfd6..137398100 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -9,17 +9,24 @@ #include #include +#include #include #include #include #include +#include +#include #include #include +#include + #include /*}}}*/ +using std::string; + // we could use pkgCache::DepType and ::Priority, but these would be localized strings… const char * const EDSP::PrioMap[] = {0, "important", "required", "standard", "optional", "extra"}; diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 743c3f5d1..c14309422 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -9,12 +9,17 @@ #ifndef PKGLIB_EDSP_H #define PKGLIB_EDSP_H -#include -#include -#include +#include +#include #include +namespace APT { + class PackageSet; +}; +class pkgDepCache; +class OpProgress; + class EDSP /*{{{*/ { // we could use pkgCache::DepType and ::Priority, but these would be localized strings… diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index b417a7562..058cef636 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 58a7f62a9..9670c4837 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -8,7 +8,6 @@ #ifndef PKGLIB_EDSPINDEXFILE_H #define PKGLIB_EDSPINDEXFILE_H -#include #include class edspIndex : public debStatusIndex diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 3e196cb9a..5d82716c7 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -12,9 +12,8 @@ #define PKGLIB_EDSPLISTPARSER_H #include -#include -#include -#include + +class FileFd; class edspListParser : public debListParser { diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 68d53ad7e..5e162a846 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -27,10 +27,12 @@ #include #include #include +#include class pkgAcquire; class pkgCacheGenerator; class OpProgress; + class pkgIndexFile { protected: diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 7b48d659e..cdb9250e8 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -10,6 +10,9 @@ #include #include #include +#include +#include + #include #include diff --git a/apt-pkg/indexrecords.h b/apt-pkg/indexrecords.h index 66b84f8bb..fa60a0847 100644 --- a/apt-pkg/indexrecords.h +++ b/apt-pkg/indexrecords.h @@ -7,7 +7,6 @@ #include -#include #include #include diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index a1cb05e38..2a709dd36 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/init.h b/apt-pkg/init.h index 4cee1001a..85ad0df7e 100644 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@ -13,8 +13,8 @@ #ifndef PKGLIB_INIT_H #define PKGLIB_INIT_H -#include -#include +class pkgSystem; +class Configuration; // These lines are extracted by the makefiles and the buildsystem // Increasing MAJOR or MINOR results in the need of recompiling all diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h index 66c287c30..9cc79a7a6 100644 --- a/apt-pkg/metaindex.h +++ b/apt-pkg/metaindex.h @@ -4,10 +4,7 @@ #include #include -#include -#include #include -#include class pkgAcquire; class pkgCacheGenerator; diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h index 7ee17942c..d4989a6e0 100644 --- a/apt-pkg/packagemanager.h +++ b/apt-pkg/packagemanager.h @@ -23,11 +23,10 @@ #ifndef PKGLIB_PACKAGEMANAGER_H #define PKGLIB_PACKAGEMANAGER_H +#include #include #include -#include -#include #include class pkgAcquire; diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index a39aa9f59..1356054b5 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include diff --git a/apt-pkg/pkgsystem.h b/apt-pkg/pkgsystem.h index 246762e0b..211fd0d56 100644 --- a/apt-pkg/pkgsystem.h +++ b/apt-pkg/pkgsystem.h @@ -37,14 +37,16 @@ #ifndef PKGLIB_PKGSYSTEM_H #define PKGLIB_PKGSYSTEM_H +#include -#include #include - + +class pkgDepCache; class pkgPackageManager; class pkgVersioningSystem; class Configuration; class pkgIndexFile; +class PkgFileIterator; class pkgSystem { diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index e20ec4704..46025fc74 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 7b473ee64..4509e54b9 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -31,13 +31,15 @@ #include #include #include -#include using std::string; using std::vector; -class pkgAquire; +class pkgAcquire; +class pkgIndexFile; +class metaIndex; + class pkgSourceList { public: diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 8c1de2ea5..f6d2d5158 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index 418e6bed8..ec86173df 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index e3034b628..a5bf5ac90 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -20,10 +20,12 @@ #ifndef PKGLIB_TAGFILE_H #define PKGLIB_TAGFILE_H - -#include #include +#include + +class FileFd; + class pkgTagSection { const char *Section; diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc index 2ccb556ab..ecfc7db87 100644 --- a/apt-pkg/vendorlist.cc +++ b/apt-pkg/vendorlist.cc @@ -2,12 +2,14 @@ #include #include +#include #include #if __GNUC__ >= 4 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif +#include #include using std::string; diff --git a/apt-pkg/vendorlist.h b/apt-pkg/vendorlist.h index 62ab78a33..733d23a32 100644 --- a/apt-pkg/vendorlist.h +++ b/apt-pkg/vendorlist.h @@ -15,10 +15,11 @@ #include #include -#include -#include #include +class Vendor; +class Configuration; + class __deprecated pkgVendorList { protected: diff --git a/apt-pkg/version.h b/apt-pkg/version.h index c9257d116..47e1919bb 100644 --- a/apt-pkg/version.h +++ b/apt-pkg/version.h @@ -20,8 +20,7 @@ #ifndef PKGLIB_VERSION_H #define PKGLIB_VERSION_H - -#include +#include #include class pkgVersioningSystem diff --git a/cmdline/acqprogress.h b/cmdline/acqprogress.h index 48f90ae59..8f0903923 100644 --- a/cmdline/acqprogress.h +++ b/cmdline/acqprogress.h @@ -12,6 +12,8 @@ #include +#include + class AcqTextStatus : public pkgAcquireStatus { unsigned int &ScreenWidth; @@ -21,7 +23,7 @@ class AcqTextStatus : public pkgAcquireStatus public: - virtual bool MediaChange(string Media,string Drive); + virtual bool MediaChange(std::string Media,std::string Drive); virtual void IMSHit(pkgAcquire::ItemDesc &Itm); virtual void Fetch(pkgAcquire::ItemDesc &Itm); virtual void Done(pkgAcquire::ItemDesc &Itm); diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index a4cdf784e..82a31c9b1 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -16,7 +16,6 @@ #include #include -#include #include #include #include @@ -24,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +31,9 @@ #include #include #include +#include +#include +#include #include #include @@ -40,6 +43,7 @@ #include #include #include +#include #include /*}}}*/ diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 8608b1215..fa48debcd 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index df2958975..94f6ee9b0 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc index dab0cc6fd..e82e15c6e 100644 --- a/cmdline/apt-dump-solver.cc +++ b/cmdline/apt-dump-solver.cc @@ -12,6 +12,7 @@ #include #include +#include /*}}}*/ // ShowHelp - Show a help screen /*{{{*/ diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index 5d7b76c23..d5c1a3208 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index d8f207f0a..5e950332f 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,10 @@ #include #include #include +#include +#include +#include +#include #include "acqprogress.h" diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index ef6c688fe..1b636e4d5 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -11,10 +11,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 8c9a47913..339cbdf44 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 44b74cf6c..20ae14f2a 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -20,6 +20,8 @@ #include #include #include +#include +#include #include #include diff --git a/debian/changelog b/debian/changelog index 8a4994a32..aa98cfbd1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ apt (0.8.16~exp7) experimental; urgency=low [ David Kalnischkies ] * do not pollute namespace in the headers with using (Closes: #500198) + * use forward declaration in headers if possible instead of includes - -- David Kalnischkies Mon, 19 Sep 2011 13:25:58 +0200 + -- David Kalnischkies Mon, 19 Sep 2011 19:13:48 +0200 apt (0.8.16~exp6) experimental; urgency=low diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc index 7d8718c56..c4db88811 100644 --- a/ftparchive/cachedb.cc +++ b/ftparchive/cachedb.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include // htonl, etc diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index f2e1e19e4..377c41607 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -13,16 +13,16 @@ #define CACHEDB_H +#include #include -#include -#include #include #include #include - +#include + #include "contents.h" - + class CacheDB { protected: diff --git a/ftparchive/contents.h b/ftparchive/contents.h index cdd8abd5c..4af9db574 100644 --- a/ftparchive/contents.h +++ b/ftparchive/contents.h @@ -12,9 +12,10 @@ #include #include -#include #include +class debDebFile; + class GenContents { struct Node diff --git a/ftparchive/multicompress.h b/ftparchive/multicompress.h index 19e5065fa..5496b06d0 100644 --- a/ftparchive/multicompress.h +++ b/ftparchive/multicompress.h @@ -16,11 +16,10 @@ #ifndef MULTICOMPRESS_H #define MULTICOMPRESS_H - - -#include #include #include + +#include #include #include diff --git a/ftparchive/writer.h b/ftparchive/writer.h index a43b83876..76a3dfd1e 100644 --- a/ftparchive/writer.h +++ b/ftparchive/writer.h @@ -22,7 +22,6 @@ #include #include "cachedb.h" -#include "multicompress.h" #include "override.h" #include "apt-ftparchive.h" @@ -31,7 +30,7 @@ using std::cout; using std::endl; using std::vector; using std::map; - + class FTWScanner { protected: @@ -81,6 +80,8 @@ class FTWScanner virtual ~FTWScanner() {}; }; +class MultiCompress; + class TranslationWriter { MultiCompress *Comp; diff --git a/methods/bzip2.cc b/methods/bzip2.cc index ad5db6cfb..8e7e46557 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/methods/cdrom.cc b/methods/cdrom.cc index bc115d259..e7114b168 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/methods/connect.cc b/methods/connect.cc index ba2264faa..9a092a43c 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -15,6 +15,8 @@ #include #include +#include +#include #include #include diff --git a/methods/connect.h b/methods/connect.h index 0afa00919..bbe1bb35d 100644 --- a/methods/connect.h +++ b/methods/connect.h @@ -11,7 +11,8 @@ #define CONNECT_H #include -#include + +class pkgAcqMethod; bool Connect(std::string To,int Port,const char *Service,int DefPort, int &Fd,unsigned long TimeOut,pkgAcqMethod *Owner); diff --git a/methods/copy.cc b/methods/copy.cc index fe2918469..f8d58e479 100644 --- a/methods/copy.cc +++ b/methods/copy.cc @@ -12,6 +12,7 @@ #include #include +#include #include #include #include diff --git a/methods/file.cc b/methods/file.cc index d58652e6e..5025c996d 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -19,6 +19,7 @@ #include #include #include +#include #include #include diff --git a/methods/ftp.cc b/methods/ftp.cc index 861647aea..2ca0ac6f7 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/methods/ftp.h b/methods/ftp.h index 7088e0954..2634f0732 100644 --- a/methods/ftp.h +++ b/methods/ftp.h @@ -10,6 +10,10 @@ #ifndef APT_FTP_H #define APT_FTP_H +#include + +#include + class FTPConn { char Buffer[1024*10]; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 67cbd36a2..2b2aba017 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -5,6 +5,7 @@ #include #include #include +#include #include #include diff --git a/methods/http.cc b/methods/http.cc index b60cfeb9e..0d81c73ed 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -288,6 +289,11 @@ void CircleBuf::Stats() clog << "Got " << InP << " in " << Diff << " at " << InP/Diff << endl;*/ } /*}}}*/ +CircleBuf::~CircleBuf() +{ + delete [] Buf; + delete Hash; +} // ServerState::ServerState - Constructor /*{{{*/ // --------------------------------------------------------------------- diff --git a/methods/http.h b/methods/http.h index 08823d1b1..c73d4df5c 100644 --- a/methods/http.h +++ b/methods/http.h @@ -13,12 +13,15 @@ #define MAXLEN 360 -#include +#include + +#include using std::cout; using std::endl; class HttpMethod; +class Hashes; class CircleBuf { @@ -80,7 +83,7 @@ class CircleBuf void Stats(); CircleBuf(unsigned long long Size); - ~CircleBuf() {delete [] Buf; delete Hash;}; + ~CircleBuf(); }; struct ServerState diff --git a/methods/https.cc b/methods/https.cc index 06a0e285a..e70206dfb 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/methods/https.h b/methods/https.h index 3f0c416b6..b7adeb880 100644 --- a/methods/https.h +++ b/methods/https.h @@ -20,7 +20,7 @@ using std::cout; using std::endl; class HttpsMethod; - +class FileFd; class HttpsMethod : public pkgAcqMethod { @@ -45,6 +45,7 @@ class HttpsMethod : public pkgAcqMethod }; }; +#include URI Proxy; #endif diff --git a/methods/mirror.cc b/methods/mirror.cc index 61a7f12fd..3d5983efa 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -18,7 +18,8 @@ #include #include #include - +#include +#include #include #include diff --git a/methods/mirror.h b/methods/mirror.h index 97d18144a..81e531e21 100644 --- a/methods/mirror.h +++ b/methods/mirror.h @@ -11,8 +11,9 @@ #ifndef APT_MIRROR_H #define APT_MIRROR_H - #include +#include +#include using std::cout; using std::cerr; @@ -24,29 +25,29 @@ class MirrorMethod : public HttpMethod { FetchResult Res; // we simply transform between BaseUri and Mirror - string BaseUri; // the original mirror://... url - string Mirror; // the selected mirror uri (http://...) - vector AllMirrors; // all available mirrors - string MirrorFile; // the file that contains the list of mirrors + std::string BaseUri; // the original mirror://... url + std::string Mirror; // the selected mirror uri (http://...) + std::vector AllMirrors; // all available mirrors + std::string MirrorFile; // the file that contains the list of mirrors bool DownloadedMirrorFile; // already downloaded this session - string Dist; // the target distrubtion (e.g. sid, oneiric) + std::string Dist; // the target distrubtion (e.g. sid, oneiric) bool Debug; protected: - bool DownloadMirrorFile(string uri); - bool RandomizeMirrorFile(string file); - string GetMirrorFileName(string uri); + bool DownloadMirrorFile(std::string uri); + bool RandomizeMirrorFile(std::string file); + std::string GetMirrorFileName(std::string uri); bool InitMirrors(); bool TryNextMirror(); void CurrentQueueUriToMirror(); - bool Clean(string dir); + bool Clean(std::string dir); // we need to overwrite those to transform the url back - virtual void Fail(string Why, bool Transient = false); + virtual void Fail(std::string Why, bool Transient = false); virtual void URIStart(FetchResult &Res); virtual void URIDone(FetchResult &Res,FetchResult *Alt = 0); - virtual bool Configuration(string Message); + virtual bool Configuration(std::string Message); public: MirrorMethod(); diff --git a/methods/rred.cc b/methods/rred.cc index 2a05acce1..ef00fcaa3 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include diff --git a/methods/rsh.cc b/methods/rsh.cc index add128c49..da9777fc4 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -14,6 +14,9 @@ #include #include +#include +#include +#include #include #include diff --git a/methods/rsh.h b/methods/rsh.h index 7bebe29a0..d7efa3f06 100644 --- a/methods/rsh.h +++ b/methods/rsh.h @@ -12,9 +12,9 @@ #include #include -#include -#include -#include + +class Hashes; +class FileFd; class RSHConn { @@ -50,6 +50,8 @@ class RSHConn ~RSHConn(); }; +#include + class RSHMethod : public pkgAcqMethod { virtual bool Fetch(FetchItem *Itm); diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc index 29dcbf371..a1b3600aa 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -1,5 +1,6 @@ #include #include +#include #include #include diff --git a/test/interactive-helper/test_udevcdrom.cc b/test/interactive-helper/test_udevcdrom.cc index bbedc0ab5..88f5f0153 100644 --- a/test/interactive-helper/test_udevcdrom.cc +++ b/test/interactive-helper/test_udevcdrom.cc @@ -3,6 +3,7 @@ #include #include +#include int main() { diff --git a/test/interactive-helper/testextract.cc b/test/interactive-helper/testextract.cc index b790df618..f7ddb72f0 100644 --- a/test/interactive-helper/testextract.cc +++ b/test/interactive-helper/testextract.cc @@ -6,6 +6,8 @@ #include #include #include +#include +#include #include #include -- cgit v1.2.3-70-g09d2 From 81ce578199d8fa83283fc6b1e759acafaee7fbf0 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 20 Sep 2011 13:27:53 +0200 Subject: * cmdline/apt-get.cc: - follow Provides in the evaluation of saving candidates, too, for statisfying garbage package dependencies (Closes: #640590) --- cmdline/apt-get.cc | 59 +++++++++++++++++++++++++++++++----------------------- debian/changelog | 5 ++++- 2 files changed, 38 insertions(+), 26 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5e950332f..88e734697 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1689,8 +1689,9 @@ bool DoAutomaticRemove(CacheFile &Cache) // install it in the first place, so nuke it instead of show it if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0) { + if (Pkg.CandVersion() != 0) + tooMuch.insert(Pkg); Cache->MarkDelete(Pkg, false); - tooMuch.insert(Pkg); } // only show stuff in the list that is not yet marked for removal else if(hideAutoRemove == false && Cache[Pkg].Delete() == false) @@ -1714,33 +1715,41 @@ bool DoAutomaticRemove(CacheFile &Cache) bool Changed; do { Changed = false; - for (APT::PackageSet::const_iterator P = tooMuch.begin(); - P != tooMuch.end() && Changed == false; ++P) + for (APT::PackageSet::const_iterator Pkg = tooMuch.begin(); + Pkg != tooMuch.end() && Changed == false; ++Pkg) { - for (pkgCache::DepIterator R = P.RevDependsList(); - R.end() == false; ++R) - { - if (R.IsNegative() == true || - Cache->IsImportantDep(R) == false) - continue; - pkgCache::PkgIterator N = R.ParentPkg(); - if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false)) - continue; - if (Debug == true) - std::clog << "Save " << P << " as another installed garbage package depends on it" << std::endl; - Cache->MarkInstall(P, false); - if(hideAutoRemove == false) + APT::PackageSet too; + too.insert(Pkg); + for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList(); + Prv.end() == false; ++Prv) + too.insert(Prv.ParentPkg()); + for (APT::PackageSet::const_iterator P = too.begin(); + P != too.end() && Changed == false; ++P) { + for (pkgCache::DepIterator R = P.RevDependsList(); + R.end() == false; ++R) { - ++autoRemoveCount; - if (smallList == false) - { - autoremovelist += P.FullName(true) + " "; - autoremoveversions += string(Cache[P].CandVersion) + "\n"; - } + if (R.IsNegative() == true || + Cache->IsImportantDep(R) == false) + continue; + pkgCache::PkgIterator N = R.ParentPkg(); + if (N.end() == true || (N->CurrentVer == 0 && (*Cache)[N].Install() == false)) + continue; + if (Debug == true) + std::clog << "Save " << Pkg << " as another installed garbage package depends on it" << std::endl; + Cache->MarkInstall(Pkg, false); + if (hideAutoRemove == false) + { + ++autoRemoveCount; + if (smallList == false) + { + autoremovelist += Pkg.FullName(true) + " "; + autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; + } + } + tooMuch.erase(Pkg); + Changed = true; + break; } - tooMuch.erase(P); - Changed = true; - break; } } } while (Changed == true); diff --git a/debian/changelog b/debian/changelog index eee0d33d9..787425193 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,11 @@ apt (0.8.16~exp7) experimental; urgency=low - use std::vector instead of fixed size arrays to store args and multiarch-packagename strings - load the dpkg base arguments only one time and reuse them later + * cmdline/apt-get.cc: + - follow Provides in the evaluation of saving candidates, too, for + statisfying garbage package dependencies (Closes: #640590) - -- David Kalnischkies Tue, 20 Sep 2011 11:50:31 +0200 + -- David Kalnischkies Tue, 20 Sep 2011 13:25:31 +0200 apt (0.8.16~exp6) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From 15fc8636b3e48eab5f3bc6f2e8c61c0409246909 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 9 Nov 2011 17:22:57 +0100 Subject: * apt-pkg/cacheset.cc: - make the cachesets real containers which can embedding any container to be able to use the same interface regardless of set or list usage --- apt-pkg/cacheset.cc | 381 ++++++++++++++++++++----------------- apt-pkg/cacheset.h | 524 +++++++++++++++++++++++++++++++++------------------ apt-pkg/edsp.h | 4 +- cmdline/apt-cache.cc | 8 +- cmdline/apt-get.cc | 20 +- debian/changelog | 5 +- 6 files changed, 565 insertions(+), 377 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc index 6b95eab70..b892ab4bf 100644 --- a/apt-pkg/cacheset.cc +++ b/apt-pkg/cacheset.cc @@ -29,7 +29,7 @@ /*}}}*/ namespace APT { // FromTask - Return all packages in the cache from a specific task /*{{{*/ -PackageSet PackageSet::FromTask(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { +bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { size_t const archfound = pattern.find_last_of(':'); std::string arch = "native"; if (archfound != std::string::npos) { @@ -38,13 +38,16 @@ PackageSet PackageSet::FromTask(pkgCacheFile &Cache, std::string pattern, CacheS } if (pattern[pattern.length() -1] != '^') - return APT::PackageSet(TASK); + return false; pattern.erase(pattern.length()-1); if (unlikely(Cache.GetPkgCache() == 0 || Cache.GetDepCache() == 0)) - return APT::PackageSet(TASK); + return false; + + bool const wasEmpty = pci->empty(); + if (wasEmpty == true) + pci->setConstructor(TASK); - PackageSet pkgset(TASK); // get the records pkgRecords Recs(Cache); @@ -54,9 +57,10 @@ PackageSet PackageSet::FromTask(pkgCacheFile &Cache, std::string pattern, CacheS snprintf(S, sizeof(S), "^Task:.*[, ]%s([, ]|$)", pattern.c_str()); if(regcomp(&Pattern,S, REG_EXTENDED | REG_NOSUB | REG_NEWLINE) != 0) { _error->Error("Failed to compile task regexp"); - return pkgset; + return false; } + bool found = false; for (pkgCache::GrpIterator Grp = Cache->GrpBegin(); Grp.end() == false; ++Grp) { pkgCache::PkgIterator Pkg = Grp.FindPkg(arch); if (Pkg.end() == true) @@ -75,22 +79,33 @@ PackageSet PackageSet::FromTask(pkgCacheFile &Cache, std::string pattern, CacheS if (regexec(&Pattern, buf, 0, 0, 0) != 0) continue; - pkgset.insert(Pkg); + pci->insert(Pkg); + helper.showTaskSelection(Pkg, pattern); + found = true; } regfree(&Pattern); - if (pkgset.empty() == true) - return helper.canNotFindTask(Cache, pattern); + if (found == false) { + helper.canNotFindTask(pci, Cache, pattern); + pci->setConstructor(UNKNOWN); + return false; + } + + if (wasEmpty == false && pci->getConstructor() != UNKNOWN) + pci->setConstructor(UNKNOWN); - helper.showTaskSelection(pkgset, pattern); - return pkgset; + return true; } /*}}}*/ // FromRegEx - Return all packages in the cache matching a pattern /*{{{*/ -PackageSet PackageSet::FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { +bool PackageContainerInterface::FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { static const char * const isregex = ".?+*|[^$"; if (pattern.find_first_of(isregex) == std::string::npos) - return PackageSet(REGEX); + return false; + + bool const wasEmpty = pci->empty(); + if (wasEmpty == true) + pci->setConstructor(REGEX); size_t archfound = pattern.find_last_of(':'); std::string arch = "native"; @@ -103,11 +118,11 @@ PackageSet PackageSet::FromRegEx(pkgCacheFile &Cache, std::string pattern, Cache } if (unlikely(Cache.GetPkgCache() == 0)) - return PackageSet(REGEX); + return false; APT::CacheFilter::PackageNameMatchesRegEx regexfilter(pattern); - PackageSet pkgset(REGEX); + bool found = false; for (pkgCache::GrpIterator Grp = Cache.GetPkgCache()->GrpBegin(); Grp.end() == false; ++Grp) { if (regexfilter(Grp) == false) continue; @@ -123,18 +138,25 @@ PackageSet PackageSet::FromRegEx(pkgCacheFile &Cache, std::string pattern, Cache continue; } - pkgset.insert(Pkg); + pci->insert(Pkg); + helper.showRegExSelection(Pkg, pattern); + found = true; } - if (pkgset.empty() == true) - return helper.canNotFindRegEx(Cache, pattern); + if (found == false) { + helper.canNotFindRegEx(pci, Cache, pattern); + pci->setConstructor(UNKNOWN); + return false; + } + + if (wasEmpty == false && pci->getConstructor() != UNKNOWN) + pci->setConstructor(UNKNOWN); - helper.showRegExSelection(pkgset, pattern); - return pkgset; + return true; } /*}}}*/ // FromName - Returns the package defined by this string /*{{{*/ -pkgCache::PkgIterator PackageSet::FromName(pkgCacheFile &Cache, +pkgCache::PkgIterator PackageContainerInterface::FromName(pkgCacheFile &Cache, std::string const &str, CacheSetHelper &helper) { std::string pkg = str; size_t archfound = pkg.find_last_of(':'); @@ -160,144 +182,131 @@ pkgCache::PkgIterator PackageSet::FromName(pkgCacheFile &Cache, return Pkg; } /*}}}*/ -// GroupedFromCommandLine - Return all versions specified on commandline/*{{{*/ -std::map PackageSet::GroupedFromCommandLine( - pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback, CacheSetHelper &helper) { - std::map pkgsets; - for (const char **I = cmdline; *I != 0; ++I) { - unsigned short modID = fallback; - std::string str = *I; - bool modifierPresent = false; - for (std::list::const_iterator mod = mods.begin(); - mod != mods.end(); ++mod) { - size_t const alength = strlen(mod->Alias); - switch(mod->Pos) { - case PackageSet::Modifier::POSTFIX: - if (str.compare(str.length() - alength, alength, - mod->Alias, 0, alength) != 0) - continue; - str.erase(str.length() - alength); - modID = mod->ID; - break; - case PackageSet::Modifier::PREFIX: - continue; - case PackageSet::Modifier::NONE: - continue; - } - modifierPresent = true; - break; - } - if (modifierPresent == true) { - bool const errors = helper.showErrors(false); - pkgCache::PkgIterator Pkg = FromName(Cache, *I, helper); - helper.showErrors(errors); - if (Pkg.end() == false) { - pkgsets[fallback].insert(Pkg); - continue; - } - } - pkgsets[modID].insert(PackageSet::FromString(Cache, str, helper)); - } - return pkgsets; -} - /*}}}*/ -// FromCommandLine - Return all packages specified on commandline /*{{{*/ -PackageSet PackageSet::FromCommandLine(pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) { - PackageSet pkgset; - for (const char **I = cmdline; *I != 0; ++I) { - PackageSet pset = FromString(Cache, *I, helper); - pkgset.insert(pset.begin(), pset.end()); - } - return pkgset; -} - /*}}}*/ // FromString - Return all packages matching a specific string /*{{{*/ -PackageSet PackageSet::FromString(pkgCacheFile &Cache, std::string const &str, CacheSetHelper &helper) { +bool PackageContainerInterface::FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str, CacheSetHelper &helper) { + bool found = true; _error->PushToStack(); - PackageSet pkgset; pkgCache::PkgIterator Pkg = FromName(Cache, str, helper); if (Pkg.end() == false) - pkgset.insert(Pkg); - else { - pkgset = FromTask(Cache, str, helper); - if (pkgset.empty() == true) { - pkgset = FromRegEx(Cache, str, helper); - if (pkgset.empty() == true) - pkgset = helper.canNotFindPackage(Cache, str); - } + pci->insert(Pkg); + else if (FromTask(pci, Cache, str, helper) == false && + FromRegEx(pci, Cache, str, helper) == false) + { + helper.canNotFindPackage(pci, Cache, str); + found = false; } - if (pkgset.empty() == false) + if (found == true) _error->RevertToStack(); else _error->MergeWithStack(); - return pkgset; + return found; } /*}}}*/ -// GroupedFromCommandLine - Return all versions specified on commandline/*{{{*/ -std::map VersionSet::GroupedFromCommandLine( - pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback, CacheSetHelper &helper) { - std::map versets; - for (const char **I = cmdline; *I != 0; ++I) { - unsigned short modID = fallback; - VersionSet::Version select = VersionSet::NEWEST; - std::string str = *I; - bool modifierPresent = false; - for (std::list::const_iterator mod = mods.begin(); - mod != mods.end(); ++mod) { - if (modID == fallback && mod->ID == fallback) - select = mod->SelectVersion; - size_t const alength = strlen(mod->Alias); - switch(mod->Pos) { - case VersionSet::Modifier::POSTFIX: - if (str.compare(str.length() - alength, alength, - mod->Alias, 0, alength) != 0) - continue; - str.erase(str.length() - alength); - modID = mod->ID; - select = mod->SelectVersion; - break; - case VersionSet::Modifier::PREFIX: - continue; - case VersionSet::Modifier::NONE: +// FromCommandLine - Return all packages specified on commandline /*{{{*/ +bool PackageContainerInterface::FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) { + bool found = false; + for (const char **I = cmdline; *I != 0; ++I) + found |= PackageContainerInterface::FromString(pci, Cache, *I, helper); + return found; +} + /*}}}*/ +// FromModifierCommandLine - helper doing the work for PKG:GroupedFromCommandLine /*{{{*/ +bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci, + pkgCacheFile &Cache, const char * cmdline, + std::list const &mods, CacheSetHelper &helper) { + std::string str = cmdline; + bool modifierPresent = false; + for (std::list::const_iterator mod = mods.begin(); + mod != mods.end(); ++mod) { + size_t const alength = strlen(mod->Alias); + switch(mod->Pos) { + case Modifier::POSTFIX: + if (str.compare(str.length() - alength, alength, + mod->Alias, 0, alength) != 0) continue; - } - modifierPresent = true; + str.erase(str.length() - alength); + modID = mod->ID; break; + case Modifier::PREFIX: + continue; + case Modifier::NONE: + continue; } - - if (modifierPresent == true) { - bool const errors = helper.showErrors(false); - VersionSet const vset = VersionSet::FromString(Cache, std::string(*I), select, helper, true); - helper.showErrors(errors); - if (vset.empty() == false) { - versets[fallback].insert(vset); + modifierPresent = true; + break; + } + if (modifierPresent == true) { + bool const errors = helper.showErrors(false); + pkgCache::PkgIterator Pkg = FromName(Cache, cmdline, helper); + helper.showErrors(errors); + if (Pkg.end() == false) { + pci->insert(Pkg); + return true; + } + } + return FromString(pci, Cache, str, helper); +} + /*}}}*/ +// FromModifierCommandLine - helper doing the work for VER:GroupedFromCommandLine /*{{{*/ +bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID, + VersionContainerInterface * const vci, + pkgCacheFile &Cache, const char * cmdline, + std::list const &mods, + CacheSetHelper &helper) { + Version select = NEWEST; + std::string str = cmdline; + bool modifierPresent = false; + unsigned short fallback = modID; + for (std::list::const_iterator mod = mods.begin(); + mod != mods.end(); ++mod) { + if (modID == fallback && mod->ID == fallback) + select = mod->SelectVersion; + size_t const alength = strlen(mod->Alias); + switch(mod->Pos) { + case Modifier::POSTFIX: + if (str.compare(str.length() - alength, alength, + mod->Alias, 0, alength) != 0) continue; - } + str.erase(str.length() - alength); + modID = mod->ID; + select = mod->SelectVersion; + break; + case Modifier::PREFIX: + continue; + case Modifier::NONE: + continue; } - versets[modID].insert(VersionSet::FromString(Cache, str, select , helper)); + modifierPresent = true; + break; } - return versets; + + if (modifierPresent == true) { + bool const errors = helper.showErrors(false); + bool const found = VersionContainerInterface::FromString(vci, Cache, cmdline, select, helper, true); + helper.showErrors(errors); + if (found == true) + return true; + } + return FromString(vci, Cache, str, select, helper); } /*}}}*/ // FromCommandLine - Return all versions specified on commandline /*{{{*/ -APT::VersionSet VersionSet::FromCommandLine(pkgCacheFile &Cache, const char **cmdline, - APT::VersionSet::Version const &fallback, CacheSetHelper &helper) { - VersionSet verset; +bool VersionContainerInterface::FromCommandLine(VersionContainerInterface * const vci, + pkgCacheFile &Cache, const char **cmdline, + Version const &fallback, CacheSetHelper &helper) { + bool found = false; for (const char **I = cmdline; *I != 0; ++I) - verset.insert(VersionSet::FromString(Cache, *I, fallback, helper)); - return verset; + found |= VersionContainerInterface::FromString(vci, Cache, *I, fallback, helper); + return found; } /*}}}*/ // FromString - Returns all versions spedcified by a string /*{{{*/ -APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg, - APT::VersionSet::Version const &fallback, CacheSetHelper &helper, - bool const &onlyFromName) { +bool VersionContainerInterface::FromString(VersionContainerInterface * const vci, + pkgCacheFile &Cache, std::string pkg, + Version const &fallback, CacheSetHelper &helper, + bool const onlyFromName) { std::string ver; bool verIsRel = false; size_t const vertag = pkg.find_last_of("/="); @@ -308,19 +317,20 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg, } PackageSet pkgset; if (onlyFromName == false) - pkgset = PackageSet::FromString(Cache, pkg, helper); + PackageContainerInterface::FromString(&pkgset, Cache, pkg, helper); else { - pkgset.insert(PackageSet::FromName(Cache, pkg, helper)); + pkgset.insert(PackageContainerInterface::FromName(Cache, pkg, helper)); } - VersionSet verset; bool errors = true; if (pkgset.getConstructor() != PackageSet::UNKNOWN) errors = helper.showErrors(false); + + bool found = false; for (PackageSet::const_iterator P = pkgset.begin(); P != pkgset.end(); ++P) { if (vertag == std::string::npos) { - verset.insert(VersionSet::FromPackage(Cache, P, fallback, helper)); + found |= VersionContainerInterface::FromPackage(vci, Cache, P, fallback, helper); continue; } pkgCache::VerIterator V; @@ -350,75 +360,78 @@ APT::VersionSet VersionSet::FromString(pkgCacheFile &Cache, std::string pkg, if (V.end() == true) continue; helper.showSelectedVersion(P, V, ver, verIsRel); - verset.insert(V); + vci->insert(V); + found = true; } if (pkgset.getConstructor() != PackageSet::UNKNOWN) helper.showErrors(errors); - return verset; + return found; } /*}}}*/ // FromPackage - versions from package based on fallback /*{{{*/ -VersionSet VersionSet::FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, - VersionSet::Version const &fallback, CacheSetHelper &helper) { - VersionSet verset; +bool VersionContainerInterface::FromPackage(VersionContainerInterface * const vci, + pkgCacheFile &Cache, + pkgCache::PkgIterator const &P, + Version const &fallback, + CacheSetHelper &helper) { pkgCache::VerIterator V; bool showErrors; + bool found = false; switch(fallback) { - case VersionSet::ALL: + case ALL: if (P->VersionList != 0) for (V = P.VersionList(); V.end() != true; ++V) - verset.insert(V); + found |= vci->insert(V); else - verset.insert(helper.canNotFindAllVer(Cache, P)); + helper.canNotFindAllVer(vci, Cache, P); break; - case VersionSet::CANDANDINST: - verset.insert(getInstalledVer(Cache, P, helper)); - verset.insert(getCandidateVer(Cache, P, helper)); + case CANDANDINST: + found |= vci->insert(getInstalledVer(Cache, P, helper)); + found |= vci->insert(getCandidateVer(Cache, P, helper)); break; - case VersionSet::CANDIDATE: - verset.insert(getCandidateVer(Cache, P, helper)); + case CANDIDATE: + found |= vci->insert(getCandidateVer(Cache, P, helper)); break; - case VersionSet::INSTALLED: - verset.insert(getInstalledVer(Cache, P, helper)); + case INSTALLED: + found |= vci->insert(getInstalledVer(Cache, P, helper)); break; - case VersionSet::CANDINST: + case CANDINST: showErrors = helper.showErrors(false); V = getCandidateVer(Cache, P, helper); if (V.end() == true) V = getInstalledVer(Cache, P, helper); helper.showErrors(showErrors); if (V.end() == false) - verset.insert(V); + found |= vci->insert(V); else - verset.insert(helper.canNotFindInstCandVer(Cache, P)); + helper.canNotFindInstCandVer(vci, Cache, P); break; - case VersionSet::INSTCAND: + case INSTCAND: showErrors = helper.showErrors(false); V = getInstalledVer(Cache, P, helper); if (V.end() == true) V = getCandidateVer(Cache, P, helper); helper.showErrors(showErrors); if (V.end() == false) - verset.insert(V); + found |= vci->insert(V); else - verset.insert(helper.canNotFindInstCandVer(Cache, P)); + helper.canNotFindInstCandVer(vci, Cache, P); break; - case VersionSet::NEWEST: + case NEWEST: if (P->VersionList != 0) - verset.insert(P.VersionList()); + found |= vci->insert(P.VersionList()); else - verset.insert(helper.canNotFindNewestVer(Cache, P)); + helper.canNotFindNewestVer(Cache, P); break; } - return verset; + return found; } /*}}}*/ // getCandidateVer - Returns the candidate version of the given package /*{{{*/ -pkgCache::VerIterator VersionSet::getCandidateVer(pkgCacheFile &Cache, +pkgCache::VerIterator VersionContainerInterface::getCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper) { pkgCache::VerIterator Cand; - if (Cache.IsPolicyBuilt() == true || Cache.IsDepCacheBuilt() == false) - { + if (Cache.IsPolicyBuilt() == true || Cache.IsDepCacheBuilt() == false) { if (unlikely(Cache.GetPolicy() == 0)) return pkgCache::VerIterator(Cache); Cand = Cache.GetPolicy()->GetCandidateVer(Pkg); @@ -431,13 +444,14 @@ pkgCache::VerIterator VersionSet::getCandidateVer(pkgCacheFile &Cache, } /*}}}*/ // getInstalledVer - Returns the installed version of the given package /*{{{*/ -pkgCache::VerIterator VersionSet::getInstalledVer(pkgCacheFile &Cache, +pkgCache::VerIterator VersionContainerInterface::getInstalledVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper) { if (Pkg->CurrentVer == 0) return helper.canNotFindInstalledVer(Cache, Pkg); return Pkg.CurrentVer(); } /*}}}*/ + // canNotFindPkgName - handle the case no package has this name /*{{{*/ pkgCache::PkgIterator CacheSetHelper::canNotFindPkgName(pkgCacheFile &Cache, std::string const &str) { @@ -447,46 +461,40 @@ pkgCache::PkgIterator CacheSetHelper::canNotFindPkgName(pkgCacheFile &Cache, } /*}}}*/ // canNotFindTask - handle the case no package is found for a task /*{{{*/ -PackageSet CacheSetHelper::canNotFindTask(pkgCacheFile &Cache, std::string pattern) { +void CacheSetHelper::canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) { if (ShowError == true) _error->Insert(ErrorType, _("Couldn't find task '%s'"), pattern.c_str()); - return PackageSet(); } /*}}}*/ // canNotFindRegEx - handle the case no package is found by a regex /*{{{*/ -PackageSet CacheSetHelper::canNotFindRegEx(pkgCacheFile &Cache, std::string pattern) { +void CacheSetHelper::canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) { if (ShowError == true) _error->Insert(ErrorType, _("Couldn't find any package by regex '%s'"), pattern.c_str()); - return PackageSet(); } /*}}}*/ // canNotFindPackage - handle the case no package is found from a string/*{{{*/ -PackageSet CacheSetHelper::canNotFindPackage(pkgCacheFile &Cache, std::string const &str) { - return PackageSet(); +void CacheSetHelper::canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str) { } /*}}}*/ // canNotFindAllVer /*{{{*/ -VersionSet CacheSetHelper::canNotFindAllVer(pkgCacheFile &Cache, +void CacheSetHelper::canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { if (ShowError == true) _error->Insert(ErrorType, _("Can't select versions from package '%s' as it is purely virtual"), Pkg.FullName(true).c_str()); - return VersionSet(); } /*}}}*/ // canNotFindInstCandVer /*{{{*/ -VersionSet CacheSetHelper::canNotFindInstCandVer(pkgCacheFile &Cache, +void CacheSetHelper::canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { if (ShowError == true) _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str()); - return VersionSet(); } /*}}}*/ // canNotFindInstCandVer /*{{{*/ -VersionSet CacheSetHelper::canNotFindCandInstVer(pkgCacheFile &Cache, +void CacheSetHelper::canNotFindCandInstVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { if (ShowError == true) _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str()); - return VersionSet(); } /*}}}*/ // canNotFindNewestVer /*{{{*/ @@ -513,4 +521,21 @@ pkgCache::VerIterator CacheSetHelper::canNotFindInstalledVer(pkgCacheFile &Cache return pkgCache::VerIterator(Cache, 0); } /*}}}*/ +// showTaskSelection /*{{{*/ +void CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const &pkg, + std::string const &pattern) { +} + /*}}}*/ +// showRegExSelection /*{{{*/ +void CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const &pkg, + std::string const &pattern) { +} + /*}}}*/ +// showSelectedVersion /*{{{*/ +void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const &Pkg, + pkgCache::VerIterator const Ver, + std::string const &ver, + bool const verIsRel) { +} + /*}}}*/ } diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 3b1118bdc..411b31513 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -23,8 +24,9 @@ class pkgCacheFile; namespace APT { -class PackageSet; -class VersionSet; +class PackageContainerInterface; +class VersionContainerInterface; + class CacheSetHelper { /*{{{*/ /** \class APT::CacheSetHelper Simple base class with a lot of virtual methods which can be overridden @@ -35,25 +37,28 @@ class CacheSetHelper { /*{{{*/ printed out. */ public: /*{{{*/ - CacheSetHelper(bool const &ShowError = true, + CacheSetHelper(bool const ShowError = true, GlobalError::MsgType ErrorType = GlobalError::ERROR) : ShowError(ShowError), ErrorType(ErrorType) {}; virtual ~CacheSetHelper() {}; - virtual void showTaskSelection(PackageSet const &pkgset, std::string const &pattern) {}; - virtual void showRegExSelection(PackageSet const &pkgset, std::string const &pattern) {}; + virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern); + virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern); virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, - std::string const &ver, bool const &verIsRel) {}; + std::string const &ver, bool const verIsRel); - virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str); - virtual PackageSet canNotFindTask(pkgCacheFile &Cache, std::string pattern); - virtual PackageSet canNotFindRegEx(pkgCacheFile &Cache, std::string pattern); - virtual PackageSet canNotFindPackage(pkgCacheFile &Cache, std::string const &str); - virtual VersionSet canNotFindAllVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); - virtual VersionSet canNotFindInstCandVer(pkgCacheFile &Cache, + virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); + virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern); + virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str); + + virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); + virtual void canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); - virtual VersionSet canNotFindCandInstVer(pkgCacheFile &Cache, + virtual void canNotFindCandInstVer(VersionContainerInterface * const vci, + pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); + + virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str); virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg); virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, @@ -62,7 +67,7 @@ public: /*{{{*/ pkgCache::PkgIterator const &Pkg); bool showErrors() const { return ShowError; }; - bool showErrors(bool const &newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }; + bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }; GlobalError::MsgType errorType() const { return ErrorType; }; GlobalError::MsgType errorType(GlobalError::MsgType const &newValue) { @@ -79,53 +84,117 @@ protected: bool ShowError; GlobalError::MsgType ErrorType; }; /*}}}*/ -class PackageSet : public std::set { /*{{{*/ -/** \class APT::PackageSet - - Simple wrapper around a std::set to provide a similar interface to - a set of packages as to the complete set of all packages in the - pkgCache. */ -public: /*{{{*/ - /** \brief smell like a pkgCache::PkgIterator */ - class const_iterator : public std::set::const_iterator {/*{{{*/ +class PackageContainerInterface { /*{{{*/ +/** \class PackageContainerInterface + + * Interface ensuring that all operations can be executed on the yet to + * define concrete PackageContainer - access to all methods is possible, + * but in general the wrappers provided by the PackageContainer template + * are nicer to use. + + * This class mostly protects use from the need to write all implementation + * of the methods working on containers in the template */ +public: + class const_iterator { /*{{{*/ public: - const_iterator(std::set::const_iterator x) : - std::set::const_iterator(x) {} - - operator pkgCache::PkgIterator(void) { return **this; } - - inline const char *Name() const {return (**this).Name(); } - inline std::string FullName(bool const &Pretty) const { return (**this).FullName(Pretty); } - inline std::string FullName() const { return (**this).FullName(); } - inline const char *Section() const {return (**this).Section(); } - inline bool Purge() const {return (**this).Purge(); } - inline const char *Arch() const {return (**this).Arch(); } - inline pkgCache::GrpIterator Group() const { return (**this).Group(); } - inline pkgCache::VerIterator VersionList() const { return (**this).VersionList(); } - inline pkgCache::VerIterator CurrentVer() const { return (**this).CurrentVer(); } - inline pkgCache::DepIterator RevDependsList() const { return (**this).RevDependsList(); } - inline pkgCache::PrvIterator ProvidesList() const { return (**this).ProvidesList(); } - inline pkgCache::PkgIterator::OkState State() const { return (**this).State(); } - inline const char *CandVersion() const { return (**this).CandVersion(); } - inline const char *CurVersion() const { return (**this).CurVersion(); } - inline pkgCache *Cache() const { return (**this).Cache(); }; - inline unsigned long Index() const {return (**this).Index();}; + virtual pkgCache::PkgIterator getPkg() const = 0; + operator pkgCache::PkgIterator(void) const { return getPkg(); } + + inline const char *Name() const {return getPkg().Name(); } + inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); } + inline std::string FullName() const { return getPkg().FullName(); } + inline const char *Section() const {return getPkg().Section(); } + inline bool Purge() const {return getPkg().Purge(); } + inline const char *Arch() const {return getPkg().Arch(); } + inline pkgCache::GrpIterator Group() const { return getPkg().Group(); } + inline pkgCache::VerIterator VersionList() const { return getPkg().VersionList(); } + inline pkgCache::VerIterator CurrentVer() const { return getPkg().CurrentVer(); } + inline pkgCache::DepIterator RevDependsList() const { return getPkg().RevDependsList(); } + inline pkgCache::PrvIterator ProvidesList() const { return getPkg().ProvidesList(); } + inline pkgCache::PkgIterator::OkState State() const { return getPkg().State(); } + inline const char *CandVersion() const { return getPkg().CandVersion(); } + inline const char *CurVersion() const { return getPkg().CurVersion(); } + inline pkgCache *Cache() const { return getPkg().Cache(); }; + inline unsigned long Index() const {return getPkg().Index();}; // we have only valid iterators here inline bool end() const { return false; }; - friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, (*i)); } + inline pkgCache::Package const * operator->() const {return &*getPkg();}; + }; + /*}}}*/ + + virtual bool insert(pkgCache::PkgIterator const &P) = 0; + virtual bool empty() const = 0; + virtual void clear() = 0; + + enum Constructor { UNKNOWN, REGEX, TASK }; + virtual void setConstructor(Constructor const &con) = 0; + virtual Constructor getConstructor() const = 0; + + static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); + static bool FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); + static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper); + static bool FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper); + static bool FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper); + + struct Modifier { + enum Position { NONE, PREFIX, POSTFIX }; + unsigned short ID; + const char * const Alias; + Position Pos; + Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}; + }; + + static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci, + pkgCacheFile &Cache, const char * cmdline, + std::list const &mods, CacheSetHelper &helper); +}; + /*}}}*/ +template class PackageContainer : public PackageContainerInterface {/*{{{*/ +/** \class APT::PackageContainer - inline pkgCache::Package const * operator->() const { - return &***this; - }; + Simple wrapper around a container class like std::set to provide a similar + interface to a set of packages as to the complete set of all packages in the + pkgCache. */ + Container _cont; +public: /*{{{*/ + /** \brief smell like a pkgCache::PkgIterator */ + class const_iterator : public PackageContainerInterface::const_iterator, + public std::iterator {/*{{{*/ + typename Container::const_iterator _iter; + public: + const_iterator(typename Container::const_iterator i) : _iter(i) {} + pkgCache::PkgIterator getPkg(void) const { return *_iter; } + inline pkgCache::PkgIterator operator*(void) const { return *_iter; }; + operator typename Container::const_iterator(void) const { return _iter; } + inline void operator++(void) { ++_iter; }; + inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }; + inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }; + friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } }; - // 103. set::iterator is required to be modifiable, but this allows modification of keys - typedef APT::PackageSet::const_iterator iterator; + // we are not going to allow modify our pkgiterators (it doesn't make sense)… + typedef APT::PackageContainer::const_iterator iterator; /*}}}*/ - using std::set::insert; - inline void insert(pkgCache::PkgIterator const &P) { if (P.end() == false) std::set::insert(P); }; - inline void insert(PackageSet const &pkgset) { insert(pkgset.begin(), pkgset.end()); }; + bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; }; + template void insert(PackageContainer const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); }; + void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }; + bool empty() const { return _cont.empty(); }; + void clear() { return _cont.clear(); }; + void erase(iterator position) { _cont.erase((typename Container::const_iterator)position); }; + size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }; + void erase(iterator first, iterator last) { _cont.erase(first, last); }; + size_t size() const { return _cont.size(); }; + + const_iterator begin() const { return const_iterator(_cont.begin()); }; + const_iterator end() const { return const_iterator(_cont.end()); }; + const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }; + + void setConstructor(Constructor const &by) { ConstructedBy = by; }; + Constructor getConstructor() const { return ConstructedBy; }; + + PackageContainer() : ConstructedBy(UNKNOWN) {}; + PackageContainer(Constructor const &by) : ConstructedBy(by) {}; /** \brief returns all packages in the cache who belong to the given task @@ -135,8 +204,12 @@ public: /*{{{*/ \param Cache the packages are in \param pattern name of the task \param helper responsible for error and message handling */ - static APT::PackageSet FromTask(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); - static APT::PackageSet FromTask(pkgCacheFile &Cache, std::string const &pattern) { + static PackageContainer FromTask(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) { + PackageContainer cont(TASK); + PackageContainerInterface::FromTask(&cont, Cache, pattern, helper); + return cont; + } + static PackageContainer FromTask(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; return FromTask(Cache, pattern, helper); } @@ -149,32 +222,43 @@ public: /*{{{*/ \param Cache the packages are in \param pattern regular expression for package names \param helper responsible for error and message handling */ - static APT::PackageSet FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper); - static APT::PackageSet FromRegEx(pkgCacheFile &Cache, std::string const &pattern) { + static PackageContainer FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) { + PackageContainer cont(REGEX); + PackageContainerInterface::FromRegEx(&cont, Cache, pattern, helper); + return cont; + } + + static PackageContainer FromRegEx(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; return FromRegEx(Cache, pattern, helper); } - /** \brief returns all packages specified by a string + /** \brief returns a package specified by a string - \param Cache the packages are in - \param string String the package name(s) should be extracted from + \param Cache the package is in + \param pattern String the package name should be extracted from \param helper responsible for error and message handling */ - static APT::PackageSet FromString(pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper); - static APT::PackageSet FromString(pkgCacheFile &Cache, std::string const &string) { + static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) { + return PackageContainerInterface::FromName(Cache, pattern, helper); + } + static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; - return FromString(Cache, string, helper); + return PackageContainerInterface::FromName(Cache, pattern, helper); } - /** \brief returns a package specified by a string + /** \brief returns all packages specified by a string - \param Cache the package is in - \param string String the package name should be extracted from + \param Cache the packages are in + \param pattern String the package name(s) should be extracted from \param helper responsible for error and message handling */ - static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &string, CacheSetHelper &helper); - static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &string) { + static PackageContainer FromString(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) { + PackageContainer cont; + PackageContainerInterface::FromString(&cont, Cache, pattern, helper); + return cont; + } + static PackageContainer FromString(pkgCacheFile &Cache, std::string const &pattern) { CacheSetHelper helper; - return FromName(Cache, string, helper); + return FromString(Cache, pattern, helper); } /** \brief returns all packages specified on the commandline @@ -184,20 +268,16 @@ public: /*{{{*/ \param Cache the packages are in \param cmdline Command line the package names should be extracted from \param helper responsible for error and message handling */ - static APT::PackageSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper); - static APT::PackageSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { + static PackageContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) { + PackageContainer cont; + PackageContainerInterface::FromCommandLine(&cont, Cache, cmdline, helper); + return cont; + } + static PackageContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { CacheSetHelper helper; return FromCommandLine(Cache, cmdline, helper); } - struct Modifier { - enum Position { NONE, PREFIX, POSTFIX }; - unsigned short ID; - const char * const Alias; - Position Pos; - Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}; - }; - /** \brief group packages by a action modifiers At some point it is needed to get from the same commandline @@ -209,76 +289,75 @@ public: /*{{{*/ \param mods list of modifiers the method should accept \param fallback the default modifier group for a package \param helper responsible for error and message handling */ - static std::map GroupedFromCommandLine( - pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback, CacheSetHelper &helper); - static std::map GroupedFromCommandLine( - pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback) { + static std::map GroupedFromCommandLine( + pkgCacheFile &Cache, + const char **cmdline, + std::list const &mods, + unsigned short const &fallback, + CacheSetHelper &helper) { + std::map pkgsets; + for (const char **I = cmdline; *I != 0; ++I) { + unsigned short modID = fallback; + PackageContainer pkgset; + PackageContainerInterface::FromModifierCommandLine(modID, &pkgset, Cache, *I, mods, helper); + pkgsets[modID].insert(pkgset); + } + return pkgsets; + } + static std::map GroupedFromCommandLine( + pkgCacheFile &Cache, + const char **cmdline, + std::list const &mods, + unsigned short const &fallback) { CacheSetHelper helper; return GroupedFromCommandLine(Cache, cmdline, mods, fallback, helper); } - - enum Constructor { UNKNOWN, REGEX, TASK }; - Constructor getConstructor() const { return ConstructedBy; }; - - PackageSet() : ConstructedBy(UNKNOWN) {}; - PackageSet(Constructor const &by) : ConstructedBy(by) {}; /*}}}*/ private: /*{{{*/ Constructor ConstructedBy; /*}}}*/ }; /*}}}*/ -class VersionSet : public std::set { /*{{{*/ -/** \class APT::VersionSet +typedef PackageContainer > PackageSet; - Simple wrapper around a std::set to provide a similar interface to - a set of versions as to the complete set of all versions in the - pkgCache. */ -public: /*{{{*/ +class VersionContainerInterface { /*{{{*/ +/** \class APT::VersionContainerInterface + + Same as APT::PackageContainerInterface, just for Versions */ +public: /** \brief smell like a pkgCache::VerIterator */ - class const_iterator : public std::set::const_iterator {/*{{{*/ + class const_iterator { /*{{{*/ public: - const_iterator(std::set::const_iterator x) : - std::set::const_iterator(x) {} - - operator pkgCache::VerIterator(void) { return **this; } - - inline pkgCache *Cache() const { return (**this).Cache(); }; - inline unsigned long Index() const {return (**this).Index();}; + virtual pkgCache::VerIterator getVer() const = 0; + operator pkgCache::VerIterator(void) { return getVer(); } + + inline pkgCache *Cache() const { return getVer().Cache(); }; + inline unsigned long Index() const {return getVer().Index();}; + inline int CompareVer(const pkgCache::VerIterator &B) const { return getVer().CompareVer(B); }; + inline const char *VerStr() const { return getVer().VerStr(); }; + inline const char *Section() const { return getVer().Section(); }; + inline const char *Arch() const { return getVer().Arch(); }; + inline pkgCache::PkgIterator ParentPkg() const { return getVer().ParentPkg(); }; + inline pkgCache::DescIterator DescriptionList() const { return getVer().DescriptionList(); }; + inline pkgCache::DescIterator TranslatedDescription() const { return getVer().TranslatedDescription(); }; + inline pkgCache::DepIterator DependsList() const { return getVer().DependsList(); }; + inline pkgCache::PrvIterator ProvidesList() const { return getVer().ProvidesList(); }; + inline pkgCache::VerFileIterator FileList() const { return getVer().FileList(); }; + inline bool Downloadable() const { return getVer().Downloadable(); }; + inline const char *PriorityType() const { return getVer().PriorityType(); }; + inline std::string RelStr() const { return getVer().RelStr(); }; + inline bool Automatic() const { return getVer().Automatic(); }; + inline pkgCache::VerFileIterator NewestFile() const { return getVer().NewestFile(); }; // we have only valid iterators here inline bool end() const { return false; }; - inline pkgCache::Version const * operator->() const { - return &***this; - }; - - inline int CompareVer(const pkgCache::VerIterator &B) const { return (**this).CompareVer(B); }; - inline const char *VerStr() const { return (**this).VerStr(); }; - inline const char *Section() const { return (**this).Section(); }; - inline const char *Arch() const { return (**this).Arch(); }; - inline pkgCache::PkgIterator ParentPkg() const { return (**this).ParentPkg(); }; - inline pkgCache::DescIterator DescriptionList() const { return (**this).DescriptionList(); }; - inline pkgCache::DescIterator TranslatedDescription() const { return (**this).TranslatedDescription(); }; - inline pkgCache::DepIterator DependsList() const { return (**this).DependsList(); }; - inline pkgCache::PrvIterator ProvidesList() const { return (**this).ProvidesList(); }; - inline pkgCache::VerFileIterator FileList() const { return (**this).FileList(); }; - inline bool Downloadable() const { return (**this).Downloadable(); }; - inline const char *PriorityType() const { return (**this).PriorityType(); }; - inline std::string RelStr() const { return (**this).RelStr(); }; - inline bool Automatic() const { return (**this).Automatic(); }; - inline pkgCache::VerFileIterator NewestFile() const { return (**this).NewestFile(); }; + inline pkgCache::Version const * operator->() const { return &*getVer(); }; }; /*}}}*/ - // 103. set::iterator is required to be modifiable, but this allows modification of keys - typedef APT::VersionSet::const_iterator iterator; - using std::set::insert; - inline void insert(pkgCache::VerIterator const &V) { if (V.end() == false) std::set::insert(V); }; - inline void insert(VersionSet const &verset) { insert(verset.begin(), verset.end()); }; + virtual bool insert(pkgCache::VerIterator const &V) = 0; + virtual bool empty() const = 0; + virtual void clear() = 0; /** \brief specifies which version(s) will be returned if non is given */ enum Version { @@ -298,6 +377,93 @@ public: /*{{{*/ NEWEST }; + struct Modifier { + enum Position { NONE, PREFIX, POSTFIX }; + unsigned short ID; + const char * const Alias; + Position Pos; + Version SelectVersion; + Modifier (unsigned short const &id, const char * const alias, Position const &pos, + Version const &select) : ID(id), Alias(alias), Pos(pos), + SelectVersion(select) {}; + }; + + static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache, + const char **cmdline, Version const &fallback, + CacheSetHelper &helper); + + static bool FromString(VersionContainerInterface * const vci, pkgCacheFile &Cache, + std::string pkg, Version const &fallback, CacheSetHelper &helper, + bool const onlyFromName = false); + + static bool FromPackage(VersionContainerInterface * const vci, pkgCacheFile &Cache, + pkgCache::PkgIterator const &P, Version const &fallback, + CacheSetHelper &helper); + + static bool FromModifierCommandLine(unsigned short &modID, + VersionContainerInterface * const vci, + pkgCacheFile &Cache, const char * cmdline, + std::list const &mods, + CacheSetHelper &helper); + +protected: /*{{{*/ + + /** \brief returns the candidate version of the package + + \param Cache to be used to query for information + \param Pkg we want the candidate version from this package */ + static pkgCache::VerIterator getCandidateVer(pkgCacheFile &Cache, + pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper); + + /** \brief returns the installed version of the package + + \param Cache to be used to query for information + \param Pkg we want the installed version from this package */ + static pkgCache::VerIterator getInstalledVer(pkgCacheFile &Cache, + pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper); + /*}}}*/ +}; + /*}}}*/ +template class VersionContainer : public VersionContainerInterface {/*{{{*/ +/** \class APT::PackageContainer + + Simple wrapper around a container class like std::set to provide a similar + interface to a set of versions as to the complete set of all versions in the + pkgCache. */ + Container _cont; +public: /*{{{*/ + /** \brief smell like a pkgCache::VerIterator */ + class const_iterator : public VersionContainerInterface::const_iterator, + public std::iterator {/*{{{*/ + typename Container::const_iterator _iter; + public: + const_iterator(typename Container::const_iterator i) : _iter(i) {} + pkgCache::VerIterator getVer(void) const { return *_iter; } + inline pkgCache::VerIterator operator*(void) const { return *_iter; }; + operator typename Container::const_iterator(void) const { return _iter; } + inline void operator++(void) { ++_iter; }; + inline bool operator!=(const_iterator const &i) const { return _iter != i._iter; }; + inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }; + friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } + }; + // we are not going to allow modify our veriterators (it doesn't make sense)… + typedef APT::VersionContainer::const_iterator iterator; + /*}}}*/ + + bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; }; + template void insert(VersionContainer const &vercont) { _cont.insert((typename Cont::const_iterator)vercont.begin(), (typename Cont::const_iterator)vercont.end()); }; + void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }; + bool empty() const { return _cont.empty(); }; + void clear() { return _cont.clear(); }; + void erase(iterator position) { _cont.erase((typename Container::const_iterator)position); }; + size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }; + void erase(iterator first, iterator last) { _cont.erase(first, last); }; + size_t size() const { return _cont.size(); }; + + const_iterator begin() const { return const_iterator(_cont.begin()); }; + const_iterator end() const { return const_iterator(_cont.end()); }; + const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); }; + /** \brief returns all versions specified on the commandline Get all versions from the commandline, uses given default version if @@ -305,26 +471,34 @@ public: /*{{{*/ \param Cache the packages and versions are in \param cmdline Command line the versions should be extracted from \param helper responsible for error and message handling */ - static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline, - APT::VersionSet::Version const &fallback, CacheSetHelper &helper); - static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline, - APT::VersionSet::Version const &fallback) { + static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline, + Version const &fallback, CacheSetHelper &helper) { + VersionContainer vercon; + VersionContainerInterface::FromCommandLine(&vercon, Cache, cmdline, fallback, helper); + return vercon; + } + static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline, + Version const &fallback) { CacheSetHelper helper; return FromCommandLine(Cache, cmdline, fallback, helper); } - static APT::VersionSet FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { + static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline) { return FromCommandLine(Cache, cmdline, CANDINST); } - static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg, - APT::VersionSet::Version const &fallback, CacheSetHelper &helper, - bool const &onlyFromName = false); - static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg, - APT::VersionSet::Version const &fallback) { + static VersionContainer FromString(pkgCacheFile &Cache, std::string const &pkg, + Version const &fallback, CacheSetHelper &helper, + bool const onlyFromName = false) { + VersionContainer vercon; + VersionContainerInterface::FromString(&vercon, Cache, pkg, fallback, helper); + return vercon; + } + static VersionContainer FromString(pkgCacheFile &Cache, std::string pkg, + Version const &fallback) { CacheSetHelper helper; return FromString(Cache, pkg, fallback, helper); } - static APT::VersionSet FromString(pkgCacheFile &Cache, std::string pkg) { + static VersionContainer FromString(pkgCacheFile &Cache, std::string pkg) { return FromString(Cache, pkg, CANDINST); } @@ -334,57 +508,47 @@ public: /*{{{*/ \param P the package in question \param fallback the version(s) you want to get \param helper the helper used for display and error handling */ - static APT::VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, - VersionSet::Version const &fallback, CacheSetHelper &helper); - static APT::VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, - APT::VersionSet::Version const &fallback) { + static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, + Version const &fallback, CacheSetHelper &helper) { + VersionContainer vercon; + VersionContainerInterface::FromPackage(&vercon, Cache, P, fallback, helper); + return vercon; + } + static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P, + Version const &fallback) { CacheSetHelper helper; return FromPackage(Cache, P, fallback, helper); } - static APT::VersionSet FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P) { + static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P) { return FromPackage(Cache, P, CANDINST); } - struct Modifier { - enum Position { NONE, PREFIX, POSTFIX }; - unsigned short ID; - const char * const Alias; - Position Pos; - VersionSet::Version SelectVersion; - Modifier (unsigned short const &id, const char * const alias, Position const &pos, - VersionSet::Version const &select) : ID(id), Alias(alias), Pos(pos), - SelectVersion(select) {}; - }; + static std::map GroupedFromCommandLine( + pkgCacheFile &Cache, + const char **cmdline, + std::list const &mods, + unsigned short const fallback, + CacheSetHelper &helper) { + std::map versets; + for (const char **I = cmdline; *I != 0; ++I) { + unsigned short modID = fallback; + VersionContainer verset; + VersionContainerInterface::FromModifierCommandLine(modID, &verset, Cache, *I, mods, helper); + versets[modID].insert(verset); + } + return versets; - static std::map GroupedFromCommandLine( - pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback, CacheSetHelper &helper); - static std::map GroupedFromCommandLine( + } + static std::map GroupedFromCommandLine( pkgCacheFile &Cache, const char **cmdline, - std::list const &mods, - unsigned short const &fallback) { + std::list const &mods, + unsigned short const fallback) { CacheSetHelper helper; return GroupedFromCommandLine(Cache, cmdline, mods, fallback, helper); } /*}}}*/ -protected: /*{{{*/ - - /** \brief returns the candidate version of the package - - \param Cache to be used to query for information - \param Pkg we want the candidate version from this package */ - static pkgCache::VerIterator getCandidateVer(pkgCacheFile &Cache, - pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper); - - /** \brief returns the installed version of the package - - \param Cache to be used to query for information - \param Pkg we want the installed version from this package */ - static pkgCache::VerIterator getInstalledVer(pkgCacheFile &Cache, - pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper); - /*}}}*/ }; /*}}}*/ +typedef VersionContainer > VersionSet; } #endif diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index c14309422..07bbbdd03 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -10,13 +10,11 @@ #define PKGLIB_EDSP_H #include +#include #include #include -namespace APT { - class PackageSet; -}; class pkgDepCache; class OpProgress; diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 82a31c9b1..ee3416ffb 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -65,12 +65,12 @@ public: return CacheSetHelper::canNotFindNewestVer(Cache, Pkg); } - virtual APT::VersionSet canNotFindAllVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { + virtual void canNotFindAllVer(APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { virtualPkgs.insert(Pkg); - return CacheSetHelper::canNotFindAllVer(Cache, Pkg); + CacheSetHelper::canNotFindAllVer(vci, Cache, Pkg); } - CacheSetHelperVirtuals(bool const &ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {} + CacheSetHelperVirtuals(bool const ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {} }; /*}}}*/ // LocalitySort - Sort a version list by package file locality /*{{{*/ @@ -108,7 +108,7 @@ void LocalitySort(pkgCache::DescFile **begin, // UnMet - Show unmet dependencies /*{{{*/ // --------------------------------------------------------------------- /* */ -bool ShowUnMet(pkgCache::VerIterator const &V, bool const &Important) +bool ShowUnMet(pkgCache::VerIterator const &V, bool const Important) { bool Header = false; for (pkgCache::DepIterator D = V.DependsList(); D.end() == false;) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 1925dea87..5ead83ddf 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -628,20 +628,18 @@ public: explicitlyNamed = true; } - virtual void showTaskSelection(APT::PackageSet const &pkgset, string const &pattern) { - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) - ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), - Pkg.FullName(true).c_str(), pattern.c_str()); + virtual void showTaskSelection(pkgCache::PkgIterator const &Pkg, string const &pattern) { + ioprintf(out, _("Note, selecting '%s' for task '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } - virtual void showRegExSelection(APT::PackageSet const &pkgset, string const &pattern) { - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) - ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), - Pkg.FullName(true).c_str(), pattern.c_str()); + virtual void showRegExSelection(pkgCache::PkgIterator const &Pkg, string const &pattern) { + ioprintf(out, _("Note, selecting '%s' for regex '%s'\n"), + Pkg.FullName(true).c_str(), pattern.c_str()); explicitlyNamed = false; } virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver, - string const &ver, bool const &verIsRel) { + string const &ver, bool const verIsRel) { if (ver == Ver.VerStr()) return; selectedByRelease.push_back(make_pair(Ver, ver)); @@ -707,7 +705,7 @@ public: APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::CANDIDATE); if (verset.empty() == false) return *(verset.begin()); - if (ShowError == true) { + else if (ShowError == true) { _error->Error(_("Package '%s' has no installation candidate"),Pkg.FullName(true).c_str()); virtualPkgs.insert(Pkg); } @@ -769,7 +767,7 @@ struct TryToInstall { unsigned long AutoMarkChanged; APT::PackageSet doAutoInstallLater; - TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const &FixBroken) : Cache(&Cache), Fix(PM), + TryToInstall(pkgCacheFile &Cache, pkgProblemResolver *PM, bool const FixBroken) : Cache(&Cache), Fix(PM), FixBroken(FixBroken), AutoMarkChanged(0) {}; void operator() (pkgCache::VerIterator const &Ver) { diff --git a/debian/changelog b/debian/changelog index df50eefbd..95ad73681 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,11 @@ apt (0.8.16~exp8) experimental; urgency=low - use a pointer-union to peace gcc strict-aliasing warning * apt-pkg/deb/deblistparser.cc: - M-A: foreign packages provide for other archs, too + * apt-pkg/cacheset.cc: + - make the cachesets real containers which can embedding any container + to be able to use the same interface regardless of set or list usage - -- David Kalnischkies Thu, 03 Nov 2011 09:40:29 -0500 + -- David Kalnischkies Wed, 09 Nov 2011 17:21:02 +0100 apt (0.8.16~exp7) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From c4cca79156ef5651e90772bae5f4aa11f669907d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 11 Nov 2011 16:03:40 +0100 Subject: - provide a {Package,Version}List similar to {Package,Version}Set * cmdline/apt-{get,cache,mark}.cc: - use Lists instead of Sets if input order should be preserved for commands accepting lists of packages, e.g. policy (Closes: #625960) --- apt-pkg/cacheset.h | 110 +++++++++++++++++++++++++++--- cmdline/apt-cache.cc | 28 ++++---- cmdline/apt-get.cc | 14 ++-- cmdline/apt-mark.cc | 16 ++--- debian/changelog | 6 +- test/integration/Packages-pdiff-usage-new | 26 +++---- 6 files changed, 146 insertions(+), 54 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 411b31513..a23659efb 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -159,8 +160,8 @@ template class PackageContainer : public PackageContainerInterf Container _cont; public: /*{{{*/ /** \brief smell like a pkgCache::PkgIterator */ - class const_iterator : public PackageContainerInterface::const_iterator, - public std::iterator {/*{{{*/ + class const_iterator : public PackageContainerInterface::const_iterator,/*{{{*/ + public std::iterator { typename Container::const_iterator _iter; public: const_iterator(typename Container::const_iterator i) : _iter(i) {} @@ -172,22 +173,37 @@ public: /*{{{*/ inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }; friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } }; - // we are not going to allow modify our pkgiterators (it doesn't make sense)… - typedef APT::PackageContainer::const_iterator iterator; + class iterator : public PackageContainerInterface::const_iterator, + public std::iterator { + typename Container::iterator _iter; + public: + iterator(typename Container::iterator i) : _iter(i) {} + pkgCache::PkgIterator getPkg(void) const { return *_iter; } + inline pkgCache::PkgIterator operator*(void) const { return *_iter; }; + operator typename Container::iterator(void) const { return _iter; } + operator typename PackageContainer::const_iterator() { return PackageContainer::const_iterator(_iter); } + inline void operator++(void) { ++_iter; }; + inline bool operator!=(iterator const &i) const { return _iter != i._iter; }; + inline bool operator==(iterator const &i) const { return _iter == i._iter; }; + friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } + }; /*}}}*/ bool insert(pkgCache::PkgIterator const &P) { if (P.end() == true) return false; _cont.insert(P); return true; }; template void insert(PackageContainer const &pkgcont) { _cont.insert((typename Cont::const_iterator)pkgcont.begin(), (typename Cont::const_iterator)pkgcont.end()); }; void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }; + bool empty() const { return _cont.empty(); }; void clear() { return _cont.clear(); }; - void erase(iterator position) { _cont.erase((typename Container::const_iterator)position); }; + void erase(iterator position) { _cont.erase((typename Container::iterator)position); }; size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }; void erase(iterator first, iterator last) { _cont.erase(first, last); }; size_t size() const { return _cont.size(); }; const_iterator begin() const { return const_iterator(_cont.begin()); }; const_iterator end() const { return const_iterator(_cont.end()); }; + iterator begin() { return iterator(_cont.begin()); }; + iterator end() { return iterator(_cont.end()); }; const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }; void setConstructor(Constructor const &by) { ConstructedBy = by; }; @@ -318,7 +334,25 @@ private: /*{{{*/ Constructor ConstructedBy; /*}}}*/ }; /*}}}*/ + +template<> template void PackageContainer >::insert(PackageContainer const &pkgcont) { + for (typename PackageContainer::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p) + _cont.push_back(*p); +}; +// these two are 'inline' as otherwise the linker has problems with seeing these untemplated +// specializations again and again - but we need to see them, so that library users can use them +template<> inline bool PackageContainer >::insert(pkgCache::PkgIterator const &P) { + if (P.end() == true) + return false; + _cont.push_back(P); + return true; +}; +template<> inline void PackageContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator p = begin; p != end; ++p) + _cont.push_back(*p); +}; typedef PackageContainer > PackageSet; +typedef PackageContainer > PackageList; class VersionContainerInterface { /*{{{*/ /** \class APT::VersionContainerInterface @@ -406,6 +440,13 @@ public: std::list const &mods, CacheSetHelper &helper); + + static bool FromDependency(VersionContainerInterface * const vci, + pkgCacheFile &Cache, + pkgCache::DepIterator const &D, + Version const &selector, + CacheSetHelper &helper); + protected: /*{{{*/ /** \brief returns the candidate version of the package @@ -425,7 +466,7 @@ protected: /*{{{*/ }; /*}}}*/ template class VersionContainer : public VersionContainerInterface {/*{{{*/ -/** \class APT::PackageContainer +/** \class APT::VersionContainer Simple wrapper around a container class like std::set to provide a similar interface to a set of versions as to the complete set of all versions in the @@ -446,8 +487,20 @@ public: /*{{{*/ inline bool operator==(const_iterator const &i) const { return _iter == i._iter; }; friend std::ostream& operator<<(std::ostream& out, const_iterator i) { return operator<<(out, *i); } }; - // we are not going to allow modify our veriterators (it doesn't make sense)… - typedef APT::VersionContainer::const_iterator iterator; + class iterator : public VersionContainerInterface::const_iterator, + public std::iterator { + typename Container::iterator _iter; + public: + iterator(typename Container::iterator i) : _iter(i) {} + pkgCache::VerIterator getVer(void) const { return *_iter; } + inline pkgCache::VerIterator operator*(void) const { return *_iter; }; + operator typename Container::iterator(void) const { return _iter; } + operator typename VersionContainer::const_iterator() { return VersionContainer::const_iterator(_iter); } + inline void operator++(void) { ++_iter; }; + inline bool operator!=(iterator const &i) const { return _iter != i._iter; }; + inline bool operator==(iterator const &i) const { return _iter == i._iter; }; + friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } + }; /*}}}*/ bool insert(pkgCache::VerIterator const &V) { if (V.end() == true) return false; _cont.insert(V); return true; }; @@ -455,13 +508,15 @@ public: /*{{{*/ void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }; bool empty() const { return _cont.empty(); }; void clear() { return _cont.clear(); }; - void erase(iterator position) { _cont.erase((typename Container::const_iterator)position); }; - size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }; + void erase(iterator position) { _cont.erase((typename Container::iterator)position); }; + size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); }; void erase(iterator first, iterator last) { _cont.erase(first, last); }; size_t size() const { return _cont.size(); }; const_iterator begin() const { return const_iterator(_cont.begin()); }; const_iterator end() const { return const_iterator(_cont.end()); }; + iterator begin() { return iterator(_cont.begin()); }; + iterator end() { return iterator(_cont.end()); }; const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); }; /** \brief returns all versions specified on the commandline @@ -520,7 +575,7 @@ public: /*{{{*/ return FromPackage(Cache, P, fallback, helper); } static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P) { - return FromPackage(Cache, P, CANDINST); + return FromPackage(Cache, P, CANDIDATE); } static std::map GroupedFromCommandLine( @@ -547,8 +602,41 @@ public: /*{{{*/ return GroupedFromCommandLine(Cache, cmdline, mods, fallback, helper); } + + static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D, + Version const &selector, CacheSetHelper &helper) { + VersionContainer vercon; + VersionContainerInterface::FromDependency(&vercon, Cache, D, selector, helper); + return vercon; + } + static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D, + Version const &selector) { + CacheSetHelper helper; + return FromPackage(Cache, D, selector, helper); + } + static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D) { + return FromPackage(Cache, D, CANDIDATE); + } /*}}}*/ }; /*}}}*/ + +template<> template void VersionContainer >::insert(VersionContainer const &vercont) { + for (typename VersionContainer::const_iterator v = vercont.begin(); v != vercont.end(); ++v) + _cont.push_back(*v); +}; +// these two are 'inline' as otherwise the linker has problems with seeing these untemplated +// specializations again and again - but we need to see them, so that library users can use them +template<> inline bool VersionContainer >::insert(pkgCache::VerIterator const &V) { + if (V.end() == true) + return false; + _cont.push_back(V); + return true; +}; +template<> inline void VersionContainer >::insert(const_iterator begin, const_iterator end) { + for (const_iterator v = begin; v != end; ++v) + _cont.push_back(*v); +}; typedef VersionContainer > VersionSet; +typedef VersionContainer > VersionList; } #endif diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index ee3416ffb..65d7b0ccd 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -199,9 +199,9 @@ bool UnMet(CommandLine &CmdL) else { CacheSetHelperVirtuals helper(true, GlobalError::NOTICE); - APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, - APT::VersionSet::CANDIDATE, helper); - for (APT::VersionSet::iterator V = verset.begin(); V != verset.end(); ++V) + APT::VersionList verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, + APT::VersionList::CANDIDATE, helper); + for (APT::VersionList::iterator V = verset.begin(); V != verset.end(); ++V) if (ShowUnMet(V, Important) == false) return false; } @@ -215,9 +215,9 @@ bool DumpPackage(CommandLine &CmdL) { pkgCacheFile CacheFile; APT::CacheSetHelper helper(true, GlobalError::NOTICE); - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { cout << "Package: " << Pkg.FullName(true) << endl; cout << "Versions: " << endl; @@ -588,7 +588,7 @@ bool ShowDepends(CommandLine &CmdL, bool const RevDepends) return false; CacheSetHelperVirtuals helper(false); - APT::VersionSet verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper); + APT::VersionList verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper); if (verset.empty() == true && helper.virtualPkgs.empty() == true) return _error->Error(_("No packages found")); std::vector Shown(Cache->Head().PackageCount); @@ -1365,10 +1365,10 @@ bool ShowPackage(CommandLine &CmdL) { pkgCacheFile CacheFile; CacheSetHelperVirtuals helper(true, GlobalError::NOTICE); - APT::VersionSet::Version const select = _config->FindB("APT::Cache::AllVersions", true) ? - APT::VersionSet::ALL : APT::VersionSet::CANDIDATE; - APT::VersionSet const verset = APT::VersionSet::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper); - for (APT::VersionSet::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) + APT::VersionList::Version const select = _config->FindB("APT::Cache::AllVersions", true) ? + APT::VersionList::ALL : APT::VersionList::CANDIDATE; + APT::VersionList const verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper); + for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) if (DisplayRecord(CacheFile, Ver) == false) return false; @@ -1531,8 +1531,8 @@ bool Policy(CommandLine &CmdL) // Print out detailed information for each package APT::CacheSetHelper helper(true, GlobalError::NOTICE); - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1, helper); + for (APT::PackageList::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { cout << Pkg.FullName(true) << ":" << endl; @@ -1608,8 +1608,8 @@ bool Madison(CommandLine &CmdL) for (const char **I = CmdL.FileList + 1; *I != 0; I++) { _error->PushToStack(); - APT::PackageSet pkgset = APT::PackageSet::FromString(CacheFile, *I, helper); - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + APT::PackageList pkgset = APT::PackageList::FromString(CacheFile, *I, helper); + for (APT::PackageList::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { for (pkgCache::VerIterator V = Pkg.VersionList(); V.end() == false; ++V) { diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 5ead83ddf..763f0edad 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2293,8 +2293,8 @@ bool DoDownload(CommandLine &CmdL) return false; APT::CacheSetHelper helper(c0out); - APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache, - CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper); + APT::VersionList verset = APT::VersionList::FromCommandLine(Cache, + CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper); if (verset.empty() == true) return false; @@ -2306,7 +2306,7 @@ bool DoDownload(CommandLine &CmdL) pkgRecords Recs(Cache); pkgSourceList *SrcList = Cache.GetSourceList(); - for (APT::VersionSet::const_iterator Ver = verset.begin(); + for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) { @@ -3165,14 +3165,14 @@ bool DoChangelog(CommandLine &CmdL) return false; APT::CacheSetHelper helper(c0out); - APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache, - CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper); + APT::VersionList verset = APT::VersionList::FromCommandLine(Cache, + CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper); if (verset.empty() == true) return false; pkgAcquire Fetcher; if (_config->FindB("APT::Get::Print-URIs", false) == true) - for (APT::VersionSet::const_iterator Ver = verset.begin(); + for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) return DownloadChangelog(Cache, Fetcher, Ver, ""); @@ -3195,7 +3195,7 @@ bool DoChangelog(CommandLine &CmdL) return _error->Errno("mkdtemp", "mkdtemp failed"); } - for (APT::VersionSet::const_iterator Ver = verset.begin(); + for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) { diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 339cbdf44..dbbef5013 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -34,14 +34,14 @@ bool DoAuto(CommandLine &CmdL) if (unlikely(Cache == NULL || DepCache == NULL)) return false; - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1); + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1); if (pkgset.empty() == true) return _error->Error(_("No packages found")); bool MarkAuto = strcasecmp(CmdL.FileList[0],"auto") == 0; int AutoMarkChanged = 0; - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if (Pkg->CurrentVer == 0) { @@ -81,7 +81,7 @@ bool DoMarkAuto(CommandLine &CmdL) if (unlikely(Cache == NULL || DepCache == NULL)) return false; - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1); + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1); if (pkgset.empty() == true) return _error->Error(_("No packages found")); @@ -89,7 +89,7 @@ bool DoMarkAuto(CommandLine &CmdL) bool const Verbose = _config->FindB("APT::MarkAuto::Verbose", false); int AutoMarkChanged = 0; - for (APT::PackageSet::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::const_iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if (Pkg->CurrentVer == 0 || (((*DepCache)[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto) == MarkAuto) @@ -157,13 +157,13 @@ bool DoHold(CommandLine &CmdL) if (unlikely(Cache == NULL)) return false; - APT::PackageSet pkgset = APT::PackageSet::FromCommandLine(CacheFile, CmdL.FileList + 1); + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1); if (pkgset.empty() == true) return _error->Error(_("No packages found")); bool const MarkHold = strcasecmp(CmdL.FileList[0],"hold") == 0; - for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if ((Pkg->SelectedState == pkgCache::State::Hold) == MarkHold) { @@ -181,7 +181,7 @@ bool DoHold(CommandLine &CmdL) if (_config->FindB("APT::Mark::Simulate", false) == true) { - for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if (MarkHold == false) ioprintf(c1out,_("%s set on hold.\n"), Pkg.FullName(true).c_str()); @@ -201,7 +201,7 @@ bool DoHold(CommandLine &CmdL) if (dpkg == NULL) return _error->Errno("DoHold", "fdopen on dpkg stdin failed"); - for (APT::PackageSet::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if (MarkHold == true) { diff --git a/debian/changelog b/debian/changelog index 95ad73681..058e2926e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,8 +12,12 @@ apt (0.8.16~exp8) experimental; urgency=low * apt-pkg/cacheset.cc: - make the cachesets real containers which can embedding any container to be able to use the same interface regardless of set or list usage + - provide a {Package,Version}List similar to {Package,Version}Set + * cmdline/apt-{get,cache,mark}.cc: + - use Lists instead of Sets if input order should be preserved for + commands accepting lists of packages, e.g. policy (Closes: #625960) - -- David Kalnischkies Wed, 09 Nov 2011 17:21:02 +0100 + -- David Kalnischkies Fri, 11 Nov 2011 15:55:13 +0100 apt (0.8.16~exp7) experimental; urgency=low diff --git a/test/integration/Packages-pdiff-usage-new b/test/integration/Packages-pdiff-usage-new index 9157596a7..4f374b37f 100644 --- a/test/integration/Packages-pdiff-usage-new +++ b/test/integration/Packages-pdiff-usage-new @@ -1,16 +1,3 @@ -Package: newstuff -Version: 1.0 -Architecture: i386 -Maintainer: Joe Sixpack -Installed-Size: 101 -Filename: pool/newstuff_1.0_i386.deb -Size: 101100 -MD5sum: 311aeeadf78324aaff1ceaf3e1f76671 -SHA1: 3c695e028f7a1ae324deeddaaa1242desa81088c -SHA256: b46fd154615edefab321cc56a5cc0e7deaef23e2da3e4f129727fd660f28f050 -Description: some cool and shiny new stuff - This package will appear in the next mirror update - Package: apt Priority: important Section: admin @@ -35,3 +22,16 @@ Description: Advanced front-end for dpkg . APT features complete installation ordering, multiple source capability and several other unique features, see the Users Guide in apt-doc. + +Package: newstuff +Version: 1.0 +Architecture: i386 +Maintainer: Joe Sixpack +Installed-Size: 101 +Filename: pool/newstuff_1.0_i386.deb +Size: 101100 +MD5sum: 311aeeadf78324aaff1ceaf3e1f76671 +SHA1: 3c695e028f7a1ae324deeddaaa1242desa81088c +SHA256: b46fd154615edefab321cc56a5cc0e7deaef23e2da3e4f129727fd660f28f050 +Description: some cool and shiny new stuff + This package will appear in the next mirror update -- cgit v1.2.3-70-g09d2 From 286afa36886b60bea0a17d244f8bddad938f27cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 23 Nov 2011 09:54:17 +0100 Subject: * cmdline/apt-get.cc: - ignore foreign architectures if we check if a provides has only one resolver as it's basically the same for the user, so no need to choose --- cmdline/apt-get.cc | 13 +++++++++++++ debian/changelog | 5 ++++- test/integration/test-multiarch-foreign | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 763f0edad..ca1169401 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -742,6 +742,19 @@ public: Prov = PPkg; found_one = true; } else if (PPkg != Prov) { + // same group, so it's a foreign package + if (PPkg->Group == Prov->Group) { + // do we already have the requested arch? + if (strcmp(Pkg.Arch(), Prov.Arch()) == 0 || + strcmp(Prov.Arch(), "all") == 0 || + unlikely(strcmp(PPkg.Arch(), Prov.Arch()) == 0)) // packages have only on candidate, but just to be sure + continue; + // see which architecture we prefer more and switch to it + std::vector archs = APT::Configuration::getArchitectures(); + if (std::find(archs.begin(), archs.end(), PPkg.Arch()) < std::find(archs.begin(), archs.end(), Prov.Arch())) + Prov = PPkg; + continue; + } found_one = false; // we found at least two break; } diff --git a/debian/changelog b/debian/changelog index 0a66d2579..3c0de2c62 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,8 +18,11 @@ apt (0.8.16~exp8) experimental; urgency=low commands accepting lists of packages, e.g. policy (Closes: #625960) * apt-pkg/depcache.cc: - prefer native providers over foreigns even if the chain is foreign + * cmdline/apt-get.cc: + - ignore foreign architectures if we check if a provides has only one + resolver as it's basically the same for the user, so no need to choose - -- David Kalnischkies Wed, 23 Nov 2011 00:18:35 +0100 + -- David Kalnischkies Wed, 23 Nov 2011 09:52:20 +0100 apt (0.8.16~exp7) experimental; urgency=low diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index d0ad829a7..332466d96 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -126,3 +126,25 @@ Inst bar:armel (1.0 unstable [armel]) Inst cool-bar (1.0 unstable [amd64]) Conf bar:armel (1.0 unstable [armel]) Conf cool-bar (1.0 unstable [amd64])' aptget install cool-bar:amd64 bar:armel -s + +testequal "Reading package lists... +Building dependency tree... +Note, selecting 'bar' instead of 'bar-provider' +The following NEW packages will be installed: + bar cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1.0 unstable [amd64]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar (1.0 unstable [amd64]) +Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider -s -q=0 + +testequal "Reading package lists... +Building dependency tree... +Note, selecting 'bar:i386' instead of 'bar-provider:i386' +The following NEW packages will be installed: + bar:i386 cool-bar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar:i386 (1.0 unstable [i386]) +Inst cool-bar (1.0 unstable [amd64]) +Conf bar:i386 (1.0 unstable [i386]) +Conf cool-bar (1.0 unstable [amd64])" aptget install cool-bar bar-provider:i386 -s -q=0 -- cgit v1.2.3-70-g09d2 From 8e16d8c39447809506a8cd8e6f88cae3c168f82d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Dec 2011 17:35:54 +0100 Subject: * cmdline/apt-config.cc: - dump the APT::Compressor settings correctly and completely --- cmdline/apt-config.cc | 16 ++++++++++++++++ debian/changelog | 11 +++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 94f6ee9b0..47bedfe3f 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -134,6 +134,22 @@ int main(int argc,const char *argv[]) /*{{{*/ for (std::vector::const_iterator a = archs.begin(); a != archs.end(); ++a) _config->Set("APT::Architectures::", *a); + std::vector const compressors = APT::Configuration::getCompressors(); + _config->Clear("APT::Compressor"); + string conf = "APT::Compressor::"; + for (std::vector::const_iterator c = compressors.begin(); c != compressors.end(); ++c) + { + string comp = conf + c->Name + "::"; + _config->Set(comp + "Name", c->Name); + _config->Set(comp + "Extension", c->Extension); + _config->Set(comp + "Binary", c->Binary); + _config->Set(std::string(comp + "Cost").c_str(), c->Cost); + for (std::vector::const_iterator a = c->CompressArgs.begin(); a != c->CompressArgs.end(); ++a) + _config->Set(comp + "CompressArg::", *a); + for (std::vector::const_iterator a = c->UncompressArgs.begin(); a != c->UncompressArgs.end(); ++a) + _config->Set(comp + "UncompressArg::", *a); + } + // Match the operation CmdL.DispatchArg(Cmds); diff --git a/debian/changelog b/debian/changelog index f95edd60c..685774a8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,16 +1,17 @@ + apt (0.8.16~exp9) UNRELEASED; urgency=low [ Julian Andres Klode ] * apt-pkg/cdrom.cc: - Accept .bz2, .xz files in addition to .gz files (Closes: #649451) - + [ Michael Vogt ] * apt-pkg/cdrom.cc: - use aptconfiguration to get the supported compression types * debian/control: - bump debhelper build-dep to debhelper (>= 8.1.3~) - set libapt-pkg-dev to multi-arch: same too - + [ Colin Watson ] * Convert libapt-pkg4.12 and libapt-inst1.4 to Multi-Arch: same. @@ -27,8 +28,10 @@ apt (0.8.16~exp9) UNRELEASED; urgency=low * cmdline/apt-get.cc: - ignore foreign architectures if we check if a provides has only one resolver as it's basically the same for the user, so no need to choose - - -- Julian Andres Klode Mon, 21 Nov 2011 18:46:36 +0100 + * cmdline/apt-config.cc: + - dump the APT::Compressor settings correctly and completely + + -- David Kalnischkies Sat, 10 Dec 2011 17:34:50 +0100 apt (0.8.16~exp8) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From 468720c59fcf48b20332cdb7b601b2b0d7cbbfbb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 10 Dec 2011 19:31:36 +0100 Subject: enable FileFd to guess the compressor based on the filename if requested or to search for compressed silbings of the given filename and use this guessing instead of hardcoding Gzip compression --- apt-pkg/contrib/fileutl.cc | 129 ++++++++++++++++++++++++++++++++++++++------ apt-pkg/contrib/fileutl.h | 14 +++-- apt-pkg/deb/debindexfile.cc | 13 ++--- apt-pkg/deb/debrecords.cc | 2 +- apt-pkg/deb/debsrcrecords.h | 2 +- cmdline/apt-cache.cc | 2 +- methods/gzip.cc | 2 +- methods/rred.cc | 2 +- 8 files changed, 135 insertions(+), 31 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc index d5e7192e3..1cb3fab1e 100644 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -725,6 +726,11 @@ bool FileFd::Open(string FileName,OpenMode Mode,CompressMode Compress, unsigned Close(); Flags = AutoClose; + if (Compress == Auto && (Mode & WriteOnly) == WriteOnly) + return _error->Error("Autodetection on %s only works in ReadOnly openmode!", FileName.c_str()); + if ((Mode & WriteOnly) != WriteOnly && (Mode & (Atomic | Create | Empty | Exclusive)) != 0) + return _error->Error("ReadOnly mode for %s doesn't accept additional flags!", FileName.c_str()); + int fileflags = 0; #define if_FLAGGED_SET(FLAG, MODE) if ((Mode & FLAG) == FLAG) fileflags |= MODE if_FLAGGED_SET(ReadWrite, O_RDWR); @@ -738,6 +744,70 @@ bool FileFd::Open(string FileName,OpenMode Mode,CompressMode Compress, unsigned if_FLAGGED_SET(Empty, O_TRUNC); #undef if_FLAGGED_SET + // FIXME: Denote inbuilt compressors somehow - as we don't need to have the binaries for them + std::vector const compressors = APT::Configuration::getCompressors(); + std::vector::const_iterator compressor = compressors.begin(); + if (Compress == Auto) + { + Compress = None; + for (; compressor != compressors.end(); ++compressor) + { + std::string file = std::string(FileName).append(compressor->Extension); + if (FileExists(file) == false) + continue; + FileName = file; + if (compressor->Binary == ".") + Compress = None; + else + Compress = Extension; + break; + } + } + else if (Compress == Extension) + { + Compress = None; + std::string ext = flExtension(FileName); + if (ext != FileName) + { + ext = "." + ext; + for (; compressor != compressors.end(); ++compressor) + if (ext == compressor->Extension) + break; + } + } + else if (Compress != None) + { + std::string name; + switch (Compress) + { + case Gzip: name = "gzip"; break; + case Bzip2: name = "bzip2"; break; + case Lzma: name = "lzma"; break; + case Xz: name = "xz"; break; + default: return _error->Error("Can't find a match for specified compressor mode for file %s", FileName.c_str()); + } + for (; compressor != compressors.end(); ++compressor) + if (compressor->Name == name) + break; + if (compressor == compressors.end() && name != "gzip") + return _error->Error("Can't find a configured compressor %s for file %s", name.c_str(), FileName.c_str()); + } + + // if we have them, use inbuilt compressors instead of forking + if (compressor != compressors.end()) + { + if (compressor->Name == "gzip") + { + Compress = Gzip; + compressor = compressors.end(); + } + else if (compressor->Name == "." || Compress == None) + { + Compress = None; + compressor = compressors.end(); + } + } + if ((Mode & Atomic) == Atomic) { Flags |= Replace; @@ -757,18 +827,27 @@ bool FileFd::Open(string FileName,OpenMode Mode,CompressMode Compress, unsigned unlink(FileName.c_str()); } - if (TemporaryFileName.empty() == false) - iFd = open(TemporaryFileName.c_str(), fileflags, Perms); - else - iFd = open(FileName.c_str(), fileflags, Perms); + if (compressor != compressors.end()) + { + if ((Mode & ReadWrite) == ReadWrite) + _error->Error("External compressors like %s do not support readwrite mode for file %s", compressor->Name.c_str(), FileName.c_str()); - if (iFd != -1 && Compress == Gzip) + _error->Error("Forking external compressor %s is not implemented for %s", compressor->Name.c_str(), FileName.c_str()); + } + else { - gz = gzdopen (iFd, "r"); - if (gz == NULL) + if (TemporaryFileName.empty() == false) + iFd = open(TemporaryFileName.c_str(), fileflags, Perms); + else + iFd = open(FileName.c_str(), fileflags, Perms); + + if (iFd != -1) { - close (iFd); - iFd = -1; + if (OpenInternDescriptor(Mode, Compress) == false) + { + close (iFd); + iFd = -1; + } } } @@ -788,17 +867,33 @@ bool FileFd::OpenDescriptor(int Fd, OpenMode Mode, CompressMode Compress, bool A Close(); Flags = (AutoClose) ? FileFd::AutoClose : 0; iFd = Fd; - if (Mode == ReadOnlyGzip) { - gz = gzdopen (iFd, "r"); - if (gz == NULL) { - if (AutoClose) - close (iFd); - return _error->Errno("gzdopen",_("Could not open file descriptor %d"), - Fd); - } + if (OpenInternDescriptor(Mode, Compress) == false) + { + if (AutoClose) + close (iFd); + return _error->Errno("gzdopen",_("Could not open file descriptor %d"), Fd); } this->FileName = ""; return true; +} +bool FileFd::OpenInternDescriptor(OpenMode Mode, CompressMode Compress) +{ + if (Compress == None) + return true; + else if (Compress == Gzip) + { + if ((Mode & ReadWrite) == ReadWrite) + gz = gzdopen(iFd, "r+"); + else if ((Mode & WriteOnly) == WriteOnly) + gz = gzdopen(iFd, "w"); + else + gz = gzdopen (iFd, "r"); + if (gz == NULL) + return false; + } + else + return false; + return true; } /*}}}*/ // FileFd::~File - Closes the file /*{{{*/ diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h index fa8f92272..59a9d97e3 100644 --- a/apt-pkg/contrib/fileutl.h +++ b/apt-pkg/contrib/fileutl.h @@ -61,7 +61,7 @@ class FileFd ReadOnlyGzip, WriteAtomic = ReadWrite | Create | Atomic }; - enum CompressMode { Auto, None, Gzip, Bzip2, Lzma, Xz }; + enum CompressMode { Auto = 'A', None = 'N', Extension = 'E', Gzip = 'G', Bzip2 = 'B', Lzma = 'L', Xz = 'X' }; inline bool Read(void *To,unsigned long long Size,bool AllowEof) { @@ -94,7 +94,7 @@ class FileFd } bool Open(std::string FileName,OpenMode Mode,CompressMode Compress,unsigned long Perms = 0666); - inline bool Open(std::string const &FileName,OpenMode Mode,unsigned long Perms = 0666) { + inline bool Open(std::string const &FileName,OpenMode Mode, unsigned long Perms = 0666) { return Open(FileName, Mode, None, Perms); }; bool OpenDescriptor(int Fd, OpenMode Mode, CompressMode Compress, bool AutoClose=false); @@ -118,11 +118,19 @@ class FileFd FileFd(std::string FileName,OpenMode Mode,unsigned long Perms = 0666) : iFd(-1), Flags(0), gz(NULL) { - Open(FileName,Mode,Perms); + Open(FileName,Mode, None, Perms); + }; + FileFd(std::string FileName,OpenMode Mode, CompressMode Compress, unsigned long Perms = 0666) : + iFd(-1), Flags(0), gz(NULL) + { + Open(FileName,Mode, Compress, Perms); }; FileFd(int Fd = -1) : iFd(Fd), Flags(AutoClose), gz(NULL) {}; FileFd(int Fd,bool) : iFd(Fd), Flags(0), gz(NULL) {}; virtual ~FileFd(); + + private: + bool OpenInternDescriptor(OpenMode Mode, CompressMode Compress); }; bool RunScripts(const char *Cnf); diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 27c1f7f32..d9c448598 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -159,7 +159,7 @@ unsigned long debSourcesIndex::Size() const /* we need to ignore errors here; if the lists are absent, just return 0 */ _error->PushToStack(); - FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnlyGzip); + FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnly, FileFd::Extension); if (!f.Failed()) size = f.Size(); @@ -288,7 +288,7 @@ unsigned long debPackagesIndex::Size() const /* we need to ignore errors here; if the lists are absent, just return 0 */ _error->PushToStack(); - FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnlyGzip); + FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnly, FileFd::Extension); if (!f.Failed()) size = f.Size(); @@ -305,7 +305,7 @@ unsigned long debPackagesIndex::Size() const bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { string PackageFile = IndexFile("Packages"); - FileFd Pkg(PackageFile,FileFd::ReadOnlyGzip); + FileFd Pkg(PackageFile,FileFd::ReadOnly, FileFd::Extension); debListParser Parser(&Pkg, Architecture); if (_error->PendingError() == true) @@ -319,6 +319,7 @@ bool debPackagesIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const // Store the IMS information pkgCache::PkgFileIterator File = Gen.GetCurFile(); pkgCacheGenerator::Dynamic DynFile(File); + // FIXME: Get this info from FileFd instead struct stat St; if (fstat(Pkg.Fd(),&St) != 0) return _error->Errno("fstat","Failed to stat"); @@ -489,7 +490,7 @@ unsigned long debTranslationsIndex::Size() const /* we need to ignore errors here; if the lists are absent, just return 0 */ _error->PushToStack(); - FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnlyGzip); + FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnly, FileFd::Extension); if (!f.Failed()) size = f.Size(); @@ -509,7 +510,7 @@ bool debTranslationsIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const string TranslationFile = IndexFile(Language); if (FileExists(TranslationFile)) { - FileFd Trans(TranslationFile,FileFd::ReadOnlyGzip); + FileFd Trans(TranslationFile,FileFd::ReadOnly, FileFd::Extension); debListParser TransParser(&Trans); if (_error->PendingError() == true) return false; @@ -590,7 +591,7 @@ unsigned long debStatusIndex::Size() const /* */ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const { - FileFd Pkg(File,FileFd::ReadOnlyGzip); + FileFd Pkg(File,FileFd::ReadOnly, FileFd::Extension); if (_error->PendingError() == true) return false; debListParser Parser(&Pkg); diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index 1afa7b74d..184c07c33 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -25,7 +25,7 @@ using std::string; // --------------------------------------------------------------------- /* */ debRecordParser::debRecordParser(string FileName,pkgCache &Cache) : - File(FileName,FileFd::ReadOnlyGzip), + File(FileName,FileFd::ReadOnly, FileFd::Extension), Tags(&File, std::max(Cache.Head().MaxVerFileSize, Cache.Head().MaxDescFileSize) + 200) { diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 4c8d03224..5d2a67f4f 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -50,7 +50,7 @@ class debSrcRecordParser : public pkgSrcRecords::Parser virtual bool Files(std::vector &F); debSrcRecordParser(std::string const &File,pkgIndexFile const *Index) - : Parser(Index), Fd(File,FileFd::ReadOnlyGzip), Tags(&Fd,102400), + : Parser(Index), Fd(File,FileFd::ReadOnly, FileFd::Extension), Tags(&Fd,102400), Buffer(NULL) {} virtual ~debSrcRecordParser(); }; diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 65d7b0ccd..1cd5080cc 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1143,7 +1143,7 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V) return _error->Error(_("Package file %s is out of sync."),I.FileName()); FileFd PkgF; - if (PkgF.Open(I.FileName(), FileFd::ReadOnlyGzip) == false) + if (PkgF.Open(I.FileName(), FileFd::ReadOnly, FileFd::Extension) == false) return false; // Read the record diff --git a/methods/gzip.cc b/methods/gzip.cc index a51497948..6ab6548ef 100644 --- a/methods/gzip.cc +++ b/methods/gzip.cc @@ -48,7 +48,7 @@ bool GzipMethod::Fetch(FetchItem *Itm) URIStart(Res); // Open the source and destination files - FileFd From(Path,FileFd::ReadOnlyGzip); + FileFd From(Path,FileFd::ReadOnly, FileFd::Gzip); if(From.FileSize() == 0) return _error->Error(_("Empty files can't be valid archives")); diff --git a/methods/rred.cc b/methods/rred.cc index ef00fcaa3..56ad8220b 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -489,7 +489,7 @@ bool RredMethod::Fetch(FetchItem *Itm) /*{{{*/ // Open the source and destination files (the d'tor of FileFd will do // the cleanup/closing of the fds) FileFd From(Path,FileFd::ReadOnly); - FileFd Patch(Path+".ed",FileFd::ReadOnlyGzip); + FileFd Patch(Path+".ed",FileFd::ReadOnly, FileFd::Gzip); FileFd To(Itm->DestFile,FileFd::WriteAtomic); To.EraseOnFailure(); if (_error->PendingError() == true) -- cgit v1.2.3-70-g09d2 From 73688d27f60b2da3889a06362ee567101e3b331e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 15 Dec 2011 09:13:21 +0100 Subject: atleast libapt should announce to itself that it is clean… (and be it if it tries to announce that…) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apt-pkg/deb/debindexfile.cc | 2 ++ apt-pkg/edsp/edspindexfile.cc | 4 ++-- apt-pkg/pkgcachegen.cc | 16 +++++++++------- apt-pkg/sourcelist.h | 4 ++-- apt-pkg/srcrecords.cc | 8 ++++---- buildlib/config.h.in | 2 ++ cmdline/apt-extracttemplates.h | 10 ++++++---- 7 files changed, 27 insertions(+), 19 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 2635d52c8..84791a70a 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -26,6 +26,8 @@ #include /*}}}*/ +using std::string; + // SourcesIndex::debSourcesIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 5d824f9cb..482581979 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -24,7 +24,7 @@ // edspIndex::edspIndex - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -edspIndex::edspIndex(string File) : debStatusIndex(File) +edspIndex::edspIndex(std::string File) : debStatusIndex(File) { } /*}}}*/ @@ -44,7 +44,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const if (Prog != NULL) Prog->SubProgress(0,File); - if (Gen.SelectFile(File,string(),*this) == false) + if (Gen.SelectFile(File,std::string(),*this) == false) return _error->Error("Problem with SelectFile %s",File.c_str()); // Store the IMS information diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc index 9f999c41b..ec072fddd 100644 --- a/apt-pkg/pkgcachegen.cc +++ b/apt-pkg/pkgcachegen.cc @@ -35,12 +35,14 @@ #include /*}}}*/ -typedef vector::iterator FileIterator; +typedef std::vector::iterator FileIterator; template std::vector pkgCacheGenerator::Dynamic::toReMap; bool IsDuplicateDescription(pkgCache::DescIterator Desc, MD5SumValue const &CurMd5, std::string const &CurLang); +using std::string; + // CacheGenerator::pkgCacheGenerator - Constructor /*{{{*/ // --------------------------------------------------------------------- /* We set the dirty flag and make sure that is written to the disk */ @@ -1221,14 +1223,14 @@ bool pkgCacheGenerator::MakeStatusCache(pkgSourceList &List,OpProgress *Progress MMap **OutMap,bool AllowMem) { bool const Debug = _config->FindB("Debug::pkgCacheGen", false); - - vector Files; - for (vector::const_iterator i = List.begin(); + + std::vector Files; + for (std::vector::const_iterator i = List.begin(); i != List.end(); ++i) { - vector *Indexes = (*i)->GetIndexFiles(); - for (vector::const_iterator j = Indexes->begin(); + std::vector *Indexes = (*i)->GetIndexFiles(); + for (std::vector::const_iterator j = Indexes->begin(); j != Indexes->end(); ++j) Files.push_back (*j); @@ -1418,7 +1420,7 @@ __deprecated bool pkgMakeOnlyStatusCache(OpProgress &Progress,DynamicMMap **OutM { return pkgCacheGenerator::MakeOnlyStatusCache(&Progress, OutMap); } bool pkgCacheGenerator::MakeOnlyStatusCache(OpProgress *Progress,DynamicMMap **OutMap) { - vector Files; + std::vector Files; unsigned long EndOfSource = Files.size(); if (_system->AddStatusFiles(Files) == false) return false; diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h index 03e29ec34..02e27101a 100644 --- a/apt-pkg/sourcelist.h +++ b/apt-pkg/sourcelist.h @@ -59,11 +59,11 @@ class pkgSourceList const char *Name; const char *Label; - bool FixupURI(string &URI) const; + bool FixupURI(std::string &URI) const; virtual bool ParseLine(std::vector &List, const char *Buffer, unsigned long const &CurLine,std::string const &File) const; - virtual bool CreateItem(vector &List,std::string const &URI, + virtual bool CreateItem(std::vector &List,std::string const &URI, std::string const &Dist,std::string const &Section, std::map const &Options) const = 0; Type(); diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index f6d2d5158..48b643eac 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -29,8 +29,8 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0) { for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I) { - vector *Indexes = (*I)->GetIndexFiles(); - for (vector::const_iterator J = Indexes->begin(); + std::vector *Indexes = (*I)->GetIndexFiles(); + for (std::vector::const_iterator J = Indexes->begin(); J != Indexes->end(); ++J) { Parser* P = (*J)->CreateSrcParser(); @@ -58,7 +58,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0) pkgSrcRecords::~pkgSrcRecords() { // Blow away all the parser objects - for(vector::iterator I = Files.begin(); I != Files.end(); ++I) + for(std::vector::iterator I = Files.begin(); I != Files.end(); ++I) delete *I; } /*}}}*/ @@ -68,7 +68,7 @@ pkgSrcRecords::~pkgSrcRecords() bool pkgSrcRecords::Restart() { Current = Files.begin(); - for (vector::iterator I = Files.begin(); + for (std::vector::iterator I = Files.begin(); I != Files.end(); ++I) (*I)->Restart(); diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 256911231..4798fe3f5 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -44,3 +44,5 @@ /* The package name string */ #undef PACKAGE + +#define APT_8_CLEANER_HEADERS diff --git a/cmdline/apt-extracttemplates.h b/cmdline/apt-extracttemplates.h index d0f90d3f4..6d07a09c2 100644 --- a/cmdline/apt-extracttemplates.h +++ b/cmdline/apt-extracttemplates.h @@ -14,6 +14,8 @@ #include #include +#include + class DebFile : public pkgDirStream { FileFd File; @@ -31,11 +33,11 @@ public: bool Go(); bool ParseInfo(); - static string GetInstalledVer(const string &package); + static std::string GetInstalledVer(const std::string &package); - string Package; - string Version; - string DepVer, PreDepVer; + std::string Package; + std::string Version; + std::string DepVer, PreDepVer; unsigned int DepOp, PreDepOp; char *Config; -- cgit v1.2.3-70-g09d2 From e75aa33384d52635fba502bed628bc68f9cb5066 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 2 Jan 2012 15:08:58 +0100 Subject: g++ 4.7 fixes --- apt-pkg/contrib/hashsum_template.h | 2 ++ cmdline/apt-mark.cc | 1 + debian/changelog | 3 +++ 3 files changed, 6 insertions(+) (limited to 'cmdline') diff --git a/apt-pkg/contrib/hashsum_template.h b/apt-pkg/contrib/hashsum_template.h index 27d192b82..d2d9f92ed 100644 --- a/apt-pkg/contrib/hashsum_template.h +++ b/apt-pkg/contrib/hashsum_template.h @@ -15,6 +15,8 @@ #include #include +#include + template class HashSumValue { diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 339cbdf44..9a628d714 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -16,6 +16,7 @@ #include #include +#include #include /*}}}*/ diff --git a/debian/changelog b/debian/changelog index df50eefbd..e6389dd06 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,9 @@ apt (0.8.16~exp8) experimental; urgency=low - use a pointer-union to peace gcc strict-aliasing warning * apt-pkg/deb/deblistparser.cc: - M-A: foreign packages provide for other archs, too + + [ Michael Vogt ] + * g++ 4.7 fixes -- David Kalnischkies Thu, 03 Nov 2011 09:40:29 -0500 -- cgit v1.2.3-70-g09d2 From 2a2a7ef4dfa9d8fb8118c2e318555438098cdf34 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Jan 2012 18:42:57 +0100 Subject: * apt-pkg/cacheiterators.h: - return the correct version arch for all+foreign, too The flag is interpreted at a few other places in different styles so this commit ensures that the flag check is consistent everywhere (checking for Same in flag style is a bit too much as it isn't used in combination with others anyway, but who knows and just for consistency) --- apt-pkg/cacheiterators.h | 2 +- apt-pkg/deb/dpkgpm.cc | 4 ++-- apt-pkg/packagemanager.cc | 2 +- cmdline/apt-get.cc | 4 ++-- debian/changelog | 6 +++++- test/integration/framework | 9 ++++++++- test/integration/test-dpkg-assert-multi-arch | 22 +++++++++++++++++----- 7 files changed, 36 insertions(+), 13 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h index e6a0fddb0..d5e018be9 100644 --- a/apt-pkg/cacheiterators.h +++ b/apt-pkg/cacheiterators.h @@ -207,7 +207,7 @@ class pkgCache::VerIterator : public Iterator { inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}; inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}; inline const char *Arch() const { - if (S->MultiArch == pkgCache::Version::All) + if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All) return "all"; return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch; }; diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 99c28d201..2b04f0e71 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1093,9 +1093,9 @@ bool pkgDPkgPM::Go(int OutStatusFd) pkgCache::VerIterator PkgVer; std::string name = I->Pkg.Name(); if (Op == Item::Remove || Op == Item::Purge) - PkgVer = I->Pkg.CurrentVer(); + PkgVer = I->Pkg.CurrentVer(); else - PkgVer = Cache[I->Pkg].InstVerIter(Cache); + PkgVer = Cache[I->Pkg].InstVerIter(Cache); name.append(":").append(PkgVer.Arch()); char * const fullname = strdup(name.c_str()); Packages.push_back(fullname); diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index c9d7a3024..349adbe40 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -733,7 +733,7 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States); - if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same) + if (Immediate == true && (instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same) { /* Do lockstep M-A:same unpacking in two phases: First unpack all installed architectures, then the not installed. diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ca1169401..85ae1cd7e 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2872,12 +2872,12 @@ bool DoBuildDep(CommandLine &CmdL) forbidden = "Multi-Arch: same"; // :native gets the buildArch } - else if (Ver->MultiArch == pkgCache::Version::Foreign || Ver->MultiArch == pkgCache::Version::AllForeign) + else if ((Ver->MultiArch & pkgCache::Version::Foreign) == pkgCache::Version::Foreign) { if (colon != string::npos) forbidden = "Multi-Arch: foreign"; } - else if (Ver->MultiArch == pkgCache::Version::Allowed || Ver->MultiArch == pkgCache::Version::AllAllowed) + else if ((Ver->MultiArch & pkgCache::Version::Allowed) == pkgCache::Version::Allowed) { if (colon == string::npos) Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); diff --git a/debian/changelog b/debian/changelog index d8316abf6..838b14ef1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,11 @@ apt (0.8.16~exp12) experimental; urgency=low * apt-pkg/deb/dpkgpm.cc: - fix segfault on pkg removal - -- Michael Vogt Thu, 19 Jan 2012 16:28:03 +0100 + [ David Kalnischkies ] + * apt-pkg/cacheiterators.h: + - return the correct version arch for all+foreign, too + + -- David Kalnischkies Thu, 19 Jan 2012 18:38:33 +0100 apt (0.8.16~exp11) experimental; urgency=low diff --git a/test/integration/framework b/test/integration/framework index 2ea1844f0..d7526a100 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -25,7 +25,14 @@ msgnwarn() { echo -n "${CWARNING}W: $1${CNORMAL}" >&2; } msgnmsg() { echo -n "${CMSG}$1${CNORMAL}" >&2; } msgninfo() { echo -n "${CINFO}I: $1${CNORMAL}" >&2; } msgndebug() { echo -n "${CDEBUG}D: $1${CNORMAL}" >&2; } -msgtest() { echo -n "${CINFO}$1 ${CCMD}$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} …${CNORMAL} " >&2; } +msgtest() { + while [ -n "$1" ]; do + echo -n "${CINFO}$1${CCMD} " >&2; + echo -n "$(echo "$2" | sed -e 's/^aptc/apt-c/' -e 's/^aptg/apt-g/' -e 's/^aptf/apt-f/')${CINFO} " >&2; + shift 2 + done + echo -n "…${CNORMAL} " >&2; +} msgpass() { echo "${CPASS}PASS${CNORMAL}" >&2; } msgskip() { echo "${CWARNING}SKIP${CNORMAL}" >&2; } msgfail() { echo "${CFAIL}FAIL${CNORMAL}" >&2; } diff --git a/test/integration/test-dpkg-assert-multi-arch b/test/integration/test-dpkg-assert-multi-arch index 532cfd26a..177d7489b 100755 --- a/test/integration/test-dpkg-assert-multi-arch +++ b/test/integration/test-dpkg-assert-multi-arch @@ -10,13 +10,13 @@ buildsimplenativepackage 'native-pkg' 'amd64' '1.0' 'stable' buildsimplenativepackage 'foreign-pkg' 'i386' '0.5' 'stable' 'Multi-Arch: foreign' buildsimplenativepackage 'same-lib' 'amd64,i386' '0.5' 'stable' 'Multi-Arch: same' buildsimplenativepackage 'all-pkg' 'all' '2.0' 'stable' -buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' +buildsimplenativepackage 'all-foreign-pkg' 'all' '2.0' 'stable' 'Multi-Arch: foreign' setupaptarchive testqualifier() { - msgtest 'Test for correct qualifier mode' $2 - GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -e '--configure' -e '^dpkg:' | sed -e 's/^.*--configure \([^ ]*\).*$/\1/')" + msgtest 'Test with' $1 'for correct qualifier mode' $2 + GIVEN="$(aptget install $1 -qq -o Debug::pkgDPkgPM=1 2>&1 | grep -v -- '--unpack' | sed -e 's/^.*--[^u][^ ]* \([^ ]*\).*$/\1/')" if [ "$GIVEN" = "$2" ]; then msgpass else @@ -49,11 +49,17 @@ testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg' testqualifier 'all-pkg:amd64' 'all-pkg' testqualifier 'all-foreign-pkg' 'all-foreign-pkg' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg' +testqualifier 'always-all-pkg-' 'always-all-pkg' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg' # multiarch dpkg (new interface version) @@ -78,8 +84,14 @@ testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' insertinstalledpackage 'all-pkg' 'amd64' '1.0' -insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' +insertinstalledpackage 'all-foreign-pkg' 'amd64' '1.0' 'Multi-Arch: foreign' testqualifier 'all-pkg' 'all-pkg:all' testqualifier 'all-pkg:amd64' 'all-pkg:all' testqualifier 'all-foreign-pkg' 'all-foreign-pkg:all' testqualifier 'all-foreign-pkg:amd64' 'all-foreign-pkg:all' +insertinstalledpackage 'always-all-pkg' 'all' '1.0' +insertinstalledpackage 'always-all-foreign-pkg' 'all' '1.0' 'Multi-Arch: foreign' +testqualifier 'all-pkg-' 'all-pkg:amd64' +testqualifier 'all-foreign-pkg-' 'all-foreign-pkg:amd64' +testqualifier 'always-all-pkg-' 'always-all-pkg:all' +testqualifier 'always-all-foreign-pkg-' 'always-all-foreign-pkg:all' -- cgit v1.2.3-70-g09d2 From aaab10075397cb4f2ec262c5d478f7ea8acd2d23 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Jan 2012 01:02:36 +0100 Subject: fix a few esoteric cppcheck errors/warnings/infos --- apt-pkg/packagemanager.cc | 1 - cmdline/apt-get.cc | 2 +- methods/gpgv.cc | 12 ++++++++++-- methods/rred.cc | 7 ++++++- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index c32c73212..a370f15a3 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -529,7 +529,6 @@ bool pkgPackageManager::SmartRemove(PkgIterator Pkg) List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States); return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge); - return true; } /*}}}*/ // PM::SmartUnPack - Install helper /*{{{*/ diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 85ae1cd7e..2d0554e21 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1730,7 +1730,7 @@ bool DoAutomaticRemove(CacheFile &Cache) Pkg != tooMuch.end() && Changed == false; ++Pkg) { APT::PackageSet too; - too.insert(Pkg); + too.insert(*Pkg); for (pkgCache::PrvIterator Prv = Cache[Pkg].CandidateVerIter(Cache).ProvidesList(); Prv.end() == false; ++Prv) too.insert(Prv.ParentPkg()); diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 2b2aba017..25ba0d063 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -98,8 +98,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, // Read a line. Sigh. while ((c = getc(pipein)) != EOF && c != '\n') { - if (bufferoff == buffersize) - buffer = (char *) realloc(buffer, buffersize *= 2); + if (bufferoff == buffersize) + { + char* newBuffer = (char *) realloc(buffer, buffersize *= 2); + if (newBuffer == NULL) + { + free(buffer); + return "Couldn't allocate a buffer big enough for reading"; + } + buffer = newBuffer; + } *(buffer+bufferoff) = c; bufferoff++; } diff --git a/methods/rred.cc b/methods/rred.cc index e37a12ed9..1e352d0e7 100644 --- a/methods/rred.cc +++ b/methods/rred.cc @@ -333,7 +333,12 @@ RredMethod::State RredMethod::patchMMap(FileFd &Patch, FileFd &From, /*{{{*/ } if(command_count == command_alloc) { command_alloc = (command_alloc + 64) * 3 / 2; - commands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + EdCommand* newCommands = (EdCommand*) realloc(commands, command_alloc * sizeof(EdCommand)); + if (newCommands == NULL) { + free(commands); + return MMAP_FAILED; + } + commands = newCommands; } commands[command_count++] = cmd; } -- cgit v1.2.3-70-g09d2 From 737c7a7b854aa833d75994b67619c5852aa2085d Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Sun, 29 Jan 2012 13:24:17 +0100 Subject: * cmdline/apt-get.cc: - for cross-build-dependencies M-A: none should be DEB_HOST_ARCH, not DEB_BUILD_ARCH (Closes: #646288) --- cmdline/apt-get.cc | 10 ++- debian/changelog | 9 ++- .../test-bug-632221-cross-dependency-satisfaction | 87 ++++++++++++++++------ 3 files changed, 78 insertions(+), 28 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 2d0554e21..32ee46980 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2863,10 +2863,16 @@ bool DoBuildDep(CommandLine &CmdL) if ((BADVER(Ver)) == false) { string forbidden; - if (Ver->MultiArch == pkgCache::Version::None || Ver->MultiArch == pkgCache::Version::All); + if (Ver->MultiArch == pkgCache::Version::None || Ver->MultiArch == pkgCache::Version::All) + { + if (colon == string::npos) + { + Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); + } + } else if (Ver->MultiArch == pkgCache::Version::Same) { - if (colon != string::npos) + if (colon == string::npos) Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); else if (strcmp(D->Package.c_str() + colon, ":any") == 0) forbidden = "Multi-Arch: same"; diff --git a/debian/changelog b/debian/changelog index e8e659749..c3fadf8bc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,16 @@ -apt (0.8.16~exp12+nmu1) experimental; urgency=low +apt (0.8.16~exp13) UNRELEASED; urgency=low [ David Kalnischkies ] * apt-pkg/deb/dpkgpm.cc: - chroot if needed before dpkg --assert-multi-arch - ensure that dpkg binary doesn't have the chroot-directory prefixed - -- David Kalnischkies Sun, 29 Jan 2012 13:08:58 +0100 + [ Steve Langasek ] + * cmdline/apt-get.cc: + - for cross-build-dependencies M-A: none should be DEB_HOST_ARCH, + not DEB_BUILD_ARCH (Closes: #646288) + + -- David Kalnischkies Sun, 29 Jan 2012 13:14:01 +0100 apt (0.8.16~exp12) experimental; urgency=low diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 4299f052f..30df48604 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -6,43 +6,51 @@ TESTDIR=$(readlink -f $(dirname $0)) setupenvironment configarchitecture 'amd64' 'armel' -insertinstalledpackage 'build-essential' 'all' '11.5' +insertinstalledpackage 'build-essential' 'all' '11.5' 'Multi-Arch: foreign' -insertpackage 'unstable' 'doxygen' 'amd64,armel' '1.0' +insertpackage 'unstable' 'doxygen' 'amd64,armel' '1.0' 'Multi-Arch: foreign' insertpackage 'unstable' 'libc6' 'amd64,armel' '1.0' 'Multi-Arch: same' insertpackage 'unstable' 'libc6-dev' 'amd64,armel' '1.0' 'Depends: libc6 Multi-Arch: same' +insertpackage 'unstable' 'libfwibble1' 'amd64,armel' '1.0' 'Depends: libc6 +Multi-Arch: same' +insertpackage 'unstable' 'libfwibble-dev' 'amd64,armel' '1.0' 'Depends: libfwibble1' insertpackage 'unstable' 'cool' 'amd64,armel' '1.0' 'Multi-Arch: allowed' insertpackage 'unstable' 'amdboot' 'amd64' '1.0' insertpackage 'unstable' 'foreigner' 'amd64,armel' '1.0' 'Multi-Arch: foreign' -insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner' +insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev' setupaptarchive testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot cool doxygen foreigner libc6 libc6-dev -0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. + amdboot cool doxygen foreigner libc6 libc6-dev libfwibble-dev libfwibble1 +0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst cool (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst foreigner (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [amd64]) +Inst libfwibble1 (1.0 unstable [amd64]) +Inst libfwibble-dev (1.0 unstable [amd64]) Conf amdboot (1.0 unstable [amd64]) Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf foreigner (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) -Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s +Conf libc6-dev (1.0 unstable [amd64]) +Conf libfwibble1 (1.0 unstable [amd64]) +Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot cool doxygen foreigner libc6 libc6:armel libc6-dev libc6-dev:armel -0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. + libfwibble-dev:armel libfwibble1:armel +0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst cool (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) @@ -51,6 +59,8 @@ Inst libc6 (1.0 unstable [amd64]) Inst libc6:armel (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [amd64]) Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libfwibble1:armel (1.0 unstable [armel]) +Inst libfwibble-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) @@ -58,34 +68,41 @@ Conf foreigner (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) Conf libc6:armel (1.0 unstable [armel]) Conf libc6-dev (1.0 unstable [amd64]) -Conf libc6-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel +Conf libc6-dev:armel (1.0 unstable [armel]) +Conf libfwibble1:armel (1.0 unstable [armel]) +Conf libfwibble-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel configarchitecture 'armel' 'amd64' testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot:amd64 cool doxygen foreigner libc6 libc6-dev -0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded. + amdboot:amd64 cool doxygen foreigner libc6 libc6-dev libfwibble-dev + libfwibble1 +0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst foreigner (1.0 unstable [armel]) Inst libc6 (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [armel]) +Inst libfwibble1 (1.0 unstable [armel]) +Inst libfwibble-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) Conf foreigner (1.0 unstable [armel]) Conf libc6 (1.0 unstable [armel]) -Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s +Conf libc6-dev (1.0 unstable [armel]) +Conf libfwibble1 (1.0 unstable [armel]) +Conf libfwibble-dev (1.0 unstable [armel])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot:amd64 cool doxygen foreigner libc6:amd64 libc6 libc6-dev:amd64 - libc6-dev -0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded. + libc6-dev libfwibble-dev:amd64 libfwibble1:amd64 +0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) @@ -94,6 +111,8 @@ Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [armel]) Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) +Inst libfwibble1:amd64 (1.0 unstable [amd64]) +Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) @@ -101,7 +120,9 @@ Conf foreigner (1.0 unstable [armel]) Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [armel]) Conf libc6-dev:amd64 (1.0 unstable [amd64]) -Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s -a amd64 +Conf libc6-dev (1.0 unstable [armel]) +Conf libfwibble1:amd64 (1.0 unstable [amd64]) +Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 configarchitecture 'amd64' 'armel' @@ -111,34 +132,43 @@ insertinstalledpackage 'foreigner' 'armel' '0.5' testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: - amdboot doxygen libc6 libc6-dev -0 upgraded, 4 newly installed, 0 to remove and 2 not upgraded. + amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1 +0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [amd64]) +Inst libfwibble1 (1.0 unstable [amd64]) +Inst libfwibble-dev (1.0 unstable [amd64]) Conf amdboot (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) -Conf libc6-dev (1.0 unstable [amd64])' aptget build-dep apt -s +Conf libc6-dev (1.0 unstable [amd64]) +Conf libfwibble1 (1.0 unstable [amd64]) +Conf libfwibble-dev (1.0 unstable [amd64])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot doxygen libc6 libc6:armel libc6-dev libc6-dev:armel -0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. + libfwibble-dev:armel libfwibble1:armel +0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded. Inst amdboot (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [amd64]) Inst libc6:armel (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [amd64]) Inst libc6-dev:armel (1.0 unstable [armel]) +Inst libfwibble1:armel (1.0 unstable [armel]) +Inst libfwibble-dev:armel (1.0 unstable [armel]) Conf amdboot (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [amd64]) Conf libc6:armel (1.0 unstable [armel]) Conf libc6-dev (1.0 unstable [amd64]) -Conf libc6-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel +Conf libc6-dev:armel (1.0 unstable [armel]) +Conf libfwibble1:armel (1.0 unstable [armel]) +Conf libfwibble-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a armel configarchitecture 'armel' 'amd64' @@ -148,36 +178,45 @@ Building dependency tree... The following packages will be REMOVED: cool:amd64 The following NEW packages will be installed: - amdboot:amd64 cool doxygen libc6 libc6-dev -0 upgraded, 5 newly installed, 1 to remove and 1 not upgraded. + amdboot:amd64 cool doxygen libc6 libc6-dev libfwibble-dev libfwibble1 +0 upgraded, 7 newly installed, 1 to remove and 1 not upgraded. Remv cool:amd64 [0.5] Inst amdboot:amd64 (1.0 unstable [amd64]) Inst cool (1.0 unstable [armel]) Inst doxygen (1.0 unstable [armel]) Inst libc6 (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [armel]) +Inst libfwibble1 (1.0 unstable [armel]) +Inst libfwibble-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf cool (1.0 unstable [armel]) Conf doxygen (1.0 unstable [armel]) Conf libc6 (1.0 unstable [armel]) -Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s +Conf libc6-dev (1.0 unstable [armel]) +Conf libfwibble1 (1.0 unstable [armel]) +Conf libfwibble-dev (1.0 unstable [armel])' aptget build-dep apt -s testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot:amd64 doxygen libc6:amd64 libc6 libc6-dev:amd64 libc6-dev -0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded. + libfwibble-dev:amd64 libfwibble1:amd64 +0 upgraded, 8 newly installed, 0 to remove and 2 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [armel]) Inst libc6:amd64 (1.0 unstable [amd64]) Inst libc6 (1.0 unstable [armel]) Inst libc6-dev:amd64 (1.0 unstable [amd64]) Inst libc6-dev (1.0 unstable [armel]) +Inst libfwibble1:amd64 (1.0 unstable [amd64]) +Inst libfwibble-dev:amd64 (1.0 unstable [amd64]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [armel]) Conf libc6:amd64 (1.0 unstable [amd64]) Conf libc6 (1.0 unstable [armel]) Conf libc6-dev:amd64 (1.0 unstable [amd64]) -Conf libc6-dev (1.0 unstable [armel])' aptget build-dep apt -s -a amd64 +Conf libc6-dev (1.0 unstable [armel]) +Conf libfwibble1:amd64 (1.0 unstable [amd64]) +Conf libfwibble-dev:amd64 (1.0 unstable [amd64])' aptget build-dep apt -s -a amd64 -- cgit v1.2.3-70-g09d2 From 6fddb156b51b443781aa376e60e443eda09d1cad Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 10 Feb 2012 19:34:35 +0100 Subject: * cmdline/apt-mark.cc: - detect if dpkg has multiarch support before calling --set-selections --- cmdline/apt-mark.cc | 129 +++++++++++++++++++++++++++++++++++++++++++++------- debian/changelog | 4 +- 2 files changed, 115 insertions(+), 18 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index c7d9b6f6a..b067413e3 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -14,9 +14,15 @@ #include #include #include +#include #include +#include #include +#include +#include +#include +#include #include /*}}}*/ @@ -158,6 +164,56 @@ bool DoHold(CommandLine &CmdL) if (unlikely(Cache == NULL)) return false; + // Generate the base argument list for dpkg + std::vector Args; + string Tmp = _config->Find("Dir::Bin::dpkg","dpkg"); + { + string const dpkgChrootDir = _config->FindDir("DPkg::Chroot-Directory", "/"); + size_t dpkgChrootLen = dpkgChrootDir.length(); + if (dpkgChrootDir != "/" && Tmp.find(dpkgChrootDir) == 0) + { + if (dpkgChrootDir[dpkgChrootLen - 1] == '/') + --dpkgChrootLen; + Tmp = Tmp.substr(dpkgChrootLen); + } + } + Args.push_back(Tmp.c_str()); + + // Stick in any custom dpkg options + Configuration::Item const *Opts = _config->Tree("DPkg::Options"); + if (Opts != 0) + { + Opts = Opts->Child; + for (; Opts != 0; Opts = Opts->Next) + { + if (Opts->Value.empty() == true) + continue; + Args.push_back(Opts->Value.c_str()); + } + } + + size_t const BaseArgs = Args.size(); + // we need to detect if we can qualify packages with the architecture or not + Args.push_back("--assert-multi-arch"); + Args.push_back(NULL); + + + pid_t dpkgAssertMultiArch = ExecFork(); + if (dpkgAssertMultiArch == 0) + { + std::string const chrootDir = _config->FindDir("DPkg::Chroot-Directory"); + if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0) + _error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --assert-multi-arch", chrootDir.c_str()); + // redirect everything to the ultimate sink as we only need the exit-status + int const nullfd = open("/dev/null", O_RDONLY); + dup2(nullfd, STDIN_FILENO); + dup2(nullfd, STDOUT_FILENO); + dup2(nullfd, STDERR_FILENO); + execvp(Args[0], (char**) &Args[0]); + _error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!"); + _exit(2); + } + APT::PackageList pkgset = APT::PackageList::FromCommandLine(CacheFile, CmdL.FileList + 1); if (pkgset.empty() == true) return _error->Error(_("No packages found")); @@ -177,6 +233,21 @@ bool DoHold(CommandLine &CmdL) } } + bool dpkgMultiArch = false; + if (dpkgAssertMultiArch > 0) + { + int Status = 0; + while (waitpid(dpkgAssertMultiArch, &Status, 0) != dpkgAssertMultiArch) + { + if (errno == EINTR) + continue; + _error->WarningE("dpkgGo", _("Waited for %s but it wasn't there"), "dpkg --assert-multi-arch"); + break; + } + if (WIFEXITED(Status) == true && WEXITSTATUS(Status) == 0) + dpkgMultiArch = true; + } + if (pkgset.empty() == true) return true; @@ -192,36 +263,60 @@ bool DoHold(CommandLine &CmdL) return true; } - string dpkgcall = _config->Find("Dir::Bin::dpkg", "dpkg"); - std::vector const dpkgoptions = _config->FindVector("DPkg::options"); - for (std::vector::const_iterator o = dpkgoptions.begin(); - o != dpkgoptions.end(); ++o) - dpkgcall.append(" ").append(*o); - dpkgcall.append(" --set-selections"); - FILE *dpkg = popen(dpkgcall.c_str(), "w"); - if (dpkg == NULL) - return _error->Errno("DoHold", "fdopen on dpkg stdin failed"); + Args.erase(Args.begin() + BaseArgs, Args.end()); + Args.push_back("--set-selections"); + Args.push_back(NULL); + + int external[2] = {-1, -1}; + if (pipe(external) != 0) + return _error->WarningE("DoHold", "Can't create IPC pipe for dpkg --set-selections"); + + pid_t dpkgSelection = ExecFork(); + if (dpkgSelection == 0) + { + close(external[1]); + std::string const chrootDir = _config->FindDir("DPkg::Chroot-Directory"); + if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0) + _error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --set-selections", chrootDir.c_str()); + int const nullfd = open("/dev/null", O_RDONLY); + dup2(nullfd, STDIN_FILENO); + dup2(external[0], STDOUT_FILENO); + dup2(nullfd, STDERR_FILENO); + execvp(Args[0], (char**) &Args[0]); + _error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!"); + _exit(2); + } + FILE* dpkg = fdopen(external[1], "w"); for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) { if (MarkHold == true) { - fprintf(dpkg, "%s hold\n", Pkg.FullName(true).c_str()); + fprintf(dpkg, "%s hold\n", Pkg.FullName(!dpkgMultiArch).c_str()); ioprintf(c1out,_("%s set on hold.\n"), Pkg.FullName(true).c_str()); } else { - fprintf(dpkg, "%s install\n", Pkg.FullName(true).c_str()); + fprintf(dpkg, "%s install\n", Pkg.FullName(!dpkgMultiArch).c_str()); ioprintf(c1out,_("Canceled hold on %s.\n"), Pkg.FullName(true).c_str()); } } + fclose(dpkg); - int const status = pclose(dpkg); - if (status == -1) - return _error->Errno("DoHold", "dpkg execution failed in the end"); - if (WIFEXITED(status) == false || WEXITSTATUS(status) != 0) - return _error->Error(_("Executing dpkg failed. Are you root?")); - return true; + if (dpkgSelection > 0) + { + int Status = 0; + while (waitpid(dpkgSelection, &Status, 0) != dpkgSelection) + { + if (errno == EINTR) + continue; + _error->WarningE("dpkgGo", _("Waited for %s but it wasn't there"), "dpkg --set-selection"); + break; + } + if (WIFEXITED(Status) == true && WEXITSTATUS(Status) == 0) + return true; + } + return _error->Error(_("Executing dpkg failed. Are you root?")); } /*}}}*/ /* ShowHold - show packages set on hold in dpkg status {{{*/ diff --git a/debian/changelog b/debian/changelog index 8f550cdae..fa8f396eb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/aptconfiguration.cc: - chroot if needed before calling dpkg --print-foreign-architectures - ensure that architectures are not added multiple times + * cmdline/apt-mark.cc: + - detect if dpkg has multiarch support before calling --set-selections [ Steve Langasek ] * cmdline/apt-get.cc: @@ -39,7 +41,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Fri, 10 Feb 2012 15:00:10 +0100 + -- David Kalnischkies Fri, 10 Feb 2012 19:33:38 +0100 apt (0.8.16~exp12) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From 5eb9a474dca2f48a935c234357c3adc9b372423e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 11 Feb 2012 18:54:48 +0100 Subject: correctly ignore already (un)hold packages --- apt-pkg/cacheset.h | 8 ++++++++ cmdline/apt-mark.cc | 7 ++++--- debian/changelog | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h index 91d7eec1c..6f0a0e358 100644 --- a/apt-pkg/cacheset.h +++ b/apt-pkg/cacheset.h @@ -191,6 +191,8 @@ public: /*{{{*/ inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; } inline bool operator!=(iterator const &i) const { return _iter != i._iter; }; inline bool operator==(iterator const &i) const { return _iter == i._iter; }; + inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }; + inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }; friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } }; /*}}}*/ @@ -201,7 +203,9 @@ public: /*{{{*/ bool empty() const { return _cont.empty(); }; void clear() { return _cont.clear(); }; + //FIXME: on ABI break, replace the first with the second without bool void erase(iterator position) { _cont.erase((typename Container::iterator)position); }; + iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }; size_t erase(const pkgCache::PkgIterator x) { return _cont.erase(x); }; void erase(iterator first, iterator last) { _cont.erase(first, last); }; size_t size() const { return _cont.size(); }; @@ -507,6 +511,8 @@ public: /*{{{*/ inline iterator operator++(int) { iterator tmp(*this); operator++(); return tmp; } inline bool operator!=(iterator const &i) const { return _iter != i._iter; }; inline bool operator==(iterator const &i) const { return _iter == i._iter; }; + inline iterator& operator=(iterator const &i) { _iter = i._iter; return *this; }; + inline iterator& operator=(typename Container::iterator const &i) { _iter = i; return *this; }; friend std::ostream& operator<<(std::ostream& out, iterator i) { return operator<<(out, *i); } }; /*}}}*/ @@ -516,7 +522,9 @@ public: /*{{{*/ void insert(const_iterator begin, const_iterator end) { _cont.insert(begin, end); }; bool empty() const { return _cont.empty(); }; void clear() { return _cont.clear(); }; + //FIXME: on ABI break, replace the first with the second without bool void erase(iterator position) { _cont.erase((typename Container::iterator)position); }; + iterator& erase(iterator &position, bool) { return position = _cont.erase((typename Container::iterator)position); }; size_t erase(const pkgCache::VerIterator x) { return _cont.erase(x); }; void erase(iterator first, iterator last) { _cont.erase(first, last); }; size_t size() const { return _cont.size(); }; diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index b067413e3..fa4134a20 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -220,7 +220,7 @@ bool DoHold(CommandLine &CmdL) bool const MarkHold = strcasecmp(CmdL.FileList[0],"hold") == 0; - for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end(); ++Pkg) + for (APT::PackageList::iterator Pkg = pkgset.begin(); Pkg != pkgset.end();) { if ((Pkg->SelectedState == pkgCache::State::Hold) == MarkHold) { @@ -228,9 +228,10 @@ bool DoHold(CommandLine &CmdL) ioprintf(c1out,_("%s was already set on hold.\n"), Pkg.FullName(true).c_str()); else ioprintf(c1out,_("%s was already not hold.\n"), Pkg.FullName(true).c_str()); - pkgset.erase(Pkg); - continue; + Pkg = pkgset.erase(Pkg, true); } + else + ++Pkg; } bool dpkgMultiArch = false; diff --git a/debian/changelog b/debian/changelog index fa8f396eb..d1a3354d0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - ensure that architectures are not added multiple times * cmdline/apt-mark.cc: - detect if dpkg has multiarch support before calling --set-selections + - correctly ignore already (un)hold packages [ Steve Langasek ] * cmdline/apt-get.cc: @@ -41,7 +42,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Fri, 10 Feb 2012 19:33:38 +0100 + -- David Kalnischkies Sat, 11 Feb 2012 18:54:11 +0100 apt (0.8.16~exp12) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From 5834d7a103cb8b68cd6eb072b4b789ca679a2d71 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 11 Feb 2012 19:46:52 +0100 Subject: fix the hold-testcase as it has problems with 'foreign' operations --- cmdline/apt-mark.cc | 4 +-- ...ages-bug-64141-install-dependencies-for-on-hold | 42 ---------------------- test/integration/framework | 2 +- ...atus-bug-64141-install-dependencies-for-on-hold | 33 ----------------- ...test-bug-64141-install-dependencies-for-on-hold | 20 ++++++++--- 5 files changed, 18 insertions(+), 83 deletions(-) delete mode 100644 test/integration/Packages-bug-64141-install-dependencies-for-on-hold delete mode 100644 test/integration/status-bug-64141-install-dependencies-for-on-hold (limited to 'cmdline') diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index fa4134a20..ef4331714 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -280,8 +280,8 @@ bool DoHold(CommandLine &CmdL) if (chrootDir != "/" && chroot(chrootDir.c_str()) != 0) _error->WarningE("getArchitecture", "Couldn't chroot into %s for dpkg --set-selections", chrootDir.c_str()); int const nullfd = open("/dev/null", O_RDONLY); - dup2(nullfd, STDIN_FILENO); - dup2(external[0], STDOUT_FILENO); + dup2(external[0], STDIN_FILENO); + dup2(nullfd, STDOUT_FILENO); dup2(nullfd, STDERR_FILENO); execvp(Args[0], (char**) &Args[0]); _error->WarningE("dpkgGo", "Can't detect if dpkg supports multi-arch!"); diff --git a/test/integration/Packages-bug-64141-install-dependencies-for-on-hold b/test/integration/Packages-bug-64141-install-dependencies-for-on-hold deleted file mode 100644 index 7005fa4f4..000000000 --- a/test/integration/Packages-bug-64141-install-dependencies-for-on-hold +++ /dev/null @@ -1,42 +0,0 @@ -Package: apt -Priority: important -Section: admin -Installed-Size: 6048 -Maintainer: APT Development Team -Architecture: i386 -Version: 0.8.10 -Provides: libapt-pkg4.10 -Depends: libc6 (>= 2.10), libdb4.8 -Breaks: oldcrap -Filename: pool/main/a/apt/apt_0.8.10_i386.deb -Size: 2160758 -MD5sum: 5aa2234f7b91056d430669cddf6e6e50 -Description: Advanced front-end for dpkg - -Package: libc6 -Priority: required -Section: libs -Installed-Size: 9356 -Maintainer: GNU Libc Maintainers -Architecture: i386 -Source: eglibc -Version: 2.11.2-7 -Provides: glibc-2.11-1 -Filename: pool/main/e/eglibc/libc6_2.11.2-7_i386.deb -Size: 3880868 -MD5sum: c48fd2854fc62125824267d086600793 -Description: Embedded GNU C Library: Shared libraries - -Package: libdb4.8 -Priority: standard -Section: libs -Installed-Size: 1488 -Maintainer: Clint Adams -Architecture: i386 -Source: db4.8 -Version: 4.8.30-3 -Depends: libc6 (>= 2.3.6-6~) -Filename: pool/main/d/db4.8/libdb4.8_4.8.30-3_i386.deb -Size: 681988 -MD5sum: 0d58c15898a95436d2ec480aa22693ff -Description: Berkeley v4.8 Database Libraries [runtime] diff --git a/test/integration/framework b/test/integration/framework index 9f741877a..350ee112e 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -166,7 +166,7 @@ getarchitecture() { if [ -n "$ARCH" ]; then echo $ARCH else - dpkg-architecture -qDEB_BUILD_ARCH + dpkg --print-architecture fi else echo $1 diff --git a/test/integration/status-bug-64141-install-dependencies-for-on-hold b/test/integration/status-bug-64141-install-dependencies-for-on-hold deleted file mode 100644 index c82ebd19c..000000000 --- a/test/integration/status-bug-64141-install-dependencies-for-on-hold +++ /dev/null @@ -1,33 +0,0 @@ -Package: apt -Status: install ok installed -Priority: important -Section: admin -Installed-Size: 6048 -Maintainer: APT Development Team -Architecture: i386 -Version: 0.8.9 -Provides: libapt-pkg4.10 -Depends: libc6 (>= 2.3.4) -Description: Advanced front-end for dpkg - -Package: libc6 -Status: install ok installed -Priority: required -Section: libs -Installed-Size: 9356 -Maintainer: GNU Libc Maintainers -Architecture: i386 -Source: eglibc -Version: 2.3.5-7 -Provides: glibc-2.11-1 -Description: Embedded GNU C Library: Shared libraries - -Package: oldcrap -Status: install ok installed -Priority: extra -Section: oldlibs -Installed-Size: 1 -Maintainer: Joe Sixpack -Architecture: all -Version: 1-1 -Description: Old crappy nothing package diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold index 4633ffcc3..e2d206fdd 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -4,7 +4,19 @@ set -e TESTDIR=$(readlink -f $(dirname $0)) . $TESTDIR/framework setupenvironment -configarchitecture "i386" +configarchitecture 'native' 'strange-arch' + +insertpackage 'unstable' 'unrelated' 'strange-arch' '1' + +insertinstalledpackage 'apt' 'native' '0.8.9' 'Depends: libc6 (>= 2.3.4)' +insertinstalledpackage 'libc6' 'native' '2.4.1-1' +insertinstalledpackage 'oldcrap' 'all' '1-1' + +insertpackage 'unstable' 'apt' 'native' '0.8.10' 'Depends: libc6 (>= 2.10), libdb4.8 +Breaks: oldcrap' +insertpackage 'unstable' 'libc6' 'native' '2.11.2-7' +insertpackage 'unstable' 'libdb4.8' 'native' '4.8.30-3' + setupaptarchive testequal 'Reading package lists... @@ -16,11 +28,10 @@ The following NEW packages will be installed: The following packages will be upgraded: apt libc6 2 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. -Need to get 0 B/6724 kB of archives. -After this operation, 1523 kB of additional disk space will be used. +After this operation, 0 B of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only -echo 'apt hold' | dpkg --set-selections +aptmark hold apt -qq testequal 'Reading package lists... Building dependency tree... @@ -29,6 +40,5 @@ The following packages have been kept back: The following packages will be upgraded: libc6 1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. -Need to get 0 B/3881 kB of archives. After this operation, 0 B of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only -o Test='hold-back-apt' -- cgit v1.2.3-70-g09d2 From 0c73b84b001028338c0862c045c0cc4e6b191fcb Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 20:44:31 +0100 Subject: * cmdline/apt-get.cc: - if a package can't be removed as it is not installed, suggest to the user an (installed) multiarch silbing with 'Did you mean?' --- cmdline/apt-get.cc | 18 +++++- debian/changelog | 5 +- .../test-suggest-installed-multiarch-silbing | 66 ++++++++++++++++++++++ 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100755 test/integration/test-suggest-installed-multiarch-silbing (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 32ee46980..42a3929d6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -904,7 +904,23 @@ struct TryToRemove { if ((Pkg->CurrentVer == 0 && PurgePkgs == false) || (PurgePkgs == true && Pkg->CurrentState == pkgCache::State::NotInstalled)) { - ioprintf(c1out,_("Package %s is not installed, so not removed\n"),Pkg.FullName(true).c_str()); + pkgCache::GrpIterator Grp = Pkg.Group(); + pkgCache::PkgIterator P = Grp.PackageList(); + for (; P.end() != true; P = Grp.NextPkg(P)) + { + if (P == Pkg) + continue; + if (P->CurrentVer != 0 || (PurgePkgs == true && P->CurrentState != pkgCache::State::NotInstalled)) + { + // TRANSLATORS: Note, this is not an interactive question + ioprintf(c1out,_("Package '%s' is not installed, so not removed. Did you mean '%s'?\n"), + Pkg.FullName(true).c_str(), P.FullName(true).c_str()); + break; + } + } + if (P.end() == true) + ioprintf(c1out,_("Package '%s' is not installed, so not removed\n"),Pkg.FullName(true).c_str()); + // MarkInstall refuses to install packages on hold Pkg->SelectedState = pkgCache::State::Hold; } diff --git a/debian/changelog b/debian/changelog index 9e23311b6..d06e48dbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,9 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low - use pdiff for Translation-* files if available (Closes: #657902) * ftparchive/writer.cc: - add 'Translation-*' to the default patterns + * cmdline/apt-get.cc: + - if a package can't be removed as it is not installed, suggest to + the user an (installed) multiarch silbing with 'Did you mean?' [ Steve Langasek ] * cmdline/apt-get.cc: @@ -55,7 +58,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Sat, 18 Feb 2012 19:44:16 +0100 + -- David Kalnischkies Sat, 18 Feb 2012 20:41:32 +0100 apt (0.8.16~exp12) experimental; urgency=low diff --git a/test/integration/test-suggest-installed-multiarch-silbing b/test/integration/test-suggest-installed-multiarch-silbing new file mode 100755 index 000000000..ca6d7bd2e --- /dev/null +++ b/test/integration/test-suggest-installed-multiarch-silbing @@ -0,0 +1,66 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' 'armel' + +insertinstalledpackage 'foo' 'i386' '1' +insertpackage 'unstable' 'foo' 'amd64,i386' '1' + +insertinstalledpackage 'foo2' 'i386' '1' +insertpackage 'unstable' 'foo2' 'i386' '1' + +insertinstalledpackage 'foo3' 'amd64' '1' +insertpackage 'unstable' 'foo3' 'amd64,i386' '1' + +insertinstalledpackage 'samefoo' 'i386,amd64' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'samefoo' 'amd64,i386,armel' '1' 'Multi-Arch: same' + +insertinstalledpackage 'samefoo2' 'i386' '1' 'Multi-Arch: same' +insertpackage 'unstable' 'samefoo2' 'amd64,i386,armel' '1' 'Multi-Arch: same' + +setupaptarchive + +testequal "Reading package lists... +Building dependency tree... +Package 'foo' is not installed, so not removed. Did you mean 'foo:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove foo -s + +testequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + foo2:i386 +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv foo2:i386 [1]" aptget remove foo2 -s + +testequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + foo3 +0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. +Remv foo3 [1]" aptget remove foo3 -s + +testequal "Reading package lists... +Building dependency tree... +Package 'foo3:i386' is not installed, so not removed. Did you mean 'foo3'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove foo3:i386 -s + +testequalor2 "Reading package lists... +Building dependency tree... +Package 'samefoo:armel' is not installed, so not removed. Did you mean 'samefoo'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." "Reading package lists... +Building dependency tree... +Package 'samefoo:armel' is not installed, so not removed. Did you mean 'samefoo:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo:armel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'samefoo2' is not installed, so not removed. Did you mean 'samefoo2:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2 -s + +testequal "Reading package lists... +Building dependency tree... +Package 'samefoo2:armel' is not installed, so not removed. Did you mean 'samefoo2:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2:armel -s -- cgit v1.2.3-70-g09d2 From ca5e41fdced7a5566b07dfc2d6adc67d74fa2d93 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 18 Feb 2012 21:20:57 +0100 Subject: improve 'error' message for packages which are only referenced e.g. in a Depends line and are now requested for removal --- cmdline/apt-get.cc | 31 ++++++++++++++++++---- debian/changelog | 4 ++- .../test-suggest-installed-multiarch-silbing | 14 ++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 42a3929d6..f4ad75d1c 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -713,11 +713,32 @@ public: } virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) { - APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::NEWEST); - if (verset.empty() == false) - return *(verset.begin()); - if (ShowError == true) - ioprintf(out, _("Virtual packages like '%s' can't be removed\n"), Pkg.FullName(true).c_str()); + if (Pkg->ProvidesList != 0) + { + APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::NEWEST); + if (verset.empty() == false) + return *(verset.begin()); + if (ShowError == true) + ioprintf(out, _("Virtual packages like '%s' can't be removed\n"), Pkg.FullName(true).c_str()); + } + else + { + pkgCache::GrpIterator Grp = Pkg.Group(); + pkgCache::PkgIterator P = Grp.PackageList(); + for (; P.end() != true; P = Grp.NextPkg(P)) + { + if (P == Pkg) + continue; + if (P->CurrentVer != 0) { + // TRANSLATORS: Note, this is not an interactive question + ioprintf(c1out,_("Package '%s' is not installed, so not removed. Did you mean '%s'?\n"), + Pkg.FullName(true).c_str(), P.FullName(true).c_str()); + break; + } + } + if (P.end() == true) + ioprintf(c1out,_("Package '%s' is not installed, so not removed\n"),Pkg.FullName(true).c_str()); + } return pkgCache::VerIterator(Cache, 0); } diff --git a/debian/changelog b/debian/changelog index d06e48dbb..b62bd3aef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -36,6 +36,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * cmdline/apt-get.cc: - if a package can't be removed as it is not installed, suggest to the user an (installed) multiarch silbing with 'Did you mean?' + - improve 'error' message for packages which are only referenced + e.g. in a Depends line and are now requested for removal [ Steve Langasek ] * cmdline/apt-get.cc: @@ -58,7 +60,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Sat, 18 Feb 2012 20:41:32 +0100 + -- David Kalnischkies Sat, 18 Feb 2012 21:19:25 +0100 apt (0.8.16~exp12) experimental; urgency=low diff --git a/test/integration/test-suggest-installed-multiarch-silbing b/test/integration/test-suggest-installed-multiarch-silbing index ca6d7bd2e..d55d250aa 100755 --- a/test/integration/test-suggest-installed-multiarch-silbing +++ b/test/integration/test-suggest-installed-multiarch-silbing @@ -21,6 +21,10 @@ insertpackage 'unstable' 'samefoo' 'amd64,i386,armel' '1' 'Multi-Arch: same' insertinstalledpackage 'samefoo2' 'i386' '1' 'Multi-Arch: same' insertpackage 'unstable' 'samefoo2' 'amd64,i386,armel' '1' 'Multi-Arch: same' +insertinstalledpackage 'mozplugger' 'i386' '1' 'Depends: iceweasel | fireweasel' +insertinstalledpackage 'fireweasel' 'i386' '1' +insertpackage 'unstable' 'mozplugger' 'i386,amd64' '1' 'Depends: iceweasel | fireweasel' + setupaptarchive testequal "Reading package lists... @@ -64,3 +68,13 @@ testequal "Reading package lists... Building dependency tree... Package 'samefoo2:armel' is not installed, so not removed. Did you mean 'samefoo2:i386'? 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove samefoo2:armel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'iceweasel' is not installed, so not removed +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove iceweasel -s + +testequal "Reading package lists... +Building dependency tree... +Package 'fireweasel' is not installed, so not removed. Did you mean 'fireweasel:i386'? +0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget remove fireweasel:amd64 -s -- cgit v1.2.3-70-g09d2 From 73edfd42d957468168551cf5a2927b7153961446 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 25 Feb 2012 19:44:55 +0100 Subject: * cmdline/apt-cache.cc: - correct --pre-depends option by using dash consistently (LP: #940837) --- cmdline/apt-cache.cc | 2 +- debian/changelog | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 1cd5080cc..94654ffd4 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1739,7 +1739,7 @@ int main(int argc,const char *argv[]) /*{{{*/ {'c',"config-file",0,CommandLine::ConfigFile}, {'o',"option",0,CommandLine::ArbItem}, {0,"installed","APT::Cache::Installed",0}, - {0,"pre-depends","APT::Cache::ShowPreDepends",0}, + {0,"pre-depends","APT::Cache::ShowPre-Depends",0}, {0,"depends","APT::Cache::ShowDepends",0}, {0,"recommends","APT::Cache::ShowRecommends",0}, {0,"suggests","APT::Cache::ShowSuggests",0}, diff --git a/debian/changelog b/debian/changelog index b62bd3aef..07878af36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,6 +38,8 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low the user an (installed) multiarch silbing with 'Did you mean?' - improve 'error' message for packages which are only referenced e.g. in a Depends line and are now requested for removal + * cmdline/apt-cache.cc: + - correct --pre-depends option by using dash consistently (LP: #940837) [ Steve Langasek ] * cmdline/apt-get.cc: @@ -60,7 +62,7 @@ apt (0.8.16~exp13) UNRELEASED; urgency=low * apt-pkg/contrib/fileutl.h: - fix compat with FileFd::OpenDescriptor() in ReadOnlyGzip mode - -- David Kalnischkies Sat, 18 Feb 2012 21:19:25 +0100 + -- David Kalnischkies Sat, 25 Feb 2012 19:43:04 +0100 apt (0.8.16~exp12) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From dcaa1185506986142bccd990a5dca4c6ec1228cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 4 Mar 2012 23:47:05 +0100 Subject: fix a bunch of cppcheck "(warning) Member variable '<#>' is not initialized in the constructor." messages (no functional change) --- apt-pkg/acquire.cc | 2 +- apt-pkg/algorithms.cc | 2 +- apt-pkg/cachefile.cc | 2 +- apt-pkg/cachefilter.cc | 2 +- apt-pkg/deb/dpkgpm.cc | 4 +++- apt-pkg/orderlist.cc | 14 ++++++-------- apt-pkg/packagemanager.cc | 11 +++++------ apt-pkg/pkgrecords.cc | 2 +- apt-pkg/pkgsystem.cc | 4 ++-- apt-pkg/sourcelist.cc | 2 +- apt-pkg/srcrecords.cc | 2 +- apt-pkg/tagfile.cc | 5 ++++- apt-pkg/version.cc | 4 ++-- cmdline/acqprogress.cc | 3 ++- cmdline/apt-extracttemplates.cc | 4 ++-- ftparchive/cachedb.h | 5 +++-- methods/ftp.cc | 1 + methods/http.h | 7 ++++--- methods/rsh.cc | 4 +++- 19 files changed, 44 insertions(+), 36 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc index cdc3fba4b..573a85c2f 100644 --- a/apt-pkg/acquire.cc +++ b/apt-pkg/acquire.cc @@ -766,7 +766,7 @@ void pkgAcquire::Queue::Bump() // AcquireStatus::pkgAcquireStatus - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgAcquireStatus::pkgAcquireStatus() : Update(true), MorePulses(false) +pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Update(true), MorePulses(false) { Start(); } diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index c337ace87..ed3534f0d 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -471,7 +471,7 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache) // ProblemResolver::pkgProblemResolver - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : Cache(*pCache) +pkgProblemResolver::pkgProblemResolver(pkgDepCache *pCache) : d(NULL), Cache(*pCache) { // Allocate memory unsigned long Size = Cache.Head().PackageCount; diff --git a/apt-pkg/cachefile.cc b/apt-pkg/cachefile.cc index f852542e5..7c2276185 100644 --- a/apt-pkg/cachefile.cc +++ b/apt-pkg/cachefile.cc @@ -30,7 +30,7 @@ // CacheFile::CacheFile - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgCacheFile::pkgCacheFile() : Map(NULL), Cache(NULL), DCache(NULL), +pkgCacheFile::pkgCacheFile() : d(NULL), Map(NULL), Cache(NULL), DCache(NULL), SrcList(NULL), Policy(NULL) { } diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc index 210a9a9ab..9ec3fa699 100644 --- a/apt-pkg/cachefilter.cc +++ b/apt-pkg/cachefilter.cc @@ -18,7 +18,7 @@ /*}}}*/ namespace APT { namespace CacheFilter { -PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) {/*{{{*/ +PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) : d(NULL) {/*{{{*/ pattern = new regex_t; int const Res = regcomp(pattern, Pattern.c_str(), REG_EXTENDED | REG_ICASE | REG_NOSUB); if (Res == 0) diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 8aea2e1c8..469132634 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -51,8 +51,10 @@ using namespace std; class pkgDPkgPMPrivate { public: - pkgDPkgPMPrivate() : dpkgbuf_pos(0), term_out(NULL), history_out(NULL) + pkgDPkgPMPrivate() : stdin_is_dev_null(false), dpkgbuf_pos(0), + term_out(NULL), history_out(NULL) { + dpkgbuf[0] = '\0'; } bool stdin_is_dev_null; // the buffer we use for the dpkg status-fd reading diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index 0ac9a83e3..3a179b2a2 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -82,16 +82,14 @@ pkgOrderList *pkgOrderList::Me = 0; // OrderList::pkgOrderList - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache) +pkgOrderList::pkgOrderList(pkgDepCache *pCache) : Cache(*pCache), + Primary(NULL), Secondary(NULL), + RevDepends(NULL), Remove(NULL), + AfterEnd(NULL), FileList(NULL), + LoopCount(-1), Depth(0) { - FileList = 0; - Primary = 0; - Secondary = 0; - RevDepends = 0; - Remove = 0; - LoopCount = -1; Debug = _config->FindB("Debug::pkgOrderList",false); - + /* Construct the arrays, egcs 1.0.1 bug requires the package count hack */ unsigned long Size = Cache.Head().PackageCount; diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 05eb1a06b..5b5961aca 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -36,11 +36,13 @@ bool pkgPackageManager::SigINTStop = false; // PM::PackageManager - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache) +pkgPackageManager::pkgPackageManager(pkgDepCache *pCache) : Cache(*pCache), + List(NULL), Res(Incomplete) { FileNames = new string[Cache.Head().PackageCount]; - List = 0; Debug = _config->FindB("Debug::pkgPackageManager",false); + NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true); + ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false); } /*}}}*/ // PM::PackageManager - Destructor /*{{{*/ @@ -169,10 +171,7 @@ bool pkgPackageManager::CreateOrderList() delete List; List = new pkgOrderList(&Cache); - - NoImmConfigure = !_config->FindB("APT::Immediate-Configure",true); - ImmConfigureAll = _config->FindB("APT::Immediate-Configure-All",false); - + if (Debug && ImmConfigureAll) clog << "CreateOrderList(): Adding Immediate flag for all packages because of APT::Immediate-Configure-All" << endl; diff --git a/apt-pkg/pkgrecords.cc b/apt-pkg/pkgrecords.cc index c5b3bebd7..36dab3480 100644 --- a/apt-pkg/pkgrecords.cc +++ b/apt-pkg/pkgrecords.cc @@ -22,7 +22,7 @@ // Records::pkgRecords - Constructor /*{{{*/ // --------------------------------------------------------------------- /* This will create the necessary structures to access the status files */ -pkgRecords::pkgRecords(pkgCache &Cache) : Cache(Cache), +pkgRecords::pkgRecords(pkgCache &Cache) : d(NULL), Cache(Cache), Files(Cache.HeaderP->PackageFileCount) { for (pkgCache::PkgFileIterator I = Cache.FileBegin(); diff --git a/apt-pkg/pkgsystem.cc b/apt-pkg/pkgsystem.cc index f61c140fa..05ba6e0e6 100644 --- a/apt-pkg/pkgsystem.cc +++ b/apt-pkg/pkgsystem.cc @@ -26,11 +26,11 @@ unsigned long pkgSystem::GlobalListLen = 0; // System::pkgSystem - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Add it to the global list.. */ -pkgSystem::pkgSystem() +pkgSystem::pkgSystem() : Label(NULL), VS(NULL) { assert(GlobalListLen < sizeof(SysList)/sizeof(*SysList)); SysList[GlobalListLen] = this; - GlobalListLen++; + ++GlobalListLen; } /*}}}*/ // System::GetSystem - Get the named system /*{{{*/ diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index f5f458099..0fddfb451 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -33,7 +33,7 @@ unsigned long pkgSourceList::Type::GlobalListLen = 0; // Type::Type - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Link this to the global list of items*/ -pkgSourceList::Type::Type() +pkgSourceList::Type::Type() : Name(NULL), Label(NULL) { ItmList[GlobalListLen] = this; GlobalListLen++; diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index 48b643eac..d63d2c422 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -25,7 +25,7 @@ // SrcRecords::pkgSrcRecords - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Open all the source index files */ -pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0) +pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0) { for (pkgSourceList::const_iterator I = List.begin(); I != List.end(); ++I) { diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc index ec86173df..79811899a 100644 --- a/apt-pkg/tagfile.cc +++ b/apt-pkg/tagfile.cc @@ -30,7 +30,10 @@ using std::string; class pkgTagFilePrivate { public: - pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Size(Size) + pkgTagFilePrivate(FileFd *pFd, unsigned long long Size) : Fd(*pFd), Buffer(NULL), + Start(NULL), End(NULL), + Done(false), iOffset(0), + Size(Size) { } FileFd &Fd; diff --git a/apt-pkg/version.cc b/apt-pkg/version.cc index a9d4fb763..cb2c34c0f 100644 --- a/apt-pkg/version.cc +++ b/apt-pkg/version.cc @@ -23,10 +23,10 @@ unsigned long pkgVersioningSystem::GlobalListLen = 0; // pkgVS::pkgVersioningSystem - Constructor /*{{{*/ // --------------------------------------------------------------------- /* Link to the global list of versioning systems supported */ -pkgVersioningSystem::pkgVersioningSystem() +pkgVersioningSystem::pkgVersioningSystem() : Label(NULL) { VSList[GlobalListLen] = this; - GlobalListLen++; + ++GlobalListLen; } /*}}}*/ // pkgVS::GetVS - Find a VS by name /*{{{*/ diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index 1ccb08804..3ac350aca 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -31,8 +31,9 @@ using namespace std; // --------------------------------------------------------------------- /* */ AcqTextStatus::AcqTextStatus(unsigned int &ScreenWidth,unsigned int Quiet) : - ScreenWidth(ScreenWidth), Quiet(Quiet) + ScreenWidth(ScreenWidth), ID(0), Quiet(Quiet) { + BlankLine[0] = 0; } /*}}}*/ // AcqTextStatus::Start - Downloading has started /*{{{*/ diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index d5c1a3208..dc4c110a1 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -53,8 +53,8 @@ pkgCache *DebFile::Cache = 0; // --------------------------------------------------------------------- /* */ DebFile::DebFile(const char *debfile) - : File(debfile, FileFd::ReadOnly), Control(0), DepOp(0), - PreDepOp(0), Config(0), Template(0), Which(None) + : File(debfile, FileFd::ReadOnly), Size(0), Control(NULL), ControlLen(0), + DepOp(0), PreDepOp(0), Config(0), Template(0), Which(None) { } /*}}}*/ diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h index 377c41607..b9ced9418 100644 --- a/ftparchive/cachedb.h +++ b/ftparchive/cachedb.h @@ -126,7 +126,8 @@ class CacheDB Misses += S.Misses; DeLinkBytes += S.DeLinkBytes; }; - Stats() : Bytes(0), MD5Bytes(0), SHA1Bytes(0), SHA256Bytes(0), Packages(0), Misses(0), DeLinkBytes(0) {}; + Stats() : Bytes(0), MD5Bytes(0), SHA1Bytes(0), SHA256Bytes(0), + SHA512Bytes(0),Packages(0), Misses(0), DeLinkBytes(0) {}; } Stats; bool ReadyDB(std::string const &DB); @@ -142,7 +143,7 @@ class CacheDB bool Clean(); - CacheDB(std::string const &DB) : Dbp(0), Fd(NULL), DebFile(0) {ReadyDB(DB);}; + CacheDB(std::string const &DB) : Dbp(0), Fd(NULL), DebFile(0) {TmpKey[0]='\0'; ReadyDB(DB);}; ~CacheDB() {ReadyDB(std::string()); delete DebFile;}; }; diff --git a/methods/ftp.cc b/methods/ftp.cc index ad8a7b828..b1e8d2b0a 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -77,6 +77,7 @@ FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1), { Debug = _config->FindB("Debug::Acquire::Ftp",false); PasvAddr = 0; + Buffer[0] = '\0'; } /*}}}*/ // FTPConn::~FTPConn - Destructor /*{{{*/ diff --git a/methods/http.h b/methods/http.h index c061ad680..7a3ccda54 100644 --- a/methods/http.h +++ b/methods/http.h @@ -115,9 +115,10 @@ struct ServerState bool HeaderLine(std::string Line); bool Comp(URI Other) const {return Other.Host == ServerName.Host && Other.Port == ServerName.Port;}; - void Reset() {Major = 0; Minor = 0; Result = 0; Size = 0; StartPos = 0; - Encoding = Closes; time(&Date); ServerFd = -1; - Pipeline = true;}; + void Reset() {Major = 0; Minor = 0; Result = 0; Code[0] = '\0'; Size = 0; + StartPos = 0; Encoding = Closes; time(&Date); HaveContent = false; + State = Header; Persistent = false; ServerFd = -1; + Pipeline = true;}; /** \brief Result of the header acquire */ enum RunHeadersResult { diff --git a/methods/rsh.cc b/methods/rsh.cc index d249ae961..fb3782314 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -42,7 +42,9 @@ int RSHMethod::FailFd = -1; // --------------------------------------------------------------------- /* */ RSHConn::RSHConn(URI Srv) : Len(0), WriteFd(-1), ReadFd(-1), - ServerName(Srv), Process(-1) {} + ServerName(Srv), Process(-1) { + Buffer[0] = '\0'; +} /*}}}*/ // RSHConn::RSHConn - Destructor /*{{{*/ // --------------------------------------------------------------------- -- cgit v1.2.3-70-g09d2 From 785412cf3b03878fc6857c7d453376a029d9eb6a Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 5 Mar 2012 00:31:52 +0100 Subject: fix "(style) The scope of the variable 'count' can be reduced" --- cmdline/apt-cdrom.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index fa48debcd..0017d954e 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -150,10 +150,9 @@ bool DoAdd(CommandLine &) bool res = true; bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect", true); - unsigned int count = 0; - if (AutoDetect && UdevCdroms.Dlopen()) { + unsigned int count = 0; while (AutoDetectCdrom(UdevCdroms, count)) res &= cdrom.Add(&log); } else { @@ -178,10 +177,10 @@ bool DoIdent(CommandLine &) bool res = true; bool AutoDetect = _config->FindB("Acquire::cdrom::AutoDetect"); - unsigned int count = 0; - + if (AutoDetect && UdevCdroms.Dlopen()) { + unsigned int count = 0; while (AutoDetectCdrom(UdevCdroms, count)) res &= cdrom.Ident(ident, &log); } else { -- cgit v1.2.3-70-g09d2 From 9179f697ed4796a86f820b516f034fd679e48be4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 22 Mar 2012 00:16:11 +0100 Subject: the previously used VERSION didn't work everywhere so we are switching to the more standard PACKAGE_VERSION and make it work in every file --- apt-pkg/init.cc | 2 +- buildlib/config.h.in | 6 +++--- buildlib/environment.mak.in | 1 + cmdline/apt-cache.cc | 2 +- cmdline/apt-cdrom.cc | 2 +- cmdline/apt-config.cc | 2 +- cmdline/apt-dump-solver.cc | 2 +- cmdline/apt-extracttemplates.cc | 2 +- cmdline/apt-get.cc | 2 +- cmdline/apt-internal-solver.cc | 2 +- cmdline/apt-mark.cc | 2 +- cmdline/apt-sortpkgs.cc | 2 +- configure.in | 7 ++++--- debian/rules | 2 +- doc/Doxyfile.in | 2 +- doc/makefile | 3 --- ftparchive/apt-ftparchive.cc | 2 +- methods/http.cc | 2 +- methods/https.cc | 2 +- po/makefile | 2 +- 20 files changed, 24 insertions(+), 25 deletions(-) (limited to 'cmdline') diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index a1c47c030..76278921f 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -24,7 +24,7 @@ #define Stringfy_(x) # x #define Stringfy(x) Stringfy_(x) -const char *pkgVersion = VERSION; +const char *pkgVersion = PACKAGE_VERSION; const char *pkgLibVersion = Stringfy(APT_PKG_MAJOR) "." Stringfy(APT_PKG_MINOR) "." Stringfy(APT_PKG_RELEASE); diff --git a/buildlib/config.h.in b/buildlib/config.h.in index 4798fe3f5..87918bbec 100644 --- a/buildlib/config.h.in +++ b/buildlib/config.h.in @@ -39,10 +39,10 @@ /* Define the arch name string */ #undef COMMON_ARCH -/* The version number string */ -#undef VERSION - /* The package name string */ #undef PACKAGE +/* The version number string */ +#undef PACKAGE_VERSION + #define APT_8_CLEANER_HEADERS diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in index fdac3e6c3..b8ddb34a2 100644 --- a/buildlib/environment.mak.in +++ b/buildlib/environment.mak.in @@ -2,6 +2,7 @@ # if you want you can edit it, just don't re-run configure. PACKAGE = @PACKAGE@ +PACKAGE_VERSION = @PACKAGE_VERSION@ # C++ compiler options CC = @CC@ diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc index 94654ffd4..ce869581b 100644 --- a/cmdline/apt-cache.cc +++ b/cmdline/apt-cache.cc @@ -1676,7 +1676,7 @@ bool GenCaches(CommandLine &Cmd) /* */ bool ShowHelp(CommandLine &Cmd) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc index 0017d954e..2551f4916 100644 --- a/cmdline/apt-cdrom.cc +++ b/cmdline/apt-cdrom.cc @@ -195,7 +195,7 @@ bool DoIdent(CommandLine &) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 47bedfe3f..79ae944df 100644 --- a/cmdline/apt-config.cc +++ b/cmdline/apt-config.cc @@ -72,7 +72,7 @@ bool DoDump(CommandLine &CmdL) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/cmdline/apt-dump-solver.cc b/cmdline/apt-dump-solver.cc index e82e15c6e..aa16b1271 100644 --- a/cmdline/apt-dump-solver.cc +++ b/cmdline/apt-dump-solver.cc @@ -21,7 +21,7 @@ bool ShowHelp() { std::cout << - PACKAGE " " VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl << + PACKAGE " " PACKAGE_VERSION " for " COMMON_ARCH " compiled on " __DATE__ " " __TIME__ << std::endl << "Usage: apt-dump-resolver\n" "\n" "apt-dump-resolver is a dummy solver who just dumps its input to the\n" diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc index dc4c110a1..60efafba5 100644 --- a/cmdline/apt-extracttemplates.cc +++ b/cmdline/apt-extracttemplates.cc @@ -224,7 +224,7 @@ bool DebFile::ParseInfo() /* */ int ShowHelp(void) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index f4ad75d1c..ac1566f30 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3295,7 +3295,7 @@ bool DoMoo(CommandLine &CmdL) /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index 1b636e4d5..25ecb7af1 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -29,7 +29,7 @@ // --------------------------------------------------------------------- /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(std::cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); std::cout << diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index ef4331714..2d5eed29d 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -360,7 +360,7 @@ bool ShowHold(CommandLine &CmdL) /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); cout << diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc index 20ae14f2a..46989044e 100644 --- a/cmdline/apt-sortpkgs.cc +++ b/cmdline/apt-sortpkgs.cc @@ -144,7 +144,7 @@ bool DoIt(string InFile) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; diff --git a/configure.in b/configure.in index 065afccf1..78ad06b72 100644 --- a/configure.in +++ b/configure.in @@ -17,11 +17,12 @@ AC_INIT(configure.in) AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) -dnl -- SET THIS TO THE RELEASE VERSION -- -AC_DEFINE_UNQUOTED(VERSION,"0.8.16~exp9") PACKAGE="apt" +PACKAGE_VERSION="0.8.16~exp14" AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") +AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION") AC_SUBST(PACKAGE) +AC_SUBST(PACKAGE_VERSION) dnl Check the archs, we want the target type. AC_CANONICAL_SYSTEM @@ -218,4 +219,4 @@ fi AC_SUBST(USE_NLS) AC_PATH_PROG(BASH, bash) -AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in doc/Doxyfile,make -s dirs) +AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in doc/Doxyfile:doc/Doxyfile.in,make -s dirs) diff --git a/debian/rules b/debian/rules index 9eda3a8fa..00e6bd4b7 100755 --- a/debian/rules +++ b/debian/rules @@ -35,7 +35,7 @@ build: PKG=apt DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS) APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p' | sed -e 's/\+.*$$//') -APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in) +APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"\(.*\)")/\1/p' configure.in) APT_CVSTAG=$(shell echo "$(APT_DEBVER)" | sed -e 's/^/v/' -e 's/\./_/g') # Determine the build directory to use diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 43d961443..cf79aff85 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -31,7 +31,7 @@ PROJECT_NAME = @PACKAGE@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = @VERSION@ +PROJECT_NUMBER = @PACKAGE_VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/doc/makefile b/doc/makefile index fca0bfa0d..0817821b6 100644 --- a/doc/makefile +++ b/doc/makefile @@ -91,9 +91,6 @@ doxygen-clean: rm -fr $(BUILD)/doc/doxygen rm -f $(BUILD)/doc/doxygen-stamp -$(BUILD)/doc/Doxyfile: Doxyfile.in - (cd $(BUILD) && ./config.status doc/Doxyfile) - $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile rm -fr $(BUILD)/doc/doxygen mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799 diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc index f289eb00d..4efbecc8c 100644 --- a/ftparchive/apt-ftparchive.cc +++ b/ftparchive/apt-ftparchive.cc @@ -587,7 +587,7 @@ void LoadBinDir(vector &PkgList,Configuration &Setup) /* */ bool ShowHelp(CommandLine &CmdL) { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return true; diff --git a/methods/http.cc b/methods/http.cc index d2e03cfbc..c62ca71d3 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -758,7 +758,7 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n"; } Req += "User-Agent: " + _config->Find("Acquire::http::User-Agent", - "Debian APT-HTTP/1.3 ("VERSION")") + "\r\n\r\n"; + "Debian APT-HTTP/1.3 ("PACKAGE_VERSION")") + "\r\n\r\n"; if (Debug == true) cerr << Req << endl; diff --git a/methods/https.cc b/methods/https.cc index 4f2d581d2..fac7ba790 100644 --- a/methods/https.cc +++ b/methods/https.cc @@ -219,7 +219,7 @@ bool HttpsMethod::Fetch(FetchItem *Itm) curl_easy_setopt(curl, CURLOPT_USERAGENT, _config->Find("Acquire::https::User-Agent", _config->Find("Acquire::http::User-Agent", - "Debian APT-CURL/1.0 ("VERSION")").c_str()).c_str()); + "Debian APT-CURL/1.0 ("PACKAGE_VERSION")").c_str()).c_str()); // set timeout int const timeout = _config->FindI("Acquire::https::Timeout", diff --git a/po/makefile b/po/makefile index 6a2bc416d..46b75ff4f 100644 --- a/po/makefile +++ b/po/makefile @@ -70,7 +70,7 @@ $(PACKAGE)-all.pot: $(POTFILES) # but we want a header for our master-pot file, so we use a dummy pot with nothing but the header $(XGETTEXT) --default-domain=$(PO)/$(PACKAGE)-dummy.pot --foreign --language=c \ -o $(PO)/$(PACKAGE)-dummy.pot --force-po --package-name=$(PACKAGE) \ - --package-version=$(VERSION) --msgid-bugs-address=deity@lists.debian.org /dev/null + --package-version=$(PACKAGE_VERSION) --msgid-bugs-address=deity@lists.debian.org /dev/null $(MSGCOMM) --more-than=0 $(PO)/$(PACKAGE)-dummy.pot $(POTFILES) --output=$(PACKAGE)-all.pot rm -f $(PO)/$(PACKAGE)-dummy.pot -- cgit v1.2.3-70-g09d2 From 53ec04bb0fd4c086e54e2a6779fa88ee53139628 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 22 Mar 2012 00:51:44 +0100 Subject: * debian/apt-utils.install: - ship the ftparchive, apt-extractemplates and apt-sortpkgs locales in the apt-utils package instead of the apt package --- cmdline/makefile | 33 +++++++++++++++++++-------------- debian/apt-utils.install | 2 +- debian/changelog | 6 ++++-- ftparchive/makefile | 1 + methods/makefile | 2 +- 5 files changed, 26 insertions(+), 18 deletions(-) (limited to 'cmdline') diff --git a/cmdline/makefile b/cmdline/makefile index 07e9eb8ca..f3712232a 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -33,20 +33,6 @@ LIB_MAKES = apt-pkg/makefile SOURCE = apt-cdrom.cc include $(PROGRAM_H) -# The apt-sortpkgs program -PROGRAM=apt-sortpkgs -SLIBS = -lapt-pkg $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = apt-sortpkgs.cc -include $(PROGRAM_H) - -# The apt-extracttemplates program -PROGRAM=apt-extracttemplates -SLIBS = -lapt-pkg -lapt-inst $(INTLLIBS) -LIB_MAKES = apt-pkg/makefile -SOURCE = apt-extracttemplates.cc -include $(PROGRAM_H) - # The apt-key program SOURCE=apt-key TO=$(BIN) @@ -66,6 +52,25 @@ include $(PROGRAM_H) #TARGET=program #include $(COPY_H) +# +# the following programs are shipped in apt-utils +# +APT_DOMAIN:=apt-utils + +# The apt-sortpkgs program +PROGRAM=apt-sortpkgs +SLIBS = -lapt-pkg $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile +SOURCE = apt-sortpkgs.cc +include $(PROGRAM_H) + +# The apt-extracttemplates program +PROGRAM=apt-extracttemplates +SLIBS = -lapt-pkg -lapt-inst $(INTLLIBS) +LIB_MAKES = apt-pkg/makefile +SOURCE = apt-extracttemplates.cc +include $(PROGRAM_H) + # The internal solver acting as an external PROGRAM=apt-internal-solver SLIBS = -lapt-pkg $(INTLLIBS) diff --git a/debian/apt-utils.install b/debian/apt-utils.install index 8b1378917..cdbcb2f37 100644 --- a/debian/apt-utils.install +++ b/debian/apt-utils.install @@ -1 +1 @@ - +usr/share/locale/*/*/apt-utils.mo diff --git a/debian/changelog b/debian/changelog index ca622a78c..cb82f715c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,9 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low (Closes: #659333, LP: #924628) * debian/libapt-pkg4.12: - update symbols file + * debian/apt-utils.install: + - ship the ftparchive, apt-extractemplates and apt-sortpkgs locales + in the apt-utils package instead of the apt package * apt-pkg/packagemanager.cc: - recheck all dependencies if we changed a package in SmartConfigure as this could break an earlier dependency (LP: #940396) @@ -39,8 +42,7 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low - do not link rred against libz anymore as FileFd handles all this transparently now - - -- David Kalnischkies Wed, 21 Mar 2012 18:50:23 +0100 + -- David Kalnischkies Thu, 22 Mar 2012 00:50:03 +0100 apt (0.8.16~exp13) experimental; urgency=low diff --git a/ftparchive/makefile b/ftparchive/makefile index 504ebf893..362c29198 100644 --- a/ftparchive/makefile +++ b/ftparchive/makefile @@ -7,6 +7,7 @@ include ../buildlib/defaults.mak # The apt-ftparchive program ifdef BDBLIB +APT_DOMAIN:=apt-utils PROGRAM=apt-ftparchive SLIBS = -lapt-pkg -lapt-inst $(BDBLIB) $(INTLLIBS) LIB_MAKES = apt-pkg/makefile apt-inst/makefile diff --git a/methods/makefile b/methods/makefile index 6f904d071..6fe95f29a 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods include ../buildlib/libversion.mak -APT_DOMAIN := libapt-pkg$(LIBAPTPKG_MAJOR) +APT_DOMAIN := apt # The file method PROGRAM=file -- cgit v1.2.3-70-g09d2 From de3786516df8b0fec2f759a16bbbc4b8605c1856 Mon Sep 17 00:00:00 2001 From: Bogdan Purcareata Date: Thu, 5 Apr 2012 12:03:37 +0200 Subject: * cmdline/apt-get.cc: - distinguish information about 'apt-get autoremove' based on the number of auto-removed packages both before and after the list of packages (Closes: #665833) --- cmdline/apt-get.cc | 2 +- debian/changelog | 6 +++++- test/integration/test-bug-604222-new-and-autoremove | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ac1566f30..52618ae28 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1826,7 +1826,7 @@ bool DoAutomaticRemove(CacheFile &Cache) else ioprintf(c1out, P_("%lu package was automatically installed and is no longer required.\n", "%lu packages were automatically installed and are no longer required.\n", autoRemoveCount), autoRemoveCount); - c1out << _("Use 'apt-get autoremove' to remove them.") << std::endl; + c1out << P_("Use 'apt-get autoremove' to remove it.", "Use 'apt-get autoremove' to remove them.", autoRemoveCount) << std::endl; } return true; } diff --git a/debian/changelog b/debian/changelog index d6913b003..fe92378dd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -63,8 +63,12 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low [ Bogdan Purcareata ] * doc/apt-get.8.xml: - add 'download' to the usage line (Closes: #649340) + * cmdline/apt-get.cc: + - distinguish information about 'apt-get autoremove' based on the + number of auto-removed packages both before and after the list + of packages (Closes: #665833) - -- David Kalnischkies Thu, 05 Apr 2012 11:22:34 +0200 + -- David Kalnischkies Thu, 05 Apr 2012 11:55:30 +0200 apt (0.8.16~exp13) experimental; urgency=low diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 2875d547a..5820fb0dc 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -16,7 +16,7 @@ Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use 'apt-get autoremove' to remove them. +Use 'apt-get autoremove' to remove it. The following NEW packages will be installed: libavcodec52 0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded. @@ -28,7 +28,7 @@ Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: libvtk5.4 -Use 'apt-get autoremove' to remove them. +Use 'apt-get autoremove' to remove it. The following extra packages will be installed: libavcodec52 libopenal-dev libvtk5.4 The following NEW packages will be installed: -- cgit v1.2.3-70-g09d2 From fdfdba56b128acf59b40edfdde0dd95fdd9c4439 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 11 Apr 2012 12:12:24 +0200 Subject: * cmdline/apt-get.cc: - print list of autoremoves in alphabetical order (Closes: #639008) --- cmdline/apt-get.cc | 36 +++++++++++----------- debian/changelog | 4 ++- .../test-bug-613420-new-garbage-dependency | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 52618ae28..6d7f80202 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1711,12 +1711,13 @@ bool DoAutomaticRemove(CacheFile &Cache) bool smallList = (hideAutoRemove == false && strcasecmp(_config->Find("APT::Get::HideAutoRemove","").c_str(),"small") == 0); - string autoremovelist, autoremoveversions; unsigned long autoRemoveCount = 0; APT::PackageSet tooMuch; + APT::PackageList autoRemoveList; // look over the cache to see what can be removed - for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg) + for (unsigned J = 0; J < Cache->Head().PackageCount; ++J) { + pkgCache::PkgIterator Pkg(Cache,Cache.List[J]); if (Cache[Pkg].Garbage) { if(Pkg.CurrentVer() != 0 || Cache[Pkg].Install()) @@ -1733,6 +1734,8 @@ bool DoAutomaticRemove(CacheFile &Cache) } else { + if (hideAutoRemove == false && Cache[Pkg].Delete() == false) + autoRemoveList.insert(Pkg); // if the package is a new install and already garbage we don't need to // install it in the first place, so nuke it instead of show it if (Cache[Pkg].Install() == true && Pkg.CurrentVer() == 0) @@ -1742,16 +1745,8 @@ bool DoAutomaticRemove(CacheFile &Cache) Cache->MarkDelete(Pkg, false); } // only show stuff in the list that is not yet marked for removal - else if(hideAutoRemove == false && Cache[Pkg].Delete() == false) - { + else if(hideAutoRemove == false && Cache[Pkg].Delete() == false) ++autoRemoveCount; - // we don't need to fill the strings if we don't need them - if (smallList == false) - { - autoremovelist += Pkg.FullName(true) + " "; - autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; - } - } } } } @@ -1786,14 +1781,7 @@ bool DoAutomaticRemove(CacheFile &Cache) std::clog << "Save " << Pkg << " as another installed garbage package depends on it" << std::endl; Cache->MarkInstall(Pkg, false); if (hideAutoRemove == false) - { ++autoRemoveCount; - if (smallList == false) - { - autoremovelist += Pkg.FullName(true) + " "; - autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; - } - } tooMuch.erase(Pkg); Changed = true; break; @@ -1803,6 +1791,18 @@ bool DoAutomaticRemove(CacheFile &Cache) } while (Changed == true); } + std::string autoremovelist, autoremoveversions; + if (smallList == false && autoRemoveCount != 0) + { + for (APT::PackageList::const_iterator Pkg = autoRemoveList.begin(); Pkg != autoRemoveList.end(); ++Pkg) + { + if (Cache[Pkg].Garbage == false) + continue; + autoremovelist += Pkg.FullName(true) + " "; + autoremoveversions += string(Cache[Pkg].CandVersion) + "\n"; + } + } + // Now see if we had destroyed anything (if we had done anything) if (Cache->BrokenCount() != 0) { diff --git a/debian/changelog b/debian/changelog index 85382b6fa..4e337df48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -73,6 +73,8 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low - use libz2 library for (de)compression instead of the bzip2 binary as the first is a dependency of dpkg and the later just priority:optional so we gain 'easier' access to bz2-compressed Translation files this way + * cmdline/apt-get.cc: + - print list of autoremoves in alphabetical order (Closes: #639008) [ Bogdan Purcareata ] * doc/apt-get.8.xml: @@ -82,7 +84,7 @@ apt (0.8.16~exp14) UNRELEASED; urgency=low number of auto-removed packages both before and after the list of packages (Closes: #665833) - -- David Kalnischkies Thu, 05 Apr 2012 21:36:16 +0200 + -- David Kalnischkies Wed, 11 Apr 2012 12:09:33 +0200 apt (0.8.16~exp13) experimental; urgency=low diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 34cf38cbc..7a08871ca 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -22,7 +22,7 @@ testequal "Reading package lists... Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: - openoffice.org-officebean libreoffice-officebean + libreoffice-officebean openoffice.org-officebean Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libreoffice-core libreoffice-officebean openoffice.org-officebean -- cgit v1.2.3-70-g09d2 From c307a4f0aa29c9c52a0e028524d21b448a53d09b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Apr 2012 12:18:43 +0200 Subject: merged r1970 lp:~vorlon/apt/lp.968828 --- cmdline/apt-get.cc | 2 +- debian/changelog | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6d7f80202..bff7ef7b6 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2864,7 +2864,7 @@ bool DoBuildDep(CommandLine &CmdL) pkgCache::PkgIterator Pkg; // Cross-Building? - if (StripMultiArch == false) + if (StripMultiArch == false && D->Type != pkgSrcRecords::Parser::BuildDependIndep) { size_t const colon = D->Package.find(":"); if (colon != string::npos && diff --git a/debian/changelog b/debian/changelog index f6446ccbc..e31b1b80e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -90,6 +90,10 @@ apt (0.9.0~exp1) UNRELEASEDexperimental; urgency=low number of auto-removed packages both before and after the list of packages (Closes: #665833) + [ Steve Langasek ] + * don't treat build-depends-indep as cross-build-dependencies; we should + always install the host arch versions. LP: #968828. + -- Michael Vogt Wed, 11 Apr 2012 17:53:39 +0200 apt (0.8.16~exp13) experimental; urgency=low -- cgit v1.2.3-70-g09d2 From a12d5352927c7d3a2fe66a90fc7794b4a8e596ad Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 12 Apr 2012 12:23:57 +0200 Subject: merged r1972 from lp:~paolorotolo/apt/fix-for-967393 --- cmdline/apt-get.cc | 2 +- debian/changelog | 5 ++++- po/apt-all.pot | 2 +- po/ar.po | 4 ++++ po/ast.po | 21 +++++++++++++++++++++ po/bg.po | 22 ++++++++++++++++++++++ po/ca.po | 21 +++++++++++++++++++++ po/cs.po | 21 +++++++++++++++++++++ po/cy.po | 21 +++++++++++++++++++++ po/da.po | 21 +++++++++++++++++++++ po/de.po | 25 +++++++++++++++++++++++++ po/dz.po | 18 ++++++++++++++++++ po/el.po | 19 +++++++++++++++++++ po/es.po | 21 +++++++++++++++++++++ po/eu.po | 18 ++++++++++++++++++ po/fi.po | 18 ++++++++++++++++++ po/fr.po | 22 ++++++++++++++++++++++ po/gl.po | 21 +++++++++++++++++++++ po/hu.po | 18 ++++++++++++++++++ po/it.po | 21 +++++++++++++++++++++ po/ja.po | 21 +++++++++++++++++++++ po/km.po | 18 ++++++++++++++++++ po/ko.po | 21 +++++++++++++++++++++ po/lt.po | 9 +++++++++ po/mr.po | 18 ++++++++++++++++++ po/nb.po | 21 +++++++++++++++++++++ po/ne.po | 18 ++++++++++++++++++ po/nl.po | 21 +++++++++++++++++++++ po/nn.po | 18 ++++++++++++++++++ po/pl.po | 21 +++++++++++++++++++++ po/pt.po | 21 +++++++++++++++++++++ po/pt_BR.po | 18 ++++++++++++++++++ po/ro.po | 18 ++++++++++++++++++ po/ru.po | 22 ++++++++++++++++++++++ po/sk.po | 21 +++++++++++++++++++++ po/sl.po | 21 +++++++++++++++++++++ po/sv.po | 23 +++++++++++++++++++++++ po/th.po | 18 ++++++++++++++++++ po/tl.po | 18 ++++++++++++++++++ po/uk.po | 19 +++++++++++++++++++ po/vi.po | 21 +++++++++++++++++++++ po/zh_CN.po | 21 +++++++++++++++++++++ po/zh_TW.po | 18 ++++++++++++++++++ test/integration/test-disappearing-packages | 2 +- 44 files changed, 784 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index bff7ef7b6..4e6cc32de 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -1415,7 +1415,7 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true, "all files have been overwritten by other packages:", "The following packages disappeared from your system as\n" "all files have been overwritten by other packages:", disappearedPkgs.size()), disappear, ""); - c0out << _("Note: This is done automatic and on purpose by dpkg.") << std::endl; + c0out << _("Note: This is done automatically and on purpose by dpkg.") << std::endl; return true; } diff --git a/debian/changelog b/debian/changelog index e31b1b80e..71efc8e38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -93,7 +93,10 @@ apt (0.9.0~exp1) UNRELEASEDexperimental; urgency=low [ Steve Langasek ] * don't treat build-depends-indep as cross-build-dependencies; we should always install the host arch versions. LP: #968828. - + + [ Paolo Rotolo ] + * Fix string from automatic to automatically (LP: #967393). + -- Michael Vogt Wed, 11 Apr 2012 17:53:39 +0200 apt (0.8.16~exp13) experimental; urgency=low diff --git a/po/apt-all.pot b/po/apt-all.pot index ed5e54ef7..b952c4f7b 100644 --- a/po/apt-all.pot +++ b/po/apt-all.pot @@ -904,7 +904,7 @@ msgstr[0] "" msgstr[1] "" #: cmdline/apt-get.cc:1381 -msgid "Note: This is done automatic and on purpose by dpkg." +msgid "Note: This is done automatically and on purpose by dpkg." msgstr "" #: cmdline/apt-get.cc:1519 diff --git a/po/ar.po b/po/ar.po index 72da5e102..ef2b7cf34 100644 --- a/po/ar.po +++ b/po/ar.po @@ -3308,6 +3308,10 @@ msgstr "" #~ msgid "Error occurred while processing %s (NewFileVer1)" #~ msgstr "حدث خطأ أثناء معالجة %s (NewFileVer1)" +#, fuzzy +#~ msgid "Error occurred while processing %s (NewVersion%d)" +#~ msgstr "حدث خطأ أثناء معالجة %s (NewVersion1)" + #~ msgid "Error occurred while processing %s (UsePackage3)" #~ msgstr "حدث خطأ أثناء معالجة %s (UsePackage3)" diff --git a/po/ast.po b/po/ast.po index 217973e3b..1b4256fd4 100644 --- a/po/ast.po +++ b/po/ast.po @@ -3553,9 +3553,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Conexón encaboxada prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Saltu mal formáu %s llinia %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Saltu mal formáu %s llinia %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Saltu mal formáu %s llinia %lu #3" + #~ msgid "decompressor" #~ msgstr "descompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: Esto faise automáticamente y baxo demanda por dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lleíos, entá tenía de lleer %lu pero nun queda nada" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escritos, entá tenía d'escribir %lu pero nun pudo facerse" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3588,6 +3606,9 @@ msgstr "Conexón encaboxada prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Hebo un error al procesar %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Hebo un error al procesar %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Hebo un error al procesar %s (CollectFileProvides)" diff --git a/po/bg.po b/po/bg.po index 94e3a0c30..805eb2121 100644 --- a/po/bg.po +++ b/po/bg.po @@ -3590,9 +3590,28 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Връзката прекъсна преждевременно" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Неправилно форматиран override %s, ред %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Неправилно форматиран override %s, ред %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Неправилно форматиран override %s, ред %lu #3" + #~ msgid "decompressor" #~ msgstr "декомпресираща програма" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Това се прави автоматично от dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "" +#~ "грешка при четене, все още има %lu за четене, но няма нито един останал" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "грешка при запис, все още име %lu за запис, но не успя" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3624,6 +3643,9 @@ msgstr "Връзката прекъсна преждевременно" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Възникна грешка при обработката на %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Възникна грешка при обработката на %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Възникна грешка при обработката на %s (CollectFileProvides)" diff --git a/po/ca.po b/po/ca.po index 7d2ca8c00..e8cc0b1fc 100644 --- a/po/ca.po +++ b/po/ca.po @@ -3611,9 +3611,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "La connexió s'ha tancat prematurament" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Línia predominant %s línia malformada %lu núm 1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Línia predominant %s línia malformada %lu núm 2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Línia predominant %s línia malformada %lu núm 3" + #~ msgid "decompressor" #~ msgstr "decompressor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: Això ho fa el dpkg automàticament i a propòsit." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "llegits, falten %lu per llegir, però no queda res" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escrits, falten %lu per escriure però no s'ha pogut" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3646,6 +3664,9 @@ msgstr "La connexió s'ha tancat prematurament" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "S'ha produït un error durant el processament de %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "S'ha produït un error durant el processament de %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "" #~ "S'ha produït un error durant el processament de %s (CollectFileProvides)" diff --git a/po/cs.po b/po/cs.po index 52fb86996..30f1e793a 100644 --- a/po/cs.po +++ b/po/cs.po @@ -3514,9 +3514,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Spojení bylo předčasně ukončeno" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Zkomolený soubor %s, řádek %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Zkomolený soubor %s, řádek %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Zkomolený soubor %s, řádek %lu #3" + #~ msgid "decompressor" #~ msgstr "dekompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Poznámka: Toto má svůj důvod a děje se automaticky v dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "čtení, stále mám k přečtení %lu, ale už nic nezbývá" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "zápis, stále mám %lu k zápisu, ale nejde to" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3548,6 +3566,9 @@ msgstr "Spojení bylo předčasně ukončeno" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Při zpracování %s se objevila chyba (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Chyba při zpracování %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Při zpracování %s se objevila chyba (CollectFileProvides)" diff --git a/po/cy.po b/po/cy.po index 4d0c2123e..8b4494037 100644 --- a/po/cy.po +++ b/po/cy.po @@ -3590,9 +3590,26 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Caewyd y cysylltiad yn gynnar" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Gwrthwneud camffurfiol %s llinell %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Gwrthwneud camffurfiol %s llinell %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Gwrthwneud camffurfiol %s llinell %lu #3" + #~ msgid "decompressor" #~ msgstr "datgywasgydd" +# FIXME +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "o hyd %lu i ddarllen ond dim ar ôl" + +# FIXME +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "o hyd %lu i ysgrifennu ond methwyd" + #, fuzzy #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Digwyddod gwall wrth brosesu %s (NewPackage)" @@ -3625,6 +3642,10 @@ msgstr "Caewyd y cysylltiad yn gynnar" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Digwyddod gwall wrth brosesu %s (NewFileVer1)" +#, fuzzy +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Digwyddod gwall wrth brosesu %s (FindPkg)" + #, fuzzy #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Digwyddod gwall wrth brosesu %s (CollectFileProvides)" diff --git a/po/da.po b/po/da.po index bac1274a9..751289588 100644 --- a/po/da.po +++ b/po/da.po @@ -3562,9 +3562,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Forbindelsen lukkedes for hurtigt" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Ugyldig gennemtvangs %s-linje %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Ugyldig gennemtvangs %s-linje %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Ugyldig gennemtvangs %s-linje %lu #3" + #~ msgid "decompressor" #~ msgstr "dekomprimerings-program" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Bemærk: Dette sker automatisk og med vilje af dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "læs, mangler stadig at læse %lu men der er ikke flere" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "skriv, mangler stadig at skrive %lu men kunne ikke" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3596,5 +3614,8 @@ msgstr "Forbindelsen lukkedes for hurtigt" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Der skete en fejl under behandlingen af %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Der skete en fejl under behandlingen af %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Der skete en fejl under behandlingen af %s (CollectfileProvides)" diff --git a/po/de.po b/po/de.po index a4153760c..8b6ebca6d 100644 --- a/po/de.po +++ b/po/de.po @@ -3632,9 +3632,31 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Verbindung vorzeitig beendet" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Missgestaltetes Override %s Zeile %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Missgestaltetes Override %s Zeile %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Missgestaltetes Override %s Zeile %lu #3" + #~ msgid "decompressor" #~ msgstr "Dekomprimierer" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "" +#~ "Hinweis: Dies wird automatisch und absichtlich von dpkg durchgeführt." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "" +#~ "Lesevorgang: es verbleiben noch %lu zu lesen, jedoch nichts mehr übrig" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "" +#~ "Schreibvorgang: es verbleiben noch %lu zu schreiben, jedoch Schreiben " +#~ "nicht möglich" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3667,6 +3689,9 @@ msgstr "Verbindung vorzeitig beendet" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Fehler aufgetreten beim Verarbeiten von %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Fehler aufgetreten beim Verarbeiten von %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Fehler aufgetreten beim Verarbeiten von %s (CollectFileProvides)" diff --git a/po/dz.po b/po/dz.po index 3d18495d2..6efb4fb6d 100644 --- a/po/dz.po +++ b/po/dz.po @@ -3509,9 +3509,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "དུས་སུ་མ་འབབ་པ་རང་མཐུད་ལམ་འདི་ག་བསྡམས་ཡོད།" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "བཟོ་ཉེས་གྱུར་བའི་ཟུར་བཞག་%s གྲལ་ཐིག་%lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "བཟོ་ཉེས་གྱུར་བའི་ཟུར་བཞག་%sགྲལ་ཐིག%lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "བཟོ་ཉེས་གྱུར་བའི་ཟུར་བཞག་%sགྲལ་ཐིག%lu #3" + #~ msgid "decompressor" #~ msgstr "ཨེབ་བཤོལ་འཕྲུལ་ཆས།" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "ལྷག་ ད་ལྟོ་ཡང་ལྷག་ནི་ལུ་%lu་ཡོད་འདི་འབདཝ་ད་ཅི་ཡང་ལྷག་ལུས་མིན་འདུག" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "འབྲི་ ད་ལྟོ་ཡང་འབྲི་ནི་ལུ་%lu་ཡོད་འདི་འདབཝ་ད་འབད་མ་ཚུགས།" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "%s (ཐུམ་སྒྲིལ་གསརཔ་)བཟོ་སྦྱོར་འབད་བའི་བསྒང་འཛོལ་བ་ཅིག་བྱུང་ནུག" @@ -3539,6 +3554,9 @@ msgstr "དུས་སུ་མ་འབབ་པ་རང་མཐུད་ལ #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "%s (ཡིག་སྣོད་འཐོན་རིམ་གསརཔ་ ༡)བཟོ་སྦྱོར་འབད་བའི་བསྒང་འཛོལ་བ་ཅིག་བྱུང་ནུག" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "%s (པི་ཀེ་ཇི་འཚོལ་ནི)དེ་བཟོ་སྦྱོར་འབད་བའི་བསྒང་འཛོལ་བ་ཅིག་བྱུང་ནུག" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "%s (CollectFileProvides)དེ་བཟོ་སྦྱོར་འབད་བའི་བསྒང་འཛོལ་བ་ཅིག་བྱུང་ནུག" diff --git a/po/el.po b/po/el.po index cd3328100..37b235f98 100644 --- a/po/el.po +++ b/po/el.po @@ -3547,9 +3547,25 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Η σύνδεση έκλεισε πρόωρα" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Κακογραμμένη παρακαμπτήρια %s γραμμή %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Κακογραμμένη παρακαμπτήρια %s γραμμή %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Κακογραμμένη παρακαμπτήρια %s γραμμή %lu #3" + #~ msgid "decompressor" #~ msgstr "αποσυμπιεστής" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "" +#~ "αναγνώστηκαν, απομένουν ακόμη %lu για ανάγνωση αλλά δεν απομένουν άλλα" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "γράφτηκαν, απομένουν %lu για εγγραφή αλλά χωρίς επιτυχία" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Προέκυψε σφάλμα κατά την επεξεργασία του %s (NewPackage)" @@ -3575,6 +3591,9 @@ msgstr "Η σύνδεση έκλεισε πρόωρα" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Προέκευψε σφάλμα κατά την επεξεργασία του %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Προέκυψε σφάλμα κατά την επεξεργασία του %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Προέκυψε σφάλμα κατά την επεξεργασία του %s (CollectFileProvides)" diff --git a/po/es.po b/po/es.po index 5d459d340..adda1e7d2 100644 --- a/po/es.po +++ b/po/es.po @@ -3657,9 +3657,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "La conexión se cerró prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Predominio mal formado %s línea %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Predominio mal formado %s línea %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Predominio mal formado %s línea %lu #3" + #~ msgid "decompressor" #~ msgstr "decompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: Dpkg realiza esto de forma automática y a propósito." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "leídos, todavía debía leer %lu pero no queda nada" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escritos, todavía tenía que escribir %lu pero no pude hacerlo" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3692,6 +3710,9 @@ msgstr "La conexión se cerró prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Se produjo un error mientras se procesaba %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Se produjo un error mientras se procesaba %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Se produjo un error mientras se procesaba %s (CollectFileProvides)" diff --git a/po/eu.po b/po/eu.po index 2ce8031a7..ab65305c7 100644 --- a/po/eu.po +++ b/po/eu.po @@ -3509,9 +3509,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Konexioa behar baino lehenago itxi da" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Gaizki osatutako override %s, lerroa: %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Gaizki osatutako override %s, lerroa: %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Gaizki osatutako override %s, lerroa: %lu #3" + #~ msgid "decompressor" #~ msgstr "deskonpresorea" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "irakurrita; oraindik %lu irakurtzeke, baina ez da ezer geratzen" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "idatzita; oraindik %lu idazteke, baina ezin da" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Errorea gertatu da %s prozesatzean (NewPackage)" @@ -3537,6 +3552,9 @@ msgstr "Konexioa behar baino lehenago itxi da" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Errorea gertatu da %s prozesatzean (NewFileDesc1)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Errorea gertatu da %s prozesatzean (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Errorea gertatu da %s prozesatzean (CollectFileProvides)" diff --git a/po/fi.po b/po/fi.po index 5f175ba30..eee05ba10 100644 --- a/po/fi.po +++ b/po/fi.po @@ -3502,9 +3502,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Yhteys katkesi ennenaikaisesti" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Väärän muotoinen poikkeus %s rivi %lu n:ro 1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Väärän muotoinen poikkeus %s rivi %lu n:ro 2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Väärän muotoinen poikkeus %s rivi %lu n:ro 3" + #~ msgid "decompressor" #~ msgstr "purkaja" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "read, vielä %lu lukematta mutta tiedosto loppui" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "write, vielä %lu kirjoittamatta mutta epäonnistui" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Tapahtui virhe käsiteltäessä %s (NewPackage)" @@ -3530,6 +3545,9 @@ msgstr "Yhteys katkesi ennenaikaisesti" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Tapahtui virhe käsiteltäessä %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Tapahtui virhe käsiteltäessä %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Tapahtui virhe käsiteltäessä %s (CollectFileProvides)" diff --git a/po/fr.po b/po/fr.po index eb4037df9..70ec1d8de 100644 --- a/po/fr.po +++ b/po/fr.po @@ -3658,9 +3658,28 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Connexion fermée prématurément" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Entrée « override » %s mal formée ligne %lu n° 1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Entrée « override » %s mal formée %lu n° 2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Entrée « override » %s mal formée %lu n° 3" + #~ msgid "decompressor" #~ msgstr "décompacteur" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "" +#~ "Note : cette opération volontaire (effectuée par dpkg) est automatique." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lu(s), %lu restant à lire, mais rien n'est disponible" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "écrit(s), %lu restant à écrire, mais l'écriture est impossible" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3694,6 +3713,9 @@ msgstr "Connexion fermée prématurément" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Erreur apparue lors du traitement de %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Erreur apparue lors du traitement de %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Erreur apparue lors du traitement de %s (CollectFileProvides)" diff --git a/po/gl.po b/po/gl.po index 57df307ce..cb4f6322e 100644 --- a/po/gl.po +++ b/po/gl.po @@ -3598,9 +3598,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "A conexión pechouse prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "«Override» %s liña %lu incorrecta (1)" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "«Override» %s liña %lu incorrecta (2)" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "«Override» %s liña %lu incorrecta (3)" + #~ msgid "decompressor" #~ msgstr "descompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: Isto será feito automaticamente por dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lectura, aínda hai %lu para ler pero non queda ningún" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escritura, aínda hai %lu para escribir pero non se puido" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3633,6 +3651,9 @@ msgstr "A conexión pechouse prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Produciuse un erro ao procesar %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Produciuse un erro ao procesar %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Produciuse un erro ao procesar %s (CollectFileProvides)" diff --git a/po/hu.po b/po/hu.po index c4c10a17a..628521c50 100644 --- a/po/hu.po +++ b/po/hu.po @@ -3609,9 +3609,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "A kapcsolat idő előtt lezárult" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Deformált felülbírálás %s %lu. sorában #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Deformált felülbírálás %s %lu. sorában #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Deformált felülbírálás %s %lu. sorában #3" + #~ msgid "decompressor" #~ msgstr "kicsomagoló" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Megjegyzés: ezt a dpkg automatikusan és szándékosan hajtja végre." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "olvasás, még kellene %lu, de már az összes elfogyott" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "írás, még kiírandó %lu, de ez nem lehetséges" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." diff --git a/po/it.po b/po/it.po index ea65d8eda..0f8fa6ff0 100644 --- a/po/it.po +++ b/po/it.po @@ -3629,9 +3629,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Connessione chiusa prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Override non corretto: file %s riga %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Override non corretto: file %s riga %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Override non corretto: file %s riga %lu #3" + #~ msgid "decompressor" #~ msgstr "de-compressore" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: questo viene svolto automaticamente da dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lettura, c'erano ancora %lu da leggere ma non ne è rimasto alcuno" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "scrittura, c'erano ancora %lu da scrivere ma non è stato possibile" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3664,6 +3682,9 @@ msgstr "Connessione chiusa prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Si è verificato un errore nell'elaborare %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Si è verificato un errore nell'elaborare %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Si è verificato un errore nell'elaborare %s (CollectFileProvides)" diff --git a/po/ja.po b/po/ja.po index 9215c3d98..404ce09e4 100644 --- a/po/ja.po +++ b/po/ja.po @@ -3571,9 +3571,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "途中で接続がクローズされました" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "不正な override %s %lu 行目 #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "不正な override %s %lu 行目 #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "不正な override %s %lu 行目 #3" + #~ msgid "decompressor" #~ msgstr "展開ツール" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "注意: これは dpkg により自動でわざと行われれます。" + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "読み込みが %lu 残っているはずですが、何も残っていません" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "あと %lu 書き込む必要がありますが、書き込むことができませんでした" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3605,6 +3623,9 @@ msgstr "途中で接続がクローズされました" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "%s を処理中にエラーが発生しました (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "%s を処理中にエラーが発生しました (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "%s を処理中にエラーが発生しました (CollectFileProvides)" diff --git a/po/km.po b/po/km.po index 77b752a37..397df6d79 100644 --- a/po/km.po +++ b/po/km.po @@ -3468,9 +3468,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "បាន​បិទ​ការ​តភ្ជាប់​មុន​ពេល" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Malformed បដិសេធ %s បន្ទាត់ %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Malformed បដិសេធ %s បន្ទាត់​ %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Malformed បដិសេធ %s បន្ទាត់​ %lu #3" + #~ msgid "decompressor" #~ msgstr "កម្មវិធី​ពន្លា" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "អាន​, នៅតែ​មាន %lu ដើម្បី​អាន​ ប៉ុន្តែ​គ្មាន​អ្វី​នៅសល់" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "សរសេរ​, នៅតែមាន​ %lu ដើម្បី​សរសេរ​ ប៉ុន្តែ​មិន​អាច​" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "កំហុស​បាន​កើត​ឡើង​​ ខណៈ​ពេល​កំពុង​ដំណើរការ​ %s (កញ្ចប់​ថ្មី​)" @@ -3498,6 +3513,9 @@ msgstr "បាន​បិទ​ការ​តភ្ជាប់​មុន​ #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "កំហុស​បានកើតឡើង​ ខណៈពេល​កំពុង​ដំណើរការ​ %s (កំណែ​​​ឯកសារ​ថ្មី​១)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "កំហុស​បានកើតឡើង​ខណៈពេល​កំពុង​ដំណើរការ​ %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "កំហុស​បានកើតឡើង​ខណៈពេល​កំពុង​ដំណើរការ​%s (ផ្តល់​ឯកសារ​ប្រមូល​ផ្តុំ)" diff --git a/po/ko.po b/po/ko.po index cd2edc115..0edbf373d 100644 --- a/po/ko.po +++ b/po/ko.po @@ -3509,9 +3509,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "연결이 너무 빨리 끊어졌습니다" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "override %s의 %lu번 줄 #1이 잘못되었습니다" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "override %s의 %lu번 줄 #2가 잘못되었습니다" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "override %s의 %lu번 줄 #3이 잘못되었습니다" + #~ msgid "decompressor" #~ msgstr "압축 해제 프로그램" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "주의: dpkg에서 자동으로 의도적으로 수행했습니다." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "%lu만큼 더 읽어야 하지만 더 이상 읽을 데이터가 없습니다" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "%lu만큼 더 써야 하지만 더 이상 쓸 수 없습니다" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3543,6 +3561,9 @@ msgstr "연결이 너무 빨리 끊어졌습니다" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "%s 처리하는 중에 오류가 발생했습니다 (NewFileDesc1)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "%s 처리 중에 오류가 발생했습니다 (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "%s 처리 중에 오류가 발생했습니다 (CollectFileProvides)" diff --git a/po/lt.po b/po/lt.po index d6148424f..c366056dc 100644 --- a/po/lt.po +++ b/po/lt.po @@ -3390,6 +3390,15 @@ msgstr "" msgid "Connection closed prematurely" msgstr "" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Nekorektiškas perrašymas %s eilutėje %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Nekorektiškas perrašymas %s eilutėje %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Nekorektiškas perrašymas %s eilutėje %lu #3" + #~ msgid "decompressor" #~ msgstr "išskleidiklis" diff --git a/po/mr.po b/po/mr.po index 314d5c7e0..69f5d7256 100644 --- a/po/mr.po +++ b/po/mr.po @@ -3480,9 +3480,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "जोडणी अकाली बंद झाली" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "व्यंगीत/हिडीस दुर्लक्षित केले %s रेषा %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "व्यंगीत/हिडीस दुर्लक्षित केले %s रेषा %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "व्यंगीत/हिडीस दुर्लक्षित केले %s रेषा %lu #3" + #~ msgid "decompressor" #~ msgstr "असंकलितकर्ता " +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "वाचा, %lu अजूनही वाचण्यासाठी आहे पण आता काही उरली नाही" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "लिहा, %lu अजूनही लिहिण्यासाठी आहे पण लिहिता येत नाही" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "%s (नविन पॅकेज) प्रक्रिया करीत असतांना दोष आढळून आला" @@ -3508,6 +3523,9 @@ msgstr "जोडणी अकाली बंद झाली" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "%s (NewFileDesc2) वर प्रक्रिया सुरू असताना त्रुटी उद्भवली" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "%s (पॅकेज शोधतांना) प्रक्रिया करीत असतांना दोष आढळून आला" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "%s (तरतूद/पुरवलेल्या संचिका जमा) प्रक्रिया करीत असतांना दोष आढळून आला" diff --git a/po/nb.po b/po/nb.po index a775e2f36..9f12ced23 100644 --- a/po/nb.po +++ b/po/nb.po @@ -3538,9 +3538,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Forbindelsen ble uventet stengt" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Ugyldig overstyring %s linje %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Ugyldig overstyring %s linje %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Ugyldig overstyring %s linje %lu #3" + #~ msgid "decompressor" #~ msgstr "dekomprimering" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Merk: Dette er gjort automatisk og med hensikt av dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lese, har fremdeles %lu igjen å lese, men ingen igjen" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "skrive, har fremdeles %lu igjen å skrive, men klarte ikke å" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3572,6 +3590,9 @@ msgstr "Forbindelsen ble uventet stengt" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Feil oppsto under behandling av %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Feil oppsto under behandling av %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Feil oppsto under behandling av %s (CollectFileProvides)" diff --git a/po/ne.po b/po/ne.po index d5dbb5162..7ee368e5e 100644 --- a/po/ne.po +++ b/po/ne.po @@ -3472,9 +3472,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "जडान असमायिक बन्द भयो" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "वैरुप्य गरिएको अधिलेखन %s रेखा %lu #१" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "वैरुप्य गरिएको अधिलेखन %s रेखा %lu #२" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "वैरुप्य गरिएको अधिलेखन %s रेखा %lu #३" + #~ msgid "decompressor" #~ msgstr "सङ्कुचनविहिन कर्ता" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "पड्नुहोस्, अहिले सम्म %lu पढ्न छ तर कुनै बाँकी छैन" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "लेख्नुहोस्, अहिले सम्म %lu लेख्न छ तर सकिदैन " + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr " %s प्रक्रिया गर्दा त्रुटि देखा पर्यो (नयाँ प्याकेज)" @@ -3502,6 +3517,9 @@ msgstr "जडान असमायिक बन्द भयो" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr " %s प्रक्रिया गर्दा त्रुटि देखा पर्यो (नयाँ फाइल संस्करण १)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr " %s प्रक्रिया गर्दा त्रुटि देखा पर्यो (pkg फेला पार्नुहोस् )" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr " %s प्रक्रिया गर्दा त्रुटि देखा पर्यो (संकलन फाइलले उपलब्ध गर्दछ)" diff --git a/po/nl.po b/po/nl.po index 36033f167..2597a3539 100644 --- a/po/nl.po +++ b/po/nl.po @@ -3600,9 +3600,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Verbinding werd voortijdig afgebroken" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Misvormde voorrangsingang %s op regel %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Misvormde voorrangsingang %s op regel %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Misvormde voorrangsingang %s op regel %lu #3" + #~ msgid "decompressor" #~ msgstr "decompressor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Let op: Dit wordt automatische en bewust door dpkg gedaan." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lees, de laatste te lezen %lu zijn niet beschikbaar" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "schrijf, de laatste %lu konden niet weggeschreven worden" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3634,6 +3652,9 @@ msgstr "Verbinding werd voortijdig afgebroken" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Fout tijdens verwerken van %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Fout tijdens verwerken van %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Fout tijdens verwerken van %s (CollectFileProvides)" diff --git a/po/nn.po b/po/nn.po index 771d933ea..418d4fe88 100644 --- a/po/nn.po +++ b/po/nn.po @@ -3493,9 +3493,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Sambandet vart uventa stengd" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Misforma overstyring %s linje %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Misforma overstyring %s linje %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Misforma overstyring %s linje %lu #3" + #~ msgid "decompressor" #~ msgstr "dekomprimering" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lese, har framleis %lu att lesa, men ingen att" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "skrive, har framleis %lu att skrive, men klarte ikkje" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Feil ved behandling av %s (NewPackage)" @@ -3523,6 +3538,9 @@ msgstr "Sambandet vart uventa stengd" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Feil ved behandling av %s (NewFileVer1)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Feil ved behandling av %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Feil ved behandling av %s (CollectFileProvides)" diff --git a/po/pl.po b/po/pl.po index e27e44ebd..fb8975b11 100644 --- a/po/pl.po +++ b/po/pl.po @@ -3624,9 +3624,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Połączenie zostało przedwcześnie zamknięte" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Nieprawidłowa linia %2$lu #1 pliku override %1$s" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Nieprawidłowa linia %2$lu #2 pliku override %1$s" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Nieprawidłowa linia %2$lu #3 pliku override %1$s" + #~ msgid "decompressor" #~ msgstr "dekompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Uwaga: dpkg wykonał to automatycznie i celowo." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "należało przeczytać jeszcze %lu, ale nic nie zostało" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "należało zapisać jeszcze %lu, ale nie udało się to" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3659,6 +3677,9 @@ msgstr "Połączenie zostało przedwcześnie zamknięte" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Wystąpił błąd podczas przetwarzania %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Wystąpił błąd podczas przetwarzania %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Wystąpił błąd podczas przetwarzania %s (CollectFileProvides)" diff --git a/po/pt.po b/po/pt.po index 0bdbeca5f..f7ca17e87 100644 --- a/po/pt.po +++ b/po/pt.po @@ -3589,9 +3589,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Ligação encerrada prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Override %s malformado linha %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Override %s malformado linha %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Override %s malformado linha %lu #3" + #~ msgid "decompressor" #~ msgstr "descompactador" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Nota: Isto foi feito automaticamente e intencionalmente pelo dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "lido, ainda restam %lu para serem lidos mas não resta nenhum" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escrito, ainda restam %lu para escrever mas não foi possível" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3624,6 +3642,9 @@ msgstr "Ligação encerrada prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Ocorreu um erro ao processar %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Ocorreu um erro ao processar %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Ocorreu um erro ao processar %s (CollectFileProvides)" diff --git a/po/pt_BR.po b/po/pt_BR.po index d7c4c0bb7..aff1293bb 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -3539,9 +3539,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Conexão encerrada prematuramente" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Override malformado %s linha %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Override malformado %s linha %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Override malformado %s linha %lu #3" + #~ msgid "decompressor" #~ msgstr "descompactador" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "leitura, ainda restam %lu para serem lidos mas nenhum deixado" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "escrita, ainda restam %lu para gravar mas não foi possível" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Um erro ocorreu processando %s (NovoPacote)" @@ -3567,6 +3582,9 @@ msgstr "Conexão encerrada prematuramente" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Um erro ocorreu processando %s (NovoArquivoDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Um erro ocorreu processando %s (EncontrarPacote)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Um erro ocorreu processando %s (ColetarArquivoProvides)" diff --git a/po/ro.po b/po/ro.po index bd84af0f1..acfcdd620 100644 --- a/po/ro.po +++ b/po/ro.po @@ -3549,9 +3549,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Conexiune închisă prematur" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Înlocuire greșită %s linia %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Înlocuire greșită %s linia %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Înlocuire greșită %s linia %lu #3" + #~ msgid "decompressor" #~ msgstr "decompresor" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "citire, încă mai am %lu de citit dar n-a mai rămas nimic" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "scriere, încă mai am %lu de scris dar nu pot" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Eroare apărută în timpul procesării %s (NewPackage)" @@ -3577,6 +3592,9 @@ msgstr "Conexiune închisă prematur" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "A apărut o eroare în timpul procesării lui %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Eroare apărută în timpul procesării %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Eroare apărută în timpul procesării %s (CollectFileProvides)" diff --git a/po/ru.po b/po/ru.po index 17e7511d1..bbeaf8e91 100644 --- a/po/ru.po +++ b/po/ru.po @@ -3626,9 +3626,28 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Соединение закрыто преждевременно" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Неправильная запись о переназначении (override) %s на строке %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Неправильная запись о переназначении (override) %s на строке %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Неправильная запись о переназначении (override) %s на строке %lu #3" + #~ msgid "decompressor" #~ msgstr "декомпрессор" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Замечание: это сделано автоматически и специально программой dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "" +#~ "ошибка при чтении. собирались прочесть ещё %lu байт, но ничего больше нет" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "ошибка при записи, собирались записать ещё %lu байт, но не смогли" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3660,6 +3679,9 @@ msgstr "Соединение закрыто преждевременно" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Произошла ошибка во время обработки %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Произошла ошибка во время обработки %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Произошла ошибка во время обработки %s (CollectFileProvides)" diff --git a/po/sk.po b/po/sk.po index c96e8441a..6c6519027 100644 --- a/po/sk.po +++ b/po/sk.po @@ -3563,9 +3563,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Spojenie bolo predčasne ukončené" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Skomolený „override“ %s riadok %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Skomolený „override“ %s riadok %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Skomolený „override“ %s riadok %lu #3" + #~ msgid "decompressor" #~ msgstr "dekompresor" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Pozn.: Toto robí dpkg automaticky a zámerne." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "čítanie, stále treba prečítať %lu, ale už nič neostáva" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "zápis, stále treba zapísať %lu, no nedá sa to" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3597,6 +3615,9 @@ msgstr "Spojenie bolo predčasne ukončené" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Vyskytla sa chyba pri spracovávaní %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Chyba pri spracovávaní %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Chyba pri spracovávaní %s (CollectFileProvides)" diff --git a/po/sl.po b/po/sl.po index 348d4569c..3a3d5bf8c 100644 --- a/po/sl.po +++ b/po/sl.po @@ -3544,9 +3544,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Povezava se je prezgodaj zaprla" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Napačno oblikovana prepisana vrstica %s %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Napačno oblikovana prepisana vrstica %s %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Napačno oblikovanje prepisane vrstice %s %lu #3" + #~ msgid "decompressor" #~ msgstr "program za razširjanje" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Opomba: To je dpkg storil samodejno in namenoma." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "branje, še vedno %lu za branje, a nobeden ni ostal" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "pisanje, še vedno %lu za pisanje, a ni mogoče" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3578,6 +3596,9 @@ msgstr "Povezava se je prezgodaj zaprla" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Med obdelovanjem %s je prišlo do napake (NovOpisDatoteke2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Prišlo je do napake med obdelavo %s (Najdi paket)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Prišlo je do napake med obdelavo %s (Zberi dobavitelje datotek)" diff --git a/po/sv.po b/po/sv.po index 9d854db62..67e603cd8 100644 --- a/po/sv.po +++ b/po/sv.po @@ -3571,9 +3571,28 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Anslutningen stängdes i förtid" +# parametrar: filnamn, radnummer +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Felaktig override %s rad %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Felaktig override %s rad %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Felaktig override %s rad %lu #3" + #~ msgid "decompressor" #~ msgstr "uppackare" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Observera: Detta sker med automatik och vid behov av dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "läsning, har fortfarande %lu att läsa men ingenting finns kvar" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "skrivning, har fortfarande %lu att skriva men kunde inte" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3606,6 +3625,10 @@ msgstr "Anslutningen stängdes i förtid" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Fel uppstod vid hantering av %s (NewFileDesc2)" +# NewPackage etc. är funktionsnamn +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Fel uppstod vid hantering av %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "Fel uppstod vid hantering av %s (CollectFileProvides)" diff --git a/po/th.po b/po/th.po index 3112ebf8d..d414c4430 100644 --- a/po/th.po +++ b/po/th.po @@ -3452,9 +3452,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "การเชื่อมต่อถูกปิดก่อนเวลาอันควร" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "แฟ้ม override %s ผิดรูปแบบที่บรรทัด %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "แฟ้ม override %s ผิดรูปแบบที่บรรทัด %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "แฟ้ม override %s ผิดรูปแบบที่บรรทัด %lu #3" + #~ msgid "decompressor" #~ msgstr "ตัวคลายบีบอัด" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "read: ยังเหลือ %lu ที่ยังไม่ได้อ่าน แต่ข้อมูลหมดแล้ว" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "write: ยังเหลือ %lu ที่ยังไม่ได้เขียน แต่ไม่สามารถเขียนได้" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "เกิดข้อผิดพลาดขณะประมวลผล %s (NewPackage)" @@ -3480,6 +3495,9 @@ msgstr "การเชื่อมต่อถูกปิดก่อนเว #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "เกิดข้อผิดพลาดขณะประมวลผล %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "เกิดข้อผิดพลาดขณะประมวลผล %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "เกิดข้อผิดพลาดขณะประมวลผล %s (CollectFileProvides)" diff --git a/po/tl.po b/po/tl.po index ddbf9db93..51fa4587a 100644 --- a/po/tl.po +++ b/po/tl.po @@ -3531,9 +3531,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Nagsara ng maaga ang koneksyon" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Maling anyo ng override %s linya %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Maling anyo ng override %s linya %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Maling anyo ng override %s linya %lu #3" + #~ msgid "decompressor" #~ msgstr "taga-decompress" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "pagbasa, mayroong %lu na babasahin ngunit walang natira" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "pagsulat, mayroon pang %lu na isusulat ngunit hindi makasulat" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "May naganap na error habang prinoseso ang %s (NewPackage)" @@ -3561,6 +3576,9 @@ msgstr "Nagsara ng maaga ang koneksyon" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "May naganap na error habang prinoseso ang %s (NewFileVer1)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "May naganap na error habang prinoseso ang %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "May naganap na Error habang prinoseso ang %s (CollectFileProvides)" diff --git a/po/uk.po b/po/uk.po index f8c1a48fb..4c0cd5b85 100644 --- a/po/uk.po +++ b/po/uk.po @@ -3544,9 +3544,25 @@ msgstr "" msgid "Connection closed prematurely" msgstr "З'єднання завершено передчасно" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Спотворений запис про перепризначення (override) %s на рядку %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Спотворений запис про перепризначення (override) %s на рядку %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Спотворений запис про перепризначення (override) %s на рядку %lu #3" + #~ msgid "decompressor" #~ msgstr "декомпресор" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "" +#~ "помилка при читанні. мали прочитати ще %lu байт, але нічого більше нема" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "помилка при записі, мали прочитати ще %lu байт, але не змогли" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "Помилка, яка була викликана внаслідок обробки %s (NewPackage)" @@ -3574,6 +3590,9 @@ msgstr "З'єднання завершено передчасно" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Помилка, яка була викликана внаслідок обробки %s (NewFileVer1)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Помилка, яка була викликана внаслідок обробки %s (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "" #~ "Помилка, яка була викликана внаслідок обробки %s (CollectFileProvides)" diff --git a/po/vi.po b/po/vi.po index 7f058840e..00300fb6d 100644 --- a/po/vi.po +++ b/po/vi.po @@ -3578,9 +3578,27 @@ msgstr "" msgid "Connection closed prematurely" msgstr "Kết nối bị đóng quá sớm." +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "Điều đè dạng sai %s dòng %lu #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "Điều đè dạng sai %s dòng %lu #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "Điều đè dạng sai %s dòng %lu #3" + #~ msgid "decompressor" #~ msgstr "bộ giải nén" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "Ghi chú : thay đổi này được tự động làm bởi dpkg." + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "đọc, còn cần đọc %lu nhưng mà không có gì còn lại" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "ghi, còn cần ghi %lu nhưng mà không thể" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3612,6 +3630,9 @@ msgstr "Kết nối bị đóng quá sớm." #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "Gặp lỗi khi xử lý %s (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "Gặp lỗi khi xử lý %s (FindPkg - tìm gói)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "" #~ "Gặp lỗi khi xử lý %s (CollectFileProvides - tập hợp các trường hợp miễn " diff --git a/po/zh_CN.po b/po/zh_CN.po index 8fb361fb9..8dfa91730 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -3466,9 +3466,27 @@ msgstr "无法连同 mmap 为 %s 打补丁(但没有 mmap 的错误) - 补丁可 msgid "Connection closed prematurely" msgstr "连接被永久关闭" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "override 文件 %s 第 %lu 行的格式有误 #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "override 文件 %s 第 %lu 行的格式有误 #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "override 文件 %s 第 %lu 行的格式有误 #3" + #~ msgid "decompressor" #~ msgstr "解压程序" +#~ msgid "Note: This is done automatically and on purpose by dpkg." +#~ msgstr "注意:这是自动被 dpkg 有意完成的。" + +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "读取文件出错,还剩 %lu 字节没有读出" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "写入文件出错,还剩 %lu 字节没有保存" + #~ msgid "" #~ "Could not perform immediate configuration on already unpacked '%s'. " #~ "Please see man 5 apt.conf under APT::Immediate-Configure for details." @@ -3500,6 +3518,9 @@ msgstr "连接被永久关闭" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "处理 %s (NewFileDesc2)时出错" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "处理 %s (FindPkg)时出错" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "处理 %s (CollectFileProvides)时出错" diff --git a/po/zh_TW.po b/po/zh_TW.po index 68807a680..aa1b493e9 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -3451,9 +3451,24 @@ msgstr "" msgid "Connection closed prematurely" msgstr "連線突然終止" +#~ msgid "Malformed override %s line %lu #1" +#~ msgstr "重新定義檔 %s 第 %lu 行的格式錯誤 #1" + +#~ msgid "Malformed override %s line %lu #2" +#~ msgstr "重新定義檔 %s 第 %lu 行的格式錯誤 #2" + +#~ msgid "Malformed override %s line %lu #3" +#~ msgstr "重新定義檔 %s 第 %lu 行的格式錯誤 #3" + #~ msgid "decompressor" #~ msgstr "解壓縮程式" +#~ msgid "read, still have %lu to read but none left" +#~ msgstr "讀取,仍有 %lu 未讀但已無空間" + +#~ msgid "write, still have %lu to write but couldn't" +#~ msgstr "寫入,仍有 %lu 待寫入但已沒辨法" + #~ msgid "Error occurred while processing %s (NewPackage)" #~ msgstr "在處理 %s 時發生錯誤 (NewPackage)" @@ -3479,6 +3494,9 @@ msgstr "連線突然終止" #~ msgid "Error occurred while processing %s (NewFileDesc2)" #~ msgstr "在處理 %s 時發生錯誤 (NewFileDesc2)" +#~ msgid "Error occurred while processing %s (FindPkg)" +#~ msgstr "在處理 %s 時發生錯誤 (FindPkg)" + #~ msgid "Error occurred while processing %s (CollectFileProvides)" #~ msgstr "在處理 %s 時發生錯誤 (CollectFileProvides)" diff --git a/test/integration/test-disappearing-packages b/test/integration/test-disappearing-packages index 0e0e9618d..d2ac4edc6 100755 --- a/test/integration/test-disappearing-packages +++ b/test/integration/test-disappearing-packages @@ -39,7 +39,7 @@ COMPAREFILE=$(mktemp) echo "The following package disappeared from your system as all files have been overwritten by other packages: old-pkg -Note: This is done automatic and on purpose by dpkg." > $COMPAREFILE +Note: This is done automatically and on purpose by dpkg." > $COMPAREFILE $CMD 2>&1 | tail -n 4 | diff $COMPAREFILE - && msgpass || msgfail rm $COMPAREFILE -- cgit v1.2.3-70-g09d2