diff options
Diffstat (limited to 'discard_patches.py')
-rwxr-xr-x | discard_patches.py | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/discard_patches.py b/discard_patches.py deleted file mode 100755 index 00c457ef..00000000 --- a/discard_patches.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python2 -# -# Copyright 2017 The Chromium OS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -"""Script to discard all the patches added to Android for this suite""" - -from __future__ import print_function - -import config -import os -import subprocess - - -def discard_git(path): - try: - subprocess.check_call(['git', '-C', path, 'reset']) - subprocess.check_call(['git', '-C', path, 'clean', '-fdx']) - subprocess.check_call(['git', '-C', path, 'stash']) - print('Patch in %s removed successfully!' % path) - except subprocess.CalledProcessError: - print('Error while removing patch in %s' % path) - - -def dispatch_autotest(): - autotest_dir = os.path.join(config.android_home, config.autotest_dir) - discard_git(autotest_dir) - - -def dispatch_panorama(): - panorama_dir = os.path.join(config.android_home, - config.bench_dict['Panorama']) - discard_git(panorama_dir) - try: - subprocess.check_call(['rm', '-rf', panorama_dir]) - print('Panorama benchmark directory deleted successfully!') - except subprocess.CalledProcessError: - print('Error deleting Panorama benchmark directory') - - -def dispatch_synthmark(): - synthmark_dir = 'synthmark' - try: - subprocess.check_call( - ['rm', '-rf', - os.path.join(config.android_home, synthmark_dir)]) - print('Synthmark patch removed successfully!') - except subprocess.CalledProcessError: - print('Synthmark is not removed. Error occurred.') - - -def main(): - dispatch_autotest() - dispatch_panorama() - dispatch_synthmark() - - -if __name__ == '__main__': - main() |