'Recursive helper function for _normalize.'

def _normalize_helper(self, visited, spec_deps, provider_index):

    if (self.name in visited):
        return False
    visited.add(self.name)
    if (self.virtual or self.external):
        return False
    any_change = False
    changed = True
    pkg = spack.repo.get(self.fullname)
    while changed:
        changed = False
        for dep_name in pkg.dependencies:
            pkg_dep = self._evaluate_dependency_conditions(dep_name)
            deptypes = pkg.dependency_types[dep_name]
            if pkg_dep:
                changed |= self._merge_dependency(pkg_dep, deptypes, visited, spec_deps, provider_index)
        any_change |= changed
    return any_change
