summaryrefslogtreecommitdiff
path: root/tools/rmboard.py
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2025-04-07 16:40:02 -0600
committerTom Rini <trini@konsulko.com>2025-04-08 11:43:23 -0600
commitff61d6bfd1c9534d3fc2397846a5899639f2e55d (patch)
treedcfe4bc52848a5637c975a3352b57885e5b8a06d /tools/rmboard.py
parent34820924edbc4ec7803eb89d9852f4b870fa760a (diff)
parentf892a7f397a66d8d09f418d1e0e06dfb48bac27d (diff)
Merge branch 'next'
Note that this undoes the changes of commit cf6d4535cc4c ("x86: emulation: Disable bloblist for now") as that was intended only for the release due to time.
Diffstat (limited to 'tools/rmboard.py')
-rwxr-xr-xtools/rmboard.py25
1 files changed, 9 insertions, 16 deletions
diff --git a/tools/rmboard.py b/tools/rmboard.py
index 0c56b149e0f..594fd89b8d7 100755
--- a/tools/rmboard.py
+++ b/tools/rmboard.py
@@ -43,18 +43,16 @@ def rm_kconfig_include(path):
Args:
path: Path to search for and remove
"""
- cmd = ['git', 'grep', path]
- stdout = command.run_pipe([cmd], capture=True, raise_on_error=False).stdout
+ stdout = command.output('git', 'grep', path, raise_on_error=False)
if not stdout:
return
fname = stdout.split(':')[0]
print("Fixing up '%s' to remove reference to '%s'" % (fname, path))
- cmd = ['sed', '-i', '\|%s|d' % path, fname]
- stdout = command.run_pipe([cmd], capture=True).stdout
+ stdout = command.run_one('sed', '-i', rf'\|{path}|d', fname,
+ capture=True).stdout
- cmd = ['git', 'add', fname]
- stdout = command.run_pipe([cmd], capture=True).stdout
+ stdout = command.output('git', 'add', fname)
def rm_board(board):
"""Create a commit which removes a single board
@@ -68,8 +66,7 @@ def rm_board(board):
"""
# Find all MAINTAINERS and Kconfig files which mention the board
- cmd = ['git', 'grep', '-l', board]
- stdout = command.run_pipe([cmd], capture=True).stdout
+ stdout = command.output('git', 'grep', '-l', board)
maintain = []
kconfig = []
for line in stdout.splitlines():
@@ -109,16 +106,14 @@ def rm_board(board):
# Search for Kconfig files in the resulting list. Remove any 'source' lines
# which reference Kconfig files we want to remove
for path in real:
- cmd = ['find', path]
- stdout = (command.run_pipe([cmd], capture=True, raise_on_error=False).
- stdout)
+ stdout = command.output('find', path, raise_on_error=False)
for fname in stdout.splitlines():
if fname.endswith('Kconfig'):
rm_kconfig_include(fname)
# Remove unwanted files
cmd = ['git', 'rm', '-r'] + real
- stdout = command.run_pipe([cmd], capture=True).stdout
+ stdout = command.output(*cmd, capture=True)
## Change the messages as needed
msg = '''arm: Remove %s board
@@ -131,13 +126,11 @@ Remove it.
msg += 'Patch-cc: %s\n' % name
# Create the commit
- cmd = ['git', 'commit', '-s', '-m', msg]
- stdout = command.run_pipe([cmd], capture=True).stdout
+ stdout = command.output('git', 'commit', '-s', '-m', msg)
# Check if the board is mentioned anywhere else. The user will need to deal
# with this
- cmd = ['git', 'grep', '-il', board]
- print(command.run_pipe([cmd], capture=True, raise_on_error=False).stdout)
+ print(command.output('git', 'grep', '-il', board, raise_on_error=False))
print(' '.join(cmd))
for board in sys.argv[1:]: