From c23d96d6520dd19dad0b947b370d4a1f6b961221 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 21 Jan 2017 16:03:02 +0000 Subject: [PATCH] Don't show source-only packages in package list external-source: packages which have no binary package will be marked skip: and so won't show up in setup.ini at all. If we change to using the Source: line to identify a source package, which is (by definition) source only, these will appear in setup.ini, but without any install: lines, so we need to explcitly avoid showing them in the package list. Future work: perhaps add another view to show just source packages? --- PickView.cc | 3 +++ package_meta.cc | 12 ++++++++++++ package_meta.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/PickView.cc b/PickView.cc index 1ba55e81..b3b1c1a2 100644 --- a/PickView.cc +++ b/PickView.cc @@ -165,6 +165,9 @@ PickView::setViewMode (views mode) { packagemeta & pkg = *(i->second); + if (!pkg.isBinary()) + continue; + if ( // "Full" : everything (view_mode == PickView::views::PackageFull) diff --git a/package_meta.cc b/package_meta.cc index 0f97f1d0..24ed17e4 100644 --- a/package_meta.cc +++ b/package_meta.cc @@ -537,6 +537,18 @@ packagemeta::sourceAccessible () const if (bin.sourcePackage().accessible()) return true; } + + return false; +} + +bool +packagemeta::isBinary () const +{ + for (set::iterator i=versions.begin(); + i != versions.end(); ++i) + if ((i->Type() == package_binary) && i->accessible()) + return true; + return false; } diff --git a/package_meta.h b/package_meta.h index 9bf83368..5f7842c7 100644 --- a/package_meta.h +++ b/package_meta.h @@ -142,6 +142,8 @@ public: bool accessible () const; bool sourceAccessible() const; + bool isBinary() const; + void logSelectionStatus() const; void logAllVersions() const; -- 2.43.5