Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 24, 2024
1 parent 583e126 commit 8034a9b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,14 @@ function _fetch_packages(packages_fetch, installdeps)
local working_count = 0
local fetching_count = 0
local parallelize = true
print("fetch_packages %d", #packages_pending)
runjobs("fetch_packages", function (index)

-- fetch a new package
local instance = nil
while instance == nil and #packages_pending > 0 do
print("")
print("pending: %d", #packages_pending)
for idx, pkg in ipairs(packages_pending) do

-- all dependences has been fetched? we fetch it now
Expand All @@ -293,6 +295,7 @@ function _fetch_packages(packages_fetch, installdeps)
break
end
end
print(" %d/%s, working_count: %d, ready: %s", idx, pkg:name(), working_count, ready)

-- get a package with the ready status
if ready then
Expand All @@ -316,6 +319,7 @@ function _fetch_packages(packages_fetch, installdeps)
end
end
if instance then
print("fetching", instance:name())

-- update working count
working_count = working_count + 1
Expand All @@ -336,9 +340,7 @@ function _fetch_packages(packages_fetch, installdeps)
packages_fetching[index] = instance
local oldenvs = os.getenvs()
instance:envs_enter()
print("fetching", instance:name())
instance:fetch()
print("fetch end", instance:name())
os.setenvs(oldenvs)

-- fix terminal mode to avoid some subprocess to change it
Expand All @@ -357,6 +359,7 @@ function _fetch_packages(packages_fetch, installdeps)

-- update working count
working_count = working_count - 1
print("fetch end", instance:name())
end
packages_fetching[index] = nil

Expand Down

0 comments on commit 8034a9b

Please sign in to comment.