china_mirrors.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --- a/scripts/download.pl
  2. +++ b/scripts/download.pl
  3. @@ -194,6 +194,8 @@ sub cleanup
  4. push @mirrors, "https://downloads.sourceforge.net/$1";
  5. }
  6. } elsif ($mirror =~ /^\@APACHE\/(.+)$/) {
  7. + push @mirrors, "https://mirrors.cloud.tencent.com/apache/$1";
  8. + push @mirrors, "https://mirrors.bfsu.edu.cn/apache/$1";
  9. push @mirrors, "https://mirror.netcologne.de/apache.org/$1";
  10. push @mirrors, "https://mirror.aarnet.edu.au/pub/apache/$1";
  11. push @mirrors, "https://mirror.csclub.uwaterloo.ca/apache/$1";
  12. @@ -204,11 +206,16 @@ sub cleanup
  13. push @mirrors, "ftp://apache.cs.utah.edu/apache.org/$1";
  14. push @mirrors, "ftp://apache.mirrors.ovh.net/ftp.apache.org/dist/$1";
  15. } elsif ($mirror =~ /^\@GITHUB\/(.+)$/) {
  16. + my $dir = $1;
  17. + my $i = 0;
  18. + push @mirrors, "https://cdn.jsdelivr.net/gh/". $dir =~ s{\/}{++$i == 2 ? '@' : $&}ger;
  19. # give github a few more tries (different mirrors)
  20. for (1 .. 5) {
  21. - push @mirrors, "https://raw.githubusercontent.com/$1";
  22. + push @mirrors, "https://raw.githubusercontent.com/$dir";
  23. }
  24. } elsif ($mirror =~ /^\@GNU\/(.+)$/) {
  25. + push @mirrors, "https://mirrors.cloud.tencent.com/gnu/$1";
  26. + push @mirrors, "https://mirrors.bfsu.edu.cn/gnu/$1";
  27. push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnu/$1";
  28. push @mirrors, "https://mirror.netcologne.de/gnu/$1";
  29. push @mirrors, "http://ftp.kddilabs.jp/GNU/gnu/$1";
  30. @@ -234,6 +241,7 @@ sub cleanup
  31. push @extra, "$extra[0]/longterm/v$1";
  32. }
  33. foreach my $dir (@extra) {
  34. + push @mirrors, "https://mirrors.ustc.edu.cn/kernel.org/$dir";
  35. push @mirrors, "https://cdn.kernel.org/pub/$dir";
  36. push @mirrors, "https://mirror.rackspace.com/kernel.org/pub/$dir";
  37. push @mirrors, "https://download.xs4all.nl/ftp.kernel.org/pub/$dir";
  38. @@ -244,6 +244,7 @@ sub cleanup
  39. push @mirrors, "ftp://www.mirrorservice.org/sites/ftp.kernel.org/pub/$dir";
  40. }
  41. } elsif ($mirror =~ /^\@GNOME\/(.+)$/) {
  42. + push @mirrors, "https://mirrors.ustc.edu.cn/gnome/sources/$1";
  43. push @mirrors, "https://mirror.csclub.uwaterloo.ca/gnome/sources/$1";
  44. push @mirrors, "http://ftp.acc.umu.se/pub/GNOME/sources/$1";
  45. push @mirrors, "http://ftp.kaist.ac.kr/gnome/sources/$1";