diff options
| author | Dan Williams <dan.j.williams@intel.com> | 2023-04-04 15:37:25 -0700 |
|---|---|---|
| committer | Dan Williams <dan.j.williams@intel.com> | 2023-04-04 15:37:25 -0700 |
| commit | ca712e47054678c5ce93a0e0f686353ad5561195 (patch) | |
| tree | 575dd9f2e541ddd74b72e82dfe69c5badcb9e281 /scripts/package/gen-diff-patch | |
| parent | 24b18197184ac39bb8566fb82c0bf788bcd0d45b (diff) | |
| parent | abf04be0e7071f2bcd39bf97ba407e7d4439785e (diff) | |
Merge branch 'for-6.3/cxl-doe-fixes' into for-6.3/cxl
Pick up the fixes (first 6 patches) from the DOE rework series from
Lukas for v6.3-rc.
Link: https://lore.kernel.org/all/cover.1678543498.git.lukas@wunner.de/
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 |
