summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2018-05-19 08:13:05 +0000
committerNiels Thykier <niels@thykier.net>2018-05-19 08:14:55 +0000
commit3cc5e6aea41f1b3d890712e622b5a4d732211936 (patch)
tree0e20a8f7c9d181029416116e9e3da4ab74cdeeb3
parent41f1ca9ed464300f5a84c9aebbf699e8b0e77928 (diff)
downloaddebhelper-3cc5e6aea41f1b3d890712e622b5a4d732211936.tar.gz
Use a new sequence to toggle dh_installinitramfs in c11 and older
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>
-rw-r--r--debhelper.pod10
-rw-r--r--debian/changelog2
-rwxr-xr-xdh4
-rwxr-xr-xdh_installinitramfs2
-rw-r--r--lib/Debian/Debhelper/Sequence/installinitramfs.pm14
5 files changed, 26 insertions, 6 deletions
diff --git a/debhelper.pod b/debhelper.pod
index 16e9aea2..924d4c4d 100644
--- a/debhelper.pod
+++ b/debhelper.pod
@@ -793,10 +793,12 @@ in F<</usr/share/doc/I<package>/examples>>.)
=item -
-The standard sequence in B<dh> now includes B<dh_dwz> by default. This makes
-the B<dwz> sequence obsolete and it will now fail with an error. If you want
-to skip B<dh_dwz>, then please insert an empty I<override_dh_dwz> target in
-F<debian/rules>.
+The standard sequence in B<dh> now includes B<dh_dwz> and
+B<dh_installinitramfs> by default. This makes the B<dwz> and
+B<installinitramfs> sequences obsolete and they will now fail with an
+error. If you want to skip these commands, then please insert an
+empty override target for them in F<debian/rules>
+(e.g. I<override_dh_dwz:>)
=item -
diff --git a/debian/changelog b/debian/changelog
index fb602ab2..b4adcf9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -56,6 +56,8 @@ debhelper (11.3) UNRELEASED; urgency=medium
* dh_installinitramfs: New tool to install initramfs hook scripts and
handle related maintscripts. Thanks to Evgeni Golov for the
suggestion. (Closes: #491027)
+ * installinitramfs.pm: New sequence to enable dh_installinitramfs in
+ compat 11 and earlier.
[ Dmitry Shachnev ]
* qmake.pm: Use ${DEB_HOST_GNU_TYPE}-qmake wrapper for
diff --git a/dh b/dh
index 71d078c4..2dc635bd 100755
--- a/dh
+++ b/dh
@@ -416,7 +416,9 @@ qw{
dh_installppp
dh_installudev
dh_installgsettings
- dh_installinitramfs
+},
+ (!compat(11) ? qw(dh_installinitramfs) : qw()),
+qw{
dh_bugfiles
dh_ucf
dh_lintian
diff --git a/dh_installinitramfs b/dh_installinitramfs
index 7b832031..e6980af3 100755
--- a/dh_installinitramfs
+++ b/dh_installinitramfs
@@ -66,7 +66,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
install_dir($hook_dir);
install_file($hook_script, "${hook_dir}/${package}");
$has_hooks = 1;
- } elsif (-d $hook_dir and not is_empty_dir($hook_dir) and not compat(11)) {
+ } elsif (-d $hook_dir and not is_empty_dir($hook_dir)) {
$has_hooks = 1;
}
diff --git a/lib/Debian/Debhelper/Sequence/installinitramfs.pm b/lib/Debian/Debhelper/Sequence/installinitramfs.pm
new file mode 100644
index 00000000..3c7b2b81
--- /dev/null
+++ b/lib/Debian/Debhelper/Sequence/installinitramfs.pm
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+# Enable dh_installinitramfs
+
+use strict;
+use warnings;
+use Debian::Debhelper::Dh_Lib;
+
+if (not compat(11)) {
+ error("In compat 12, dh_installinitramfs is run by default and the installinitramfs-sequence is no longer required.");
+}
+
+insert_after('dh_installgsettings', 'dh_installinitramfs');
+
+1;