diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-31 11:15:09 -0400 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-31 11:15:09 -0400 |
| commit | 85b475a4502d45380c1b9223c01954daa228eeb0 (patch) | |
| tree | 2f37f9ea8519f7a101decd8a1e9ec13db051363b /scripts/package/gen-diff-patch | |
| parent | 80962ec912db56d323883154efc2297473e692cb (diff) | |
| parent | 21f27df854008b86349a203bf97fef79bb11f53e (diff) | |
| download | linux-85b475a4502d45380c1b9223c01954daa228eeb0.tar.gz linux-85b475a4502d45380c1b9223c01954daa228eeb0.zip | |
Merge tag 'kvm-s390-master-6.3-1' of https://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
A small fix that repairs the external loop detection code for PV
guests.
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 |
