diff options
author | shuai.fu <shuai01.fu@samsung.com> | 2017-04-22 13:43:02 +0800 |
---|---|---|
committer | y0169.zhang <y0169.zhang@samsung.com> | 2017-07-10 11:19:29 +0800 |
commit | 24dc605f13d22c9c40999910af164d1f8c5bfd8e (patch) | |
tree | ace6b1cfe91019ef6ea452a7fa6bd9d446c4d153 /download | |
parent | 07c0dbf5da85bc3931186838be1420cfd8a2de7f (diff) | |
download | build-24dc605f13d22c9c40999910af164d1f8c5bfd8e.tar.gz build-24dc605f13d22c9c40999910af164d1f8c5bfd8e.tar.bz2 build-24dc605f13d22c9c40999910af164d1f8c5bfd8e.zip |
Update to upstream 20160629upstream/20160629
Change-Id: Idc31c269aec94e852b30885dee65a827b318b7a3
Signed-off-by: shuai.fu <shuai01.fu@samsung.com>
Diffstat (limited to 'download')
-rwxr-xr-x | download | 46 |
1 files changed, 23 insertions, 23 deletions
@@ -65,27 +65,27 @@ for my $url (@ARGV) { last; } } else { - my $found = 0; - if ( defined $ENV{BUILD_ROOT} && -e $ENV{BUILD_ROOT} . "/.repo.config" ) { - open FILE, "<", $ENV{BUILD_ROOT} . "/.repo.config" or die $!; - while (<FILE>) { - next if ($_ !~ /^http[s]?:\/\/([^\/]*)\/?/); - chomp($_); - my $hidden = URI->new($_); - my $ui = $hidden->userinfo; - $hidden->userinfo(undef); - if ( $url =~ m/^$hidden/ ) { - $url = URI->new($url); - $url->userinfo($ui); - $found = 1; - last; - } - } - close FILE; - } - if ($found == 0 ) { - $url = URI->new($url); - } + my $found = 0; + if ( defined $ENV{BUILD_ROOT} && -e $ENV{BUILD_ROOT} . "/.repo.config" ) { + open FILE, "<", $ENV{BUILD_ROOT} . "/.repo.config" or die $!; + while (<FILE>) { + next if ($_ !~ /^http[s]?:\/\/([^\/]*)\/?/); + chomp($_); + my $hidden = URI->new($_); + my $ui = $hidden->userinfo; + $hidden->userinfo(undef); + if ( $url =~ m/^$hidden/ ) { + $url = URI->new($url); + $url->userinfo($ui); + $found = 1; + last; + } + } + close FILE; + } + if ($found == 0 ) { + $url = URI->new($url); + } } $ua->env_proxy if $url->scheme ne 'https'; my $dest = "$dir/".basename($url->path); @@ -95,8 +95,8 @@ for my $url (@ARGV) { my $res = $ua->mirror($url, $dest); last if $res->is_success; # if it's a redirect we probably got a bad mirror and should just retry - die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry && $res->previous; - warn "retrying " . hide_passwd($original) . "\n"; + die "reqesting " . hide_passwd($original) . " failed: ".$res->status_line."\n" unless $retry && $res->previous; + warn "retrying " . hide_passwd($original) . "\n"; } } |