1Dpkg::BuildOptions(3perl) libdpkg-perl Dpkg::BuildOptions(3perl)
2
3
4
6 Dpkg::BuildOptions - parse and update build options
7
9 This class can be used to manipulate options stored in environment
10 variables like DEB_BUILD_OPTIONS and DEB_BUILD_MAINT_OPTIONS.
11
13 $bo = Dpkg::BuildOptions->new(%opts)
14 Create a new Dpkg::BuildOptions object. It will be initialized
15 based on the value of the environment variable named $opts{envvar}
16 (or DEB_BUILD_OPTIONS if that option is not set).
17
18 $bo->reset()
19 Reset the object to not have any option (it's empty).
20
21 $bo->merge($content, $source)
22 Merge the options set in $content and record that they come from
23 the source $source. $source is mainly used in warning messages
24 currently to indicate where invalid options have been detected.
25
26 $content is a space separated list of options with optional
27 assigned values like "nocheck parallel=2".
28
29 $bo->set($option, $value, [$source])
30 Store the given option in the object with the given value. It's
31 legitimate for a value to be undefined if the option is a simple
32 boolean (its presence means true, its absence means false). The
33 $source is optional and indicates where the option comes from.
34
35 The known options have their values checked for sanity. Options
36 without values have their value removed and options with invalid
37 values are discarded.
38
39 $bo->get($option)
40 Return the value associated to the option. It might be undef even
41 if the option exists. You might want to check with
42 $bo->has($option) to verify if the option is stored in the object.
43
44 $bo->has($option)
45 Returns a boolean indicating whether the option is stored in the
46 object.
47
48 $bo->parse_features($option, $use_feature)
49 Parse the $option values, as a set of known features to enable or
50 disable, as specified in the $use_feature hash reference.
51
52 Each feature is prefixed with a ‘+’ or a ‘-’ character as a marker
53 to enable or disable it. The special feature “all” can be used to
54 act on all known features.
55
56 Unknown or malformed features will emit warnings.
57
58 $string = $bo->output($fh)
59 Return a string representation of the build options suitable to be
60 assigned to an environment variable. Can optionally output that
61 string to the given filehandle.
62
63 $bo->export([$var])
64 Export the build options to the given environment variable. If
65 omitted, the environment variable defined at creation time is
66 assumed. The value set to the variable is also returned.
67
69 Version 1.02 (dpkg 1.18.19)
70 New method: $bo->parse_features().
71
72 Version 1.01 (dpkg 1.16.1)
73 Enable to use another environment variable instead of
74 DEB_BUILD_OPTIONS. Thus add support for the "envvar" option at
75 creation time.
76
77 Version 1.00 (dpkg 1.15.6)
78 Mark the module as public.
79
80
81
821.20.9 2021-05-10 Dpkg::BuildOptions(3perl)