Bug 1445683 - Don't update mimetype when updating aom; r=chmanchester
authorDan Minor <dminor@mozilla.com>
Mon, 09 Jul 2018 13:29:55 -0400
changeset 818887 383fb5a261ffb2075b014a42c676eda91d1193c3
parent 818886 a77a850eead4b0596c0fe942829c5a145d0d49f8
child 818888 0f16daade35d58c27e50980bb528a59504c7d3e4
push id116388
push userrwood@mozilla.com
push dateMon, 16 Jul 2018 19:48:57 +0000
reviewerschmanchester
bugs1445683
milestone63.0a1
Bug 1445683 - Don't update mimetype when updating aom; r=chmanchester The bitstream is frozen and we're updating to v1.0.0. There is no longer any need to indicate which revision we're using in the mimetype.
python/mozbuild/mozbuild/vendor_aom.py
--- a/python/mozbuild/mozbuild/vendor_aom.py
+++ b/python/mozbuild/mozbuild/vendor_aom.py
@@ -127,52 +127,16 @@ Please set a repository url with --repo 
         new_readme = re.sub(prefix + ' https*://.*',
                             prefix + ' %s' % self.repo_url,
                             new_readme)
 
         if readme != new_readme:
             with open(filename, 'w') as f:
                 f.write(new_readme)
 
-    def update_mimetype(self, revision):
-        '''Update source tree references to the aom revision.
-
-        While the av1 bitstream is unstable, we track the git revision
-        of the reference implementation we're building, and are careful
-        to build with default feature flags. This lets us answer whether
-        a particular bitstream will be playable by comparing the encode-
-        side hash as part of the mime type.
-        '''
-        filename = mozpath.join(self.topsrcdir,
-                'dom/media/platforms/agnostic/AOMDecoder.cpp')
-        with open(filename) as f:
-            source = f.read()
-
-        new_source = ''
-        pattern = re.compile('version.AppendLiteral\("([a-f0-9]{40})"\);')
-        match = pattern.search(source)
-        if match:
-            old_revision = match.group(1)
-            if old_revision == revision:
-                # Nothing to update.
-                return
-            new_source = pattern.sub('version.AppendLiteral("%s");' % revision,
-                                     source)
-        if not match or new_source == source:
-            self.log(logging.ERROR, 'hash_update', {},
-                     '''Couldn't update commit hash in
-    {file}.
-Please check manually and update the vendor script.
-                     '''.format(file=filename))
-            sys.exit(1)
-
-        with open(filename, 'w') as f:
-            f.write(new_source)
-
-
     def clean_upstream(self, target):
         '''Remove files we don't want to import.'''
         mozfile.remove(mozpath.join(target, '.gitattributes'))
         mozfile.remove(mozpath.join(target, '.gitignore'))
         mozfile.remove(mozpath.join(target, 'build', '.gitattributes'))
         mozfile.remove(mozpath.join(target, 'build' ,'.gitignore'))
 
     def generate_sources(self, target):
@@ -228,19 +192,16 @@ Please commit or stash these changes bef
         self.fetch_and_unpack(commit, vendor_dir)
         self.log(logging.INFO, 'clean_upstream', {},
                  '''Removing unnecessary files.''')
         self.clean_upstream(vendor_dir)
         glue_dir = mozpath.join(self.topsrcdir, 'media/libaom')
         self.log(logging.INFO, 'generate_sources', {},
                  '''Generating build files...''')
         self.generate_sources(glue_dir)
-        self.log(logging.INFO, 'update_source', {},
-                 '''Updating mimetype extension.''')
-        self.update_mimetype(commit)
         self.log(logging.INFO, 'update_readme', {},
                  '''Updating README_MOZILLA.''')
         self.update_readme(commit, timestamp, glue_dir)
         self.repository.add_remove_files(vendor_dir)
         self.log(logging.INFO, 'add_remove_files', {},
                  '''Registering changes with version control.''')
         self.repository.add_remove_files(vendor_dir)
         self.repository.add_remove_files(glue_dir)