|
|
@@ -15,17 +15,16 @@ def main():
|
|
|
|
|
|
count_submodules = 0
|
|
|
|
|
|
- url = sane_origin_url( args.source_url, args.output_dir )
|
|
|
-
|
|
|
- sub = AbeSubmodule([args.output_dir, url.geturl(), args.tag], AbeSubType.SUBMODULE)
|
|
|
-
|
|
|
last_parent = None
|
|
|
jobs = []
|
|
|
|
|
|
if args.abe_command:
|
|
|
executeAbeCommand( args.output_dir, args.abe_command )
|
|
|
else:
|
|
|
- for sub in abe_submodules( args.output_dir, args.source_url, args.tag):
|
|
|
+ for sub in abe_submodules(
|
|
|
+ args.output_dir, args.source_url, args.tag,
|
|
|
+ recurse_bsps=args.recurse_bsps,
|
|
|
+ recurse_bootloaders=args.recurse_bootloaders ):
|
|
|
count_submodules += 1
|
|
|
if DEBUG > 0:
|
|
|
print("Count:",count_submodules)
|
|
|
@@ -81,6 +80,12 @@ def parser():
|
|
|
p.add_argument('-s', '--source_url',
|
|
|
default=None,
|
|
|
help='url to be used for origin remote')
|
|
|
+ p.add_argument('--recurse_bootloaders',
|
|
|
+ action='store_true',
|
|
|
+ help='also recurse into .abe/bootloaders')
|
|
|
+ p.add_argument('--recurse_bsps',
|
|
|
+ action='store_true',
|
|
|
+ help='also recurse into .abe/bsps')
|
|
|
p.add_argument('-a', '--abe_command',
|
|
|
default=None,
|
|
|
help="execute an ABE command in output_dir")
|
|
|
@@ -101,18 +106,18 @@ def executeAbeCommand( repo_path, command_name ):
|
|
|
print(commandFileRel, 'in', repo_path, 'returned exitcode', err.returncode)
|
|
|
|
|
|
|
|
|
-def abe_submodules(path, remote, ref, parent=None):
|
|
|
+def abe_submodules(path, remote, ref, **kwargs):
|
|
|
url = sane_origin_url( remote, path )
|
|
|
|
|
|
sub = AbeSubmodule([path, url.geturl(), ref], AbeSubType.SUBMODULE)
|
|
|
yield sub
|
|
|
- for s in recurse_abe_submodules(sub):
|
|
|
+ for s in recurse_abe_submodules(sub, **kwargs):
|
|
|
yield s
|
|
|
|
|
|
|
|
|
-def recurse_abe_submodules(parent):
|
|
|
+def recurse_abe_submodules(parent, **kwargs):
|
|
|
|
|
|
- subm = get_abe_subtree( parent.fullpath )
|
|
|
+ subm = get_abe_subtree( parent.fullpath, **kwargs)
|
|
|
|
|
|
acc = []
|
|
|
last = None
|
|
|
@@ -165,7 +170,7 @@ class ProgressPrinter(RemoteProgress):
|
|
|
if DEBUG:
|
|
|
cur_count_int = round(cur_count)
|
|
|
if not max_count:
|
|
|
- div = f"cur_count_int/?"
|
|
|
+ div = f"{cur_count_int}/?"
|
|
|
perc = '??%'
|
|
|
else:
|
|
|
max_count_int = round(max_count)
|
|
|
@@ -314,13 +319,18 @@ class AbeSubmodule():
|
|
|
def clone_repo(self, cache_dir=None, fetch_origin=True):
|
|
|
return clone_repo_cached( self, cache_dir=cache_dir, fetch_origin=fetch_origin)
|
|
|
|
|
|
-def get_abe_subtree(repo_dir):
|
|
|
+def get_abe_subtree(repo_dir, recurse_bsps=False, recurse_bootloaders=False):
|
|
|
import itertools
|
|
|
subfile_generators = [
|
|
|
get_abe_submodules(repo_dir),
|
|
|
- get_abe_bootloaders(repo_dir),
|
|
|
- get_abe_bsps(repo_dir),
|
|
|
]
|
|
|
+
|
|
|
+ if recurse_bootloaders:
|
|
|
+ subfile_generators.append(get_abe_bootloaders(repo_dir))
|
|
|
+
|
|
|
+ if recurse_bsps:
|
|
|
+ subfile_generators.append(get_abe_bsps(repo_dir))
|
|
|
+
|
|
|
return itertools.chain(*subfile_generators)
|
|
|
|
|
|
def get_abe_bsps(repo_dir):
|