summaryrefslogtreecommitdiff
path: root/dh
AgeCommit message (Collapse)AuthorFilesLines
2019-11-16Merge https://salsa.debian.org/debian/debhelperIgor Pashev1-228/+355
2019-09-01dh: Fix bug in binary-indep in compat 5-12Niels Thykier1-2/+4
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-18dh: Fix regression in dh addon APINiels Thykier1-8/+9
Previously, dh's API functions were sloppy in their return values but *often* they would return a truth value. We changed that in 12.5 by insisting on return undef. However, that broke addons relying on the API function to work around Perl's idiom of "module must end with a truth value". To resolve that, we now always return a truth value from all API functions to fix that. This also give consistent behaviour, which is better than the previous setup. Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-17dh: Skip some invalid calls to helpers after an overrideNiels Thykier1-1/+13
With the new "conditional" addon feature, it was possible to trigger a gratious useless warning with a conditional override. Consider: override_dh_foo-arch: ... And dh_foo was added by an arch-only addon. Before this commit, we would do: debian/rules override_dh_foo-arch dh_foo -a -N<for each arch:any package> The latter call to dh_foo rightfully complained there was nothing to do. With this commit, we correctly omit the latter call. Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-17dh: Fix use of uninitialized variable in compat 13Niels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-17Rewrite special-casing of ELF tools (dh_strip etc.) via an elf-tools sequenceNiels Thykier1-19/+26
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16Fix logic for arch-only commands to make it testable againNiels Thykier1-2/+9
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16Update documentation and changelog to cover new sequence/addon featuresNiels Thykier1-6/+19
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16Dh_Lib: Only parse dh-sequence-X in dhNiels Thykier1-0/+1
We do not want to pay a non-trivial cost of loading Dpkg::Deps in every helper (for cases where that is needed to parse th dh-sequence clause). Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16Generalize and move logic for filtering out arch-only helpersNiels Thykier1-3/+0
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16Rewrite sequence handling to ensure add-on commands are ordered correctlyNiels Thykier1-76/+78
Previously, we relied on a command being inserted in the -arch sequence to be ordered correctly. With this rewrite, a command added only to the -indep sequence will still appear in the right order. Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16dh: Implement conditional sequence add-onsNiels Thykier1-25/+181
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-16dh: Drop code only used for obsolete parametersNiels Thykier1-57/+10
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-15Disable auto-abbrev of cli options in c13 to enable dh optimizationsNiels Thykier1-3/+9
Disable auto-abbreviation of command-line options in compat 13 and re-enable dh's optimization for skipping redundant commands when passed long options. Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-15dh_auto_*: Officially adopt --sourcedir/--builddirNiels Thykier1-1/+1
Since the beginning, debhelper has accepted abbrevated command line parameters. Anyone that has been using (e.g.): dh $@ --sourcedir=foo To pass --sourcedir to dh_install has *also* implicitly passed it to the dh_auto_* helpers. Due to auto-abbrevation being enabled, they have considered it a short form of --sourcedirectory. This is trivially confirmable by comparing: dh_auto_configure --bar foo Unknown option: bar dh_auto_configure: unknown option or error during option parsing; aborting with dh_auto_configure --sourcedir foo dh_auto_configure: invalid or non-existing path to the source directory: foo Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-13dh: Remove dead variableNiels Thykier1-1/+0
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-08-13dh: Stop mentioning removed options in manpageSven Joachim1-34/+1
The --{until,after,before,remaining} were retroactively removed in debhelper 12.4 even for older compat levels.
2019-08-12dh: Remove support for --{until,after,before,remaining}Niels Thykier1-7/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-07-20dh: Move an if-elsif chain out of an if and de-indentNiels Thykier1-40/+37
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-24dh: Special case cli-options() with no optionsNiels Thykier1-0/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-09dh: Fix inverted boolean logicNiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-14dh_installsystemduser: New helper to handle systemd user instance unitsDaniele Nicolodi1-9/+10
Add a new 'dh_installsystemduser' helper responsible for istalling package maintainer supplied systemd user instance units and to produce postinst and postrm maintiner scripts code blocks to appropriately enable, mask and disable units when the package is installed, upgraded, or removed.
2018-09-29dh: Disable cli-options NOOP PROMISE optimization with long optionsNiels Thykier1-1/+6
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-14dh: Add hidden ENV variable to test can_skip under --no-actNiels Thykier1-1/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-14dh: Remove broken (and obsolete) compat itemNiels Thykier1-14/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-14dh: Support a new cli-options NOOP PROMISENiels Thykier1-9/+23
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-09-14dh: Track which options have been passedNiels Thykier1-11/+10
Note this commit neuters some command line option optimizations completely. The optimizations will be re-added for commands that support a NOOP PROMISE hint in later commits. Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-30Merge https://salsa.debian.org/debian/debhelperIgor Pashev1-231/+211
2018-08-04dh: Support autoloading sequences via Build-DependsNiels Thykier1-0/+11
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-08-04dh: Refactor --with/--without handling of add-onsNiels Thykier1-19/+57
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-05-19Use a new sequence to toggle dh_installinitramfs in c11 and olderNiels Thykier1-1/+3
Then we can make dh_installinitramfs do the same in all compat levels and people can simply opt-in with a "--with installinitramfs" in older compat levels. Signed-off-by: Niels Thykier <niels@thykier.net>
2018-05-18dh_installinitramfs: New helper toolNiels Thykier1-0/+1
2018-05-10Enable dwz in c12 by defaultNiels Thykier1-2/+4
Closes: nthykier/debhelper#3 Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-07dh: Simplify sequence definitionsNiels Thykier1-19/+7
As of commit d68d6751a86052246433bf4381a5f8daac45f90d, the SequencerUtil function "unpack_sequence" should correctly transform the "compat 9"-style sequences into "compat 8"-style sequences. Exploit this to avoid the duplicated definitions. Signed-off-by: Niels Thykier <niels@thykier.net>
2018-03-07Move sub from dh to D::DH::SequencerUtilNiels Thykier1-17/+0
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-28dh: Rename optimize_sequence to unpack_sequenceNiels Thykier1-2/+2
It is not a super name, but "optimize" implies that dh will work if you skip the call. By renaming it to unpack we avoid that implication. Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-20dh: Always run commands with sequence defined optionsNiels Thykier1-0/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-07dh: Fix missing $ in $startpointNiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-07dh: Fix off-by-one in a compat checkNiels Thykier1-3/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-04dh: Avoid reset of starting point with multiple opaque targetsNiels Thykier1-1/+10
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-04dh: Move some "compat 9"-only code inside an if-guardNiels Thykier1-9/+7
This will make it easier to see that the code is dead once compat 9 is removed. Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-02dh: Ensure that $startpoint{$package} is definedNiels Thykier1-0/+4
Thanks to James Cowgill for finding this bug.
2018-01-02dh: Isolate some (now) "compat 9"-only codeNiels Thykier1-45/+30
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-02dh: Do not re-run completed targetsNiels Thykier1-32/+85
This is part of 2 of the dh sequence rewrite. Part 1 is cb2caa7f67837294b0681d881f52dd23df487f33. This change ensures that dh no longer attempts to run a target that is already marked as complete (e.g. via the stamp file). Signed-off-by: Niels Thykier <niels@thykier.net>
2018-01-02dh: Rewrite sequence handlingNiels Thykier1-113/+15
Rewrite the way we compute the sequences to ensure that: 1) Rules target remain opaque (particularly "subtargets" are now also opaque). 2) Opaque targets are run first, so they can run their subtargets before dh runs a command that depends on it. This is the first half of fixing Debian#880840. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-12-30dh: Fix a warning about an uninitialized variableNiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-12-29Add DH_EXTRA_ADDONS env variable to specify local addons.Paul Tagliamonte1-0/+1
This is intended to be used by downstreams or specific local configurations that require a debhelper addon to be run during multiple builds without having to patch a large number of rules file. If at all possible, this should be avoided in favor of a --with flag in the rules file. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-11-19Merge https://anonscm.debian.org/git/debhelper/debhelperIgor Pashev1-77/+120
2017-11-11Replace some string evals with a simple requireNiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-10-28dh,dh_auto_*: Add NOOP promisesNiels Thykier1-0/+9
Signed-off-by: Niels Thykier <niels@thykier.net>