@@ -60,7 +60,11 @@ def commit_changes(self, distro):
60
60
self .repo .git .commit (m = '{0}' .format (commit_msg ))
61
61
62
62
def regenerate_manifests (
63
- self , regen_dict , image_owner = 'allenh1' , image_name = 'ros_gentoo_base'
63
+ self ,
64
+ regen_dict ,
65
+ image_owner = 'tomkimsour' ,
66
+ image_name = 'ros_gentoo_base' ,
67
+ split_limit = 1000
64
68
):
65
69
info (
66
70
"Pulling docker image '%s/%s:latest'..." % (
@@ -76,16 +80,31 @@ def regenerate_manifests(
76
80
'/root/.gnupg'
77
81
)
78
82
dock .map_directory (self .repo .repo_dir , '/tmp/ros-overlay' )
79
- for key in regen_dict .keys ():
80
- for pkg in regen_dict [key ]:
81
- pkg_dir = '/tmp/ros-overlay/ros-{0}/{1}' .format (key , pkg )
82
- dock .add_bash_command ('cd {0}' .format (pkg_dir ))
83
- dock .add_bash_command ('repoman manifest' )
84
- try :
85
- dock .run (show_cmd = True )
86
- except docker .errors .ContainerError :
87
- print (dock .log )
88
- raise
83
+ for distro in regen_dict .keys ():
84
+ chunk_list = []
85
+ chunk_count = 0
86
+ pkg_list = regen_dict [distro ]
87
+ while len (pkg_list ) > 0 :
88
+ current_chunk = list ()
89
+ for x in range (split_limit ):
90
+ if len (pkg_list ) > 0 :
91
+ current_chunk .append (pkg_list .pop ())
92
+ else :
93
+ break
94
+ chunk_list .append (current_chunk )
95
+ info ("Regeneration list consists of '%d' chunks" % len (chunk_list ))
96
+ info ("key_lists: '%s'" % chunk_list )
97
+ for chunk in chunk_list :
98
+ for pkg in chunk :
99
+ pkg_dir = '/tmp/ros-overlay/ros-{0}/{1}' .format (distro , pkg )
100
+ dock .add_bash_command ('cd {0}' .format (pkg_dir ))
101
+ dock .add_bash_command ('ebuild *.ebuild manifest' )
102
+ try :
103
+ dock .run (show_cmd = True )
104
+ dock .clear_commands ()
105
+ except docker .errors .ContainerError :
106
+ print (dock .log )
107
+ raise
89
108
90
109
def pull_request (self , message , overlay = None , title = '' ):
91
110
if not title :
0 commit comments