コード例 #1
0
ファイル: release_sanity.py プロジェクト: EkkiD/build-tools
def verify_configs(revision, hghost, configs_repo, changesets, filename):
    """Check the release_configs and l10n-changesets against tagged revisions"""
    configs_url = make_hg_url(hghost,
                              configs_repo,
                              revision=revision,
                              filename="mozilla/%s" % filename)
    l10n_url = make_hg_url(hghost,
                           configs_repo,
                           revision=revision,
                           filename="mozilla/%s" % changesets)

    success = True
    try:
        official_configs = urllib2.urlopen(configs_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." %
                 (configs_url, filename))
        if not compare(official_configs, filename):
            log.error("local configs do not match tagged revisions in repo")
            success = False
            error_tally.add('verify_configs')
        l10n_changesets = urllib2.urlopen(l10n_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." %
                 (l10n_url, changesets))
        if not compare(l10n_changesets, changesets):
            log.error(
                "local l10n-changesets do not match tagged revisions in repo")
            success = False
            error_tally.add('verify_configs')
    except urllib2.HTTPError:
        log.error("cannot find configs in repo %s" % configs_url)
        log.error("cannot find configs in repo %s" % l10n_url)
        success = False
        error_tally.add('verify_configs')
    return success
コード例 #2
0
ファイル: release_sanity.py プロジェクト: magnyld/build-tools
def verify_configs(configs_dir, revision, hghost, configs_repo, changesets,
                   filename):
    """Check the release_configs and l10n-changesets against tagged
    revisions"""

    release_config_file = path.join(configs_dir, 'mozilla', filename)
    l10n_changesets_file = path.join(configs_dir, 'mozilla', changesets)
    configs_url = make_hg_url(hghost, configs_repo, revision=revision,
                              filename=path.join('mozilla', filename))
    l10n_url = make_hg_url(hghost, configs_repo, revision=revision,
                           filename=path.join('mozilla', changesets))

    success = True
    try:
        official_configs = urllib2.urlopen(configs_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." % (
            configs_url, filename))
        if not compare(official_configs, release_config_file):
            log.error("local configs do not match tagged revisions in repo")
            success = False
            error_tally.add('verify_configs')
        l10n_changesets = urllib2.urlopen(l10n_url)
        log.info("Comparing tagged revision %s to on-disk %s ..." % (
            l10n_url, changesets))
        if not compare(l10n_changesets, l10n_changesets_file):
            log.error("local l10n-changesets do not match tagged revisions"
                      " in repo")
            success = False
            error_tally.add('verify_configs')
    except urllib2.HTTPError:
        log.error("cannot find configs in repo %s" % configs_url)
        log.error("cannot find configs in repo %s" % l10n_url)
        success = False
        error_tally.add('verify_configs')
    return success
コード例 #3
0
 def testCompareEqFiles(self):
     tmpdir = tempfile.mkdtemp()
     file1 = os.path.join(tmpdir, "foo")
     file2 = os.path.join(tmpdir, "bar")
     open(file1, "w").write("hello")
     open(file2, "w").write("hello")
     self.failUnless(compare(file1, file2))