diff --git a/python/eups/db/Database.py b/python/eups/db/Database.py index b2848f29..5e811986 100644 --- a/python/eups/db/Database.py +++ b/python/eups/db/Database.py @@ -535,18 +535,18 @@ def getChainFile(self, tag, productName, searchUserDB=False): if is_string(tag): tag = eups.tags.Tag(tag) - pdirs = [] + tfile = self._tagFileInDir(pdir, tag.name) + if os.path.exists(tfile): + return ChainFile(tfile) + + # not found; user tags may be in the userDB if searchUserDB and tag.isUser(): for d in self._getUserTagDb(values=True): if d: - pdirs.append(self._productDir(productName, d)) - else: - pdirs.append(pdir) - - for pdir in pdirs: - tfile = self._tagFileInDir(pdir, tag.name) - if os.path.exists(tfile): - return ChainFile(tfile) + pdir = self._productDir(productName, d) + tfile = self._tagFileInDir(pdir, tag.name) + if os.path.exists(tfile): + return ChainFile(tfile) return None