From 72cf877c2e11cafe4809b2530af17881ec3c2ebe Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 24 May 2012 19:42:57 +0200 Subject: * cmdline/apt-get.cc: - do not show 'list of broken packages' header if no package is broken as it happens e.g. for external resolver errors --- cmdline/apt-get.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index c996017b8..6ef046089 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -254,6 +254,9 @@ bool ShowList(ostream &out,string Title,string List,string VersionsList) */ void ShowBroken(ostream &out,CacheFile &Cache,bool Now) { + if (Cache->BrokenCount() == 0) + return; + out << _("The following packages have unmet dependencies:") << endl; for (unsigned J = 0; J < Cache->Head().PackageCount; J++) { -- cgit v1.2.3 From a98b6615254f8f7251d43c52de8f1f605c821ed7 Mon Sep 17 00:00:00 2001 From: Daniel Hartwig Date: Sun, 10 Jun 2012 00:18:19 +0200 Subject: * cmdline/apt-get.cc: - print URIs for all changelogs in case of --print-uris, thanks to Daniel Hartwig for the patch! (Closes: #674897) --- cmdline/apt-get.cc | 6 +++++- debian/changelog | 2 ++ test/integration/test-apt-get-changelog | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 6ef046089..0636489cb 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -3244,9 +3244,13 @@ bool DoChangelog(CommandLine &CmdL) pkgAcquire Fetcher; if (_config->FindB("APT::Get::Print-URIs", false) == true) + { + bool Success = true; for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver) - return DownloadChangelog(Cache, Fetcher, Ver, ""); + Success &= DownloadChangelog(Cache, Fetcher, Ver, ""); + return Success; + } AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0)); Fetcher.Setup(&Stat); diff --git a/debian/changelog b/debian/changelog index 3a8ae4002..d8adba89a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ apt (0.9.5.2) UNRELEASED; urgency=low * cmdline/apt-get.cc: - do not show 'list of broken packages' header if no package is broken as it happens e.g. for external resolver errors + - print URIs for all changelogs in case of --print-uris, + thanks to Daniel Hartwig for the patch! (Closes: #674897) * debian/apt-utils.links: - the internal resolver 'apt' is now directly installed in /usr/lib/apt/solvers, so don't instruct dh to create a broken link diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog index 0a80cc08c..d013cc458 100755 --- a/test/integration/test-apt-get-changelog +++ b/test/integration/test-apt-get-changelog @@ -17,6 +17,9 @@ echo 'Apt::Changelogs::Server "http://localhost:8080/";' >> ./aptconfig.conf testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris +testequal "'http://localhost:8080//pool/apt_1.0/changelog' +'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt apt --print-uris + aptget changelog apt -qq > apt.changelog testfileequal 'apt.changelog' "$(cat aptarchive/pool/apt_1.0/changelog)" rm apt.changelog -- cgit v1.2.3 From f3e3a2d40e736e368678adf1c4d2793535dc9acc Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sun, 10 Jun 2012 12:27:24 +0200 Subject: show 'bzr branch' as 'bzr get' is deprecated (LP: #1011032) --- cmdline/apt-get.cc | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 0636489cb..ef16a7870 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2499,7 +2499,7 @@ bool DoSource(CommandLine &CmdL) Src.c_str(), vcs.c_str(), uri.c_str()); if(vcs == "Bzr") ioprintf(c1out,_("Please use:\n" - "bzr get %s\n" + "bzr branch %s\n" "to retrieve the latest (possibly unreleased) " "updates to the package.\n"), uri.c_str()); diff --git a/debian/changelog b/debian/changelog index adcf0d956..91511f2e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ apt (0.9.5.2) UNRELEASED; urgency=low is broken as it happens e.g. for external resolver errors - print URIs for all changelogs in case of --print-uris, thanks to Daniel Hartwig for the patch! (Closes: #674897) + - show 'bzr branch' as 'bzr get' is deprecated (LP: #1011032) * debian/apt-utils.links: - the internal resolver 'apt' is now directly installed in /usr/lib/apt/solvers, so don't instruct dh to create a broken link -- cgit v1.2.3 From a9a370d92c490f3f28cc1a1b1619971832c76de5 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 10 Jun 2012 13:06:11 +0200 Subject: * cmdline/apt-get.cc: - complain correctly about :any build-dep on M-A:none packages --- cmdline/apt-get.cc | 8 ++++---- debian/changelog | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index ef16a7870..a4fd3cfb9 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2919,9 +2919,9 @@ bool DoBuildDep(CommandLine &CmdL) if (Ver->MultiArch == pkgCache::Version::None || Ver->MultiArch == pkgCache::Version::All) { if (colon == string::npos) - { Pkg = Ver.ParentPkg().Group().FindPkg(hostArch); - } + else if (strcmp(D->Package.c_str() + colon, ":any") == 0) + forbidden = "Multi-Arch: none"; } else if (Ver->MultiArch == pkgCache::Version::Same) { @@ -2956,13 +2956,13 @@ bool DoBuildDep(CommandLine &CmdL) if (forbidden.empty() == false) { if (_config->FindB("Debug::BuildDeps",false) == true) - cout << " :any is not allowed from M-A: same package " << (*D).Package << endl; + cout << D->Package.substr(colon, string::npos) << " is not allowed from " << forbidden << " package " << (*D).Package << endl; if (hasAlternatives) continue; return _error->Error(_("%s dependency for %s can't be satisfied " "because %s is not allowed on '%s' packages"), Last->BuildDepType(D->Type), Src.c_str(), - D->Package.c_str(), "Multi-Arch: same"); + D->Package.c_str(), forbidden.c_str()); } } else if (_config->FindB("Debug::BuildDeps",false) == true) diff --git a/debian/changelog b/debian/changelog index 91511f2e7..720b07273 100644 --- a/debian/changelog +++ b/debian/changelog @@ -64,6 +64,10 @@ apt (0.9.5.2) UNRELEASED; urgency=low * French program and manpage translation update * Danish program translation by Joe Hansen. Closes: #675605 + [ Thibaut Girka ] + * cmdline/apt-get.cc: + - complain correctly about :any build-dep on M-A:none packages + -- David Kalnischkies Wed, 06 Jun 2012 23:54:01 +0200 apt (0.9.5.1) unstable; urgency=low -- cgit v1.2.3 From d5dea0bed00ff1811fac1b56c2046d63c937a3f6 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 11 Jun 2012 00:16:51 +0200 Subject: check build-dep candidate if install is forbidden --- cmdline/apt-get.cc | 58 +++++++++++++++------- debian/changelog | 1 + test/integration/framework | 3 +- .../test-bug-632221-cross-dependency-satisfaction | 14 ++++++ 4 files changed, 56 insertions(+), 20 deletions(-) (limited to 'cmdline') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index a4fd3cfb9..870c77280 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -2889,33 +2889,42 @@ bool DoBuildDep(CommandLine &CmdL) else Pkg = Cache->FindPkg(D->Package); - // We need to decide if host or build arch, so find a version we can look at - pkgCache::VerIterator Ver; - // a bad version either is invalid or doesn't satify dependency - #define BADVER(Ver) Ver.end() == true || \ - (Ver.end() == false && D->Version.empty() == false && \ - Cache->VS().CheckDep(Ver.VerStr(),D->Op,D->Version.c_str()) == false) + #define BADVER(Ver) (Ver.end() == true || \ + (D->Version.empty() == false && \ + Cache->VS().CheckDep(Ver.VerStr(),D->Op,D->Version.c_str()) == false)) + APT::VersionList verlist; if (Pkg.end() == false) { - Ver = (*Cache)[Pkg].InstVerIter(*Cache); - if (BADVER(Ver)) - Ver = (*Cache)[Pkg].CandidateVerIter(*Cache); + pkgCache::VerIterator Ver = (*Cache)[Pkg].InstVerIter(*Cache); + if (BADVER(Ver) == false) + verlist.insert(Ver); + Ver = (*Cache)[Pkg].CandidateVerIter(*Cache); + if (BADVER(Ver) == false) + verlist.insert(Ver); } - if (BADVER(Ver)) + if (verlist.empty() == true) { pkgCache::PkgIterator HostPkg = Cache->FindPkg(D->Package, hostArch); if (HostPkg.end() == false) { - Ver = (*Cache)[HostPkg].InstVerIter(*Cache); - if (BADVER(Ver)) - Ver = (*Cache)[HostPkg].CandidateVerIter(*Cache); + pkgCache::VerIterator Ver = (*Cache)[HostPkg].InstVerIter(*Cache); + if (BADVER(Ver) == false) + verlist.insert(Ver); + Ver = (*Cache)[HostPkg].CandidateVerIter(*Cache); + if (BADVER(Ver) == false) + verlist.insert(Ver); } } - if ((BADVER(Ver)) == false) + #undef BADVER + + string forbidden; + // We need to decide if host or build arch, so find a version we can look at + APT::VersionList::const_iterator Ver = verlist.begin(); + for (; Ver != verlist.end(); ++Ver) { - string forbidden; + forbidden.clear(); if (Ver->MultiArch == pkgCache::Version::None || Ver->MultiArch == pkgCache::Version::All) { if (colon == string::npos) @@ -2953,10 +2962,24 @@ bool DoBuildDep(CommandLine &CmdL) } // native gets buildArch } + if (forbidden.empty() == false) { if (_config->FindB("Debug::BuildDeps",false) == true) - cout << D->Package.substr(colon, string::npos) << " is not allowed from " << forbidden << " package " << (*D).Package << endl; + cout << D->Package.substr(colon, string::npos) << " is not allowed from " << forbidden << " package " << (*D).Package << " (" << Ver.VerStr() << ")" << endl; + continue; + } + + //we found a good version + break; + } + if (Ver == verlist.end()) + { + if (_config->FindB("Debug::BuildDeps",false) == true) + cout << " No multiarch info as we have no satisfying installed nor candidate for " << D->Package << " on build or host arch" << endl; + + if (forbidden.empty() == false) + { if (hasAlternatives) continue; return _error->Error(_("%s dependency for %s can't be satisfied " @@ -2965,9 +2988,6 @@ bool DoBuildDep(CommandLine &CmdL) D->Package.c_str(), forbidden.c_str()); } } - else if (_config->FindB("Debug::BuildDeps",false) == true) - cout << " No multiarch info as we have no satisfying installed nor candidate for " << D->Package << " on build or host arch" << endl; - #undef BADVER } else Pkg = Cache->FindPkg(D->Package); diff --git a/debian/changelog b/debian/changelog index 720b07273..ee108b059 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ apt (0.9.5.2) UNRELEASED; urgency=low - print URIs for all changelogs in case of --print-uris, thanks to Daniel Hartwig for the patch! (Closes: #674897) - show 'bzr branch' as 'bzr get' is deprecated (LP: #1011032) + - check build-dep candidate if install is forbidden * debian/apt-utils.links: - the internal resolver 'apt' is now directly installed in /usr/lib/apt/solvers, so don't instruct dh to create a broken link diff --git a/test/integration/framework b/test/integration/framework index 5a0e1070f..dba8c0162 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -508,7 +508,8 @@ Architecture: $ARCH" >> $FILE test -z "$DEPENDENCIES" || echo "$DEPENDENCIES" >> $FILE echo "Files: d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.dsc - d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz" >> $FILE + d41d8cd98f00b204e9800998ecf8427e 0 ${NAME}_${VERSION}.tar.gz +" >> $FILE } insertinstalledpackage() { diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index a128366c5..93cc153e6 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -23,8 +23,22 @@ insertpackage 'unstable' 'linux-stuff' 'amd64,armel' '1.0' insertsource 'unstable' 'apt' 'any' '0.8.15' 'Build-Depends: doxygen, libc6-dev, libc6-dev:native, cool:any, amdboot:amd64, foreigner, libfwibble-dev, arm-stuff [any-arm] | linux-stuff [ linux-any]' +insertsource 'unstable' 'forbidden-none' 'any' '1' 'Build-Depends: amdboot:any' +insertsource 'unstable' 'forbidden-same' 'any' '1' 'Build-Depends: libc6:any' +insertsource 'unstable' 'forbidden-foreign' 'any' '1' 'Build-Depends: doxygen:any' + setupaptarchive +testequal "Reading package lists... +Building dependency tree... +E: Build-Depends dependency for forbidden-none can't be satisfied because amdboot:any is not allowed on 'Multi-Arch: none' packages" aptget build-dep forbidden-none -s -a armel +testequal "Reading package lists... +Building dependency tree... +E: Build-Depends dependency for forbidden-same can't be satisfied because libc6:any is not allowed on 'Multi-Arch: same' packages" aptget build-dep forbidden-same -s -a armel +testequal "Reading package lists... +Building dependency tree... +E: Build-Depends dependency for forbidden-foreign can't be satisfied because doxygen:any is not allowed on 'Multi-Arch: foreign' packages" aptget build-dep forbidden-foreign -s -a armel + testequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: -- cgit v1.2.3