Explorar o código

Dpkg::BuildFlags: Add get_feature_areas()

Add a way for a caller to enumerate all possible values of get_features().

Signed-off-by: Bernhard R. Link <brlink@debian.org>
Signed-off-by: Guillem Jover <guillem@debian.org>
Bernhard R. Link %!s(int64=14) %!d(string=hai) anos
pai
achega
a9c7a93ef1
Modificáronse 1 ficheiros con 18 adicións e 1 borrados
  1. 18 1
      scripts/Dpkg/BuildFlags.pm

+ 18 - 1
scripts/Dpkg/BuildFlags.pm

@@ -18,7 +18,7 @@ package Dpkg::BuildFlags;
 use strict;
 use warnings;
 
-our $VERSION = "1.02";
+our $VERSION = "1.03";
 
 use Dpkg::Gettext;
 use Dpkg::BuildOptions;
@@ -320,6 +320,18 @@ sub get {
     return $self->{'flags'}{$key};
 }
 
+=item $bf->get_feature_areas()
+
+Return the feature areas (i.e. the area values has_features will return
+true for).
+
+=cut
+
+sub get_feature_areas {
+    my ($self) = @_;
+    return keys $self->{'features'};
+}
+
 =item $bf->get_features($area)
 
 Return, for the given area, a hash with keys as feature names, and values
@@ -394,6 +406,11 @@ based on the package maintainer directives.
 
 New methods: $bf->get_features(), $bf->has_features(), $bf->set_feature().
 
+=head2 Version 1.03
+
+New method: $bf->get_feature_areas() to list possible values for
+$bf->get_features.
+
 =head1 AUTHOR
 
 Raphaël Hertzog <hertzog@debian.org>