[openwrt/openwrt] scripts/download.pl: fix broken link for KERNEL projects

LEDE Commits lede-commits at lists.infradead.org
Wed Jun 19 05:32:36 PDT 2024


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/3b83d393ddcd09e9ceb6ce04559d8f4a697f817f

commit 3b83d393ddcd09e9ceb6ce04559d8f4a697f817f
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Jun 19 14:30:06 2024 +0200

    scripts/download.pl: fix broken link for KERNEL projects
    
    Fix broken link generation for KERNEL projects.
    
    Using $1 in projectsmirrors sub was still referencing the caller $1
    instead of the remaining args of projectsmirrors sub.
    
    Use shift and put the second arg of projectsmirrors sub in $append to
    correctly handle the sub args.
    
    Fixes: 465cf358881c ("scripts/download.pl: detach mirror URLs from script file")
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 scripts/download.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/download.pl b/scripts/download.pl
index eba48e84a0..5449a3406a 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -59,6 +59,7 @@ sub localmirrors {
 
 sub projectsmirrors {
 	my $project = shift;
+	my $append = shift;
 
 	open (PM, "$scriptdir/projectsmirrors.json") ||
 		die "Can´t open $scriptdir/projectsmirrors.json: $!\n";
@@ -67,7 +68,7 @@ sub projectsmirrors {
 	my $mirror = decode_json $mirror_json;
 
 	foreach (@{$mirror->{$project}}) {
-		push @mirrors, $_ . "/" . ($1 or "");
+		push @mirrors, $_ . "/" . ($append or "");
 	}
 }
 




More information about the lede-commits mailing list