summaryrefslogtreecommitdiff
path: root/dh
AgeCommit message (Collapse)AuthorFilesLines
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>
2017-10-22Document directory requirement for all debhelper toolsNiels Thykier1-1/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-10-13dh: Replace systemd sequence with dh_installsystemd [c11]Niels Thykier1-1/+7
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-30dh: Avoid unintended shell in run()Niels Thykier1-2/+2
Anything relying on this would fail under -B or -A builds, so abuse should have been weeded out by now. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-23dh: Stricter parsing of DH NOOP PROMISENiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-23dh: Rely on PROMISE NOOP to exclude dh_testdirNiels Thykier1-4/+6
Turns out that some debhelper sequences try to inject themselves *before* dh_testdir. Concretely, dh-di (--with d-i) being an example. While I find the use rather questionable at first glance, I am not going to break their code. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-22dh: Optimize out dh_testdir as it is literally uselessNiels Thykier1-6/+4
As it turned out in 333376abf9c4d6e8f286a7cbda7e8c13307745f3, dh_testdir is called too late to provide its "helpful" error message. Accordingly, dh itself has to print it directly now (via getpackages()) for the user to get the correct error message. This literally makes dh_testdir useless under dh in its default configuration. While it is possible to override dh_testdir and have it check for other files, it is largely an unused feature - even more under dh. On the plus side, we seem to save 2x 0.040s by doing this per build. Assuming 70% of the 25 000 source packages in Debian are using dh, this translates into a 23 "core-minutes" saving on an single architecture archive-wide rebuild (e.g. arch:amd64 plus arch:all). Somehow, I hope I got the math wrong because it seems obscene... Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-10dh: --with=build-stamp is a c10+ thingNiels Thykier1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-09dh: Revert --without=build-stamp in c11Niels Thykier1-7/+11
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-09dh: Support pkgfile and pkgfile-logged PROMISE hintsNiels Thykier1-0/+11
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-07Dh_Lib: Embed tool versions into auto-generated snippetsNiels Thykier1-0/+2
Use $main::VERSION to determine the version of the tool and embed that into auto-generated snippets (e.g. via autoscript). This enables lintian to extract the tool + version and display it on: https://lintian.debian.org/tags/debhelper-autoscript-in-maintainer-scripts.html Signed-off-by: Niels Thykier <niels@thykier.net>
2017-07-03Set Emacs file variables directory-wideSven Joachim1-6/+0
Set the local variables for Emacs in the central placed intended for it, rather than in (currently) 95 individual files. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-06-26Avoid fork+exec for rm -f and ln -s in non-deprecated toolsNiels Thykier1-1/+4
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-06-04Revert 80c955221e83327efb984845f59648678c729978Niels Thykier1-10/+8
It made dh skip "-arch" and "-indep" targets. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-06-04include present/wanted architecture in error messageMichael Stapelberg1-1/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-05-06Remove remains of dh_pysupportNiels Thykier1-7/+1
There is no point in loading a sequence that conditionally adds a tool that no longer exists. Just give a deprecation warning for people still explicitly loading it and drop the rest. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-10pkgfile: Create a "secret" bulk check call for dhNiels Thykier1-3/+2
With "enough" packages, pkgfile is still a very expensive part of dh. Mostly due to the can_skip check which often need to call pkgfile to determine if a helper can be skipped. By doing a "bulk check" we can reduce that overhead by about roughly 50% (20-25% of dh's total runtime). Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-10dh: Juggle some loops to move invariants outNiels Thykier1-11/+12
It does not matter that much for actual performance, but it does seem like it under Devel::NYTProf. By juggling these loops around, we avoid some minor unnecessary work and Devel::NYTProf now produces more accurate reports. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-10dh: Avoid unnecessary work for empty overridesNiels Thykier1-10/+12
Save an inner loop over all packages for empty overrides. This makes empty overrides a lot cheaper when there are many packages. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-10pkgfile: Attempt to make it scale better for more pkgsNiels Thykier1-0/+5
Each time pkgfile is called, it will glob the debian/ dir (with a filter). Obviously this adds up, but unfortunately, glob is a lot cheaper in some cases than calling buildarch()/buildos(), which requires Dpkg::Arch. To solve this, we implement a cache of the globbing so we at most glob once per file name. Depending on that result, we will now unconditionally check for architecture qualified files or not. This should make both cases faster for 2+ packages. It should also apply to dh when checking if it can skip a command. When testing about 500 empty "transitional" packages, we save about 7-8% run time for dh_install. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-04-08dh: Include dh_missing in the sequence after dh_fixpermsNiels Thykier1-0/+1
Signed-off-by: Niels Thykier <niels@thykier.net>
2017-01-17dh: Avoid repeating added build commands after "dh_auto_test"Niels Thykier1-1/+12
This fixes a bug, where dh would replay a command added to the "build", "build-arch" or "build-indep" sequences (via --with $ADD_ON) in the binary sequences. Signed-off-by: Niels Thykier <niels@thykier.net>
2017-01-12dh: Show when running the create-stamp "command"Niels Thykier1-0/+2
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-22Make the build-stamp optional via a build-stamp sequenceNiels Thykier1-3/+9
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-22dh: Factor argument unpackingNiels Thykier1-28/+19
Gpb-Dch: Ignore Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-02dh: Remove logs before and not after the override targetNiels Thykier1-1/+3
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-09-21Merge https://anonscm.debian.org/git/debhelper/debhelperIgor Pashev1-37/+38
2016-07-09Enable systemd sequence in compat 10Niels Thykier1-3/+1
Signed-off-by: Niels Thykier <niels@thykier.net>