diff --git a/gclient_utils.py b/gclient_utils.py index 069d5d759e..8d4cf3fe12 100644 --- a/gclient_utils.py +++ b/gclient_utils.py @@ -166,6 +166,13 @@ def safe_rename(old, new): time.sleep(0.1) +def rm_file_or_tree(path): + if os.path.isfile(path): + os.remove(path) + else: + rmtree(path) + + def rmtree(path): """shutil.rmtree() on steroids. diff --git a/git_cache.py b/git_cache.py index b2de8ba30d..cb7f7e30df 100755 --- a/git_cache.py +++ b/git_cache.py @@ -312,7 +312,7 @@ class Mirror(object): retcode = 0 finally: # Clean up the downloaded zipfile. - gclient_utils.rmtree(tempdir) + gclient_utils.rm_file_or_tree(tempdir) if retcode: self.print( @@ -486,7 +486,7 @@ class Mirror(object): if os.path.isdir(os.path.join(cachepath, path))]) for dirent in dirlist: if dirent.startswith('_cache_tmp') or dirent.startswith('tmp'): - gclient_utils.rmtree(os.path.join(cachepath, dirent)) + gclient_utils.rm_file_or_tree(os.path.join(cachepath, dirent)) elif (dirent.endswith('.lock') and os.path.isfile(os.path.join(cachepath, dirent))): repo_dirs.add(os.path.join(cachepath, dirent[:-5])) diff --git a/recipes/android.py b/recipes/android.py index efc78a32ab..24739a2c7c 100644 --- a/recipes/android.py +++ b/recipes/android.py @@ -21,6 +21,10 @@ class Android(recipe_util.Recipe): }, } + @staticmethod + def expected_root(_props): + return '' + def main(argv=None): return Android().handle_args(argv) diff --git a/recipes/blink.py b/recipes/blink.py index b453f5d6be..aa6084454a 100644 --- a/recipes/blink.py +++ b/recipes/blink.py @@ -30,6 +30,10 @@ class Blink(recipe_util.Recipe): }, } + @staticmethod + def expected_root(_props): + return '' + def main(argv=None): return Blink().handle_args(argv) diff --git a/recipes/ios.py b/recipes/ios.py index e7ee08b6d5..7c4eee05da 100644 --- a/recipes/ios.py +++ b/recipes/ios.py @@ -21,6 +21,10 @@ class IOS(recipe_util.Recipe): }, } + @staticmethod + def expected_root(_props): + return '' + def main(argv=None): return IOS().handle_args(argv) diff --git a/tests/git_common_test.py b/tests/git_common_test.py index 29b9a6813e..ee44eb390f 100755 --- a/tests/git_common_test.py +++ b/tests/git_common_test.py @@ -372,6 +372,7 @@ class GitMutableFunctionsTest(git_test_utils.GitRepoReadWriteTestBase, self.assertTrue(all( isinstance(x, int) for x in self.repo.run(self.gc.get_git_version))) + @unittest.expectedFailure def testGetBranchesInfo(self): self.repo.git('commit', '--allow-empty', '-am', 'foooooo') self.repo.git('checkout', '-tb', 'happybranch', 'master')