summaryrefslogtreecommitdiff
path: root/dh_installdeb
diff options
context:
space:
mode:
authorNiels Thykier <niels@thykier.net>2015-09-10 22:06:20 +0200
committerNiels Thykier <niels@thykier.net>2015-09-10 22:06:20 +0200
commit9bcb9a4710b17c0631e1ff6a557ccef3a64b64a9 (patch)
treea7fdcbf33c4af84442baf62d1cd0b47eb6fec0fc /dh_installdeb
parentf58508b5ba1fad4b769855423be9de9be54ee3aa (diff)
downloaddebhelper-9bcb9a4710b17c0631e1ff6a557ccef3a64b64a9.tar.gz
dh_makeshlibs: Use ldconfig trigger instead of maintscripts
Signed-off-by: Niels Thykier <niels@thykier.net>
Diffstat (limited to 'dh_installdeb')
-rwxr-xr-xdh_installdeb29
1 files changed, 28 insertions, 1 deletions
diff --git a/dh_installdeb b/dh_installdeb
index 5d16921b..591669e9 100755
--- a/dh_installdeb
+++ b/dh_installdeb
@@ -121,7 +121,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
# Install non-executable files
- my @non_exec_files = (qw{conffiles triggers});
+ my @non_exec_files = (qw{conffiles});
# In compat 10, we let dh_makeshlibs handle "shlibs".
push(@non_exec_files, 'shlibs') if compat(9);
foreach my $file (@non_exec_files) {
@@ -131,6 +131,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
}
+ install_triggers($package, $tmp);
+
# Automatic conffiles registration: If it is in /etc, it is a
# conffile.
if (! compat(2) && -d "$tmp/etc") {
@@ -145,6 +147,31 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
}
}
+sub install_triggers {
+ my ($package, $tmp) = @_;
+ my $generated = generated_file($package, 'triggers', 0);
+ my @sources = grep { -f $_ } (
+ pkgfile($package, 'triggers'),
+ $generated,
+ );
+ my $target = "$tmp/DEBIAN/triggers";
+ return if not @sources;
+ if (@sources > 1) {
+ my $merged = "${generated}.merged";
+ open(my $ofd, '>', $merged)
+ or error("open ${target} failed: $!");
+ for my $src (@sources) {
+ open(my $ifd, '<', $src)
+ or error("open ${src} failed: $!");
+ print {$ofd} $_ while <$ifd>;
+ close($ifd);
+ }
+ close($ofd) or error("close ${merged} failed: $!");
+ @sources = ($merged);
+ }
+ install_file($sources[0], $target);
+}
+
=head1 SEE ALSO
L<debhelper(7)>