diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-10-09 22:35:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-10-09 22:48:43 +0300 |
commit | fb46d273f885fc8df6e6792236c00db811667f84 (patch) | |
tree | b9ed568c169f6d0d4b241fb622a1e8bbd8e1afaa /build_files/utils/make_update.py | |
parent | d95bb087d0346164ab35df003ed8c4a27088e9eb (diff) |
Fix "make update" not working on buildbot after recent changes
The submodules don't have remote branches configured, skip that test since
we assume pulling from the "origin" remote anyway.
Diffstat (limited to 'build_files/utils/make_update.py')
-rwxr-xr-x | build_files/utils/make_update.py | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py index af35846f6fc..d0c20d166c9 100755 --- a/build_files/utils/make_update.py +++ b/build_files/utils/make_update.py @@ -87,10 +87,14 @@ def svn_update(args, release_version): if os.path.isdir(lib_dirpath): for dirname in os.listdir(lib_dirpath): + dirpath = os.path.join(lib_dirpath, dirname) + if dirname == ".svn": + # Cleanup must be run from svn root directory if it exists. + if not make_utils.command_missing(args.svn_command): + call(svn_non_interactive + ["cleanup", lib_dirpath]) continue - dirpath = os.path.join(lib_dirpath, dirname) svn_dirpath = os.path.join(dirpath, ".svn") svn_root_dirpath = os.path.join(lib_dirpath, ".svn") @@ -100,12 +104,15 @@ def svn_update(args, release_version): sys.stderr.write("svn not found, can't update libraries\n") sys.exit(1) - call(svn_non_interactive + ["cleanup", dirpath]) + # Cleanup to continue with interrupted downloads. + if os.path.exists(svn_dirpath): + call(svn_non_interactive + ["cleanup", dirpath]) + # Switch to appropriate branch and update. call(svn_non_interactive + ["switch", svn_url + dirname, dirpath]) call(svn_non_interactive + ["update", dirpath]) # Test if git repo can be updated. -def git_update_skip(args): +def git_update_skip(args, check_remote_exists=True): if make_utils.command_missing(args.git_command): sys.stderr.write("git not found, can't update code\n") sys.exit(1) @@ -125,10 +132,11 @@ def git_update_skip(args): return "you have unstaged changes" # Test if there is an upstream branch configured - branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"]) - remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False) - if len(remote) == 0: - return "no remote branch to pull from" + if check_remote_exists: + branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"]) + remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False) + if len(remote) == 0: + return "no remote branch to pull from" return "" @@ -168,7 +176,7 @@ def submodules_update(args, release_version, branch): cwd = os.getcwd() try: os.chdir(submodule_path) - msg = git_update_skip(args) + msg = git_update_skip(args, check_remote_exists=False) if msg: skip_msg += submodule_path + " skipped: " + msg + "\n" else: |