From fd19e44f449f7e2e58d42d7bb6813e2292c38fba Mon Sep 17 00:00:00 2001
From: Linus Torvalds <torvalds@woody.linux-foundation.org>
Date: Mon, 12 Feb 2007 15:05:15 -0800
Subject: [PATCH] don't use 'localversion*' files twice

Since we look in both source and object directories for localversion*
files, we accidentally ended up getting them twice.  Use 'sort -u' to
avoid that.

Reported-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index cdeda68cf2aa9..7e4968fb2134d 100644
--- a/Makefile
+++ b/Makefile
@@ -789,7 +789,7 @@ $(vmlinux-dirs): prepare scripts
 
 pattern = ".*/localversion[^~]*"
 string  = $(shell cat /dev/null \
-	   `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort`)
+	   `find $(objtree) $(srctree) -maxdepth 1 -regex $(pattern) | sort -u`)
 
 localver = $(subst $(space),, $(string) \
 			      $(patsubst "%",%,$(CONFIG_LOCALVERSION)))
-- 
GitLab