Skip to contentSkip to conversation

Makefile: Use sort shortopts

PATCH In review Marek Vasut 4 participants 4 messages Jul 20, 2023 – Jul 25, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: Use sort shortopts

POSIX does not defined longopts for sort, use shortops for even more compatibility.

Fixes cc5a490cf465 ("Makefile: Sort u-boot-initial-env output")

---
Cc: Christoph Niedermaier <[email protected]>
Cc: Marek Behún <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 87f9fc786e8..5fc16b3b1f1 100644
@@ -2444,7 +2444,7 @@ quiet_cmd_genenv = GENENV  $@
 cmd_genenv = \
 	$(objtree)/tools/printinitialenv | \
 	sed -e '/^\s*$$/d' | \
-	sort --field-separator='=' -k1,1 --stable -o $@
+	sort -t '=' -k 1,1 -s -o $@
 
 u-boot-initial-env: $(env_h) FORCE
 	$(Q)$(MAKE) $(build)=tools $(objtree)/tools/printinitialenv
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines

From: Marek Vasut <[email protected]>
Date: Thu, 20 Jul 2023 14:50:42 +0200

POSIX does not defined longopts for sort, use shortops for even more compatibility.

Even though OpenBSD's sort does implement the long options this is still good to have!

Quoted 31 lines
Fixes cc5a490cf465 ("Makefile: Sort u-boot-initial-env output")

---
Cc: Christoph Niedermaier <[email protected]>
Cc: Marek Behún <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 87f9fc786e8..5fc16b3b1f1 100644
@@ -2444,7 +2444,7 @@ quiet_cmd_genenv = GENENV  $@
 cmd_genenv = \
 	$(objtree)/tools/printinitialenv | \
 	sed -e '/^\s*$$/d' | \
-	sort --field-separator='=' -k1,1 --stable -o $@
+	sort -t '=' -k 1,1 -s -o $@
 
 u-boot-initial-env: $(env_h) FORCE
 	$(Q)$(MAKE) $(build)=tools $(objtree)/tools/printinitialenv
Signature · 1 line
2.40.1
Tested-by on v1 1/1
#2 lore raw
In reply to Marek Vasut
Quoted 6 lines · Marek Vasut

POSIX does not defined longopts for sort, use shortops for even more compatibility.

Fixes cc5a490cf465 ("Makefile: Sort u-boot-initial-env output")

small note: single quotes are not needed aroud = (equal sign)

Quoted 27 lines

---
Cc: Christoph Niedermaier <[email protected]>
Cc: Marek Behún <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Stefano Babic <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 87f9fc786e8..5fc16b3b1f1 100644
@@ -2444,7 +2444,7 @@ quiet_cmd_genenv = GENENV  $@
 cmd_genenv = \
 	$(objtree)/tools/printinitialenv | \
 	sed -e '/^\s*$$/d' | \
-	sort --field-separator='=' -k1,1 --stable -o $@
+	sort -t '=' -k 1,1 -s -o $@
 
 u-boot-initial-env: $(env_h) FORCE
 	$(Q)$(MAKE) $(build)=tools $(objtree)/tools/printinitialenv
Signature · 1 line
2.40.1