[Git][cip-project/cip-kernel/cip-kernel-sec][master] 5 commits: remotes: refer to configuration files


Agustin Benito Bethencourt
 

Ben Hutchings pushed to branch master at cip-project / cip-kernel / cip-kernel-sec

Commits:

  • 3ed9dc6d
    by Daniel Sangorrin at 2019-06-17T20:14:31Z
    remotes: refer to configuration files
    
    The Readme indicated some remote names (torvalds, stable) but
    not all of them. Ask the user to check conf/remotes.yml instead.
    I also added information on how to override or extend the
    configuration file (through '~/.config/kernel-sec/remotes.yml')
    
    Signed-off-by: Daniel Sangorrin <daniel.sangorrin@...>
    Signed-off-by: Ben Hutchings <ben.hutchings@...>
    
  • 716ee107
    by Daniel Sangorrin at 2019-06-17T20:16:36Z
    import_stable: update torvalds remote as well
    
    Otherwise, the script will not find all the expected tags
    and fail with a message like:
    
    fatal: ambiguous argument 'v5.1..torvalds/master':
    unknown revision or path not in the working tree
    
    Signed-off-by: Daniel Sangorrin <daniel.sangorrin@...>
    Signed-off-by: Ben Hutchings <ben.hutchings@...>
    
  • b2aed3f3
    by Daniel Sangorrin at 2019-06-18T14:43:19Z
    remotes: call _get_configured_remotes
    
    This is probably a copy&paste mistake that had no effect
    because the contents of _get_configured_remotes and
    _get_configured_branches is the same.
    
    Signed-off-by: Daniel Sangorrin <daniel.sangorrin@...>
    Signed-off-by: Ben Hutchings <ben.hutchings@...>
    
  • 6210caef
    by Daniel Sangorrin at 2019-06-20T17:41:20Z
    branch: fix remotes mapping
    
    Probably a copy&paste error that never got checked because
    nobody is using the mapping functionality.
    
    Signed-off-by: Daniel Sangorrin <daniel.sangorrin@...>
    Signed-off-by: Ben Hutchings <ben.hutchings@...>
    
  • b257980d
    by Daniel Sangorrin at 2019-06-20T17:41:20Z
    help:remote_name: use colon instead of equal
    
    The example and implementation use a colon (:) to specify
    remote mappings, but the command's help use the equal
    sign (=).
    
    Signed-off-by: Daniel Sangorrin <daniel.sangorrin@...>
    Signed-off-by: Ben Hutchings <ben.hutchings@...>
    

5 changed files:

Changes:

  • README.md
    ... ... @@ -18,9 +18,10 @@ beneath that. They require PyYAML and html5lib (packaged in Debian as
    18 18
     python3-yaml and python3-html5lib).
    
    19 19
     
    
    20 20
     Many scripts require access to a kernel git repository.  By default
    
    21
    -this is assumed to be in `../kernel`, with remotes named `torvalds`
    
    22
    -and `stable` for the mainline and stable repositories.  These can
    
    23
    -be overridden by command-line options or by configuration.
    
    21
    +this is assumed to be in `../kernel`, with remotes configured in
    
    22
    +`conf/remotes.yml`, e.g. `torvalds`, `stable` and `cip` for the mainline,
    
    23
    +stable and cip repositories. These can be overridden by command-line options
    
    24
    +or configuration (`~/.config/kernel-sec/remotes.yml`).
    
    24 25
     
    
    25 26
     * `scripts/import_debian.py` - import information from Debian's
    
    26 27
     `kernel_sec` project.  It includes all issues that Debian considers
    

  • scripts/import_stable.py
    ... ... @@ -137,8 +137,7 @@ def add_backports(branches, c_b_map, issue_commits, all_backports,
    137 137
     
    
    138 138
     def main(git_repo, remotes, debug=False):
    
    139 139
         branches = kernel_sec.branch.get_live_branches()
    
    140
    -    remote_names = set(branch['git_remote'] for branch in branches
    
    141
    -                       if branch['short_name'] != 'mainline')
    
    140
    +    remote_names = set(branch['git_remote'] for branch in branches)
    
    142 141
     
    
    143 142
         for remote_name in remote_names:
    
    144 143
             update(git_repo, remotes[remote_name]['git_name'])
    
    ... ... @@ -175,7 +174,7 @@ if __name__ == '__main__':
    175 174
         parser.add_argument('--remote-name',
    
    176 175
                             dest='remote_name', action='append', default=[],
    
    177 176
                             help='git remote name mappings, e.g. stable:korg-stable',
    
    178
    -                        metavar='NAME=OTHER-NAME')
    
    177
    +                        metavar='NAME:OTHER-NAME')
    
    179 178
         parser.add_argument('--mainline-remote',
    
    180 179
                             dest='mainline_remote_name',
    
    181 180
                             help="git remote name to use instead of 'torvalds'",
    

  • scripts/kernel_sec/branch.py
    ... ... @@ -209,10 +209,10 @@ def get_remotes(mappings, mainline=None, stable=None):
    209 209
         remotes = RemoteMap()
    
    210 210
         remotes.update(_get_configured_remotes('conf/remotes.yml'))
    
    211 211
         remotes.update(
    
    212
    -        _get_configured_branches(
    
    212
    +        _get_configured_remotes(
    
    213 213
                 os.path.expanduser('~/.config/kernel-sec/remotes.yml')))
    
    214 214
         for mapping in mappings:
    
    215
    -        left, right = arg.split(':', 1)
    
    215
    +        left, right = mapping.split(':', 1)
    
    216 216
             remotes[left]['git_name'] = right
    
    217 217
         if mainline:
    
    218 218
             remotes['torvalds']['git_name'] = mainline
    

  • scripts/report_affected.py
    ... ... @@ -76,7 +76,7 @@ if __name__ == '__main__':
    76 76
         parser.add_argument('--remote-name',
    
    77 77
                             dest='remote_name', action='append', default=[],
    
    78 78
                             help='git remote name mappings, e.g. stable:korg-stable',
    
    79
    -                        metavar='NAME=OTHER-NAME')
    
    79
    +                        metavar='NAME:OTHER-NAME')
    
    80 80
         parser.add_argument('--mainline-remote',
    
    81 81
                             dest='mainline_remote_name',
    
    82 82
                             help="git remote name to use instead of 'torvalds'",
    

  • scripts/webview.py
    ... ... @@ -206,7 +206,7 @@ if __name__ == '__main__':
    206 206
         parser.add_argument('--remote-name',
    
    207 207
                             dest='remote_name', action='append', default=[],
    
    208 208
                             help='git remote name mappings, e.g. stable:korg-stable',
    
    209
    -                        metavar='NAME=OTHER-NAME')
    
    209
    +                        metavar='NAME:OTHER-NAME')
    
    210 210
         parser.add_argument('--mainline-remote',
    
    211 211
                             dest='mainline_remote_name',
    
    212 212
                             help="git remote name to use instead of 'torvalds'",