1Dpkg::BuildFlags(3perl) libdpkg-perl Dpkg::BuildFlags(3perl)
2
3
4
6 Dpkg::BuildFlags - query build flags
7
9 This class is used by dpkg-buildflags and can be used to query the same
10 information.
11
13 $bf = Dpkg::BuildFlags->new()
14 Create a new Dpkg::BuildFlags object. It will be initialized based
15 on the value of several configuration files and environment
16 variables.
17
18 If the option vendor_defaults is set to false, then no vendor
19 defaults are initialized (it defaults to true).
20
21 $bf->load_vendor_defaults()
22 Reset the flags stored to the default set provided by the vendor.
23
24 $bf->load_system_config()
25 Update flags from the system configuration.
26
27 $bf->load_user_config()
28 Update flags from the user configuration.
29
30 $bf->load_environment_config()
31 Update flags based on user directives stored in the environment.
32 See dpkg-buildflags(1) for details.
33
34 $bf->load_maintainer_config()
35 Update flags based on maintainer directives stored in the
36 environment. See dpkg-buildflags(1) for details.
37
38 $bf->load_config()
39 Call successively load_system_config(), load_user_config(),
40 load_environment_config() and load_maintainer_config() to update
41 the default build flags defined by the vendor.
42
43 $bf->unset($flag)
44 Unset the build flag $flag, so that it will not be known anymore.
45
46 $bf->set($flag, $value, $source, $maint)
47 Update the build flag $flag with value $value and record its origin
48 as $source (if defined). Record it as maintainer modified if $maint
49 is defined and true.
50
51 $bf->set_feature($area, $feature, $enabled)
52 Update the boolean state of whether a specific feature within a
53 known feature area has been enabled. The only currently known
54 feature areas are "future", "qa", "sanitize", "optimize",
55 "hardening" and "reproducible".
56
57 $bf->get_feature($area, $feature)
58 Returns the value for the given feature within a known feature
59 area. This is relevant for builtin features where the feature has
60 a ternary state of true, false and undef, and where the latter
61 cannot be retrieved with use_feature().
62
63 $bf->use_feature($area, $feature)
64 Returns true if the given feature within a known feature areas has
65 been enabled, and false otherwise. The only currently recognized
66 feature areas are "future", "qa", "sanitize", "optimize",
67 "hardening" and "reproducible".
68
69 $bf->set_builtin($area, $feature, $enabled)
70 Update the boolean state of whether a specific feature within a
71 known feature area is handled (even if only in some architectures)
72 as a builtin default by the compiler.
73
74 $bf->get_builtins($area)
75 Return, for the given area, a hash with keys as feature names, and
76 values as booleans indicating whether the feature is handled as a
77 builtin default by the compiler or not. Only features that might be
78 handled as builtins on some architectures are returned as part of
79 the hash. Missing features mean they are currently never handled as
80 builtins by the compiler.
81
82 $bf->set_option_value($option, $value)
83 Private method to set the value of a build option. Do not use
84 outside of the dpkg project.
85
86 $bf->get_option_value($option)
87 Private method to get the value of a build option. Do not use
88 outside of the dpkg project.
89
90 $bf->strip($flag, $value, $source, $maint)
91 Update the build flag $flag by stripping the flags listed in $value
92 and record its origin as $source (if defined). Record it as
93 maintainer modified if $maint is defined and true.
94
95 $bf->append($flag, $value, $source, $maint)
96 Append the options listed in $value to the current value of the
97 flag $flag. Record its origin as $source (if defined). Record it
98 as maintainer modified if $maint is defined and true.
99
100 $bf->prepend($flag, $value, $source, $maint)
101 Prepend the options listed in $value to the current value of the
102 flag $flag. Record its origin as $source (if defined). Record it
103 as maintainer modified if $maint is defined and true.
104
105 $bf->update_from_conffile($file, $source)
106 Update the current build flags based on the configuration
107 directives contained in $file. See dpkg-buildflags(1) for the
108 format of the directives.
109
110 $source is the origin recorded for any build flag set or modified.
111
112 $bf->get($flag)
113 Return the value associated to the flag. It might be undef if the
114 flag doesn't exist.
115
116 $bf->get_feature_areas()
117 Return the feature areas (i.e. the area values has_features will
118 return true for).
119
120 $bf->get_features($area)
121 Return, for the given area, a hash with keys as feature names, and
122 values as booleans indicating whether the feature is enabled or
123 not.
124
125 $bf->get_origin($flag)
126 Return the origin associated to the flag. It might be undef if the
127 flag doesn't exist.
128
129 $bf->is_maintainer_modified($flag)
130 Return true if the flag is modified by the maintainer.
131
132 $bf->has_features($area)
133 Returns true if the given area of features is known, and false
134 otherwise. The only currently recognized feature areas are
135 "future", "qa", "sanitize", "optimize", "hardening" and
136 "reproducible".
137
138 $bf->has($option)
139 Returns a boolean indicating whether the flags exists in the
140 object.
141
142 @flags = $bf->list()
143 Returns the list of flags stored in the object.
144
146 Version 1.06 (dpkg 1.21.15)
147 New method: $bf->get_feature().
148
149 Version 1.05 (dpkg 1.21.14)
150 New option: 'vendor_defaults' in new().
151
152 New methods: $bf->load_vendor_defaults(), $bf->use_feature(),
153 $bf->set_builtin(), $bf->get_builtins().
154
155 Version 1.04 (dpkg 1.20.0)
156 New method: $bf->unset().
157
158 Version 1.03 (dpkg 1.16.5)
159 New method: $bf->get_feature_areas() to list possible values for
160 $bf->get_features.
161
162 New method $bf->is_maintainer_modified() and new optional parameter to
163 $bf->set(), $bf->append(), $bf->prepend(), $bf->strip().
164
165 Version 1.02 (dpkg 1.16.2)
166 New methods: $bf->get_features(), $bf->has_features(),
167 $bf->set_feature().
168
169 Version 1.01 (dpkg 1.16.1)
170 New method: $bf->prepend() very similar to append(). Implement support
171 of the prepend operation everywhere.
172
173 New method: $bf->load_maintainer_config() that update the build flags
174 based on the package maintainer directives.
175
176 Version 1.00 (dpkg 1.15.7)
177 Mark the module as public.
178
179
180
1811.21.21 2023-07-19 Dpkg::BuildFlags(3perl)