diff options
author | Wynn Wolf Arbor | 2020-06-04 15:35:48 +0200 |
---|---|---|
committer | Wynn Wolf Arbor | 2020-06-04 16:01:30 +0200 |
commit | 7fad1f76aaac2c4b67a475027221ee64736d6b42 (patch) | |
tree | 0e05f025399ac48ecf3d79e599b8c4e7bafda5ba | |
parent | 74e9da1ae9dcee56112cb36b610856fe3620e6fc (diff) | |
download | kern-7fad1f76aaac2c4b67a475027221ee64736d6b42.tar.gz |
Move sed invocation into its own function0.4.0
In test_diff() we are duplicating the sed invocation that strips config
files of anything irrelevant. Move that part of the functionality into
its own function.
Diffstat (limited to '')
-rwxr-xr-x | kern | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -102,10 +102,15 @@ clean_kernel() { sudo eclean-kernel -An3 } +strip_config() { + sed -nE '/^(# )?CONFIG_.*/p' "$1" +} + test_diff() { dt=$(mktemp) - sed -nE '/^(# )?CONFIG_.*/p' "$(get_running_config)" > "$dt" - if ! sed -nE '/^(# )?CONFIG_.*/p' .config | diff -q "$dt" -; then + strip_config "$(get_running_config)" > "$dt" + + if ! strip_config .config | diff -q "$dt" -; then diff_kernel || true printf "Continue? [y/N] " read -r response |