Skip to content

Commit

Permalink
Eups.getDependentProducts: don't addDefaultProducts if it's one of th…
Browse files Browse the repository at this point in the history
…e defaults

If the product is one of the default products, we don't want to add the default
products to the list of dependencies because that leads to a situation where
we can have cycles: we have to build X in order to build Y in order to build X.
  • Loading branch information
PaulPrice committed Jun 23, 2015
1 parent 9679202 commit 7ce47ef
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions python/eups/Eups.py
Original file line number Diff line number Diff line change
Expand Up @@ -3041,10 +3041,32 @@ def getDependentProducts(self, topProduct, setup=False, shouldRaise=False,
if not prodtbl:
return dependentProducts

for product, optional, recursionDepth in prodtbl.dependencies(self, recursive=True, recursionDepth=1,
followExact=followExact,
productDictionary=productDictionary,
requiredVersions=requiredVersions):
productDict = {}
dependencies = prodtbl.dependencies(self, recursive=True, recursionDepth=1,
followExact=followExact,
productDictionary=productDict,
requiredVersions=requiredVersions)

# Check to see whether this product is in the list of default products
defaultProductName = hooks.config.Eups.defaultProduct["name"]
defaultProductList = [p for p, _, _ in dependencies if p.name == defaultProductName]
if len(defaultProductList) > 0:
defaultProduct = defaultProductList[0]
defaultDeps = defaultProduct.getTable().dependencies(self, recursive=True, recursionDepth=1,
followExact=followExact,
requiredVersions=requiredVersions,
addDefaultProduct=False)
if topProduct.name in set(p[0].name for p in defaultDeps):
# Our product of interest is in the list of default products, so disable the inclusion
# of default products. This is to ensure we don't depend on something that depends on us.
productDict = {}
dependencies = prodtbl.dependencies(self, recursive=True, recursionDepth=1,
followExact=followExact, productDictionary=productDict,
requiredVersions=requiredVersions, addDefaultProduct=False)
if productDictionary is not None:
productDictionary.update(productDict)

for product, optional, recursionDepth in dependencies:

if product == topProduct:
continue
Expand Down

0 comments on commit 7ce47ef

Please sign in to comment.