Skip to content

Commit

Permalink
ncm-metaconfig: switch to shellwords for commandline splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
stdweird committed Oct 30, 2020
1 parent aa0444f commit 51f7b3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ncm-metaconfig/src/main/perl/metaconfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ use LC::Exception;
use EDG::WP4::CCM::TextRender 18.6.1;
use CAF::Service;
use EDG::WP4::CCM::Path qw(unescape);
use Text::ParseWords qw(old_shellwords);
use Text::ParseWords qw(shellwords);
use Readonly;

# Has to correspond to what is allowed in the schema
Expand Down Expand Up @@ -242,8 +242,8 @@ sub run_shell_command
$command =~ s/^-//;
$error_on_fail = 0;
}
my $cmd_ref = [old_shellwords($command)];
if (!$cmd_ref) {
my $cmd_ref = [shellwords($command)];
if (!@$cmd_ref) {
$self->error("Failed to split '$command'");
return;
}
Expand Down Expand Up @@ -358,8 +358,8 @@ sub resolve_command_actions
$commands->{$type} = $command;
$self->verbose("Resolved $type action $action to command '$command'");
} else {
# Not fatal, should be covered in schema already
$self->error("Unable to resovle $type action $action to command");
# Should not happen due to this being validated in the schema
$self->error("Unable to resolve $type action $action to command");
}
};
return $commands;
Expand Down

0 comments on commit 51f7b3f

Please sign in to comment.