From: Herton R. Krzesinski herton@redhat.com
redhat: make Patchlist.changelog generation conditional
Right now Patchlist.changelog is always generated and contains an URL to the kernel-ark repository. However, when kernel-ark is forked into CentOS or any other downstream repo, this file will continue to be generated and will contain the kernel-ark repo URLs even if we are already in another repository.
Drop the URL from the file, and make the Patchlist.changelog generation conditional because any downstream, like RHEL or CentOS, might backport a lot of upstream changes which makes Patchlog.changelog not very useful in this case.
Signed-off-by: Herton R. Krzesinski herton@redhat.com
diff --git a/redhat/Makefile b/redhat/Makefile index blahblah..blahblah 100644 --- a/redhat/Makefile +++ b/redhat/Makefile @@ -236,7 +236,7 @@ setup-source: dist-git-version-check dist-clean-sources cp $(REDHAT)/$(CHANGELOG_PREV) $(REDHAT)/$(CHANGELOG); \ fi @cp $(REDHAT)/$(CHANGELOG) $(SOURCES)/$(CHANGELOG) - @$(REDHAT)/genspec.sh $(SOURCES) $(SOURCES)/$(SPECFILE) $(SOURCES)/$(CHANGELOG) $(PKGRELEASE) $(RPMKVERSION) $(RPMKPATCHLEVEL) $(RPMKSUBLEVEL) $(DISTRO_BUILD) $(RELEASED_KERNEL) $(SPECRELEASE) $(__ZSTREAM) "$(BUILDOPTS)" $(MARKER) `cat $(REDHAT)/marker` $(SINGLE_TARBALL) $(TARFILE_RELEASE) $(SNAPSHOT) $(UPSTREAM_BRANCH) $(INCLUDE_FEDORA_FILES) $(INCLUDE_RHEL_FILES) $(BUILDID) + @$(REDHAT)/genspec.sh $(SOURCES) $(SOURCES)/$(SPECFILE) $(SOURCES)/$(CHANGELOG) $(PKGRELEASE) $(RPMKVERSION) $(RPMKPATCHLEVEL) $(RPMKSUBLEVEL) $(DISTRO_BUILD) $(RELEASED_KERNEL) $(SPECRELEASE) $(__ZSTREAM) "$(BUILDOPTS)" $(MARKER) `cat $(REDHAT)/marker` $(SINGLE_TARBALL) $(TARFILE_RELEASE) $(SNAPSHOT) $(UPSTREAM_BRANCH) $(INCLUDE_FEDORA_FILES) $(INCLUDE_RHEL_FILES) $(INCLUDE_PATCHLIST) $(BUILDID) @cp $(SOURCES)/$(SPECFILE) $(SOURCES)/../SPECS/
generate-testpatch-tmp: diff --git a/redhat/Makefile.variables b/redhat/Makefile.variables index blahblah..blahblah 100644 --- a/redhat/Makefile.variables +++ b/redhat/Makefile.variables @@ -45,3 +45,8 @@ BUMP_RELEASE:=yes # to '0'. INCLUDE_FEDORA_FILES:=1 INCLUDE_RHEL_FILES:=1 + +# INCLUDE_PATCHLIST controls whether or not a list of patches that didn't +# come from upstream is generated, and included in the Patchlist.changelog +# file in the kernel src.rpm +INCLUDE_PATCHLIST:=1 diff --git a/redhat/genspec.sh b/redhat/genspec.sh index blahblah..blahblah 100755 --- a/redhat/genspec.sh +++ b/redhat/genspec.sh @@ -24,7 +24,8 @@ SNAPSHOT=${17} UPSTREAM_BRANCH=${18} INCLUDE_FEDORA_FILES=${19} INCLUDE_RHEL_FILES=${20} -BUILDID=${21} +INCLUDE_PATCHLIST=${21} +BUILDID=${22} RPMVERSION=${KVERSION}.${KPATCHLEVEL} clogf="$SOURCES/changelog" # hide [redhat] entries from changelog @@ -126,6 +127,24 @@ else BUILDID_DEFINE="# define buildid .local" fi
+EXCLUDE_FILES=":(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 \ + :(exclude,top)configs" + +# Generate Patchlist.changelog file that holds the shas and commits of +# changes that didn't come from upstream. +if [ "$INCLUDE_PATCHLIST" -ne 0 ]; then + # May need to preserve word splitting in EXCLUDE_FILES + # shellcheck disable=SC2086 + git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. $EXCLUDE_FILES \ + > "$SOURCES"/Patchlist.changelog +fi + test -n "$SPECFILE" && sed -i -e " /%%CHANGELOG%%/r $CHANGELOG @@ -141,19 +160,11 @@ test -n "$SPECFILE" && s/%%DEBUG_BUILDS_ENABLED%%/$DEBUG_BUILDS_ENABLED/ s/%%INCLUDE_FEDORA_FILES%%/$INCLUDE_FEDORA_FILES/ s/%%INCLUDE_RHEL_FILES%%/$INCLUDE_RHEL_FILES/ + s/%%INCLUDE_PATCHLIST%%/$INCLUDE_PATCHLIST/ s/%%TARBALL_VERSION%%/$TARFILE_RELEASE/" "$SPECFILE"
echo "MARKER is $MARKER"
-EXCLUDE_FILES=":(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 \ - :(exclude,top)configs" - if [ "$SINGLE_TARBALL" = 0 ]; then # May need to preserve word splitting in EXCLUDE_FILES # shellcheck disable=SC2086 @@ -164,22 +175,6 @@ else touch "$SOURCES"/patch-"$RPMVERSION"-redhat.patch fi
-# generate Patchlist.changelog file that holds the shas and commits not -# included upstream and git commit url. -ARK_COMMIT_URL="https://gitlab.com/cki-project/kernel-ark/-/commit" - -# sed convert -# <sha> <description> -# to -# <ark_commit_url>/<sha> -# <sha> <description> -# -# May need to preserve word splitting in EXCLUDE_FILES -# shellcheck disable=SC2086 -git log --no-merges --pretty=oneline --no-decorate ${UPSTREAM}.. $EXCLUDE_FILES | \ - sed "s!^([^ ]*)!$ARK_COMMIT_URL/\1\n &!; s!$!\n!" \ - > "$SOURCES"/Patchlist.changelog - # We depend on work splitting of BUILDOPTS # shellcheck disable=SC2086 for opt in $BUILDOPTS; do diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index blahblah..blahblah 100755 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -7,6 +7,8 @@ %global include_fedora %%INCLUDE_FEDORA_FILES%% # Include RHEL files %global include_rhel %%INCLUDE_RHEL_FILES%% +# Provide Patchlist.changelog file +%global patchlist_changelog %%INCLUDE_PATCHLIST%%
# Disable LTO in userspace packages. %global _lto_cflags %{nil} @@ -828,7 +830,9 @@ Source2002: kvm_stat.logrotate # source tree, but in the mean time we carry this to support the legacy workflow Source3000: merge.pl Source3001: kernel-local -Source3003: Patchlist.changelog +%if %{patchlist_changelog} +Source3002: Patchlist.changelog +%endif
Source4000: README.rst Source4001: rpminspect.yaml
-- https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1415
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1415#note_6957819...
Drop the URL from the file […]
The URL was added for a reason: to make it easier for users to check what patches Fedora ships, as squashing them up makes it hard and is IMHO kind against the idea of RPM (the archives has the details somewhere; I was the one that asked for it). I thus hate to see it go. Can't you somehow check if the repo you are dealing with is kernel-ark upstream and only drop it for downstream repos? Or something like that?
From: Justin M. Forbes on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1415#note_6963019...
That was my fault. Originally there was talk of making it adapt the URL to the correct repository. I figured the URL was unnecessary as everything before the commit id is identical for every patch, and it introduces more churn into the file. If people find the URL to be beneficial, I am not opposed to keeping it around.
From: Thorsten Leemhuis on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1415#note_6963217...
If people find the URL to be beneficial, I am not opposed to keeping it
around.
Maybe I'm the only one, so FWIW, here is why I think it would be good if the URL could stay:
One feature that people really like about RPM: you can take a SRPM and read or remove patches easily. The kernel-ark workflow breaks with this, as it squashes the commits into one giant patch. As a compensation & courtesy it IMHO would be good to at least make such aspects a bit easier for people again; among them journalists and developers from others distros that want to check how Fedora patches their kernel and don't want to deal with git or the kernel-ark webinterface.
kernel@lists.fedoraproject.org