Re: [OS-BUILD PATCHv2] Remove filterdiff and use native git instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 10, 2020 at 06:31:25PM -0000, GitLab Bridge on behalf of dzickusrh wrote:
> From: Don Zickus <dzickus@xxxxxxxxxx>
> 
> Closes: #34
> 
> Long ago, we needed the ability to filter out files and directories
> from patches.  Now that ability is built into git a few years ago,
> let's use that instead of filterdiff.
> 
> One less tool to depend on and require.
> 
> V2: rebase and fix conflicts
> 
> Cc: Bastien Nocera <bnocera@xxxxxxxxxx>
> Cc: Herton Krzesinski <hkrzesin@xxxxxxxxxx>
> Signed-off-by: Don Zickus <dzickus@xxxxxxxxxx>
> ---
>  redhat/Makefile        | 23 ++++++++++-------------
>  redhat/Makefile.common |  1 -
>  2 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/redhat/Makefile b/redhat/Makefile
> index c807609fbf21..f6bc167c163f 100644
> --- a/redhat/Makefile
> +++ b/redhat/Makefile
> @@ -220,18 +220,17 @@ setup-source: dist-git-version-check dist-clean-sources
>  	@$(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) $(BUILDID)
>  	@cp $(SOURCES)/$(SPECFILE) $(SOURCES)/../SPECS/
>  
> -sources-rh: $(TARBALL)
> +generate-testpatch-tmp:
> +	@(GIT) diff --no-renames HEAD ":(exclude,top).get_maintainer.conf" \
> +		":(exclude,top).gitattributes" \
> +		":(exclude,top).gitignore" \
> +		":(exclude,top)makefile" \
> +		":(exclude,top)Makefile.rhelver" \
> +		":(exclude,top)redhat" > $(TESTPATCH).tmp
> +
> +sources-rh: $(TARBALL) generate-testpatch-tmp
>  	@cp -l $(TARBALL) $(SOURCES)/ || cp $(TARBALL) $(SOURCES)/
>  	@touch $(TESTPATCH)
> -	@$(GIT) diff --no-renames HEAD > $(TESTPATCH).tmp
> -	@# 1) filterdiff will return crap from the patches it just filtered,
> -	@#    that's why egrep is needed so if there're changes under redhat/
> -	@#    but not everywhere else, it will be empty just like
> -	@#    linux-kernel-test.patch
> -	@# 2) egrep -v will return "1" if it sucessfully removed index and diff
> -	@#    lines, which will be considered an error
> -	@($(FILTERDIFF) $(TESTPATCH).tmp | egrep -v "^index|^diff" >$(TESTPATCH).tmp2; true)
> -	@mv $(TESTPATCH).tmp2 $(TESTPATCH).tmp
>  	@diff $(TESTPATCH).tmp $(TESTPATCH) > /dev/null || \
>  		echo "WARNING: There are uncommitted changes in your tree or the changes are not in sync with linux-kernel-test.patch.  Either commit the changes or run 'make dist-test-patch'"
>  	@rm $(TESTPATCH).tmp
> @@ -268,9 +267,7 @@ sources-rh: $(TARBALL)
>  
>  dist-sources: setup-source dist-configs-check dist-kabi dist-kabi-dup sources-rh
>  
> -dist-test-patch:
> -	@$(GIT) diff --no-renames HEAD > $(TESTPATCH);
> -	@($(FILTERDIFF) $(TESTPATCH) | egrep -v "^index|^diff" >$(TESTPATCH).tmp; true)
> +dist-test-patch: generate-testpatch-tmp
>  	@mv $(TESTPATCH).tmp $(TESTPATCH);
>  
>  dist-all-rpms: dist-sources
> diff --git a/redhat/Makefile.common b/redhat/Makefile.common
> index cdffa9fb3d3d..5e6fcd999e58 100644
> --- a/redhat/Makefile.common
> +++ b/redhat/Makefile.common
> @@ -82,7 +82,6 @@ RPM:=$(REDHAT)/rpm
>  SRPMS:=$(RPM)/SRPMS
>  SOURCES:=$(RPM)/SOURCES
>  TESTPATCH:=$(REDHAT)/linux-kernel-test.patch
> -FILTERDIFF:=/usr/bin/filterdiff -x '*redhat/*' -x '*/.gitignore' -x '*/makefile' -x '*/Makefile'
>  ARCH_LIST=aarch64 ppc64le s390x x86_64
>  # Make can't match on a regex to match fc31, fc32 so add another check here
>  # A unified tarball means that the tarball in the srpm contains both the
> -- 
> GitLab
> 

Acked-by: Herton R. Krzesinski <herton@xxxxxxxxxx>

-- 
[]'s
Herton
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/kernel@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux