mirror of
https://github.com/curl/curl.git
synced 2026-07-30 12:38:10 +03:00
perl: switch from backticks to qx()
To make it easier to find external command invocation in the source. Also drop backticks from a comment. To find external command invocations in Perl code use: ```sh git grep -E "((exec|qx|open2|open3|system)\(|open\(.+-\|)" $(<perlfiles>) ``` Refs: https://perldoc.perl.org/functions/qx https://perldoc.perl.org/perlop#Simpler-Quote-Like-Operators Closes #21994
This commit is contained in:
parent
c61f007a73
commit
9972f700a8
17 changed files with 48 additions and 48 deletions
|
|
@ -1226,12 +1226,12 @@ sub scanfile {
|
|||
@copyright = sort {$$b{year} cmp $$a{year}} @copyright;
|
||||
|
||||
# if the file is modified, assume commit year this year
|
||||
if(`git status -s -- "$file"` =~ /^ [MARCU]/) {
|
||||
if(qx(git status -s -- "$file") =~ /^ [MARCU]/) {
|
||||
$commityear = (localtime(time))[5] + 1900;
|
||||
}
|
||||
else {
|
||||
# min-parents=1 to ignore wrong initial commit in truncated repos
|
||||
my $grl = `git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- "$file"`;
|
||||
my $grl = qx(git rev-list --max-count=1 --min-parents=1 --timestamp HEAD -- "$file");
|
||||
if($grl) {
|
||||
chomp $grl;
|
||||
$commityear = (localtime((split(/ /, $grl))[0]))[5] + 1900;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ if(defined $ARGV[0] && $ARGV[0] eq "--dry-run") {
|
|||
}
|
||||
|
||||
# list all files to scan for links
|
||||
my @files = `git ls-files docs include lib scripts src`;
|
||||
my @files = qx(git ls-files docs include lib scripts src);
|
||||
|
||||
sub storelink {
|
||||
my ($f, $line, $link) = @_;
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ if(!$opt_n) {
|
|||
|
||||
# If we have an HTTPS URL then use curl
|
||||
if($url =~ /^https:\/\//i) {
|
||||
my $curl = `curl -V`;
|
||||
my $curl = qx(curl -V);
|
||||
if($curl) {
|
||||
if($curl =~ /^Protocols:.* https( |$)/m) {
|
||||
report "Get certdata with curl!";
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use List::Util qw/shuffle/;
|
|||
my @disable;
|
||||
|
||||
sub getoptions {
|
||||
my @all = `./configure --help`;
|
||||
my @all = qx(./configure --help);
|
||||
for my $o (@all) {
|
||||
chomp $o;
|
||||
if($o =~ /(--disable-[^ ]*)/) {
|
||||
|
|
|
|||
|
|
@ -58,8 +58,8 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
my $cleanup = (@ARGV && $ARGV[0] eq "cleanup");
|
||||
my @gitlog = `git log @^{/RELEASE-NOTES:.synced}..` if(!$cleanup);
|
||||
my @releasenotes = `cat RELEASE-NOTES`;
|
||||
my @gitlog = qx(git log @^{/RELEASE-NOTES:.synced}..) if(!$cleanup);
|
||||
my @releasenotes = qx(cat RELEASE-NOTES);
|
||||
|
||||
my @o; # the entire new RELEASE-NOTES
|
||||
my @refused; # [num] = [2 bits of use info]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue