diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-27 10:27:01 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-27 10:27:01 +0300 |
| commit | 97318d6427f62b723c89f4150f8f48126ef74961 (patch) | |
| tree | 771550fabd4b7d67dd4827550bac458036185cb9 /scripts/package/gen-diff-patch | |
| parent | 2b947f8769be8b8181dc795fd292d3e7120f5204 (diff) | |
| parent | 197b6b60ae7bc51dd0814953c562833143b292aa (diff) | |
| download | linux-97318d6427f62b723c89f4150f8f48126ef74961.tar.xz | |
Merge 6.3-rc4 into usb-next
We need the USB fixes here, and the USB gadget update for future
development patches to be based on.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/package/gen-diff-patch')
| -rwxr-xr-x | scripts/package/gen-diff-patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/package/gen-diff-patch b/scripts/package/gen-diff-patch new file mode 100755 index 000000000000..f842ab50a780 --- /dev/null +++ b/scripts/package/gen-diff-patch @@ -0,0 +1,44 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only + +diff_patch="${1}" +untracked_patch="${2}" +srctree=$(dirname $0)/../.. + +rm -f ${diff_patch} ${untracked_patch} + +if ! ${srctree}/scripts/check-git; then + exit +fi + +mkdir -p "$(dirname ${diff_patch})" "$(dirname ${untracked_patch})" + +git -C "${srctree}" diff HEAD > "${diff_patch}" + +if [ ! -s "${diff_patch}" ]; then + rm -f "${diff_patch}" + exit +fi + +git -C ${srctree} status --porcelain --untracked-files=all | +while read stat path +do + if [ "${stat}" = '??' ]; then + + if ! diff -u /dev/null "${srctree}/${path}" > .tmp_diff && + ! head -n1 .tmp_diff | grep -q "Binary files"; then + { + echo "--- /dev/null" + echo "+++ linux/$path" + cat .tmp_diff | tail -n +3 + } >> ${untracked_patch} + fi + fi +done + +rm -f .tmp_diff + +if [ ! -s "${diff_patch}" ]; then + rm -f "${diff_patch}" + exit +fi |
