Fix rebuild blacklist so that icedtea isn't rebuilt unnecessarily.

It turns out that my previous rebuild_blacklist code had a bug where
blacklisted packages would get rebuilt unnecessarily. This would result
in slow builds if icedtea was built.

BUG=chromium-os:6628
TEST=Mock case where prebuilts for icedtea are older than packages that
     icedtea depends on.

Change-Id: I498b6499b78ab065109c1fe0e77969028ceff6cb

Review URL: http://codereview.chromium.org/3308027
This commit is contained in:
David James 2010-09-10 18:07:55 -07:00
parent 012bff9e81
commit cc19005e15

View File

@ -1016,13 +1016,13 @@ class DepGraphGenerator(object):
# built from source, all children must also be built from source. # built from source, all children must also be built from source.
local_ready_cache, remote_ready_cache = {}, {} local_ready_cache, remote_ready_cache = {}, {}
local_mtime_cache, remote_mtime_cache = {}, {} local_mtime_cache, remote_mtime_cache = {}, {}
for pkg in final_pkgs: for pkg in final_pkgs.difference(rebuild_blacklist):
# If all the necessary local packages are ready, and their # If all the necessary local packages are ready, and their
# modification times are in sync, we don't need to do anything here. # modification times are in sync, we don't need to do anything here.
local_mtime = LastModifiedWithDeps(pkg, local_pkgs, local_mtime_cache) local_mtime = LastModifiedWithDeps(pkg, local_pkgs, local_mtime_cache)
local_ready = PrebuiltsReady(pkg, local_pkgs, local_ready_cache) local_ready = PrebuiltsReady(pkg, local_pkgs, local_ready_cache)
if (not local_ready or local_pkgs.get(pkg, 0) < local_mtime and if (not local_ready or local_pkgs.get(pkg, 0) < local_mtime and
pkg not in cycles and pkg not in rebuild_blacklist): pkg not in cycles):
# OK, at least one package is missing from the local cache or is # OK, at least one package is missing from the local cache or is
# outdated. This means we're going to have to install the package # outdated. This means we're going to have to install the package
# and all dependencies. # and all dependencies.