From f555a5fc200b47fabfa6ccd071c3dc6a7fa47e9f Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Fri, 15 Nov 2013 16:57:55 -0800 Subject: [PATCH] add get source maintainers command --- Debbugs/Common.pm | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/Debbugs/Common.pm b/Debbugs/Common.pm index 732ac2e..fe25d25 100644 --- a/Debbugs/Common.pm +++ b/Debbugs/Common.pm @@ -299,6 +299,36 @@ sub getmaintainers_reverse{ return $_maintainer_rev; } +=head2 getsourcemaintainers + + my $maintainer = getsourcemaintainers()->{debbugs} + +Returns a hashref of src_package => maintainer pairs. + +=cut + +our $_source_maintainer = undef; +our $_source_maintainer_rev = undef; +sub getsourcemaintainers { + return $_source_maintainer if defined $_source_maintainer; + package_maintainer(rehash => 1); + return $_source_maintainer; +} + +=head2 getsourcemaintainers_reverse + + my @src_packages = @{getsourcemaintainers_reverse->{'don@debian.org'}||[]}; + +Returns a hashref of maintainer => [qw(list of source packages)] pairs. + +=cut + +sub getsourcemaintainers_reverse{ + return $_source_maintainer_rev if defined $_source_maintainer_rev; + package_maintainer(rehash => 1); + return $_source_maintainer_rev; +} + =head2 package_maintainer my @s = package_maintainer(source => [qw(foo bar baz)], @@ -324,8 +354,6 @@ files; defaults to 0 =cut -our $_source_maintainer = undef; -our $_source_maintainer_rev = undef; sub package_maintainer { my %param = validate_with(params => \@_, spec => {source => {type => SCALAR|ARRAYREF, -- 2.39.2