Check location first. Grab final progress when multiple entries listed.

This commit is contained in:
Chris Roberts 2018-02-21 19:46:12 -08:00
parent 5e7e56f573
commit 04e05088ff
1 changed files with 18 additions and 10 deletions

View File

@ -101,13 +101,6 @@ module Vagrant
progress_data << data
while true
# If we have a full amount of column data (two "\r") then
# we report new progress reports. Otherwise, just keep
# accumulating.
match = progress_regexp.match(progress_data)
break if !match
# If the download has been redirected and we are no longer downloading
# from the original host, notify the user that the target host has
# changed from the source.
@ -129,9 +122,24 @@ module Vagrant
break
end
data = match[1].to_s
stop = progress_data.index(data) + data.length
progress_data.slice!(0, stop)
# If we have a full amount of column data (two "\r") then
# we report new progress reports. Otherwise, just keep
# accumulating.
match = nil
check_match = true
while check_match
check_match = progress_regexp.match(progress_data)
if check_match
data = check_match[1].to_s
stop = progress_data.index(data) + data.length
progress_data.slice!(0, stop)
match = check_match
end
end
break if !match
# Ignore the first \r and split by whitespace to grab the columns
columns = data.strip.split(/\s+/)