diff options
author | Niels Thykier <niels@thykier.net> | 2022-11-21 16:51:19 +0000 |
---|---|---|
committer | Niels Thykier <niels@thykier.net> | 2022-11-21 16:51:19 +0000 |
commit | 64cec8bc64baaec24b724ea920314256469b2bc4 (patch) | |
tree | ef2d51eb420826d1125349018655269a7dc50e2e | |
parent | 48b3fe8745852b76c9e0a9ec6bd86868c4a43fea (diff) |
Dh_Lib.pm: Remove unused third parameter from install_dh_config_file
Signed-off-by: Niels Thykier <niels@thykier.net>
-rw-r--r-- | doc/PROGRAMMING.md | 4 | ||||
-rw-r--r-- | lib/Debian/Debhelper/Dh_Lib.pm | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/doc/PROGRAMMING.md b/doc/PROGRAMMING.md index 9a176b23..4f47e648 100644 --- a/doc/PROGRAMMING.md +++ b/doc/PROGRAMMING.md @@ -371,9 +371,9 @@ The following keys are also set in the `%dh` hash when you call `init()`: `$src`. If `$tmp` is given, then `$tmp` will be prefixed to `$dest` when creating the actual symlink. -- `install_dh_config_file($src, $dest[, $mode])` +- `install_dh_config_file($src, $dest)` - Installs `$src` into `$dest` with `$mode` (defaults to 0644). + Installs `$src` into `$dest` using mode 0644. If compat is 9 (or later) and `$src` is executable, `$src` will be executed instead and its output will be used to generate the `$dest` file. diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm index de53e22c..52c4b9b9 100644 --- a/lib/Debian/Debhelper/Dh_Lib.pm +++ b/lib/Debian/Debhelper/Dh_Lib.pm @@ -2723,15 +2723,14 @@ sub _executable_dh_config_file_failed { # the package. Under compat 9+ it may execute the file and use its # output instead. # -# install_dh_config_file(SOURCE, TARGET[, MODE]) +# install_dh_config_file(SOURCE, TARGET) sub install_dh_config_file { - my ($source, $target, $mode) = @_; - $mode = 0644 if not defined($mode); + my ($source, $target) = @_; if (!compat(8) and -x $source) { my @sstat = stat(_) || error("cannot stat $source: $!"); open(my $tfd, '>', $target) || error("cannot open $target: $!"); - chmod($mode, $tfd) || error("cannot chmod $target: $!"); + chmod(0644, $tfd) || error("cannot chmod $target: $!"); open(my $sfd, '-|', $source) || error("cannot run $source: $!"); while (my $line = <$sfd>) { print ${tfd} $line; @@ -2743,7 +2742,7 @@ sub install_dh_config_file { # Set the mtime (and atime) to ensure reproducibility. utime($sstat[9], $sstat[9], $target); } else { - _install_file_to_path(1, $mode, $source, $target); + install_file($source, $target); } return 1; } |