Exemple #1
0
def scan_releases(releases_directory):
    """Return a sequence of dictionaries describing releases.

    Will not cope with many of these inconsistent releases that predate
    release.py; they are ignored."""
    releases = []
    rnames = {}
    for release in listdir(releases_directory):
        nfd_dir = join(releases_directory, release, NOT_FOR_DISTRIBUTION)
        if isdir(nfd_dir):
            nfd_tags = [f for f in listdir(nfd_dir) if is_tag(f)]
            if len(nfd_tags) == 0:
                # no tags, which happens for manual releases 
                # eg 2014-01-30-XT-3.2.0-SyncXT-Fix
                continue
            if len(nfd_tags) != 1:
                print >>stderr, 'WARNING: found', nfd_tags,
                print >>stderr, 'rather than exactly one tag in', nfd_dir,
                print >>stderr, 'so skipping', release
                continue
            tag = nfd_tags[0]
            builddir = join(nfd_dir, tag)
            name = release
            if DATE_REGEXP.match(name):
                name = name[11:]
            name = name.replace('XT-', '').replace('-Release', '').lower()
            if name in rnames:
                print >>stderr, 'WARNING: name clash on', release, name, 
                print >>stderr, nfd_dir, rnames[name]
            else:
                releases += inspect_build(builddir, tag, 'release', name)
                rnames[name] = nfd_dir
    return releases
Exemple #2
0
def scan_builds(branch_parent_directories, verbose=True):
    """Return a sequence of dictionaries describing builds in
    branch_parent_directories."""
    builds = []
    for branch_parent_directory in branch_parent_directories: 
        for branch in listdir(branch_parent_directory):
            # 23 is experimentally shown to be safe
            if len(branch) > 23:
                if verbose:
                    # this warning is going to happen but better not to spam cron email
                    # so the warning is only produced in verbose mode
                    print 'WARNING: skipping', branch, 'since the labels may crash pxelinux'
                continue
            if branch == 'netboots':
                continue
            branchd = join(branch_parent_directory, branch)
            if isfile(branchd):
                continue
            try:
                tagfiles = listdir(branchd)
            except OSError:
                print 'WARNING: unable to access', branchd
                continue
            for tag in tagfiles:
                if not is_tag(tag):
                    continue
                branch_from_tag = extract_branch(tag)
                if branch_from_tag != branch:
                    print 'WARNING: branch/tag confusion in',
                    print join(branchd, tag),
                    print 'so leaving that build out'
                    continue
                root = join(branchd, tag)
                builds += inspect_build(root, tag, 'build', tag)
    return builds
Exemple #3
0
def scan_releases(releases_directory):
    """Return a sequence of dictionaries describing releases.

    Will not cope with many of these inconsistent releases that predate
    release.py; they are ignored."""
    releases = []
    rnames = {}
    for release in listdir(releases_directory):
        nfd_dir = join(releases_directory, release, NOT_FOR_DISTRIBUTION)
        if isdir(nfd_dir):
            nfd_tags = [f for f in listdir(nfd_dir) if is_tag(f)]
            if len(nfd_tags) == 0:
                # no tags, which happens for manual releases
                # eg 2014-01-30-XT-3.2.0-SyncXT-Fix
                continue
            if len(nfd_tags) != 1:
                print >> stderr, 'WARNING: found', nfd_tags,
                print >> stderr, 'rather than exactly one tag in', nfd_dir,
                print >> stderr, 'so skipping', release
                continue
            tag = nfd_tags[0]
            builddir = join(nfd_dir, tag)
            name = release
            if DATE_REGEXP.match(name):
                name = name[11:]
            name = name.replace('XT-', '').replace('-Release', '').lower()
            if name in rnames:
                print >> stderr, 'WARNING: name clash on', release, name,
                print >> stderr, nfd_dir, rnames[name]
            else:
                releases += inspect_build(builddir, tag, 'release', name)
                rnames[name] = nfd_dir
    return releases