Bug 1421162: Remove some dead mozharness `mar` code; r=jlund

MozReview-Commit-ID: JvkQ713z1eW

--HG--
extra : rebase_source : 25329f9d189cc1ca1c5823bfa0c15966417ff841
extra : source : d768123592505cb15bcb03f86b62e244c066626a
This commit is contained in:
Tom Prince 2017-11-27 22:50:31 -07:00
Родитель 89778e9157
Коммит 615d82c39d
2 изменённых файлов: 1 добавлений и 74 удалений

Просмотреть файл

@ -1,4 +1,3 @@
#!/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,
@ -7,30 +6,6 @@
"""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
@ -41,13 +16,6 @@ class MarMixin(object):
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()"""
@ -68,45 +36,3 @@ class MarMixin(object):
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)

Просмотреть файл

@ -23,6 +23,7 @@ flake8:
- testing/mochitest
- testing/mozbase
- testing/mozharness/mozfile
- testing/mozharness/mozharness/mozilla/mar.py
- testing/mozharness/mozinfo
- testing/mozharness/scripts
- testing/remotecppunittests.py