Blame SOURCES/0015-Makefile-Fix-unnecessary-re-patching-with-coreutils-.patch

56ae9b
From 619e36c18791333ee3a7fea759ce20396e711a46 Mon Sep 17 00:00:00 2001
56ae9b
From: Kazuhito Hagio <k-hagio-ab@nec.com>
56ae9b
Date: Mon, 22 Aug 2022 11:59:46 +0900
56ae9b
Subject: [PATCH 15/28] Makefile: Fix unnecessary re-patching with
56ae9b
 coreutils-9.0
56ae9b
56ae9b
"sum" command in coreutils-9.0 (e.g. Fedora 36) started to output a file
56ae9b
name.  As a result, "make" always detects a change of gdb-10.2.patch
56ae9b
wrongly and re-applies it unnecessarily.
56ae9b
56ae9b
Use standard input to fix it and "md5sum" to improve detection.
56ae9b
56ae9b
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
56ae9b
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
56ae9b
---
56ae9b
 Makefile | 2 +-
56ae9b
 1 file changed, 1 insertion(+), 1 deletion(-)
56ae9b
56ae9b
diff --git a/Makefile b/Makefile
56ae9b
index 059759b3e4ab..dd81df6c198c 100644
56ae9b
--- a/Makefile
56ae9b
+++ b/Makefile
56ae9b
@@ -269,7 +269,7 @@ rebuild:
56ae9b
 	@if [ ! -f ${GDB}/${GDB}.patch ]; then \
56ae9b
 	  touch ${GDB}/${GDB}.patch; fi
56ae9b
 	@if [ -f ${GDB}.patch ] && [ -s ${GDB}.patch ] && \
56ae9b
-	  [ "`sum ${GDB}.patch`" != "`sum ${GDB}/${GDB}.patch`" ]; then \
56ae9b
+	  [ "`md5sum < ${GDB}.patch`" != "`md5sum < ${GDB}/${GDB}.patch`" ]; then \
56ae9b
 	  (sh -x ${GDB}.patch ${TARGET}; patch -N -p0 -r- --fuzz=0 < ${GDB}.patch; cp ${GDB}.patch ${GDB}; cd ${GDB}; \
56ae9b
 	  $(MAKE) CRASH_TARGET=${TARGET}) \
56ae9b
 	else (cd ${GDB}/gdb; $(MAKE) CRASH_TARGET=${TARGET}); fi
56ae9b
-- 
56ae9b
2.37.1
56ae9b