Bug 1421162: Remove some dead mozharness `mar` code; r?jlund draft
authorTom Prince <mozilla@hocat.ca>
Mon, 27 Nov 2017 22:50:31 -0700
changeset 704045 21e548e6d901db1f03e818d4fd6e62af2d2bf4fd
parent 704031 83a778c30f3730706711d7f79748277db7fac05e
child 704046 16807460d22e5ccc800677a55dfb64f6c7aa3c5e
push id91046
push userbmo:mozilla@hocat.ca
push dateTue, 28 Nov 2017 05:58:05 +0000
reviewersjlund
bugs1421162
milestone59.0a1
Bug 1421162: Remove some dead mozharness `mar` code; r?jlund MozReview-Commit-ID: JvkQ713z1eW
testing/mozharness/mozharness/mozilla/mar.py
tools/lint/flake8.yml
--- a/testing/mozharness/mozharness/mozilla/mar.py
+++ b/testing/mozharness/mozharness/mozilla/mar.py
@@ -1,58 +1,26 @@
-#!/usr/bin/env python
 # ***** BEGIN LICENSE BLOCK *****
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this file,
 # You can obtain one at http://mozilla.org/MPL/2.0/.
 # ***** END LICENSE BLOCK *****
 """MarMixin, manages mar files"""
 
 import os
-import sys
-import ConfigParser
-
-# load modules from parent dir
-sys.path.insert(1, os.path.dirname(sys.path[0]))
-
-
-CONFIG = {
-    "buildid_section": 'App',
-    "buildid_option": "BuildID",
-}
-
-
-def query_ini_file(ini_file, section, option):
-    ini = ConfigParser.SafeConfigParser()
-    ini.read(ini_file)
-    return ini.get(section, option)
-
-
-def buildid_from_ini(ini_file):
-    """reads an ini_file and returns the buildid"""
-    return query_ini_file(ini_file,
-                          CONFIG.get('buildid_section'),
-                          CONFIG.get('buildid_option'))
 
 
 # MarMixin {{{1
 class MarMixin(object):
     def _mar_tool_dir(self):
         """returns the path or the mar tool directory"""
         config = self.config
         dirs = self.query_abs_dirs()
         return os.path.join(dirs['abs_objdir'], config["local_mar_tool_dir"])
 
-    def _incremental_update_script(self):
-        """returns the path of incremental update script"""
-        config = self.config
-        dirs = self.query_abs_dirs()
-        return os.path.join(dirs['abs_mozilla_dir'],
-                            config['incremental_update_script'])
-
     def download_mar_tools(self):
         """downloads mar tools executables (mar,mbsdiff)
            and stores them local_dir()"""
         self.info("getting mar tools")
         dst_dir = self._mar_tool_dir()
         self.mkdir_p(dst_dir)
         config = self.config
         replace_dict = {'platform': config['platform'],
@@ -63,50 +31,8 @@ class MarMixin(object):
             from_url = "/".join((url, binary))
             full_path = os.path.join(dst_dir, binary)
             if not os.path.exists(full_path):
                 self.download_file(from_url, file_name=full_path)
                 self.info("downloaded %s" % full_path)
             else:
                 self.info("found %s, skipping download" % full_path)
             self.chmod(full_path, 0755)
-
-    def _temp_mar_base_dir(self):
-        """a base dir for unpacking mars"""
-        dirs = self.query_abs_dirs()
-        return dirs['abs_objdir']
-
-    def _unpack_mar(self, mar_file, dst_dir):
-        """unpacks a mar file into dst_dir"""
-        cmd = ['perl', self._unpack_script(), mar_file]
-        env = self.query_bootstrap_env()
-        self.info("unpacking %s" % mar_file)
-        self.mkdir_p(dst_dir)
-        return self.run_command(cmd,
-                                cwd=dst_dir,
-                                env=env,
-                                halt_on_failure=True)
-
-    def do_incremental_update(self, previous_dir, current_dir, partial_filename):
-        """create an incremental update from src_mar to dst_src.
-           It stores the result in partial_filename"""
-        # Usage: make_incremental_update.sh [OPTIONS] ARCHIVE FROMDIR TODIR
-        cmd = [self._incremental_update_script(), partial_filename,
-               previous_dir, current_dir]
-        env = self.query_bootstrap_env()
-        cwd = self._mar_dir('update_mar_dir')
-        self.mkdir_p(cwd)
-        result = self.run_command(cmd, cwd=cwd, env=env)
-        return result
-
-    def get_buildid_from_mar_dir(self, mar_unpack_dir):
-        """returns the buildid of the current mar file"""
-        config = self.config
-        ini_file = config['application_ini']
-        ini_file = os.path.join(mar_unpack_dir, ini_file)
-        self.info("application.ini file: %s" % ini_file)
-
-        # log the content of application.ini
-        with self.opened(ini_file, 'r') as (ini, error):
-            if error:
-                self.fatal('cannot open %s' % ini_file)
-            self.debug(ini.read())
-        return buildid_from_ini(ini_file)
--- a/tools/lint/flake8.yml
+++ b/tools/lint/flake8.yml
@@ -18,16 +18,17 @@ flake8:
         - testing/firefox-ui
         - testing/mach_commands.py
         - testing/marionette/client
         - testing/marionette/harness
         - testing/marionette/puppeteer
         - testing/mochitest
         - testing/mozbase
         - testing/mozharness/mozfile
+        - testing/mozharness/mozharness/mozilla/mar.py
         - testing/mozharness/mozinfo
         - testing/mozharness/scripts
         - testing/remotecppunittests.py
         - testing/runcppunittests.py
         - testing/talos/
         - testing/xpcshell
         - tools/git
         - tools/lint