diff options
author | Olliver Schinagl <oliver@schinagl.nl> | 2024-03-18 13:24:12 +0100 |
---|---|---|
committer | Robert Marko <robimarko@gmail.com> | 2024-04-12 18:20:52 +0200 |
commit | 8ed187e471b0f7622c8791bf688302cdfe484868 (patch) | |
tree | dc6a40fc63f0e4d9f2a55444a8e08d9261a023c7 /scripts | |
parent | 9e6c4392f85f9123fda8ef8690c2a36599fe334c (diff) | |
download | openwrt-8ed187e471b0f7622c8791bf688302cdfe484868.tar.gz openwrt-8ed187e471b0f7622c8791bf688302cdfe484868.tar.bz2 openwrt-8ed187e471b0f7622c8791bf688302cdfe484868.zip |
scripts/kernel_bump: Use git to obtain the list of files
Instead of looping of a directory to find directories related to kernel
changes, use the git index instead.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/kernel_bump.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/kernel_bump.sh b/scripts/kernel_bump.sh index 069f53bb77..d9fc5287df 100755 --- a/scripts/kernel_bump.sh +++ b/scripts/kernel_bump.sh @@ -18,8 +18,10 @@ REQUIRED_COMMANDS=' exit git printf + sed set shift + sort ' _msg() @@ -115,7 +117,9 @@ bump_kernel() git switch --force-create '__openwrt_kernel_files_mover' if [ "${config_only:-false}" != 'true' ]; then - for _path in "${_target_dir}/"*; do + for _path in $(git ls-tree -d -r --name-only '__openwrt_kernel_files_mover' "${_target_dir}" | + sed -n "s|^\(.*-${source_version}\).*|\1|p" | + sort -u); do if [ ! -e "${_path}" ] || \ [ "${_path}" = "${_path%%"-${source_version}"}" ]; then continue |