extends 'System::Introspector::Report::Builder';
-has _known_package => (is => 'ro', default => sub { {} });
-has _host_package => (is => 'ro', default => sub { {} });
-has _host_upgrade => (is => 'ro', default => sub { {} });
+has _known_package => (is => 'ro', default => sub { {} });
+has _host_package => (is => 'ro', default => sub { {} });
+has _host_upgrade => (is => 'ro', default => sub { {} });
+has include_uninstalled => (is => 'ro');
sub required_data {
return qw(
my $host_package = $self->_host_package;
my $host_upgrade = $self->_host_upgrade;
my @known_packages = sort keys %{$self->_known_package};
+ my $inc_uninstalled = $self->include_uninstalled;
return map {
my $remote = $_;
+{
defined($version) ? (version => $version) : (),
defined($upgrade) ? (upgrade => $upgrade) : (),
};
+ } grep {
+ $inc_uninstalled
+ ? 1
+ : defined($host_package->{$remote}{$_});
} @known_packages],
};
} sort keys %{$self->_host_package};
use aliased 'System::Introspector::Report::Source';
my $source = Source->new(root => "$FindBin::Bin/data/json/");
-my @reports = $source->generate(['Packages::Apt::ByHost', {}]);
+my @reports = $source->generate(['Packages::Apt::ByHost', {
+ include_uninstalled => 1,
+}]);
is scalar(@reports), 2, 'two reports received';