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:
        deb_name = "ros-%s-%s" % (distro.release_name, debianize_name(sn))
        # see if there's a dry version
        deb_version = '[0-9.-]*-[st][0-9]+~[a-z]+'
        if not deb_in_repo(
                repo, deb_name, deb_version, os_platform, arch,
                use_regex=True):
            # now test for wet version
            wet_deb_version = '[0-9.]*-[0-9a-z]+-[0-9]+-[0-9]+-\+0000'
            if not deb_in_repo(repo,
                               deb_name,
                               wet_deb_version,
                               os_platform,
                               arch,
                               use_regex=True):
                missing_deps.add(deb_name)

    return missing_deps
Exemple #2
0
 def test_deb_in_repo(self):
     from rosdeb import deb_in_repo, load_Packages
     parsed = load_Packages(SHADOW_REPO, 'lucid', 'amd64')
     self.assert_(
         deb_in_repo(SHADOW_REPO, parsed[0][0], parsed[0][1], 'lucid',
                     'amd64'))
     self.failIf(
         deb_in_repo(SHADOW_REPO, 'fake', parsed[0][1], 'lucid', 'amd64'))
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:
        deb_name = "ros-%s-%s"%(distro.release_name, debianize_name(sn))
        # see if there's a dry version
        deb_version = '[0-9.-]*-[st][0-9]+~[a-z]+' 
        if not deb_in_repo(repo, deb_name, deb_version, os_platform, arch, use_regex=True):
            # now test for wet version
            wet_deb_version = '[0-9.]*-[0-9a-z]+-[0-9]+-[0-9]+-\+0000'
            if not deb_in_repo(repo, deb_name, wet_deb_version, os_platform, arch, use_regex=True):
                missing_deps.add(deb_name)

    return missing_deps
Exemple #4
0
def deb_in_repo(deb_name, deb_version, os_platform, arch, cache=None):
    return rosdeb.deb_in_repo(SHADOW_REPO_URL,
                              deb_name,
                              deb_version,
                              os_platform,
                              arch,
                              use_regex=True,
                              cache=cache)
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
        deb_name = "ros-%s-%s"%(distro_name, debianize_name(sn))
        if lock_version:
            deb_version = debianize_version(sv, '\w*', os_platform)
        else:
            deb_version = '[0-9.]*-[st][0-9]+~[a-z]+'
        if not deb_in_repo(repo, deb_name, deb_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
def deb_in_repo(deb_name, deb_version, os_platform, arch, cache=None):
    return rosdeb.deb_in_repo(REPO_URL, deb_name, deb_version, os_platform, arch, use_regex=True, cache=cache)
 def test_deb_in_repo(self):
     from rosdeb import deb_in_repo, load_Packages
     parsed = load_Packages(SHADOW_REPO, 'lucid', 'amd64')
     self.assert_(deb_in_repo(SHADOW_REPO, parsed[0][0], parsed[0][1], 'lucid', 'amd64'))
     self.failIf(deb_in_repo(SHADOW_REPO, 'fake', parsed[0][1], 'lucid', 'amd64'))        
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
        deb_name = "ros-%s-%s" % (distro_name, debianize_name(sn))
        if lock_version:
            deb_version = debianize_version(sv, '\w*', os_platform)
        else:
            deb_version = '[0-9.]*-[st][0-9]+~[a-z]+'
        if not deb_in_repo(
                repo, deb_name, deb_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
def deb_in_repo(deb_name, deb_version, os_platform, arch):
    return rosdeb.deb_in_repo(SHADOW_REPO_URL, deb_name, deb_version, os_platform, arch, use_regex=True)