|
|
@ -509,7 +509,7 @@ class Mirror(object):
|
|
|
|
self._fetch(self.mirror_path, verbose, depth, no_fetch_tags,
|
|
|
|
self._fetch(self.mirror_path, verbose, depth, no_fetch_tags,
|
|
|
|
reset_fetch_config)
|
|
|
|
reset_fetch_config)
|
|
|
|
|
|
|
|
|
|
|
|
def update_bootstrap(self, prune=False, gc_aggressive=False, branch='main'):
|
|
|
|
def update_bootstrap(self, prune=False, gc_aggressive=False):
|
|
|
|
# NOTE: There have been cases where repos were being recursively uploaded
|
|
|
|
# NOTE: There have been cases where repos were being recursively uploaded
|
|
|
|
# to google storage.
|
|
|
|
# to google storage.
|
|
|
|
# E.g. `<host_url>-<repo>/<gen_number>/<host_url>-<repo>/` in GS and
|
|
|
|
# E.g. `<host_url>-<repo>/<gen_number>/<host_url>-<repo>/` in GS and
|
|
|
@ -524,9 +524,9 @@ class Mirror(object):
|
|
|
|
gclient_utils.rmtree(recursed_dir)
|
|
|
|
gclient_utils.rmtree(recursed_dir)
|
|
|
|
|
|
|
|
|
|
|
|
# The folder is <git number>
|
|
|
|
# The folder is <git number>
|
|
|
|
gen_number = subprocess.check_output(
|
|
|
|
gen_number = subprocess.check_output([self.git_exe, 'number'],
|
|
|
|
[self.git_exe, 'number', branch],
|
|
|
|
cwd=self.mirror_path).decode(
|
|
|
|
cwd=self.mirror_path).decode('utf-8', 'ignore').strip()
|
|
|
|
'utf-8', 'ignore').strip()
|
|
|
|
gsutil = Gsutil(path=self.gsutil_exe, boto_path=None)
|
|
|
|
gsutil = Gsutil(path=self.gsutil_exe, boto_path=None)
|
|
|
|
|
|
|
|
|
|
|
|
dest_prefix = '%s/%s' % (self._gs_path, gen_number)
|
|
|
|
dest_prefix = '%s/%s' % (self._gs_path, gen_number)
|
|
|
@ -655,8 +655,6 @@ def CMDupdate_bootstrap(parser, args):
|
|
|
|
help='Run aggressive repacking of the repo.')
|
|
|
|
help='Run aggressive repacking of the repo.')
|
|
|
|
parser.add_option('--prune', action='store_true',
|
|
|
|
parser.add_option('--prune', action='store_true',
|
|
|
|
help='Prune all other cached bundles of the same repo.')
|
|
|
|
help='Prune all other cached bundles of the same repo.')
|
|
|
|
parser.add_option('--branch', default='main',
|
|
|
|
|
|
|
|
help='Branch to use for bootstrap. (Default \'main\')')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
populate_args = args[:]
|
|
|
|
populate_args = args[:]
|
|
|
|
options, args = parser.parse_args(args)
|
|
|
|
options, args = parser.parse_args(args)
|
|
|
@ -671,7 +669,7 @@ def CMDupdate_bootstrap(parser, args):
|
|
|
|
_, args2 = parser.parse_args(args)
|
|
|
|
_, args2 = parser.parse_args(args)
|
|
|
|
url = args2[0]
|
|
|
|
url = args2[0]
|
|
|
|
mirror = Mirror(url)
|
|
|
|
mirror = Mirror(url)
|
|
|
|
mirror.update_bootstrap(options.prune, options.gc_aggressive, options.branch)
|
|
|
|
mirror.update_bootstrap(options.prune, options.gc_aggressive)
|
|
|
|
return 0
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|