Index: lib/OpenBSD/PortGen/Port.pm =================================================================== RCS file: /home/cvs/ports/infrastructure/lib/OpenBSD/PortGen/Port.pm,v retrieving revision 1.22 diff -u -p -u -p -r1.22 Port.pm --- lib/OpenBSD/PortGen/Port.pm 5 Jan 2022 09:12:50 -0000 1.22 +++ lib/OpenBSD/PortGen/Port.pm 5 Jan 2022 15:21:33 -0000 @@ -22,6 +22,7 @@ use warnings; use Cwd; use Fcntl qw( :mode ); +use File::Copy qw ( cp ); use File::Find qw(); use File::Path qw( make_path ); use JSON::PP; @@ -44,11 +45,6 @@ sub add_make_options push(@make_options, @_); } -sub _cp { - my (@args) = @_; - system('/bin/cp', @args) == 0; -} - sub new { my ( $class, %args ) = @_; @@ -536,7 +532,7 @@ sub make_portdir if ( -e $old ) { my ($dst) = $new =~ m{^(.*)/[^/]+$}; make_path($dst) unless -e $dst; - _cp( '-a', $old, $dst ) + copy( $old, $dst ) or die "Unable to copy $old to $new: $!"; unlink glob("$new/pkg/PLIST*.orig");