From 443266ef94244f2c6854f34ddbacf1fcacfdb0f6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 14 Aug 2010 01:21:50 +0200 Subject: do not unconditional print the new debugoutput for "FixByInstall" --- apt-pkg/algorithms.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 5641869ab..3c8711b74 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1052,7 +1052,8 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) solving this dependency. This helps every time a previous solver is removed by the resolver because of a conflict or alike but it is dangerous as it could trigger new breaks/conflicts… */ - std::cout << " Try Installing " << Start.TargetPkg() << " before changing " << I.FullName(false) << std::endl; + if (Debug == true) + clog << " Try Installing " << Start.TargetPkg() << " before changing " << I.FullName(false) << std::endl; unsigned long const OldBroken = Cache.BrokenCount(); Cache.MarkInstall(Start.TargetPkg(), true, 1, false); // FIXME: we should undo the complete MarkInstall process here -- cgit v1.2.3 From ea6db08d45e012d577f3081fa2070db9e034add9 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 16 Aug 2010 11:38:20 +0200 Subject: * apt-pkg/contrib/strutl.cc: - fix error checking for vsnprintf in its safe variant Spotted by -Wextra: contrib/strutl.cc: In function 'char* safe_snprintf(char*, char*, const char*, ...)': contrib/strutl.cc:1172:14: warning: comparison of unsigned expression < 0 is always false --- apt-pkg/contrib/strutl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index ace74cb37..c1844de40 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1161,7 +1161,7 @@ void strprintf(string &out,const char *format,...) char *safe_snprintf(char *Buffer,char *End,const char *Format,...) { va_list args; - unsigned long Did; + int Did; va_start(args,Format); -- cgit v1.2.3 From 4368851d55589a55fc10ff347890d8bbf33ee002 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Aug 2010 00:04:05 +0200 Subject: * apt-pkg/init.cc: - set the default values for dir::etc::trusted options correctly --- apt-pkg/indexcopy.cc | 5 ++--- apt-pkg/init.cc | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index b4e587d7b..a2a1d5934 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -661,9 +661,8 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, { string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); // FIXME: remove support for deprecated APT::GPGV setting - string const trustedFile = _config->FindFile("Dir::Etc::Trusted", - _config->Find("APT::GPGV::TrustedKeyring", "/etc/apt/trusted.gpg").c_str()); - string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts", "/etc/apt/trusted.gpg.d"); + string const trustedFile = _config->FindFile("Dir::Etc::Trusted"); + string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts"); bool const Debug = _config->FindB("Debug::Acquire::gpgv", false); diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 7a332c86e..846b27313 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -70,6 +70,9 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::Etc::parts","apt.conf.d"); Cnf.Set("Dir::Etc::preferences","preferences"); Cnf.Set("Dir::Etc::preferencesparts","preferences.d"); + string const deprecated = _config->Find("APT::GPGV::TrustedKeyring"); + Cnf.Set("Dir::Etc::trusted", deprecated.empty() ? "trusted.gpg" : deprecated); + Cnf.Set("Dir::Etc::trustedparts","trusted.gpg.d"); Cnf.Set("Dir::Bin::methods","/usr/lib/apt/methods"); Cnf.Set("Dir::Media::MountPath","/media/apt"); -- cgit v1.2.3 From 86f33b2382bbc8a4c06343801564f6a74e3081f4 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 19 Aug 2010 00:31:55 +0200 Subject: * apt-pkg/deb/debsystem.cc: - set dir::state::status based at least on dir --- apt-pkg/deb/debsystem.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/debsystem.cc b/apt-pkg/deb/debsystem.cc index 7056d771d..ab08a8f4d 100644 --- a/apt-pkg/deb/debsystem.cc +++ b/apt-pkg/deb/debsystem.cc @@ -165,7 +165,7 @@ bool debSystem::Initialize(Configuration &Cnf) which is yet to be determined. The functions in pkgcachegen should be the only users of these */ Cnf.CndSet("Dir::State::extended_states", Cnf.FindDir("Dir::State").append("extended_states")); - Cnf.CndSet("Dir::State::status","/var/lib/dpkg/status"); + Cnf.CndSet("Dir::State::status", Cnf.FindDir("Dir", "/").append("var/lib/dpkg/status")); Cnf.CndSet("Dir::Bin::dpkg","/usr/bin/dpkg"); if (StatusFile) { -- cgit v1.2.3 From 75954ae2420ae7755d8482f2f1eecc03595a5153 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 20 Aug 2010 19:09:16 +0200 Subject: * apt-pkg/deb/dpkgpm.cc: - use the InstVer instead of the CurrentVer for the autobit transfer Add also a small testcase to check the handling automatical --- apt-pkg/deb/dpkgpm.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index aa0b04bd5..5530ef129 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -554,7 +554,7 @@ void pkgDPkgPM::handleDisappearAction(string const &pkgname) // the disappeared package was auto-installed - nothing to do if ((Cache[Pkg].Flags & pkgCache::Flag::Auto) == pkgCache::Flag::Auto) return; - pkgCache::VerIterator PkgVer = Pkg.CurrentVer(); + pkgCache::VerIterator PkgVer = Cache[Pkg].InstVerIter(Cache); if (unlikely(PkgVer.end() == true)) return; /* search in the list of dependencies for (Pre)Depends, @@ -571,7 +571,9 @@ void pkgDPkgPM::handleDisappearAction(string const &pkgname) // the package is already marked as manual if ((Cache[Tar].Flags & pkgCache::Flag::Auto) != pkgCache::Flag::Auto) continue; - pkgCache::VerIterator TarVer = Tar.CurrentVer(); + pkgCache::VerIterator TarVer = Cache[Tar].InstVerIter(Cache); + if (TarVer.end() == true) + continue; for (pkgCache::DepIterator Rep = TarVer.DependsList(); Rep.end() != true; ++Rep) { if (Rep->Type != pkgCache::Dep::Replaces) -- cgit v1.2.3 From f213b6ea7397f2ba5b770e1a30e57dc8438bf61e Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 21 Aug 2010 22:19:56 +0200 Subject: * apt-pkg/acquire-item.cc: - don't use ReadOnlyGzip mode for PDiffs as this mode doesn't work in combination with the AddFd methods of our hashclasses Add also 2 testcases: one to test pdiffs in general and one to test the handling of compressed indexes. --- apt-pkg/acquire-item.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index a289fb7ba..752bc6a99 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -280,7 +280,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) /*{{{*/ ss >> ServerSha1 >> size; unsigned long const ServerSize = atol(size.c_str()); - FileFd fd(CurrentPackagesFile, FileFd::ReadOnlyGzip); + FileFd fd(CurrentPackagesFile, FileFd::ReadOnly); SHA1Summation SHA1; SHA1.AddFD(fd.Fd(), fd.Size()); string const local_sha1 = SHA1.Result(); @@ -297,7 +297,7 @@ bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile) /*{{{*/ else { if(Debug) - std::clog << "SHA1-Current: " << ServerSha1 << std::endl; + std::clog << "SHA1-Current: " << ServerSha1 << " and we start at "<< fd.Name() << " " << fd.Size() << " " << local_sha1 << std::endl; // check the historie and see what patches we need string const history = Tags.FindS("SHA1-History"); @@ -511,7 +511,7 @@ bool pkgAcqIndexDiffs::QueueNextDiff() /*{{{*/ string FinalFile = _config->FindDir("Dir::State::lists"); FinalFile += URItoFileName(RealURI); - FileFd fd(FinalFile, FileFd::ReadOnlyGzip); + FileFd fd(FinalFile, FileFd::ReadOnly); SHA1Summation SHA1; SHA1.AddFD(fd.Fd(), fd.Size()); string local_sha1 = string(SHA1.Result()); -- cgit v1.2.3