Пример #1
0
        detailsUrl = substitutePath(
            pc['current-update']['details'], platform, locale, appVersion)
        optionalAttrs = pc.getOptionalAttrs(fromVersion, locale)
        checksumsUrl = substitutePath(
            pc['release'][version]['checksumsurl'], platform, locale)
        checksumsFile = path.join(options.checksumsDir, "%s-%s-%s-%s" %
                                  (appName, platform, locale, version))

        info = getChecksum(platform, locale, checksumsFile)
        # We may have multiple update types to generate a snippet for...
        for type_ in updateTypes:
            # And also multiple channels...
            for channel in channels:
                log.debug("Processing: %s %s %s %s %s" % (
                    fromVersion, platform, locale, channel, type_))
                url = pc.getUrl(fromVersion, platform, locale, type_, channel)
                filename = path.basename(
                    pc.getPath(fromVersion, platform, locale, type_))
                for f in info:
                    if filename == path.basename(f):
                        hash_ = info[f]['hashes'][hashType]
                        size = info[f]['size']
                        break
                else:
                    raise Exception("Couldn't find hash/size, bailing")
                # We also may have multiple snippets for the same platform.
                for snippet in getSnippetPaths(pc['appName'], fromAppVersion, platform, fromBuildid, locale, channel, type_):
                    if channel in pc['current-update']['channel']:
                        snippet = path.join(options.snippet_dir, snippet)
                    else:
                        snippet = path.join(options.test_snippet_dir, snippet)