"dpkb-buildpackage -j<N>" sets not only DEB_BUILD_OPTIONS
but also MAKEFLAGS.
This is clearly explained in "man dpkb-buildpackage".
-j, --jobs[=jobs|auto]
...
Will add itself to the MAKEFLAGS environment variable, which should
cause all subsequent make invocations to inherit the option, thus
forcing the parallel setting on the packaging ...
Your statement sounds like
'MAKEFLAGS=-j<N> dpkg-buildpackage'
is the only way to build packages in parallel.
Apparently, dpkg-buildpackage provides a much shorter way
and invokes internal Make in parallel.
So it is not used to run the actual build, just the top level `make -f debian/rules` invocation.
You can set --jobs-force=16, which ends up in MAKEFLAGS but the point of the patch is that one can use
the usual way of parallelizing.
What is the "usual" way in this context?
Do you mean
'DEB_BUILD_OPTIONS=parallel=16 dpkg-buildpackage -b'
is the usual way for parallel building?
If so, I agree. This patch caters to this case.
But, I think your code should go to debian/rules
instead of scripts/package/deb-build-option.
Kbuild's "make clean" works much faster with the parallel option.
Also, the commit description should explain the
benefit of this patch.