diff options
Diffstat (limited to 'dh_installdeb')
-rwxr-xr-x | dh_installdeb | 29 |
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)> |