From 6d9d8dbe6ae70e6326a7d6244b7be5a90081cb58 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 20 Nov 2020 17:04:05 -0800 Subject: [PATCH] Remove dependency on file::copy --- net/debian-linux-lib.pl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/net/debian-linux-lib.pl b/net/debian-linux-lib.pl index 10eb6dedb..f64b01b97 100755 --- a/net/debian-linux-lib.pl +++ b/net/debian-linux-lib.pl @@ -5,8 +5,6 @@ # Rene Mayrhofer, July 2000 # Some code has been taken from redhat-linux-lib.pl -use File::Copy; - $network_interfaces_config = '/etc/network/interfaces'; $modules_config = '/etc/modprobe.d/arch/i386'; if (!-d $modules_config) { @@ -387,7 +385,7 @@ sub modify_module_def my $modify_block = 0; # make a backup copy - copy("$modules_config", "$modules_config~"); + ©_source_dest($modules_config, "$modules_config~"); local *OLDCFGFILE, *NEWCFGFILE; &open_readfile(OLDCFGFILE, "$modules_config~") || error("Unable to open $modules_config"); @@ -489,7 +487,7 @@ sub new_module_def { local ($name, $mode, $miimon, $downdelay, $updelay) = @_; return if (!$modules_config); - copy("$modules_config", "$modules_config~"); + ©_source_dest($modules_config, "$modules_config~"); local *CFGFILE; &open_lock_tempfile(CFGFILE, ">> $modules_config") || error("Unable to open $modules_config"); @@ -901,7 +899,7 @@ sub modify_interface_def { my ($name, $addrfam, $method, $options, $mode) = @_; # make a backup copy -copy("$network_interfaces_config", "$network_interfaces_config~"); +©_source_dest($network_interfaces_config, "$network_interfaces_config~"); local *OLDCFGFILE, *NEWCFGFILE; &open_readfile(OLDCFGFILE, "$network_interfaces_config~") || error("Unable to open $network_interfaces_config"); @@ -968,7 +966,7 @@ close(OLDCFGFILE); sub new_interface_def { # make a backup copy -copy("$network_interfaces_config", "$network_interfaces_config~"); +©_source_dest($network_interfaces_config, "$network_interfaces_config~"); local *CFGFILE; &open_lock_tempfile(CFGFILE, ">> $network_interfaces_config") || error("Unable to open $network_interfaces_config");