Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-10-31 04:54:38 +0300
committerCampbell Barton <campbell@blender.org>2022-10-31 04:57:17 +0300
commitfe5cbd5eea4ad56e889be1f6b18eb2ca96225754 (patch)
tree5758ecc7ba8f1ad739e552036b29c2ed9a5f9670
parent5042f895ceeee0c7f54a0823d250a39aa68ea651 (diff)
make_update: support updating "lib" as a single repository
With a full SVN checkout of "../lib", updating all paths is slower than running an update on the whole repository at once. Also collect paths and run the update in separate passes, this avoids some duplicate checks such as checking the svn command exists.
-rwxr-xr-xbuild_files/utils/make_update.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index e7d28aeb75b..a0b61b18e60 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -104,37 +104,37 @@ def svn_update(args: argparse.Namespace, release_version: Optional[str]) -> None
call(svn_non_interactive + ["checkout", svn_url_tests, lib_tests_dirpath])
# Update precompiled libraries and tests
- print_stage("Updating Precompiled Libraries and Tests")
-
- 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
- elif dirname.startswith("."):
- # Temporary paths such as ".mypy_cache" will report a warning, skip hidden directories.
- continue
-
- svn_dirpath = os.path.join(dirpath, ".svn")
- svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
-
- if (
- os.path.isdir(dirpath) and
- (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
- ):
- if make_utils.command_missing(args.svn_command):
- sys.stderr.write("svn not found, can't update libraries\n")
- sys.exit(1)
-
- # Cleanup to continue with interrupted downloads.
- if os.path.exists(svn_dirpath):
- call(svn_non_interactive + ["cleanup", dirpath])
+
+ if not os.path.isdir(lib_dirpath):
+ print("Library path: %r, not found, skipping" % lib_dirpath)
+ else:
+ paths_local_and_remote = []
+ if os.path.exists(os.path.join(lib_dirpath, ".svn")):
+ print_stage("Updating Precompiled Libraries and Tests (one repository)")
+ paths_local_and_remote.append((lib_dirpath, svn_url))
+ else:
+ print_stage("Updating Precompiled Libraries and Tests (multiple repositories)")
+ # Separate paths checked out.
+ for dirname in os.listdir(lib_dirpath):
+ if dirname.startswith("."):
+ # Temporary paths such as ".mypy_cache" will report a warning, skip hidden directories.
+ continue
+
+ dirpath = os.path.join(lib_dirpath, dirname)
+ if not (os.path.isdir(dirpath) and os.path.exists(os.path.join(dirpath, ".svn"))):
+ continue
+
+ paths_local_and_remote.append((dirpath, svn_url + dirname))
+
+ if paths_local_and_remote:
+ if make_utils.command_missing(args.svn_command):
+ sys.stderr.write("svn not found, can't update libraries\n")
+ sys.exit(1)
+
+ for dirpath, svn_url_full in paths_local_and_remote:
+ call(svn_non_interactive + ["cleanup", dirpath])
# Switch to appropriate branch and update.
- call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
+ call(svn_non_interactive + ["switch", svn_url_full, dirpath], exit_on_error=False)
call(svn_non_interactive + ["update", dirpath])