diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:06:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 21:06:40 +0000 |
commit | d827c6cf1631209f5042a9d1d8a7ecc24223c8a0 (patch) | |
tree | 91a431d301efd0e524bdfb0c46e97d591a9d7b03 /dh_ucf | |
parent | Initial commit. (diff) | |
download | debhelper-317edf61ca7b4a9acdf8a38e4b634bad6c07ddf6.tar.xz debhelper-317edf61ca7b4a9acdf8a38e4b634bad6c07ddf6.zip |
Adding upstream version 13.11.4.upstream/13.11.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | dh_ucf | 111 |
1 files changed, 111 insertions, 0 deletions
@@ -0,0 +1,111 @@ +#!/usr/bin/perl + +=head1 NAME + +dh_ucf - register configuration files with ucf + +=cut + +use strict; +use warnings; +use Debian::Debhelper::Dh_Lib; + +our $VERSION = DH_BUILTIN_VERSION; + +=head1 SYNOPSIS + +B<dh_ucf> [S<I<debhelper options>>] [B<-A>] [B<-n>] [S<I<file> ...>] + +=head1 DESCRIPTION + +B<dh_ucf> is a debhelper program that is responsible for generating the +F<postinst> and F<postrm> commands that register files with ucf(1) and ucfr(1). + +=head1 FILES + +=over 4 + +=item debian/I<package>.ucf + +List pairs of source and destination files to register with ucf. Each pair +should be put on its own line, with the source and destination separated by +whitespace. Both source and destination must be absolute paths. The source +should be a file that is provided by your package, typically in /usr/share/, +while the destination is typically a file in /etc/. + +A dependency on ucf will be generated in B<${misc:Depends}>. + +Supports substitution variables in compat 13 and later as +documented in L<debhelper(7)>. + +=back + +=head1 OPTIONS + +=over 4 + +=item B<-A>, B<--all> + +Install all files specified by command line parameters in ALL packages +acted on. + +=item B<-n>, B<--no-scripts> + +Do not modify F<postinst>/F<postrm> scripts. Turns this command into a no-op. + +=item I<file> ... + +Install these info files into the first package acted on. (Or in +all packages if B<-A> is specified). + +=back + +=head1 NOTES + +Note that this command is not idempotent. L<dh_prep(1)> should be called +between invocations of this command. Otherwise, it may cause multiple +instances of the same text to be added to maintainer scripts. + +=cut + +init(); + +# PROMISE: DH NOOP WITHOUT ucf cli-options() + +foreach my $package (@{$dh{DOPACKAGES}}) { + my $file=pkgfile($package,"ucf"); + + my @ucf; + if ($file) { + @ucf=filedoublearray($file); + } + + if (($package eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { + push @ucf, [@ARGV]; + } + + if (! $dh{NOSCRIPTS}) { + if (@ucf) { + addsubstvar($package, "misc:Depends", "ucf"); + } + foreach my $set (@ucf) { + my $src = $set->[0]; + my $dest = $set->[1]; + autoscript($package,"postinst","postinst-ucf","s:#UCFSRC#:$src:g;s:#UCFDEST#:$dest:g;s/#PACKAGE#/$package/g",); + autoscript($package,"postrm","postrm-ucf","s:#UCFDEST#:$dest:g;s/#PACKAGE#/$package/g"); + } + } +} + +=head1 SEE ALSO + +L<debhelper(7)> + +This program is a part of debhelper. + +=head1 AUTHOR + +Joey Hess <joeyh@debian.org> +Jeroen Schot <schot@a-eskwadraat.nl> + +=cut |