This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=759883b03e517922f0a0a78b22fc7d7f174c589c

commit 759883b03e517922f0a0a78b22fc7d7f174c589c
Author: Guillem Jover <[email protected]>
AuthorDate: Sat Feb 10 18:28:00 2024 +0100

    man: Improve build flags feature specification in environment variables
    
    Add information about the format of the feature areas and the feature
    specification, how the values get parsed and how they override each
    other. Add few examples to showcase the various scenarios.
    
    Closes: #1063641
---
 man/dpkg-buildflags.pod   | 28 ++++++++++++++++++++++++++++
 man/dpkg-buildpackage.pod |  5 +++++
 2 files changed, 33 insertions(+)

diff --git a/man/dpkg-buildflags.pod b/man/dpkg-buildflags.pod
index 67df011cc..bed746d5b 100644
--- a/man/dpkg-buildflags.pod
+++ b/man/dpkg-buildflags.pod
@@ -405,6 +405,16 @@ and the ones described below are only recognized on Debian 
and derivatives.
 Each area feature can be enabled and disabled in the B<DEB_BUILD_OPTIONS>
 and B<DEB_BUILD_MAINT_OPTIONS> environment variable's area value with the
 ‘B<+>’ and ‘B<->’ modifier.
+Following the general syntax of these variables
+(described in L<dpkg-buildpackage(1)>),
+multiple feature areas can be specified separated by spaces,
+where each get feature specifiers as mandatory parameters after an
+equal sign (‘B<=>’).
+The feature specifiers are comma-separated and parsed from left to right,
+where the settings within the same feature specifier override previous ones,
+even if the feature specifiers are split across multiple space-separated
+feature area settings for the same area.
+
 For example, to enable the B<hardening> “pie” feature and disable the
 “fortify” feature you can do this in B<debian/rules>:
 
@@ -417,6 +427,24 @@ Thus disabling everything in the B<hardening> area and 
enabling only
 
     export DEB_BUILD_MAINT_OPTIONS = hardening=-all,+format,+fortify
 
+Multiple feature areas can be set:
+
+    export DEB_BUILD_MAINT_OPTIONS = hardening=+pie abi=+lfs
+
+The override behavior applies as much to the B<all> special feature,
+as to specific features,
+which should allow for composition.
+Thus to enable “lfs” in the B<abi> area, and only “pie” and “fortify”
+in the B<hardening> area, but “format” only when CONDITION is defined,
+this could be done with:
+
+    export DEB_BUILD_MAINT_OPTIONS = hardening=-all,+pie,+format abi=+lfs
+    …
+    DEB_BUILD_MAINT_OPTIONS += hardening=+fortify
+    ifdef CONDITION
+    DEB_BUILD_MAINT_OPTIONS += hardening=-format
+    endif
+
 =head2 abi
 
 Several compile-time options (detailed below) can be used to enable features
diff --git a/man/dpkg-buildpackage.pod b/man/dpkg-buildpackage.pod
index 660333c95..f90471ddf 100644
--- a/man/dpkg-buildpackage.pod
+++ b/man/dpkg-buildpackage.pod
@@ -753,6 +753,11 @@ If set, it will contain a space-separated list of options 
that affect
 the behavior of some dpkg tools involved in package building,
 and might affect the package build process if the code in F<debian/rules>
 honors them.
+These options can have parameters specified immediately after an
+equal sign (‘B<=>‘).
+For options that support multiple parameters,
+these will not be separated by spaces,
+as these are reserved to separate options.
 
 The following are the options known and supported by dpkg tools,
 other options honored by F<debian/rules> might be defined by distribution

-- 
Dpkg.Org's dpkg

Reply via email to