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