def compute_missing_depends(stack_name, distro, os_platform, arch, repo=SHADOW_REPO, lock_version=True):
    missing_deps = set()
    deps = compute_deps(distro, stack_name, ignore_catkinized = False)
    #don't include self
    deps = set([(sn, sv) for (sn, sv) in deps if not sn == stack_name])
    for sn, sv in deps:
        rpm_name = "ros-%s-%s"%(distro.release_name, redhatify_name(sn))
        # see if there's a dry version
        rpm_version = '[0-9.-]*-[st][0-9]+\.fc[0-9]+' 
        if not rpm_in_repo(repo, rpm_name, rpm_version, os_platform, arch, use_regex=True):
            # now test for wet version
            wet_rpm_version = '[0-9.]*-[0-9a-z]+-[0-9]+-[0-9]+-\+0000'
            if not rpm_in_repo(repo, rpm_name, wet_rpm_version, os_platform, arch, use_regex=True):
                missing_deps.add(rpm_name)

    return missing_deps
def get_missing(distro, os_platform, arch, repo=SHADOW_REPO, lock_version=True):
    distro_name = distro.release_name
    # Load the list of exclusions
    excludes_uri = "https://code.ros.org/svn/release/trunk/distros/%s.excludes"%(distro_name)
    excludes = ExclusionList(excludes_uri, distro_name, os_platform, arch)

    # Find all the deps in the distro for this stack
    deps = compute_deps(distro, 'ALL')

    # These stacks are not actually relased, so we treat them as implicitly excluded
    missing_primary = set(distro.stacks.keys()) - set(distro.released_stacks.keys())
    missing_dep = set()
    missing_excluded = set(distro.stacks.keys()) - set(distro.released_stacks.keys())
    missing_excluded_dep = set()

    # Build the deps in order
    for (sn, sv) in deps:
        if not sv:
            missing_primary.add(sn)
            continue
        rpm_name = "ros-%s-%s"%(distro_name, redhatify_name(sn))
        if lock_version:
            rpm_version = redhatify_version(sv, '\w*', os_platform)
        else:
            rpm_version = '[0-9.]*-[st][0-9]+\.fc[0-9]+'
        if not rpm_in_repo(repo, rpm_name, rpm_version, os_platform, arch, use_regex=True):
            try:
                si = load_info(sn, sv)
                depends = set(si['depends'])
            except:
                # stack is missing, including its info
                depends = set()

            # subtract any depends that aren't in the distro b/c of catkin dry/wet line
            to_remove = [d for d in depends if not d in distro.stacks]
            for d in to_remove:
                depends.remove(d)
                
            if excludes.check(sn):
                missing_excluded.add(sn)
                missing_primary.add(sn)
            elif depends.isdisjoint(missing_primary.union(missing_dep)):
                missing_primary.add(sn)
            else:
                missing_dep.add(sn)
                if not depends.isdisjoint(missing_excluded.union(missing_excluded_dep)):
                    missing_excluded_dep.add(sn)

        else:
            pass
            #print "IN", sn
    missing_primary -= missing_excluded
    missing_dep -= missing_excluded_dep

    return missing_primary, missing_dep, missing_excluded, missing_excluded_dep