build,json: fix generation with empty profiles
[openwrt/staging/dedeckeh.git] / scripts / download.pl
index beb3abdeee429acd7489e7b8ce1e94dc31dfe3c3..8e6463c007615e42f826f3f75d68ec8a039e4d19 100755 (executable)
@@ -65,8 +65,8 @@ sub hash_cmd() {
        my $len = length($file_hash);
        my $cmd;
 
-       $len == 64 and return "mkhash sha256";
-       $len == 32 and return "mkhash md5";
+       $len == 64 and return "$ENV{'MKHASH'} sha256";
+       $len == 32 and return "$ENV{'MKHASH'} md5";
        return undef;
 }
 
@@ -196,6 +196,10 @@ foreach my $mirror (@ARGV) {
                }
        } elsif ($mirror =~ /^\@OPENWRT$/) {
                # use OpenWrt source server directly
+       } elsif ($mirror =~ /^\@DEBIAN\/(.+)$/) {
+               push @mirrors, "https://ftp.debian.org/debian/$1";
+               push @mirrors, "https://mirror.leaseweb.com/debian/$1";
+               push @mirrors, "https://mirror.netcologne.de/debian/$1";
        } elsif ($mirror =~ /^\@APACHE\/(.+)$/) {
                push @mirrors, "https://mirror.netcologne.de/apache.org/$1";
                push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1";
@@ -245,6 +249,7 @@ foreach my $mirror (@ARGV) {
                        push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir";
                }
        } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
+               push @mirrors, "https://download.gnome.org/sources/$1";
                push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1";
                push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1";
                push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1";
@@ -291,4 +296,3 @@ while (!-f "$target/$filename") {
 }
 
 $SIG{INT} = \&cleanup;
-