From 4c4326140484b090df4dd2ed7165e669991744cc Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Sat, 13 Jul 2013 18:33:53 +0200 Subject: Move {safe_,}rename() from install{man,perl} into install_lib.pl installman's rename() was identical to installperl's safe_rename() in all but name (and whitespace), so de-duplicate by moving the code to install_lib.pl --- installperl | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'installperl') diff --git a/installperl b/installperl index 9cf7d7b663..f71243f05f 100755 --- a/installperl +++ b/installperl @@ -625,20 +625,6 @@ sub safe_unlink { } } -sub safe_rename { - my($from,$to) = @_; - if (-f $to and not unlink($to)) { - my($i); - for ($i = 1; $i < 50; $i++) { - last if rename($to, "$to.$i"); - } - warn("Cannot rename to '$to.$i': $!"), return 0 - if $i >= 50; # Give up! - } - link($from,$to) || return 0; - unlink($from); -} - sub copy { my($from,$to) = @_; -- cgit v1.2.1