@@ -69,14 +69,14 @@ def create_patches_branch(repo, commit, remote, dev_mode=True):
6969 return branch_name
7070
7171
72- def get_downstream_distgit_branch (dlrn_projects_ini ):
72+ def get_downstream_distgit_branch (dlrn_projects_ini , driver ):
7373 """Get downstream distgit branch info from DLRN projects.ini"""
7474 config = configparser .ConfigParser ()
7575 config .read (dlrn_projects_ini )
76- return config .get ('downstream_driver' , 'downstream_distro_branch' )
76+ return config .get (driver , 'downstream_distro_branch' )
7777
7878
79- def get_patches_branch (repo , remote , dlrn_projects_ini ):
79+ def get_patches_branch (repo , remote , dlrn_projects_ini , driver ):
8080 """Get the patches branch name"""
8181 branch_name = os .environ .get ('PATCHES_BRANCH' , None )
8282 if branch_name :
@@ -87,7 +87,8 @@ def get_patches_branch(repo, remote, dlrn_projects_ini):
8787 return None
8888 else :
8989 # Get downstream distgit branch from DLRN config
90- distgit_branch = get_downstream_distgit_branch (dlrn_projects_ini )
90+ distgit_branch = get_downstream_distgit_branch (dlrn_projects_ini ,
91+ driver )
9192 LOGGER .warning ("No PATCHES_BRANCH env var found, trying to guess it" )
9293 # Guess at patches branch based on the distgit branch name
9394 return find_patches_branch (repo , remote , distgit_branch )
@@ -188,7 +189,7 @@ def get_rebaser_config(defaults=None):
188189 """
189190 default_options = ['dev_mode' , 'remote_name' , 'git_name' , 'git_email' ,
190191 'packages_to_process' , 'dlrn_projects_ini' ,
191- 'create_patches_branch' ]
192+ 'create_patches_branch' , 'driver' ]
192193 distroinfo_options = ['patches_repo_key' ]
193194
194195 RebaserConfig = namedtuple ('RebaserConfig' ,
@@ -426,6 +427,7 @@ def main():
426427
427428 # Default values for options in patch_rebaser.ini
428429 defaults = {
430+ 'driver' : 'downstream_driver' ,
429431 'remote_name' : 'remote_name' ,
430432 'git_name' : 'Your Name' ,
431433 'git_email' : 'you@example.com' ,
@@ -469,7 +471,8 @@ def main():
469471 # Create local patches branch
470472 branch_name = get_patches_branch (repo ,
471473 config .remote_name ,
472- config .dlrn_projects_ini )
474+ config .dlrn_projects_ini ,
475+ config .driver )
473476
474477 # Not every project has a -patches branch for every release
475478 if not branch_name :
0 commit comments