From 591b3f6dceca93edbd5c68b5e6eca95709caec81 Mon Sep 17 00:00:00 2001 From: Jacob Bachmeyer Date: Sat, 5 Nov 2022 15:34:43 -0500 Subject: [PATCH] Use new mkdir_p helper in install_files Instead of using File::Path or invokgin the system mkdir, we now emulate "mkdir -p" using about 5 lines of Perl elsewhere in the script. --- gatekeeper.pl | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gatekeeper.pl b/gatekeeper.pl index e085635..4877858 100755 --- a/gatekeeper.pl +++ b/gatekeeper.pl @@ -2406,8 +2406,9 @@ sub install_files { our $Stage_dir; our $Public_dir; + my @directory = File::Spec::Unix->splitdir($header->{directory}); my $destdir = File::Spec->catdir - ($Public_dir, File::Spec::Unix->splitdir($header->{directory})); + ($Public_dir, @directory); my $install_as = $step->[1]; my $upload_file = $header->{filename}; @@ -2419,13 +2420,7 @@ sub install_files { my $final_upload = File::Spec->catfile($destdir, $install_as); my $final_signature = File::Spec->catfile($destdir, $install_as.'.sig'); - # File::Path is 200 lines of Perl and requires reading an external - # text file. In my mind, it is a toss-up as to whether that or - # forking the system mkdir is safer. We could debate endlessly, - # change it if you like, let's move on ... - my @mkdir_args = ("/bin/mkdir", "-p", $destdir); - system (@mkdir_args); - -d $destdir or fatal("no directory $destdir",1); + mkdir_p $Public_dir, @directory; my $notification_str = ''; -- 2.25.1