From: Jeremy Cline <[email protected]>

People like to go look at the dist-git instead of a source tree for
patch files and there were complaints about the big diff file. Jump
through some hoops to generate a list of patches from the release branch
so the patches are preserved in dist-git.

Denys Vlasenko <[email protected]>
Rado Vrbovsky <[email protected]>
Clark Williams <[email protected]>
Jan Stancek <[email protected]>
Juri Lelli <[email protected]>
"Herton R. Krzesinski" <[email protected]>
Frantisek Hrbata <[email protected]>
Luis Claudio Goncalves <[email protected]>
Jeremy Cline <[email protected]>
Justin Forbes <[email protected]>
Signed-off-by: Jeremy Cline <[email protected]>
---
 redhat/genspec.sh | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/redhat/genspec.sh b/redhat/genspec.sh
index ff60ab79aa91..1e60bd31c06b 100755
--- a/redhat/genspec.sh
+++ b/redhat/genspec.sh
@@ -242,11 +242,35 @@ test -n "$SPECFILE" &&
        s/%%TARBALL_VERSION%%/$TARFILE_RELEASE/" $SPECFILE
 
 
+# Need an empty file for dist-git compatibility
+touch "$SOURCES/patch-$RPMVERSION-redhat.patch"
+truncate -s 0 "$SOURCES/patch-$RPMVERSION-redhat.patch"
 if [ "$SINGLE_TARBALL" = 0 ]; then
-       git diff -p --no-renames --stat $MARKER.. ":(exclude,top)redhat" 
":(exclude,top)makefile" ":(exclude,top)configs" ":(exclude,top).gitattributes" 
":(exclude,top).gitignore"> $SOURCES/patch-${RPMVERSION}-redhat.patch
-else
-       # Need an empty file for dist-git compatibility
-       touch $SOURCES/patch-${RPMVERSION}-redhat.patch
+       # We want the current state of this file, not all its history
+       RHELVER=$(git diff -p --stat master HEAD -- ../Makefile.rhelver)
+       printf "From 8474ffe83a89d7b5d2c6515875a308ff682df6f9 Mon Sep 17 
00:00:00 2001
+From: Kernel Team <[email protected]>
+Date: %s
+Subject: [PATCH] Include Makefile.rhelver
+
+Used to set the RHEL version.
+---
+%s
+--
+2.26.0\n
+" "$(date "+%a, %d %b %Y %R:%S %z")" "$RHELVER" > 
"$SOURCES/patch-$RPMVERSION-redhat.patch"
+
+       COMMITS=$(git log --reverse --pretty=format:"%h" --no-merges 
"$MARKER".. \
+               ":(exclude,top).get_maintainer.conf" \
+               ":(exclude,top).gitattributes" \
+               ":(exclude,top).gitignore" \
+               ":(exclude,top).gitlab-ci.yml" \
+               ":(exclude,top)makefile" \
+               ":(exclude,top)Makefile.rhelver" \
+               ":(exclude,top)redhat")
+       for c in $COMMITS; do
+               git format-patch --stdout -1 "$c" >> 
"$SOURCES/patch-$RPMVERSION-redhat.patch"
+       done
 fi
 
 for opt in $BUILDOPTS; do
-- 
2.26.2
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]

Reply via email to