Tue Apr 16 23:40:36 2024 UTC (23d)
Set LC_ALL=C before calling sort so that it works consistently. Unfortunately
ENVIRON["LC_ALL"] = "C"; does not work like in gawk (Jan-Benedict Glaw)


(christos)
diff -r1.16 -r1.17 src/distrib/common/parselist.awk

cvs diff -r1.16 -r1.17 src/distrib/common/parselist.awk (expand / switch to unified diff)

--- src/distrib/common/parselist.awk 2009/04/10 16:16:12 1.16
+++ src/distrib/common/parselist.awk 2024/04/16 23:40:36 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: parselist.awk,v 1.16 2009/04/10 16:16:12 apb Exp $ 1# $NetBSD: parselist.awk,v 1.17 2024/04/16 23:40:36 christos Exp $
2# 2#
3# Copyright (c) 2002 The NetBSD Foundation, Inc. 3# Copyright (c) 2002 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# This code is derived from software contributed to The NetBSD Foundation 6# This code is derived from software contributed to The NetBSD Foundation
7# by Luke Mewburn of Wasabi Systems. 7# by Luke Mewburn of Wasabi Systems.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
@@ -167,37 +167,37 @@ $1 == "COPY" \ @@ -167,37 +167,37 @@ $1 == "COPY" \
167 if (mode == "install" || mode == "mtree" || mode == "populate") 167 if (mode == "install" || mode == "mtree" || mode == "populate")
168 copy($2, $3, $4); 168 copy($2, $3, $4);
169 next; 169 next;
170} 170}
171 171
172$1 == "COPYDIR" \ 172$1 == "COPYDIR" \
173{ 173{
174 if (NF != 3) 174 if (NF != 3)
175 err("Usage: COPYDIR src dest"); 175 err("Usage: COPYDIR src dest");
176 srcdir=$2; 176 srcdir=$2;
177 destdir=$3; 177 destdir=$3;
178 if (mode == "mtree") { 178 if (mode == "mtree") {
179 printf("./%s type=dir mode=755\n", destdir); 179 printf("./%s type=dir mode=755\n", destdir);
180 command="cd " srcdir " && find . -type d -print" 180 command="cd " srcdir " && find . -type d -print | LC_ALL=C sort"
181 while (command | getline dir) { 181 while (command | getline dir) {
182 gsub(/^\.\//, "", dir); 182 gsub(/^\.\//, "", dir);
183 if (dir == ".") 183 if (dir == ".")
184 continue; 184 continue;
185 printf("./%s/%s type=dir mode=755\n", destdir, dir); 185 printf("./%s/%s type=dir mode=755\n", destdir, dir);
186 } 186 }
187 close(command); 187 close(command);
188 } 188 }
189 if (mode == "install" || mode == "mtree" || mode == "populate") { 189 if (mode == "install" || mode == "mtree" || mode == "populate") {
190 command="cd " srcdir " && find . -type f -print" 190 command="cd " srcdir " && find . -type f -print | LC_ALL=C sort"
191 while (command | getline srcfile) { 191 while (command | getline srcfile) {
192 gsub(/^\.\//, "", srcfile); 192 gsub(/^\.\//, "", srcfile);
193 copy(srcdir "/" srcfile, destdir "/" srcfile, ""); 193 copy(srcdir "/" srcfile, destdir "/" srcfile, "");
194 } 194 }
195 close(command); 195 close(command);
196 } 196 }
197 next; 197 next;
198} 198}
199 199
200$1 == "LIBS" || $1 == "SPECIAL" || $1 == "SRCDIRS" \ 200$1 == "LIBS" || $1 == "SPECIAL" || $1 == "SRCDIRS" \
201{ 201{
202 if (NF < 2) 202 if (NF < 2)
203 err("Usage: " $1 " args..."); 203 err("Usage: " $1 " args...");