projects
/
openwrt
/
staging
/
wigyori.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6de2d7
)
scripts/download.pl: use perl builtins instead of system()
author
Matteo Croce
<
[email protected]
>
Sat, 28 Sep 2024 22:41:23 +0000
(
00:41
+0200)
committer
Hauke Mehrtens
<
[email protected]
>
Sat, 12 Oct 2024 19:59:15 +0000
(21:59 +0200)
Perl natively supports renaming files and create directories.
Do it without calling system().
Signed-off-by: Matteo Croce <
[email protected]
>
Link:
https://github.com/openwrt/openwrt/pull/16542
Signed-off-by: Hauke Mehrtens <
[email protected]
>
scripts/download.pl
patch
|
blob
|
history
diff --git
a/scripts/download.pl
b/scripts/download.pl
index 5449a3406aa96f4312dc76a33f8d46566049129e..c6c9b8e56cd4c310b6b4da061e3552a827ce0196 100755
(executable)
--- a/
scripts/download.pl
+++ b/
scripts/download.pl
@@
-11,6
+11,7
@@
use strict;
use warnings;
use File::Basename;
use File::Copy;
+use File::Path;
use Text::ParseWords;
use JSON::PP;
@@
-173,7
+174,7
@@
sub download
}
if (! -d "$target") {
-
system("mkdir", "-p", "$target/"
);
+
make_path($target
);
}
if (! open TMPDLS, "find $mirror -follow -name $filename 2>/dev/null |") {
@@
-244,7
+245,7
@@
sub download
};
unlink "$target/$filename";
-
system("mv",
"$target/$filename.dl", "$target/$filename");
+
move(
"$target/$filename.dl", "$target/$filename");
cleanup();
}