mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
734 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74ba433a14 | ||
|
|
c980b0566a | ||
|
|
31896c21c6 | ||
|
|
773a88d33f | ||
|
|
cd78f85b0b | ||
|
|
2061cd8aa6 | ||
|
|
0c91ae335d | ||
|
|
0e40e9de57 | ||
|
|
0a3f944791 | ||
|
|
fa391362e1 | ||
|
|
8c243ff965 | ||
|
|
86cef85b36 | ||
|
|
65ba955988 | ||
|
|
dac5f12c6e | ||
|
|
26d3d090bd | ||
|
|
1eaacac312 | ||
|
|
5d0b158f4c | ||
|
|
982504452d | ||
|
|
48cae1e864 | ||
|
|
022889a457 | ||
|
|
adc62b5d9f | ||
|
|
1f4fcd083d | ||
|
|
9c8e4f6918 | ||
|
|
ed85df444a | ||
|
|
0dc4478f13 | ||
|
|
8ed84c3438 | ||
|
|
c55c0e7369 | ||
|
|
e3e9713fad | ||
|
|
6b8578af5e | ||
|
|
04d49874a2 | ||
|
|
18810ae65f | ||
|
|
d3dcb10f90 | ||
|
|
52b4d2a51a | ||
|
|
2b32399fdc | ||
|
|
44421c22a3 | ||
|
|
61a42e3743 | ||
|
|
60ca9e1599 | ||
|
|
0889381cbf | ||
|
|
1bdf77ad52 | ||
|
|
05a50b7848 | ||
|
|
2f61473e85 | ||
|
|
460ebb078e | ||
|
|
0d5508de13 | ||
|
|
ddf56e0440 | ||
|
|
2fbee63cc9 | ||
|
|
b27275c668 | ||
|
|
016f8c9998 | ||
|
|
10f3e12a0d | ||
|
|
83ae1bdd44 | ||
|
|
2a8f5104cd | ||
|
|
065f14f471 | ||
|
|
9a45c19667 | ||
|
|
f6240c49df | ||
|
|
b52a88607f | ||
|
|
f15842de47 | ||
|
|
c926d002b5 | ||
|
|
31b6c0489a | ||
|
|
a488f288a2 | ||
|
|
a7592cfcb2 | ||
|
|
3288ebb0d7 | ||
|
|
9934f50282 | ||
|
|
46d6df933e | ||
|
|
7b1967351c | ||
|
|
d01338eb3d | ||
|
|
a99c35b04d | ||
|
|
5e3a5ae519 | ||
|
|
1fd718e93c | ||
|
|
972967903d | ||
|
|
e0035fa4eb | ||
|
|
99be907838 | ||
|
|
1ead085826 | ||
|
|
695682d514 | ||
|
|
442d63051c | ||
|
|
7fc5292a29 | ||
|
|
cf5616a0aa | ||
|
|
13601dd3cf | ||
|
|
1ee192a9ff | ||
|
|
cbecb8cab8 | ||
|
|
fb992bae4c | ||
|
|
ac9e4915ad | ||
|
|
92465d59c6 | ||
|
|
921feefb12 | ||
|
|
0c65638b0f | ||
|
|
5c065bb0cb | ||
|
|
680afe6751 | ||
|
|
0fcf730104 | ||
|
|
f144582e17 | ||
|
|
9a913a2461 | ||
|
|
317d2c6384 | ||
|
|
292d68565a | ||
|
|
c352bb469d | ||
|
|
22a2a43021 | ||
|
|
4000c35ae3 | ||
|
|
99eccc3359 | ||
|
|
9965d234e5 | ||
|
|
a011b01af1 | ||
|
|
28fbe5a487 | ||
|
|
9b8023e69c | ||
|
|
b8497a3a7a | ||
|
|
c2e56e0de7 | ||
|
|
031e2fb5e9 | ||
|
|
e181802521 | ||
|
|
c58b5daa33 | ||
|
|
80325aca2d | ||
|
|
d3b5555f10 | ||
|
|
ca738e4414 | ||
|
|
21eb87e6ea | ||
|
|
7ef56a26fd | ||
|
|
aa2617b908 | ||
|
|
016958f2f0 | ||
|
|
1ce9d86c30 | ||
|
|
00b5a2db33 | ||
|
|
e34894bf3f | ||
|
|
b14e5c40b9 | ||
|
|
90f74735aa | ||
|
|
d6a62182f0 | ||
|
|
847ab6a518 | ||
|
|
b5b3690d06 | ||
|
|
57e2022b8d | ||
|
|
be6b4218e4 | ||
|
|
48a05a9ce9 | ||
|
|
fc3b301d4f | ||
|
|
c7e971bee0 | ||
|
|
b0312caf6f | ||
|
|
1c318d52de | ||
|
|
186b655094 | ||
|
|
8333cc3c0f | ||
|
|
c27c4a0957 | ||
|
|
a5e53ecc2c | ||
|
|
d5ab05998c | ||
|
|
a2be861b04 | ||
|
|
fbd87029cf | ||
|
|
3ece0355d5 | ||
|
|
1760ade090 | ||
|
|
ed017d44b2 | ||
|
|
8b09875b59 | ||
|
|
4e38e6a19c | ||
|
|
b3e779c090 | ||
|
|
17409787bb | ||
|
|
ac819e1044 | ||
|
|
36eb45201f | ||
|
|
b43255473f | ||
|
|
90a83264b9 | ||
|
|
43448b0493 | ||
|
|
854284f788 | ||
|
|
0e2ac2de24 | ||
|
|
03911ef780 | ||
|
|
32d4d0dd5e | ||
|
|
cfa2120e83 | ||
|
|
1c5e5d6277 | ||
|
|
41ec3548b0 | ||
|
|
5b27ec57b0 | ||
|
|
1e48b1fee5 | ||
|
|
5dc070cc86 | ||
|
|
b4ec994b26 | ||
|
|
2bf151cd93 | ||
|
|
153477479a | ||
|
|
fec0e89c20 | ||
|
|
407e8f0fdd | ||
|
|
461231f022 | ||
|
|
b705e9a9e7 | ||
|
|
b3677e5e38 | ||
|
|
cc0f637b6d | ||
|
|
7920f2c14a | ||
|
|
99f4994982 | ||
|
|
5afac2aee1 | ||
|
|
aa67daf63b | ||
|
|
f7a009c17c | ||
|
|
028e12ce3b | ||
|
|
f3f1ccfd87 | ||
|
|
08c38ab7cb | ||
|
|
d60e33e241 | ||
|
|
31a884dab7 | ||
|
|
74443830ea | ||
|
|
2ae61facc7 | ||
|
|
bb7fa1e932 | ||
|
|
16c8062085 | ||
|
|
17278118ee | ||
|
|
7f6fb43e7d | ||
|
|
ddc409b59e | ||
|
|
7eb3aab88b | ||
|
|
4fb3704c25 | ||
|
|
514b7fbc00 | ||
|
|
555c219d9e | ||
|
|
59964c164b | ||
|
|
7377f49ea8 | ||
|
|
969841cb77 | ||
|
|
c3e1fe230b | ||
|
|
1833a876ae | ||
|
|
0f5695bd59 | ||
|
|
42df6d7de2 | ||
|
|
9c0c57a1b4 | ||
|
|
a36f4cb451 | ||
|
|
ed0a1c9f94 | ||
|
|
f9da2d0e87 | ||
|
|
42285406aa | ||
|
|
5149348906 | ||
|
|
fbc5aa7c47 | ||
|
|
15f4d612df | ||
|
|
e505736f82 | ||
|
|
7eb15e1020 | ||
|
|
ef13885b37 | ||
|
|
0628b73f35 | ||
|
|
dafbd407bc | ||
|
|
94c59c97f9 | ||
|
|
ab02e256e9 | ||
|
|
0eff09dfcf | ||
|
|
0482f193b5 | ||
|
|
cfe3602ad6 | ||
|
|
cee53c1430 | ||
|
|
0643c51cab | ||
|
|
b616886492 | ||
|
|
58aaf71f07 | ||
|
|
24412edeaf | ||
|
|
a5111af33e | ||
|
|
1e3ebd660a | ||
|
|
2f706199d0 | ||
|
|
e13188e7ef | ||
|
|
2a4dcb627e | ||
|
|
13a2025998 | ||
|
|
9a33347007 | ||
|
|
e916c8ff05 | ||
|
|
beaee48f26 | ||
|
|
2643b4b77d | ||
|
|
8c4a656fad | ||
|
|
fec05eb377 | ||
|
|
6d5bf36d5c | ||
|
|
be11df4916 | ||
|
|
2f776f3096 | ||
|
|
13edec7c62 | ||
|
|
57622cac71 | ||
|
|
3b39aa796f | ||
|
|
a7ea04404c | ||
|
|
e34eb51728 | ||
|
|
771484f47a | ||
|
|
c7c961a3e5 | ||
|
|
4718a2fdf4 | ||
|
|
2298544c64 | ||
|
|
18efee4e2a | ||
|
|
f923ceceba | ||
|
|
e10e4b6697 | ||
|
|
cddcb5d468 | ||
|
|
3e8f9c8d35 | ||
|
|
ae1c205fc4 | ||
|
|
2221ea2c3a | ||
|
|
a06afbeec5 | ||
|
|
d9903062cf | ||
|
|
9dcebc51be | ||
|
|
1084bf78ea | ||
|
|
68561594ca | ||
|
|
22e5102f19 | ||
|
|
e4fa3e7808 | ||
|
|
737461d23f | ||
|
|
6b22726dd4 | ||
|
|
54281e9c60 | ||
|
|
ea2887bbe4 | ||
|
|
ef6a361a07 | ||
|
|
63a7120c28 | ||
|
|
5bf3e7ee96 | ||
|
|
0c1fc1c715 | ||
|
|
f03a67735a | ||
|
|
f325d180cf | ||
|
|
bfe4a55520 | ||
|
|
8ea96a5c90 | ||
|
|
f3574102d3 | ||
|
|
edd292f8d4 | ||
|
|
929479026b | ||
|
|
4c9fae4e97 | ||
|
|
a01c4720d6 | ||
|
|
081ebb2822 | ||
|
|
22999697b8 | ||
|
|
7e0019b168 | ||
|
|
64c25ed741 | ||
|
|
d9c0881137 | ||
|
|
4290abda87 | ||
|
|
5a74a2d566 | ||
|
|
7ee3d2430a | ||
|
|
f0f6e14610 | ||
|
|
e4fd2bf4e6 | ||
|
|
18e2a330b9 | ||
|
|
4ebf956b4e | ||
|
|
0392142b87 | ||
|
|
127c689f64 | ||
|
|
baad54258d | ||
|
|
d3ad58376d | ||
|
|
a1cb30c1fb | ||
|
|
d7e2f425e7 | ||
|
|
4b5e044be3 | ||
|
|
43f66923cc | ||
|
|
cd1f4bc1ec | ||
|
|
b673a5b8ac | ||
|
|
2a2d3f237b | ||
|
|
0d279d2378 | ||
|
|
c339cff4a6 | ||
|
|
ae5ae5e117 | ||
|
|
f65cafd67b | ||
|
|
d9207b48a3 | ||
|
|
d7f79cf6cb | ||
|
|
8c3835bf93 | ||
|
|
273c10fc2c | ||
|
|
f4bffea5e9 | ||
|
|
6b9f1bdd66 | ||
|
|
ffc630e598 | ||
|
|
c4c3dbc024 | ||
|
|
110df929fc | ||
|
|
e3b5543ea8 | ||
|
|
84f6abfe00 | ||
|
|
00c6aacf31 | ||
|
|
8d974b00fb | ||
|
|
b44f5f74aa | ||
|
|
662ce25d83 | ||
|
|
0d75784da0 | ||
|
|
cbdcc9fb4e | ||
|
|
bee58d8a04 | ||
|
|
e535754fdb | ||
|
|
f674a10f7e | ||
|
|
4fff95cfe1 | ||
|
|
77d97a1be4 | ||
|
|
f82c5ba71e | ||
|
|
9bb0d5766e | ||
|
|
1ee81530c0 | ||
|
|
ecb0ea20ca | ||
|
|
9a221e27f5 | ||
|
|
4e6af68846 | ||
|
|
186b45aaed | ||
|
|
773be9eca8 | ||
|
|
8461d49df0 | ||
|
|
b1a1fcbf57 | ||
|
|
0fb0a03c5c | ||
|
|
63467fa187 | ||
|
|
5483165b12 | ||
|
|
9a4e22d036 | ||
|
|
bba4d3e054 | ||
|
|
760bc6f7e7 | ||
|
|
9396eb9037 | ||
|
|
8da8dfc470 | ||
|
|
1d9b3de948 | ||
|
|
f38003890b | ||
|
|
5b610a06b2 | ||
|
|
5cc42f7de6 | ||
|
|
0a98d79bd2 | ||
|
|
a676856285 | ||
|
|
e2dbcee444 | ||
|
|
8ce745dc61 | ||
|
|
1fcd8cf8b4 | ||
|
|
595fc63c42 | ||
|
|
58b2e1204a | ||
|
|
27311c9e85 | ||
|
|
556fbb5721 | ||
|
|
b1a1c9ee06 | ||
|
|
3d309aa725 | ||
|
|
4f4700cca8 | ||
|
|
2e6fa14d16 | ||
|
|
3ea1fe588e | ||
|
|
574f761403 | ||
|
|
c1aabf84e6 | ||
|
|
02bfd65480 | ||
|
|
2c88abe2a2 | ||
|
|
7d10e30088 | ||
|
|
61f94d4dbc | ||
|
|
a087f17a44 | ||
|
|
20905b0cdc | ||
|
|
322c6f2e5c | ||
|
|
3435bb7f40 | ||
|
|
96ae7199c4 | ||
|
|
a7a328af0f | ||
|
|
94cecb5cf6 | ||
|
|
58db1bb942 | ||
|
|
45e67188d6 | ||
|
|
3de1559830 | ||
|
|
956abf969c | ||
|
|
b1db942595 | ||
|
|
2cbbbf6319 | ||
|
|
837bb31803 | ||
|
|
44530f2ddd | ||
|
|
9823682c2f | ||
|
|
1463824d8e | ||
|
|
d42994df5d | ||
|
|
d7d80c5b7b | ||
|
|
20c0b8701f | ||
|
|
46a811b9e7 | ||
|
|
bbbc35c9ed | ||
|
|
c49b2e32bb | ||
|
|
b83c498809 | ||
|
|
6c79825ce9 | ||
|
|
3808eccbbf | ||
|
|
81d0c8f367 | ||
|
|
98a96822d9 | ||
|
|
5f47278372 | ||
|
|
47ed009e57 | ||
|
|
394f88c4aa | ||
|
|
8253a9aeb4 | ||
|
|
a16bee4f07 | ||
|
|
e63c9825da | ||
|
|
263bb1be67 | ||
|
|
23c2a0cbac | ||
|
|
252d6d01c9 | ||
|
|
6eec737ade | ||
|
|
68158e6b10 | ||
|
|
75e0047c4b | ||
|
|
74c0bfbc4c | ||
|
|
80213bc66d | ||
|
|
4b92612944 | ||
|
|
896b672499 | ||
|
|
1b0b6c8d08 | ||
|
|
cc4bdb92f9 | ||
|
|
0647f3eb5a | ||
|
|
77b1bfc85c | ||
|
|
434258ca73 | ||
|
|
eebe731014 | ||
|
|
91c1384602 | ||
|
|
265c4b83a8 | ||
|
|
4a510cd399 | ||
|
|
ecb67c8389 | ||
|
|
86535835fe | ||
|
|
01e6181965 | ||
|
|
8a4192d3c0 | ||
|
|
423f28be77 | ||
|
|
dd3612a12b | ||
|
|
3cafcf8584 | ||
|
|
4db4c2aa6d | ||
|
|
d81d2e0ba6 | ||
|
|
eba365275b | ||
|
|
eb4b2d462e | ||
|
|
72df741618 | ||
|
|
fc6827e2bb | ||
|
|
6c9b505329 | ||
|
|
9f678af5f3 | ||
|
|
8581bcc9e3 | ||
|
|
00a3098235 | ||
|
|
c6c9e8730e | ||
|
|
8976a2b27e | ||
|
|
87386cc8a9 | ||
|
|
545a116748 | ||
|
|
9d59509937 | ||
|
|
26552f2756 | ||
|
|
86837548f1 | ||
|
|
199d850038 | ||
|
|
581b2e3cee | ||
|
|
d8382a4d26 | ||
|
|
74a106985a | ||
|
|
be2abe31fd | ||
|
|
b69b4cca95 | ||
|
|
7855cbfcac | ||
|
|
29290d0485 | ||
|
|
3ceabe1bfc | ||
|
|
5e6a1837ea | ||
|
|
76367f06b3 | ||
|
|
c4a9551eee | ||
|
|
9300779cc8 | ||
|
|
878e51ebfa | ||
|
|
51243cdaca | ||
|
|
1081bbc74e | ||
|
|
ea54b6f47c | ||
|
|
4a4fe636dc | ||
|
|
c6a3937288 | ||
|
|
0bf3eb3682 | ||
|
|
513a235858 | ||
|
|
433881d802 | ||
|
|
295d47736a | ||
|
|
346dd8b5bf | ||
|
|
65d65fe094 | ||
|
|
a59258fbc7 | ||
|
|
b347377bd3 | ||
|
|
0fe9fc4558 | ||
|
|
15b0d75930 | ||
|
|
f0ad302ca9 | ||
|
|
28c9d4ecff | ||
|
|
ce7b12ef1b | ||
|
|
7fcb73cec0 | ||
|
|
6a9c6804dd | ||
|
|
7c9c6c7875 | ||
|
|
d3dc29c0be | ||
|
|
6ec3a4f033 | ||
|
|
7cc3733f29 | ||
|
|
e98006dde0 | ||
|
|
bc2b9e04e9 | ||
|
|
5ad6145142 | ||
|
|
2656da4705 | ||
|
|
3269104d17 | ||
|
|
f15e62d12e | ||
|
|
32b84c9c90 | ||
|
|
1f3e964802 | ||
|
|
62ebe4dabd | ||
|
|
cca51697aa | ||
|
|
22adc16d9c | ||
|
|
f375a52f51 | ||
|
|
eb62800728 | ||
|
|
f02102211e | ||
|
|
209850fd7e | ||
|
|
4d3bf408b9 | ||
|
|
2224ef83fe | ||
|
|
0b66c5776e | ||
|
|
c64411a38a | ||
|
|
fcd450ecb9 | ||
|
|
d701f6abb7 | ||
|
|
a892af0d48 | ||
|
|
e3171c43eb | ||
|
|
bbc49eb536 | ||
|
|
bbc0cb0f37 | ||
|
|
28f1b61e59 | ||
|
|
29a2fb3856 | ||
|
|
ed30cd94e3 | ||
|
|
eef629eea1 | ||
|
|
2f55920ffc | ||
|
|
d6ec836387 | ||
|
|
5a3b0c4805 | ||
|
|
972e2737ab | ||
|
|
816e56a3de | ||
|
|
bbafdc3c8f | ||
|
|
dfdb532fd3 | ||
|
|
53d8a2c412 | ||
|
|
427f179542 | ||
|
|
8dc387dba5 | ||
|
|
cca6a8d7e5 | ||
|
|
6bbbd65d89 | ||
|
|
d30ac3d321 | ||
|
|
37370a584c | ||
|
|
8657cf19e2 | ||
|
|
1a5b6e3a50 | ||
|
|
0a4a938b6b | ||
|
|
d9c1b8fd30 | ||
|
|
0bc8813b1e | ||
|
|
68466d44b1 | ||
|
|
79a98d9bc1 | ||
|
|
a6894d063c | ||
|
|
90bc2fe272 | ||
|
|
c51900a6bd | ||
|
|
b214b51ca0 | ||
|
|
512e111a92 | ||
|
|
d25bf9dceb | ||
|
|
fdb7e5b44c | ||
|
|
b29e812e82 | ||
|
|
e347e9d722 | ||
|
|
87de29e6f0 | ||
|
|
dc4a8e6280 | ||
|
|
b021f59dfa | ||
|
|
6856089f7b | ||
|
|
7e1075dd74 | ||
|
|
a85752ff4b | ||
|
|
0d03baa068 | ||
|
|
57ae7da075 | ||
|
|
9bb5e5e9af | ||
|
|
d9cdf8ce28 | ||
|
|
5d8b8d8b74 | ||
|
|
bc22dbbf84 | ||
|
|
7cb24684cc | ||
|
|
739cf4e832 | ||
|
|
08f2a71ee3 | ||
|
|
4827dd27b0 | ||
|
|
f91dec277a | ||
|
|
512c906ca6 | ||
|
|
2ef40e9654 | ||
|
|
051c345f17 | ||
|
|
a899840bcc | ||
|
|
40c2d565ba | ||
|
|
eab0cebc76 | ||
|
|
8b3ec19019 | ||
|
|
383b1e3b5c | ||
|
|
9982e26c12 | ||
|
|
2741677b28 | ||
|
|
c1b6f9458a | ||
|
|
f3653f0d20 | ||
|
|
184a0298f3 | ||
|
|
1fb8739c0b | ||
|
|
a1a0b32bd7 | ||
|
|
9b16f4cc8c | ||
|
|
6e177448b9 | ||
|
|
504fa74e24 | ||
|
|
157ff3506e | ||
|
|
5916dec460 | ||
|
|
94251ff084 | ||
|
|
1a0104fc63 | ||
|
|
ed9120545f | ||
|
|
f433c3835f | ||
|
|
0d34887fe9 | ||
|
|
e373bb1933 | ||
|
|
72e962c97e | ||
|
|
0ec483f365 | ||
|
|
76576ba2f5 | ||
|
|
eb8fa94f2c | ||
|
|
cdb16829a6 | ||
|
|
dc16dc835c | ||
|
|
17720c10cd | ||
|
|
818dbee8dc | ||
|
|
b58a8b4ef5 | ||
|
|
6743f81136 | ||
|
|
0e5381fe93 | ||
|
|
72d052896a | ||
|
|
f7d1c59c22 | ||
|
|
5f2ea441ac | ||
|
|
da9f5e7fdf | ||
|
|
157a274da5 | ||
|
|
1a7f64b157 | ||
|
|
c3869f6564 | ||
|
|
a0851554bd | ||
|
|
4f812540a2 | ||
|
|
6e5bbc267a | ||
|
|
e73dfc3899 | ||
|
|
18ce670a33 | ||
|
|
04f1470c51 | ||
|
|
677610ec7c | ||
|
|
ba4b9d9d6e | ||
|
|
4682f132f2 | ||
|
|
8058da0065 | ||
|
|
2c7bed000e | ||
|
|
9e2ed5521d | ||
|
|
22e66dfc12 | ||
|
|
092239c608 | ||
|
|
116f832b45 | ||
|
|
63feb84a2d | ||
|
|
4b544e447e | ||
|
|
2708cd9ca0 | ||
|
|
7feeb7cf23 | ||
|
|
8378eca4d4 | ||
|
|
e3b22389a8 | ||
|
|
29ff7a3943 | ||
|
|
0ecdb0a52a | ||
|
|
12ff1eb9b9 | ||
|
|
c960211fe7 | ||
|
|
a5d8b18bea | ||
|
|
dec8bb25bb | ||
|
|
9c393fa194 | ||
|
|
3c7a6ae340 | ||
|
|
381e69eace | ||
|
|
c58c2ea3e4 | ||
|
|
d44893c5db | ||
|
|
b7a836c0a3 | ||
|
|
f5d58041d5 | ||
|
|
c7d33788e0 | ||
|
|
07bc841590 | ||
|
|
dd647e78ca | ||
|
|
87a2903cca | ||
|
|
137c167a16 | ||
|
|
8eacedd3b5 | ||
|
|
dcc543f44c | ||
|
|
b22067a582 | ||
|
|
cce03822fc | ||
|
|
b4be756402 | ||
|
|
e8139f2768 | ||
|
|
f33599c144 | ||
|
|
39fc8c581b | ||
|
|
d622ad088b | ||
|
|
5a0b032e9e | ||
|
|
e81d5a49b7 | ||
|
|
710e5f32fc | ||
|
|
46e51208c7 | ||
|
|
d2177c280c | ||
|
|
0dc92c8fde | ||
|
|
3bb1783158 | ||
|
|
fcdf32c159 | ||
|
|
9396e9104e | ||
|
|
dacff7cb2b | ||
|
|
f656cafd4c | ||
|
|
a15329798c | ||
|
|
49f7ebaac4 | ||
|
|
bf9e98344d | ||
|
|
0f8faebb97 | ||
|
|
d2d9234098 | ||
|
|
a1ec12dad6 | ||
|
|
cb3147d298 | ||
|
|
c78039b87d | ||
|
|
59b803e3d0 | ||
|
|
4f3ff2e700 | ||
|
|
a1e715698a | ||
|
|
4242d4f5c4 | ||
|
|
b8108fd2dd | ||
|
|
1d96b88c66 | ||
|
|
38bfb60c11 | ||
|
|
f0bafdb427 | ||
|
|
ace5387fb6 | ||
|
|
bbb82c231a | ||
|
|
5b9f908ce3 | ||
|
|
483297d5dd | ||
|
|
7dc26da47c | ||
|
|
526e43a1c2 | ||
|
|
2c42c1c2ce | ||
|
|
cc8b73b1d9 | ||
|
|
167b8025ac | ||
|
|
0601086bd8 | ||
|
|
70a2bd1864 | ||
|
|
31d7d5d8c8 | ||
|
|
6ed90c719e | ||
|
|
5b954a8756 | ||
|
|
2746a6c05c | ||
|
|
d80aaca2da | ||
|
|
48b9ff8555 | ||
|
|
b0823fb415 | ||
|
|
61d93cb0d8 | ||
|
|
29ebe8f50a | ||
|
|
06a369c34e | ||
|
|
64b39468b8 | ||
|
|
39137a5d05 | ||
|
|
5282e54c08 | ||
|
|
72565ddffe | ||
|
|
52d9bba712 | ||
|
|
0f197c8acd | ||
|
|
1bfffd6a2d | ||
|
|
16c005fe6a | ||
|
|
5ae0543737 | ||
|
|
dcc6638e46 | ||
|
|
a09dadf100 | ||
|
|
0981b56f26 | ||
|
|
ae96ae296b | ||
|
|
7cf7888ee9 | ||
|
|
1d6931a643 | ||
|
|
ffd3ba2805 | ||
|
|
9a0b4599c7 | ||
|
|
49d22be1a6 | ||
|
|
e8bb94a4e3 | ||
|
|
62b7b422a2 | ||
|
|
839f321fde | ||
|
|
afeeea66f3 | ||
|
|
ed5c4e770a | ||
|
|
194ca7b3f9 | ||
|
|
b0d3d97a0f | ||
|
|
69b1a35c6d | ||
|
|
c1c51585f6 | ||
|
|
a7f5e64909 | ||
|
|
533391a2a7 | ||
|
|
a6228c5437 | ||
|
|
77abf69a60 | ||
|
|
ae17ae779e | ||
|
|
ca3de82a18 | ||
|
|
76c9c9845e | ||
|
|
c0c8685d46 | ||
|
|
2c6754363f | ||
|
|
b5d6e9db91 | ||
|
|
73cfcbac05 | ||
|
|
6b5f3dd224 | ||
|
|
d81716addb | ||
|
|
3b9b0c5c16 | ||
|
|
5983242eef | ||
|
|
ce0adae571 |
7
.gitattributes
vendored
Normal file
7
.gitattributes
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
*.texi* diff=texinfo
|
||||
|
||||
# Put something like the following e.g., in your ~/.gitconfig file
|
||||
# # Include proper "function name" string in diffs of texinfo.
|
||||
# # Derived from the regexp in emacs' lisp/add-log.el.
|
||||
# [diff "texinfo"]
|
||||
# funcname = "^@node[ \t][ \t]*\\([^,][^,]*\\)"
|
||||
55
.gitignore
vendored
55
.gitignore
vendored
@@ -5,14 +5,30 @@
|
||||
*/.deps
|
||||
*~
|
||||
.gdb-history
|
||||
.kludge-stamp
|
||||
.tarball-version
|
||||
.version
|
||||
ABOUT-NLS
|
||||
ChangeLog
|
||||
GNUmakefile
|
||||
ID
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
TAGS
|
||||
THANKS-to-translators
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
build-aux/.gitignore
|
||||
build-aux/compile
|
||||
build-aux/config.guess
|
||||
build-aux/config.sub
|
||||
build-aux/depcomp
|
||||
build-aux/install-sh
|
||||
build-aux/mdate-sh
|
||||
build-aux/missing
|
||||
build-aux/texinfo.tex
|
||||
build-aux/ylwrap
|
||||
config.cache
|
||||
config.h
|
||||
config.hin
|
||||
@@ -25,44 +41,33 @@ coreutils-*.tar.gz
|
||||
coreutils-*.tar.gz.sig
|
||||
coreutils-*.tar.lzma
|
||||
coreutils-*.tar.lzma.sig
|
||||
coreutils-*.xdelta
|
||||
coreutils-*.xdelta.sig
|
||||
gnulib-tests
|
||||
lib/.cvsignore
|
||||
lib/.gitignore
|
||||
lib/arpa
|
||||
lib/binary-io.h
|
||||
lib/charset.alias
|
||||
lib/configmake.h
|
||||
lib/uniwidth/
|
||||
lib/libcoreutils.a
|
||||
lib/printf.c
|
||||
lib/progname.c
|
||||
lib/progname.h
|
||||
lib/selinux
|
||||
lib/uniwidth
|
||||
m4/.cvsignore
|
||||
m4/.gitignore
|
||||
po/*.gmo
|
||||
po/*.po
|
||||
po/.gitignore
|
||||
po/.reference
|
||||
po/LINGUAS
|
||||
po/Makefile.in
|
||||
po/Makevars
|
||||
po/POTFILES
|
||||
po/checksums
|
||||
po/coreutils.pot
|
||||
po/stamp-po
|
||||
src/version.c
|
||||
src/version.h
|
||||
stamp-h1
|
||||
tests/*/*.log
|
||||
tests/cut/Makefile.am
|
||||
tests/cut/cut-tests
|
||||
tests/head/Makefile.am
|
||||
tests/head/head-tests
|
||||
tests/join/Makefile.am
|
||||
tests/join/join-tests
|
||||
tests/pr/Makefile.am
|
||||
tests/pr/pr-tests
|
||||
tests/sort/Makefile.am
|
||||
tests/sort/sort-tests
|
||||
tests/tac/Makefile.am
|
||||
tests/tac/tac-tests
|
||||
tests/tail/Makefile.am
|
||||
tests/tail/tail-tests
|
||||
tests/test/Makefile.am
|
||||
tests/test/test-tests
|
||||
tests/tr/Makefile.am
|
||||
tests/tr/tr-tests
|
||||
tests/uniq/Makefile.am
|
||||
tests/uniq/uniq-tests
|
||||
tests/wc/Makefile.am
|
||||
tests/wc/wc-tests
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.9.92
|
||||
7.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Suppress valgrind diagnostics we don't care about.
|
||||
|
||||
# Copyright (C) 2003, 2004, 2006-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2004, 2006-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -90,3 +90,11 @@
|
||||
fun:gobble_file
|
||||
fun:main
|
||||
}
|
||||
{
|
||||
utimensat-NULL
|
||||
Memcheck:Param
|
||||
utimensat(filename)
|
||||
fun:futimens
|
||||
fun:gl_futimens
|
||||
fun:main
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
ChangeLog(-[0-9]+)?$
|
||||
^old/
|
||||
^src/c99-to-c98\.diff$
|
||||
^gl/.*
|
||||
1
.x-sc_error_message_uppercase
Normal file
1
.x-sc_error_message_uppercase
Normal file
@@ -0,0 +1 @@
|
||||
build-aux/cvsu
|
||||
@@ -1,8 +1,5 @@
|
||||
ChangeLog
|
||||
Makefile.maint
|
||||
NEWS
|
||||
config-log
|
||||
po/
|
||||
src/df.c
|
||||
src/stat.c
|
||||
tests/misc/df-P
|
||||
|
||||
@@ -1,6 +1 @@
|
||||
ChangeLog*
|
||||
Makefile.maint
|
||||
config.hin
|
||||
configure
|
||||
m4/jm-macros.m4
|
||||
src/system.h
|
||||
ChangeLog
|
||||
|
||||
1
.x-sc_po_check
Normal file
1
.x-sc_po_check
Normal file
@@ -0,0 +1 @@
|
||||
^gl/
|
||||
2
.x-sc_program_name
Normal file
2
.x-sc_program_name
Normal file
@@ -0,0 +1,2 @@
|
||||
gl/lib/randint.c
|
||||
lib/euidaccess-stat.c
|
||||
@@ -1,11 +1 @@
|
||||
^configure$
|
||||
ChangeLog
|
||||
^TODO$
|
||||
^lib/mktime\.c$
|
||||
^lib/getloadavg\.c$
|
||||
^lib/euidaccess\.c$
|
||||
^lib/euidaccess-stat\.c$
|
||||
^lib/group-member\.c$
|
||||
^Makefile\.maint$
|
||||
^doc/coreutils.texi$
|
||||
^tests/misc/stty-invalid$
|
||||
|
||||
4
.x-sc_prohibit_stat_st_blocks
Normal file
4
.x-sc_prohibit_stat_st_blocks
Normal file
@@ -0,0 +1,4 @@
|
||||
src/system.h
|
||||
tests/du/2g
|
||||
old/fileutils/ChangeLog-1997
|
||||
ChangeLog-2005
|
||||
@@ -1,2 +1 @@
|
||||
^src/system\.h
|
||||
ChangeLog
|
||||
|
||||
@@ -1,30 +1,9 @@
|
||||
^lib/at-func\.c$
|
||||
^lib/bcopy\.c$
|
||||
^lib/buffer-lcm\.c$
|
||||
^lib/c-strtold\.c$
|
||||
^lib/fnmatch_loop\.c$
|
||||
^lib/full-read\.c$
|
||||
^lib/imaxtostr\.c$
|
||||
^lib/mempcpy\.c$
|
||||
^lib/memset\.c$
|
||||
^lib/offtostr\.c$
|
||||
^lib/regcomp\.c$
|
||||
^lib/regex_internal\.c$
|
||||
^lib/regexec\.c$
|
||||
^lib/safe-write\.c$
|
||||
^lib/strtoll\.c$
|
||||
^lib/strtoul\.c$
|
||||
^lib/strtoull\.c$
|
||||
^lib/strtoumax\.c$
|
||||
^lib/umaxtostr\.c$
|
||||
^lib/xstrtold\.c$
|
||||
^lib/xstrtoul\.c$
|
||||
^src/false\.c$
|
||||
^src/lbracket\.c$
|
||||
^src/ls-dir\.c$
|
||||
^src/ls-ls\.c$
|
||||
^src/ls-vdir\.c$
|
||||
^src/rand-isaac\.c$
|
||||
^src/tac-pipe\.c$
|
||||
^src/uname-arch\.c$
|
||||
^src/uname-uname\.c$
|
||||
|
||||
9
.x-sc_require_config_h_first
Normal file
9
.x-sc_require_config_h_first
Normal file
@@ -0,0 +1,9 @@
|
||||
^lib/buffer-lcm\.c$
|
||||
^src/false\.c$
|
||||
^src/lbracket\.c$
|
||||
^src/ls-dir\.c$
|
||||
^src/ls-ls\.c$
|
||||
^src/ls-vdir\.c$
|
||||
^src/tac-pipe\.c$
|
||||
^src/uname-arch\.c$
|
||||
^src/uname-uname\.c$
|
||||
40
AUTHORS
40
AUTHORS
@@ -3,35 +3,35 @@ each followed by the name(s) of its author(s).
|
||||
|
||||
arch: David MacKenzie, Karel Zak
|
||||
base64: Simon Josefsson
|
||||
basename: FIXME unknown
|
||||
cat: Torbjorn Granlund, Richard M. Stallman
|
||||
basename: David MacKenzie
|
||||
cat: Torbjörn Granlund, Richard M. Stallman
|
||||
chcon: Russell Coker, Jim Meyering
|
||||
chgrp: David MacKenzie, Jim Meyering
|
||||
chmod: David MacKenzie, Jim Meyering
|
||||
chown: David MacKenzie, Jim Meyering
|
||||
chroot: Roland McGrath
|
||||
cksum: Q. Frank Xia
|
||||
comm: Richard Stallman, David MacKenzie
|
||||
cp: Torbjorn Granlund, David MacKenzie, Jim Meyering
|
||||
comm: Richard M. Stallman, David MacKenzie
|
||||
cp: Torbjörn Granlund, David MacKenzie, Jim Meyering
|
||||
csplit: Stuart Kemp, David MacKenzie
|
||||
cut: David Ihnat, David MacKenzie, Jim Meyering
|
||||
cut: David M. Ihnat, David MacKenzie, Jim Meyering
|
||||
date: David MacKenzie
|
||||
dd: Paul Rubin, David MacKenzie, Stuart Kemp
|
||||
df: Torbjorn Granlund, David MacKenzie, Paul Eggert
|
||||
dir: Richard Stallman, David MacKenzie
|
||||
df: Torbjörn Granlund, David MacKenzie, Paul Eggert
|
||||
dir: Richard M. Stallman, David MacKenzie
|
||||
dircolors: H. Peter Anvin
|
||||
dirname: David MacKenzie, Jim Meyering
|
||||
du: Torbjorn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
|
||||
echo: FIXME unknown
|
||||
du: Torbjörn Granlund, David MacKenzie, Paul Eggert, Jim Meyering
|
||||
echo: Brian Fox, Chet Ramey
|
||||
env: Richard Mlynarik, David MacKenzie
|
||||
expand: David MacKenzie
|
||||
expr: Mike Parker
|
||||
expr: Mike Parker, James Youngman, Paul Eggert
|
||||
factor: Paul Rubin
|
||||
false: Jim Meyering
|
||||
fmt: Ross Paterson
|
||||
fold: David MacKenzie
|
||||
ginstall: David MacKenzie
|
||||
groups: David MacKenzie
|
||||
groups: David MacKenzie, James Youngman
|
||||
head: David MacKenzie, Jim Meyering
|
||||
hostid: Jim Meyering
|
||||
hostname: Jim Meyering
|
||||
@@ -41,7 +41,7 @@ kill: Paul Eggert
|
||||
link: Michael Stone
|
||||
ln: Mike Parker, David MacKenzie
|
||||
logname: FIXME: unknown
|
||||
ls: Richard Stallman, David MacKenzie
|
||||
ls: Richard M. Stallman, David MacKenzie
|
||||
md5sum: Ulrich Drepper, Scott Miller, David Madore
|
||||
mkdir: David MacKenzie
|
||||
mkfifo: David MacKenzie
|
||||
@@ -58,10 +58,10 @@ pinky: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
|
||||
pr: Pete TerMaat, Roland Huebner
|
||||
printenv: David MacKenzie, Richard Mlynarik
|
||||
printf: David MacKenzie
|
||||
ptx: F. Pinard
|
||||
ptx: François Pinard
|
||||
pwd: Jim Meyering
|
||||
readlink: Dmitry V. Levin
|
||||
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
|
||||
rm: Paul Rubin, David MacKenzie, Richard M. Stallman, Jim Meyering
|
||||
rmdir: David MacKenzie
|
||||
runcon: Russell Coker
|
||||
seq: Ulrich Drepper
|
||||
@@ -74,7 +74,7 @@ shred: Colin Plumb
|
||||
shuf: Paul Eggert
|
||||
sleep: Jim Meyering, Paul Eggert
|
||||
sort: Mike Haertel, Paul Eggert
|
||||
split: Torbjorn Granlund, Richard M. Stallman
|
||||
split: Torbjörn Granlund, Richard M. Stallman
|
||||
stat: Michael Meskes
|
||||
stty: David MacKenzie
|
||||
su: David MacKenzie
|
||||
@@ -84,19 +84,25 @@ tac: Jay Lepreau, David MacKenzie
|
||||
tail: Paul Rubin, David MacKenzie, Ian Lance Taylor, Jim Meyering
|
||||
tee: Mike Parker, Richard M. Stallman, David MacKenzie
|
||||
test: Kevin Braunsdorf, Matthew Bradburn
|
||||
timeout: Pádraig Brady
|
||||
touch: Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, Randy Smith
|
||||
tr: Jim Meyering
|
||||
true: Jim Meyering
|
||||
truncate: Pádraig Brady
|
||||
tsort: Mark Kettenis
|
||||
tty: David MacKenzie
|
||||
uname: David MacKenzie
|
||||
unexpand: David MacKenzie
|
||||
uniq: Richard Stallman, David MacKenzie
|
||||
uniq: Richard M. Stallman, David MacKenzie
|
||||
unlink: Michael Stone
|
||||
uptime: Joseph Arceneaux, David MacKenzie, Kaveh Ghazi
|
||||
users: Joseph Arceneaux, David MacKenzie
|
||||
vdir: Richard Stallman, David MacKenzie
|
||||
vdir: Richard M. Stallman, David MacKenzie
|
||||
wc: Paul Rubin, David MacKenzie
|
||||
who: Joseph Arceneaux, David MacKenzie, Michael Stone
|
||||
whoami: Richard Mlynarik
|
||||
yes: David MacKenzie
|
||||
|
||||
;; Local Variables:
|
||||
;; coding: utf-8
|
||||
;; End:
|
||||
|
||||
605
ChangeLog-2005
605
ChangeLog-2005
@@ -1,3 +1,608 @@
|
||||
2005-12-27 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
|
||||
(sc_prohibit_assert_without_use): New rule.
|
||||
(syntax-check-rules): Add it to the list.
|
||||
* .x-sc_prohibit_assert_without_use: New empty file.
|
||||
* Makefile.am (EXTRA_DIST): Add it.
|
||||
|
||||
* Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
|
||||
|
||||
* cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
|
||||
Don't include <assert.h>; it wasn't used.
|
||||
|
||||
2005-12-26 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/chown-core.c (restricted_chown):
|
||||
Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
|
||||
* src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
|
||||
| O_NOFOLLOW too, for consistency with other dir-openers.
|
||||
Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
|
||||
(is_empty_dir): Likewise.
|
||||
* src/shred.c (wipename): Likewise. Don't bother trying to open
|
||||
dir for writing, since POSIX prohibits it.
|
||||
|
||||
2005-12-22 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/help-version: Redirect stderr to /dev/full, to suppress
|
||||
write error diagnostic.
|
||||
|
||||
2005-12-19 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
|
||||
Avoid a minor race condition when `-m MODE' is specified, by using
|
||||
open, fchown, and close rather than just chown. To do that reliably --
|
||||
even with an overly restrictive umask -- ensure that each mkdir,
|
||||
mknod and mkfifo call uses a mode including at least owner-read access.
|
||||
* src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
|
||||
the subsequent chown (or equivalent open,fchown,close) fails.
|
||||
* tests/misc/mknod: New tests.
|
||||
* tests/misc/Makefile.am (TESTS): Add mknod.
|
||||
|
||||
2005-12-17 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
|
||||
e.g., on a named pipe.
|
||||
(OPEN_NO_FOLLOW_SYMLINK): Remove definition. Use O_NOFOLLOW in
|
||||
place of all uses, since it is guaranteed (system.h) to be defined.
|
||||
|
||||
2005-12-05 Andreas Gruenbacher <agruen@suse.de>
|
||||
|
||||
Add POSIX ACL support
|
||||
* src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
|
||||
is no requirement for ACL support; particularly, it does not exist
|
||||
on systems that have POSIX ACLs.
|
||||
* src/copy.h (cp_option_init) [umask_kill]: Remove member.
|
||||
* src/cp.c (umask_kill): With default acls, the umask is not to be
|
||||
applied. Remove umask_kill, don't change the process umask, and let
|
||||
the kernel apply the umask where appropriate.
|
||||
* src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
|
||||
* src/copy.c (get_dest_mode): Remove; it is obsolete after removing
|
||||
umask_kill.
|
||||
(copy_reg, copy_internal): Use copy_acl and set_acl
|
||||
instead of fchown/chown. Fix the logic for POSIX ACLs.
|
||||
(chown_succeded): Remove; we now always copy acls and
|
||||
preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
|
||||
did a chown before or not.
|
||||
* src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
|
||||
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
|
||||
mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
|
||||
to link with it via $(LIB_ACL), for the utilities that need it.
|
||||
|
||||
2005-12-16 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
|
||||
(OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
|
||||
(fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
|
||||
value is now signified by whether cwd_errno is null.
|
||||
(fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
|
||||
pointer-to-bool to pointer-to-errno-value. All callers changed.
|
||||
(rm_1): Don't bother setting a local cwd failure flag and then
|
||||
ORing it into the caller's. Just set the caller's.
|
||||
(rm): Use cwd failure errno value to print a slightly-better
|
||||
diagnostic.
|
||||
|
||||
2005-12-15 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/stat.c (print_it): Properly handle a backslash at the
|
||||
end of a --printf format string. Reported by Paul Eggert.
|
||||
* tests/misc/stat-printf (end-bs): Add a test for the above.
|
||||
|
||||
2005-12-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
|
||||
Don't assume /etc/passwd contains user names; use 'id' instead.
|
||||
|
||||
2005-12-15 Jim Meyering <jim@meyering.net>
|
||||
|
||||
stat: revert behavior of --format=FMT (-c)
|
||||
stat: add new option: --printf=FMT
|
||||
* NEWS: Mention this.
|
||||
* src/stat.c (isodigit, octtobin, hextobin): Define.
|
||||
(PRINTF_OPTION): Define.
|
||||
(interpret_backslash_escapes, trailing_delim): New globals.
|
||||
(usage): Document them. Alphabetize on long option names.
|
||||
(print_esc_char): New function.
|
||||
(print_it): Rewrite, in order to handle backslash escapes.
|
||||
(main): Handle new option. Set globals for --format, too.
|
||||
|
||||
* tests/misc/stat-printf: Test --printf and --format.
|
||||
* tests/misc/Makefile.am (TESTS): Add stat-printf.
|
||||
|
||||
2005-12-14 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: sort now reports incompatible options.
|
||||
* src/sort.c (incompatible_options, check_ordering_compatibility):
|
||||
New functions.
|
||||
(main): Use them. Don't bother with a usage message for
|
||||
"sort -c a b", for consistency with other error diagnostics.
|
||||
* tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
|
||||
New tests.
|
||||
|
||||
* src/cat.c (main): Undo previous change. close_stdout already
|
||||
does the check, so the previous change wasn't necessary.
|
||||
|
||||
2005-12-13 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/cat.c (main): Check for close (STDOUT_FILENO) failure.
|
||||
|
||||
2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Install a more-conservative approach for sort -R. It's the
|
||||
same basic idea as the existing code, except it uses the full ISAAC
|
||||
approach (called the "more kosher" approach in the existing comments).
|
||||
This makes "sort -R" quite a bit slower (about a factor of 2 on my
|
||||
little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
|
||||
better to be conservative here at first, and review any performance
|
||||
improvements carefully.
|
||||
* .x-sc_require_config_h: Add src/rand-isaac.c.
|
||||
* src/rand-isaac.h: Remove. All uses now simply include rand-isaac.c.
|
||||
* src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
|
||||
(shred_SOURCES, sort_SOURCES): Remove.
|
||||
(EXTRA_DIST): Add rand-isaac.c.
|
||||
* src/rand-isaac.c: Revert to what used to be in shred.c, without
|
||||
changing it to allow for varying numbers of words in the state.
|
||||
Alter so that we include rand-isaac.c directly rather than
|
||||
compiling it and linking to it. Don't include config.h or
|
||||
system.h; that's the includer's responsibility.
|
||||
Omit functions that are specific to shred.
|
||||
(ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
|
||||
(isaac_step, struct irand_state):
|
||||
Resurrect these, with the same defns that used to be in shred.c.
|
||||
(ISAAC_SIZE, isaac_new, isaac_copy): Remove.
|
||||
(isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
|
||||
static again.
|
||||
(struct isaac_state, isaac_refill, isaac_mix, isaac_init):
|
||||
(isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
|
||||
(irand_init, irand32, irand_mod):
|
||||
Number of words is constant again.
|
||||
(struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
|
||||
* src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
|
||||
* src/sort.c: Likewise.
|
||||
* src/shred.c (fillrand, dopass, main): Undo previous change.
|
||||
(struct irand_state, irand_init, irand32, irand_mod): Moved back here,
|
||||
from rand-isaac.c.
|
||||
* src/sort.c: Don't include md5.h; it wasn't needed.
|
||||
(struct keyfield): Rename random_hash to random, for consistency
|
||||
with the other member names. All uses changed.
|
||||
(usage): Tweak wording to mention STRING for --seed option.
|
||||
(short_options): Rorder for consistency with other programs.
|
||||
(rand_state): Now a struct, not a pointer to one. All uses changed.
|
||||
(HASH_WORDS, HASH_SIZE): Remove.
|
||||
(get_hash): Remove comments around resbuf size, since we can assume C89.
|
||||
Use a "more-kosher" (but slower) approach of invoking isaac_refill.
|
||||
(keycompare): Adjust to the new get_hash.
|
||||
Add a FIXME.
|
||||
(badfieldspec): Omit recently-introduced comment; it isn't needed.
|
||||
(main): Don't set need_random simply because gkey has it set; that
|
||||
doesn't necessarily mean we'll need random numbers.
|
||||
Redo seeding to match new get_hash approach.
|
||||
|
||||
2005-12-10 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
|
||||
|
||||
Avoid shred segfault on 64-bit systems.
|
||||
* src/rand-isaac.c (isaac_refill): Don't try to negate a
|
||||
local of type uint32_t. Make the local an `int' instead.
|
||||
|
||||
* NEWS: Mention sort's new options.
|
||||
|
||||
* src/rand-isaac.c (isaac_mix): Declare to be static.
|
||||
Mark all other functions as `extern' so the tight-scope
|
||||
part of `make distcheck' passes once again.
|
||||
* src/rand-isaac.h (isaac_mix): Remove declaration.
|
||||
|
||||
* src/sort.c (get_hash): Change position of `*' in parameter
|
||||
type to conform with convention.
|
||||
(main): Split a long line so it fits in 80 columns.
|
||||
(keycompare): Remove stray SPACE before TAB that was
|
||||
causing `make distcheck' to fail.
|
||||
|
||||
* src/shred.c: Don't include gethrxtime.h. No longer needed.
|
||||
|
||||
* tests/misc/sort-rand: New file: basic tests for the new options.
|
||||
* tests/misc/Makefile.am (TESTS): Add sort-rand.
|
||||
|
||||
2005-12-10 Frederik Eaton <frederik@ofb.net>
|
||||
|
||||
* src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
|
||||
(shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
|
||||
* src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
|
||||
Make state size runtime-configurable.
|
||||
(isaac_new, isaac_copy): New functions.
|
||||
* src/rand-isaac.h: New file.
|
||||
* src/shred.c: Include rand-isaac.h. Move ISAAC code to rand-isaac.c.
|
||||
(fillrand, main): Adjust to the fact that the state size is now
|
||||
runtime-configurable.
|
||||
* src/sort.c (short_options, long_options, WORDS, keycompare, main):
|
||||
(usage): Add options --random-sort and --seed to implement a random
|
||||
shuffle.
|
||||
Include md5.h and rand-isaac.h.
|
||||
(get_hash): New function.
|
||||
(rand_state): New var.
|
||||
(HASH_WORDS, HASH_SIZE): New macros.
|
||||
|
||||
2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* tests/dd/misc: Add test for dd iflags=noatime.
|
||||
|
||||
2005-12-09 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/sort.c (usage): Mention white space vs -b and -t options.
|
||||
From The Wanderer.
|
||||
|
||||
2005-12-09 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* src/test.c (main): Fix misleading comment.
|
||||
|
||||
2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: Mention dd's new noatime flag.
|
||||
* src/system.h (O_NOATIME): Define to 0 if not already defined.
|
||||
* src/dd.c (flags, usage): Add support for noatime flag.
|
||||
|
||||
2005-12-07 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Distribute the cvsu script, used only by `make syntax-check'.
|
||||
* Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
|
||||
* Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
|
||||
distribute a copy of this script.
|
||||
* .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
|
||||
|
||||
* tests/mv/acl: exit-77 before the trap, not after, if we fail
|
||||
to create a temporary directory on another partition.
|
||||
From Andreas Gruenbacher.
|
||||
|
||||
2005-12-06 Tomas Pospisek <tpo@sourcepole.ch> (tiny change)
|
||||
|
||||
* man/basename.x: Cross-reference to dirname and readlink.
|
||||
* man/dirname.x: Cross-reference to basename and readlink.
|
||||
|
||||
2005-12-05 Andreas Gruenbacher
|
||||
|
||||
* src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
|
||||
(set_owner, preserve_author): New functions, factored out of copy_reg.
|
||||
(copy_reg): Use them.
|
||||
(copy_internal): Use them here, too.
|
||||
|
||||
2005-12-04 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/sleep.c (usage): Say what happens with two or more arguments.
|
||||
Suggested by Justin Pryzby.
|
||||
|
||||
* src/uptime.c (print_uptime): Move decl of `upsecs' into scope
|
||||
where it's used.
|
||||
|
||||
2005-12-03 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/rm.c (long_opts): Change the name of each undocumented, for-
|
||||
testing-only option to start with `-', so that it cannot render
|
||||
ambiguous any prefix it happens to share with some other option name.
|
||||
Problem reported by Eric Blake.
|
||||
* src/head.c (long_options): Likewise.
|
||||
* src/tail.c (long_options): Likewise.
|
||||
|
||||
* tests/misc/head-elide-tail: Update uses of undocumented, for-
|
||||
testing-only --presume* options to start with `---'.
|
||||
* tests/rm/dangling-symlink: Likewise.
|
||||
* tests/rm/dir-no-w: Likewise.
|
||||
* tests/rm/isatty: Likewise.
|
||||
|
||||
2005-11-30 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* Makefile.maint: Add a comment about cvsu.
|
||||
|
||||
2005-11-25 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: df updates for "none", "proc", inaccessible file systems.
|
||||
* src/df.c (show_point): Ignore inaccessible file systems.
|
||||
(usage): -a includes dummy file systems, not size-0 file systems.
|
||||
|
||||
* src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
|
||||
to avoid collision with POSIX name space. All uses changed.
|
||||
|
||||
2005-11-24 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/Makefile.am (EXTRA_DIST): Add acl to the list.
|
||||
* tests/acl: Add `$0: ' prefix to diagnostics.
|
||||
|
||||
* .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
|
||||
|
||||
2005-11-23 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/copy.c: Improve performance a bit by optimizing away
|
||||
unnecessary system calls and going to a block size of at least
|
||||
8192 (on normal hosts, anyway). This improved performance 5% on my
|
||||
Debian stable host (2.4.27 kernel, x86, copying from root
|
||||
ext3 file system to itself).
|
||||
Include "buffer-lcm.h".
|
||||
(copy_reg): Omit last argument. All callers changed.
|
||||
Use xmalloc to allocate rather than trusting alloca
|
||||
(which is unwise with large block sizes).
|
||||
Declare locals more locally, if possible.
|
||||
Use uintptr_t words instead of int words, for a bit more speed
|
||||
when looking for null blocks on 64-bit hosts.
|
||||
Optimize away reads of zero bytes on regular files.
|
||||
In the typical case, insist on 8 KiB buffers, at least.
|
||||
Avoid unnecessary extra call to fstat when checking for sparse files.
|
||||
Avoid now-unnecessary cast to off_t, and "0L".
|
||||
Avoid unnecessary test of *new_dst when checking for same owner
|
||||
and group.
|
||||
|
||||
2005-11-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/remove.c (rm): Don't assume C99 for-loop syntax.
|
||||
|
||||
2005-11-22 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/remove.c (AD_push): Remove debugging cruft.
|
||||
|
||||
* tests/rm/unread2 (rm): Change expected diagnostic,
|
||||
`cannot open directory' to `cannot remove', to align with
|
||||
new version of rm.
|
||||
* tests/rm/rm2: Ensure that rm now continues removing entries
|
||||
even after certain types of failure.
|
||||
|
||||
* src/remove.c: Rewrite. Now, this module is reentrant on systems
|
||||
that provide openat (Solaris), and on systems like Linux+procfs
|
||||
where our openat emulation code is reentrant. This also fixes a
|
||||
few low-probability leaks and eliminates some code that could,
|
||||
in very unusual circumstances, cause rm() (via a callee) to exit.
|
||||
* NEWS: Mention this.
|
||||
|
||||
* configure.ac: Put copyright dates all on one line so the
|
||||
emacs function that updates them works properly.
|
||||
|
||||
2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* configure.ac (AM_PROG_CC_C_O): Add. Needed for CVS Automake.
|
||||
Problem reported by Eric Blake.
|
||||
(AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
|
||||
we get a standard-conforming compiler. This relies on the new
|
||||
m4/c.m4 file. Note that it's a bit tricky, since c.m4 doesn't
|
||||
define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
|
||||
m4/c.m4 can go away with Autoconf 2.60 comes out.
|
||||
|
||||
2005-11-17 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
|
||||
(AD_mark_current_as_unremovable): Likewise, but for a local.
|
||||
(rm_1): Likewise.
|
||||
|
||||
* tests/mv/acl: Let traps handle removing temporary directories.
|
||||
|
||||
Expect acl-related tests to fail, until the corresponding
|
||||
patches are committed.
|
||||
* tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
|
||||
* tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
|
||||
|
||||
ACL tests, from Andreas Gruenbacher.
|
||||
* tests/acl, tests/mv/acl, tests/cp/acl: New files.
|
||||
* tests/mv/Makefile.am (TESTS): Add acl.
|
||||
* tests/cp/Makefile.am (TESTS): Add acl.
|
||||
|
||||
* src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
|
||||
|
||||
2005-11-16 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: Improve quality of ln's diagnostics.
|
||||
* src/ln.c (do_link, usage): Likewise.
|
||||
(do_link): Don't use alloca on a buffer of unbounded size.
|
||||
|
||||
2005-11-16 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/cp/fail-perm: Accommodate HPUX. It appears to fail
|
||||
with EACCES rather than EPERM. Reported by Peter O'Gorman here:
|
||||
http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
|
||||
This also affects AIX 4.3.3, according to Ralf Wildenhues, in
|
||||
http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
|
||||
|
||||
2005-11-14 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
|
||||
|
||||
2005-11-13 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* announce-gen: Accept new option, --gpg-key-id=ID and
|
||||
emit a blurb telling how to use the .sig files.
|
||||
* Makefile.cfg (gpg_key_ID): Define.
|
||||
* Makefile.maint (announcement): Use new option and key.
|
||||
|
||||
Require that most .c files include <config.h>.
|
||||
* Makefile.maint (sc_require_config_h): New rule.
|
||||
(syntax-check-rules): Add it.
|
||||
* .x-sc_require_config_h: New file listing exceptions to the
|
||||
above rule. Some are legit, others are simply grandfathered in.
|
||||
* Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
|
||||
|
||||
2005-11-12 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
|
||||
|
||||
2005-11-11 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
|
||||
Mention new readlink options in 5.3.0's `New features' section.
|
||||
Spotted by Thomas Hood.
|
||||
|
||||
2005-11-08 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* NEWS: Merge in changes from b5_9x branch.
|
||||
|
||||
2005-11-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: ls now defaults to --time-style='locale', which in turn acts
|
||||
like --time-style='posix-long-iso' if the locale settings are messed up.
|
||||
* src/ls.c (decode_switches): Implement this.
|
||||
|
||||
2005-11-08 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/du/2g: s/expensive/very expensive/ in a comment.
|
||||
From Paul Townsend.
|
||||
|
||||
2005-10-17 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* src/ls.c (usage): Fix descriptions of --sort, --time.
|
||||
Reported by Vitaly A. Ostanin.
|
||||
|
||||
2005-11-04 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/ln.c: Include filenamecat.c.
|
||||
(FILE_BASENAME_CONCAT): Remove.
|
||||
(do_link): Remove last arg DEST_IS_DIR. All callers changed.
|
||||
(main): Use file_name_concat, base_name, and strip_trailing_slashes
|
||||
instead of FILE_BASENAME_CONCAT. This simplifies the code, and avoids
|
||||
the use of alloca.
|
||||
|
||||
2005-11-04 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/du.c (process_file): Don't overflow for files of size >= 2^31
|
||||
on systems with stat.st_blocks of a signed 32-bit type.
|
||||
This bug causes trouble on some AIX 5.1 systems.
|
||||
Report and trivial patch from Paul Townsend:
|
||||
<http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
|
||||
* NEWS: Mention this.
|
||||
|
||||
* tests/du/2g: New (very-expensive) test for the above-fixed bug.
|
||||
* tests/du/Makefile.am (TESTS): Add it here.
|
||||
* tests/very-expensive: New file.
|
||||
* tests/Makefile.am (EXTRA_DIST): Add it here.
|
||||
* tests/cp/perm: Mark this test as `very-expensive', too.
|
||||
|
||||
2005-11-02 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: Mention that rm -d and maybe ln -d are scheduled for
|
||||
removal in 2006.
|
||||
* src/remove.h (struct rm_options): Remove unlink_dirs. All uses
|
||||
removed.
|
||||
* src/rm.c (usage): Don't mention rm -d.
|
||||
|
||||
2005-11-02 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
|
||||
From Andreas Schwab.
|
||||
|
||||
* tests/dd/unblock-sync: Redirect stderr to /dev/null so the
|
||||
`M+N records in/out' lines don't pollute `make check' output.
|
||||
|
||||
* tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
|
||||
fixed on 2005-10-31. This test uses the new, IN_PIPE specifier.
|
||||
* tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
|
||||
to indicate that the input file should be piped into the command
|
||||
under test (via `cat FILE | $prog ...').
|
||||
|
||||
* src/remove.c (remove_entry): Emit a better diagnostic when rm
|
||||
(without -r) fails to remove a directory on a non-Linux system.
|
||||
This change affects only newer Solaris systems (with priv_*
|
||||
functions like priv_allocset). Reported by Keith Thompson.
|
||||
|
||||
* tests/rm/dir-nonrecur: New file/test for the above fix.
|
||||
* tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
|
||||
|
||||
2005-11-01 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
|
||||
POSIX 1002.1-2001 requires.
|
||||
* src/tail.c (parse_obsolete_option): Implement this.
|
||||
Problem reported by Vincent Lefevre.
|
||||
* src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
|
||||
* tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
|
||||
(test_vector): Add special cases for _POSIX2_VERSION, and
|
||||
regularize the old ones a bit.
|
||||
* tests/touch/obsolescent: Add y2000 test.
|
||||
|
||||
2005-10-31 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/dd.c (skip): Fix off-by-one error reported by
|
||||
Theodoros V. Kalamatianos.
|
||||
|
||||
2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* tests/mkdir/p-3: Require that the test be run as non-root.
|
||||
Problem and trivial fix reported by Theodoros V. Kalamatianos.
|
||||
|
||||
2005-10-28 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
|
||||
boundary between DEST and SOURCE in the result.
|
||||
|
||||
2005-10-26 Dmitry V. Levin <ldv@altlinux.org>
|
||||
|
||||
* src/md5sum.c (main) [!O_BINARY]: Changed default read mode
|
||||
back to text, to sync with documentation and for backwards
|
||||
compatibility.
|
||||
|
||||
2005-10-25 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tests/dircolors/simple (other-wr): Add an explicit test for
|
||||
the dircolors bug (NULL-dereference) fixed yesterday.
|
||||
|
||||
2005-10-24 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/tac.c (tac_file): When determining whether a file is seekable,
|
||||
also test whether it is a tty. Using only the lseek-based test would
|
||||
give a false positive on Solaris. Reported by Peter Fales.
|
||||
|
||||
2005-10-24 Dmitry V. Levin <ldv@altlinux.org>
|
||||
|
||||
* tests/install/d-slashdot: New test, for "install -d" failure.
|
||||
* tests/install/Makefile.am (TESTS): Add d-slashdot.
|
||||
* tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
|
||||
* tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
|
||||
|
||||
2005-10-24 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/dircolors.c (ls_codes): Add missing comma.
|
||||
Anonymous report and patch from
|
||||
http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
|
||||
|
||||
* src/dircolors.c: Add compile-time assertion that the slack_codes
|
||||
and ls_codes arrays have the same number of elements. This would
|
||||
have prevented the above-fixed bug.
|
||||
|
||||
* src/expand.c (parse_tab_stops): Add a comment to make this function
|
||||
identical to the one in unexpand.c.
|
||||
* src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
|
||||
identical to the one in expand.c.
|
||||
|
||||
* src/expand.c (next_file): Don't assume fopen cannot return stdin.
|
||||
|
||||
2005-10-23 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* src/md5sum.c (digest_check, main): Use ptr_align rather than
|
||||
a dangerous pointer-value-to-`unsigned' cast.
|
||||
* NEWS: mention the new sha* programs.
|
||||
* AUTHORS: Add new sha* programs.
|
||||
|
||||
2005-08-28 David Madore <david.madore@ens.fr>
|
||||
|
||||
Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
|
||||
* README: Add their names to the list.
|
||||
* src/md5sum.c: Provide framework for computing sha-2 hashes.
|
||||
* src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
|
||||
Rules for compiling sha-2 utilities
|
||||
(noinst_HEADERS): Remove checksum.h.
|
||||
* man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
|
||||
New files.
|
||||
* man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
|
||||
(sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
|
||||
* tests/misc/sha224sum, tests/misc/sha256sum: New files.
|
||||
* tests/misc/sha384sum, tests/misc/sha512sum: New files.
|
||||
* tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
|
||||
sha384sum, sha512sum test scripts here rather that each in its
|
||||
own directory.
|
||||
|
||||
2005-08-28 David Madore <david.madore@ens.fr>
|
||||
|
||||
* tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
|
||||
of the FIPS test vectors).
|
||||
|
||||
2005-10-23 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* configure.ac: Use 6.0-cvs as the version string.
|
||||
* NEWS: Adjust accordingly.
|
||||
|
||||
2005-10-22 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* Version 5.92.
|
||||
|
||||
4040
ChangeLog-2006
Normal file
4040
ChangeLog-2006
Normal file
File diff suppressed because it is too large
Load Diff
4022
ChangeLog-2007
Normal file
4022
ChangeLog-2007
Normal file
File diff suppressed because it is too large
Load Diff
379
ChangeLog-2008
Normal file
379
ChangeLog-2008
Normal file
@@ -0,0 +1,379 @@
|
||||
2008-12-16 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
NB: ChangeLog files are no longer manually maintained.
|
||||
See HACKING for details.
|
||||
|
||||
2008-02-07 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
We *do* need two different version files.
|
||||
One for tarball-only, the other to be updated any time we
|
||||
get a new value of $(VERSION).
|
||||
* Makefile.am (dist-hook): Create .tarball-version in dist tarball.
|
||||
* GNUmakefile (_curr-ver): Make git-version-gen use it.
|
||||
* .gitignore: Ignore it.
|
||||
|
||||
Fix a typo in description of size suffixes: s/GB/G/.
|
||||
* doc/coreutils.texi (od invocation, head invocation, tail invocation):
|
||||
Spotted by Bert Wesarg.
|
||||
|
||||
* NEWS [6.9.90]: Mention the added feature that head, od, split and
|
||||
tail now accept the standard size suffixes (kB, M, MB, G, GB, and
|
||||
so on for T, P, Y, Z, and Y) on arguments to selected options.
|
||||
|
||||
2008-02-06 Steven Schubiger <schubiger@gmail.com>
|
||||
|
||||
mkdir, split: write --verbose output to stdout, not stderr.
|
||||
* src/mkdir.c (verbose_output): New function.
|
||||
(announce_mkdir): Use it.
|
||||
* src/split.c (usage): Update.
|
||||
* src/split.c (cwrite): Write to stdout, not stderr.
|
||||
* doc/coreutils.texi (split invocation): Remove the mention
|
||||
of --verbose output being printed to stderr.
|
||||
* tests/mkdir/p-v: Redirect stdout, not stderr.
|
||||
* tests/misc/split-a: Likewise.
|
||||
* NEWS: Mention this change.
|
||||
* TODO: Remove this item.
|
||||
|
||||
2008-02-04 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* Makefile.maint (announcement): Remove stale comment.
|
||||
|
||||
2008-02-02 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Clarify a comment.
|
||||
* tests/sort/Test.pm: Replace a vague ChangeLog reference with a URL.
|
||||
|
||||
2008-01-31 Bob Proulx <bob@proulx.com>
|
||||
|
||||
Improve wording of date and time man page.
|
||||
* man/date.x: Improve compact description of the --date=STRING.
|
||||
* man/touch.x: Likewise.
|
||||
Suggested by A. Costa.
|
||||
|
||||
2008-01-31 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Remove alignment constraint from the sha*_read_ctx functions.
|
||||
* lib/sha256.c (set_uint32): New function.
|
||||
(sha256_read_ctx, sha224_read_ctx): Use it.
|
||||
* lib/sha512.c (set_uint64): New function.
|
||||
(sha512_read_ctx, sha384_read_ctx): Use it.
|
||||
* lib/sha256.h: Remove warning about alignment constraint.
|
||||
* lib/sha512.h: Likewise.
|
||||
Prompted by similar changes in gnulib's sha1 and md[45] modules.
|
||||
|
||||
Adapt to new version of vc-list-files.
|
||||
* tests/check.mk (vc_exe_in_TESTS): Adapt to new constraint
|
||||
that vc-list-files be run only from $(top_srcdir).
|
||||
|
||||
Pull vc-list-files from gnulib.
|
||||
* bootstrap.conf (gnulib_modules): Add vc-list-files.
|
||||
* build-aux/vc-list-files: Remove file.
|
||||
|
||||
Improve the cp/parent-perm test.
|
||||
* tests/cp/parent-perm: Also check that perms of existing dest
|
||||
dirs are changed to match those of corresponding src dir
|
||||
|
||||
2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Don't modify argv in dd due to ',' in arguments.
|
||||
* src/dd.c: Include quotearg.h.
|
||||
(operand_matches): New function.
|
||||
(parse_symbols, operand_is): Use it.
|
||||
(parse_symbols): 1st arg is now const pointer. Don't modify it.
|
||||
msgid arg is now just the message, not a format.
|
||||
(scanargs): Add some 'const's to check for problems like the above.
|
||||
|
||||
2008-01-30 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* src/c99-to-c89.diff: Adjust remove.c offsets, again.
|
||||
|
||||
Now that system.h defines is_empty_dir, include "openat.h".
|
||||
* src/system.h: Include "openat.h" here, ...
|
||||
* src/chcon.c: ... not here.
|
||||
* src/chmod.c: Likewise.
|
||||
* src/chown-core.c: Likewise.
|
||||
* src/remove.c: Likewise.
|
||||
|
||||
* src/c99-to-c89.diff: Adjust remove.c offsets.
|
||||
|
||||
Improve "rmdir --ignore-fail-on-non-empty"
|
||||
* src/rmdir.c (remove_parents, main): With --ignore-fail-on-non-empty,
|
||||
suppress a diagnostic also for other errno values, which can arise
|
||||
with read-only media or when the parent directory has the immutable
|
||||
attribute (set via chattr +i).
|
||||
(errno_may_be_empty, ignorable_failure): New functions.
|
||||
* src/remove.c (is_empty_dir): Move function to ...
|
||||
* src/system.h (is_empty_dir): ...here, and make it inline.
|
||||
Suggested by Josselin Mouette in <http://bugs.debian.org/363011>
|
||||
via Bob Proulx.
|
||||
* NEWS: Mention the improvement.
|
||||
|
||||
2008-01-29 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Don't modify argv in dd.
|
||||
* src/dd.c (operand_is): New function.
|
||||
(scanargs): Use it so that we don't need to modify argv, as a nicety.
|
||||
Problem reported by Adam Goode in
|
||||
<http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00264.html>.
|
||||
|
||||
2008-01-29 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* Makefile.am (BUILT_SOURCES): Ensure that .version exists.
|
||||
Reported by Bob Proulx.
|
||||
|
||||
2008-01-29 Bob Proulx <bob@proulx.com>
|
||||
|
||||
Improve the man pages of --date=STRING for 'date' and 'touch'.
|
||||
* man/date.x: Add a compact description of the --date=STRING.
|
||||
* man/touch.x: Likewise.
|
||||
Reported by A. Costa in http://bugs.debian.org/363011
|
||||
|
||||
2008-01-29 Michael Stone <mstone@debian.org>
|
||||
|
||||
Improve the description of when dd outputs its final statistics.
|
||||
* doc/coreutils.texi (dd invocation): Say that dd prints stats
|
||||
upon normal termination and upon SIGINT.
|
||||
|
||||
2008-01-29 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Avoid "make distcheck" failure: newly-created man/*.1 files not removed
|
||||
* Makefile.am (EXTRA_DIST): Add .version.
|
||||
(.version): New rule.
|
||||
(dist-hook): Don't create $(distdir)/.version here, now that it's
|
||||
being distributed.
|
||||
* man/Makefile.am (common_dep): Use ../.version, not ../VERSION.
|
||||
(../VERSION): Remove rule.
|
||||
* GNUmakefile (dummy): Create .version, not VERSION.
|
||||
Add an extra "...:= $(shell..." statement to ensure that
|
||||
.version exists even when the preceding code is not run.
|
||||
* .gitignore: Remove both .version and VERSION.
|
||||
|
||||
ls: don't segfault on files in /proc with an old libselinux
|
||||
* src/ls.c (gobble_file): Work around a bug in libselinux1-2.0.15
|
||||
whereby getfilecon returns 0 yet sets the context to NULL.
|
||||
Reported by Jan Moringen via Michael Stone in
|
||||
http://bugs.debian.org/463043
|
||||
* tests/ls/Makefile.am (TESTS): Add proc-selinux-segfault.
|
||||
* tests/ls/proc-selinux-segfault: Test for the above fix.
|
||||
* NEWS: Mention the fix.
|
||||
|
||||
2008-01-26 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Work around Darwin9's set-GID-like group ownership inheritance.
|
||||
This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
|
||||
* tests/cp/preserve-gid: Accept a group ID of 0, as well.
|
||||
Reported by Elias Pipping.
|
||||
|
||||
Emit "info coreutils 'PROG invocation'" into the man page,
|
||||
rather than just "info PROG". The latter would often fail
|
||||
or simply display the man page.
|
||||
* man/help2man: Change the template.
|
||||
Prompted by http://bugs.debian.org/399684
|
||||
|
||||
chcon: correct description of --no-dereference (-h) option.
|
||||
* src/chcon.c (usage): Remove invalid reference to lchown.
|
||||
Reported by Göran Uddeborg.
|
||||
|
||||
Ensure that each version string change propagates to man pages.
|
||||
* man/Makefile.am (common_dep): Don't depend on configure.ac for
|
||||
version changes. Instead, depend on ../VERSION.
|
||||
(../VERSION): New rule.
|
||||
* Makefile.am (DISTCLEANFILES): Define.
|
||||
* GNUmakefile: Update ./VERSION.
|
||||
* .gitignore: List VERSION.
|
||||
Reported by Sven Joachim.
|
||||
|
||||
Avoid cp/preserve-gid test failure on Mac OS 10.5.1 (Darwin 9.1)
|
||||
* tests/cp/preserve-gid: Set group as well as owner on ".".
|
||||
Reported by Elias Pipping.
|
||||
|
||||
Improve a warning about non-portable "mv" usage.
|
||||
* doc/coreutils.texi (mv invocation): Adjust the warning: moving a
|
||||
dir-symlink-specified-with-a-trailing-slash works in a surprising
|
||||
manner only on some systems. Reported by Tomas Pospisek in
|
||||
http://bugs.debian.org/343652.
|
||||
|
||||
2008-01-26 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* src/dircolors.hin (TERM): Add jfbterm.
|
||||
|
||||
2008-01-23 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Clean up build-related rules.
|
||||
* Makefile.cfg (gnulib_dir): Update comment.
|
||||
* Makefile.maint (announcement) [cl_date, utc_date]: Don't set
|
||||
now-unused variables.
|
||||
|
||||
* TODO: Update the note on getgrouplist.
|
||||
|
||||
2008-01-23 Zvi Har'El <rl@math.technion.ac.il>
|
||||
|
||||
Add a ";", so "make install" works with --enable-install-program=su.
|
||||
* src/Makefile.am (install_su): Add a semicolon. (tiny change)
|
||||
|
||||
2008-01-23 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Avoid misinterpreting mgetgroups failure in running root-only tests.
|
||||
* src/setuidgid.c (main): Don't misinterpret as size_t an error
|
||||
return from mgetgroups. Reported by Theodoros V. Kalamatianos.
|
||||
|
||||
* README: Remove/convert a few stray mentions of CVS.
|
||||
|
||||
2008-01-22 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Require automake-1.10.1, for its support of dist-lzma.
|
||||
* configure.ac (AM_INIT_AUTOMAKE): Require 1.10.1.
|
||||
|
||||
Version 6.10.
|
||||
|
||||
* NEWS: Record release date.
|
||||
|
||||
* README-hacking: Update to reflect existence of automake-1.10.1.
|
||||
|
||||
2008-01-18 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Update README.
|
||||
* README: Remove a note about failing tests on SunOS 4.
|
||||
On Mac OS 10.5.1 (Darwin 9.1), you'll need --disable-acl.
|
||||
(Running tests as root): Recommend using "check-root", not "check".
|
||||
|
||||
2008-01-17 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Do not define-away __attribute__ when __STRICT_ANSI__ is set.
|
||||
* src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
|
||||
It has been unnecessary since approximately gcc-2.6, and now, leaving
|
||||
it would cause gcc -Werror -ansi to fail to compile csplit.c.
|
||||
* gl/lib/randread.c (__attribute__): Likewise.
|
||||
|
||||
2008-01-16 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* NEWS: Mention the configure.ac fix.
|
||||
|
||||
* TODO: Add an introduction.
|
||||
Remove a few entries. Update a few others.
|
||||
|
||||
2008-01-13 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Remove each output redirection target before writing to it.
|
||||
* tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_,
|
||||
in case they exist beforehand and are not writable.
|
||||
* build-aux/check.mk (am__check_pre): Likewise, remove $@-t.
|
||||
|
||||
2008-01-13 Elias Pipping <pipping@gentoo.org>
|
||||
|
||||
* configure.ac: Correct a non-portable use of sed.
|
||||
|
||||
2008-01-12 Mike Frysinger <vapier@gentoo.org>
|
||||
|
||||
* src/dircolors.hin (image formats): Add the .svg suffix.
|
||||
|
||||
2008-01-12 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Use new version of announce-gen.
|
||||
* Makefile.maint (announcement): Remove use of the
|
||||
--gnulib-snapshot-time-stamp option.
|
||||
Use new --gnulib-version option instead.
|
||||
(gnulib-version): New variable.
|
||||
|
||||
2008-01-11 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* Version 6.9.92.
|
||||
|
||||
* tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
|
||||
Suggestions from James Youngman and Pádraig Brady in
|
||||
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227
|
||||
|
||||
2008-01-10 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* README-hacking: Add Git to the list of required tools.
|
||||
|
||||
2008-01-08 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix a minor race condition when using cp -p --parents.
|
||||
* src/cp.c (make_dir_parents_private): If stat fails on the parent
|
||||
directory, do not add it to the list of directories whose modes
|
||||
might need fixing later. Also, do not bother invoking 'stat'
|
||||
unless the stat results might be needed later.
|
||||
|
||||
2008-01-08 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
parent-perm: avoid a bizarre test failure.
|
||||
* tests/cp/parent-perm: Accommodate the situation in which
|
||||
chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.
|
||||
|
||||
Remove uses of now-undefined Makefile variable.
|
||||
* src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
|
||||
of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
|
||||
|
||||
2008-01-07 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
cp (but not copy.c): plug a small leak.
|
||||
* src/cp.c (do_copy) [--parents]: Free the attribute list.
|
||||
|
||||
Make a racy test failure less likely to happen.
|
||||
* tests/misc/tty-eof: Uncomment a debug "warn".
|
||||
This change happens to make this test far less likely to fail.
|
||||
With that statement commented out, this test would fail about
|
||||
20% of the time on my desktop. Now, it's gone 100 iterations
|
||||
in a row with no failure.
|
||||
|
||||
* NEWS: Mention the cp bug fix.
|
||||
|
||||
2008-01-07 Jan Blunck <jblunck@suse.de>
|
||||
|
||||
cp --parents: don't use uninitialized memory when restoring permissions
|
||||
* src/cp.c (make_dir_parents_private): Always stat each source
|
||||
directory, in case its permissions are required in re_protect,
|
||||
when setting permissions of a just-created destination directory.
|
||||
|
||||
2008-01-07 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
cp: add a test for today's bug fix.
|
||||
* tests/cp/parent-perm: New script. Test today's change.
|
||||
Based on reproducer from Jan Blunck.
|
||||
* tests/cp/Makefile.am (TESTS): Add parent-perm.
|
||||
|
||||
2008-01-06 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
touch: add a test for today's change.
|
||||
* tests/touch/now-owned-by-other: New script. Test today's change.
|
||||
* tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
|
||||
* tests/Makefile.am (all_t): Add td, a new root-only test.
|
||||
(td): New target.
|
||||
* NEWS: Mention the improvement.
|
||||
|
||||
2008-01-06 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
touch: ignore "-d now" option, when appropriate
|
||||
* src/touch.c (main): Treat "-d now" as if it were absent, if
|
||||
neither -a nor -m is specified. Problem reported by Dan Jacobson in:
|
||||
http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
|
||||
|
||||
2008-01-05 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Avoid tr case-conversion failure in some locales.
|
||||
* src/tr.c (skip_construct): New function.
|
||||
(main): When processing a pair of case-converting classes, don't
|
||||
iterate through the elements of each [:upper:] or [:lower:] class.
|
||||
Reported by Gerald Pfeifer in
|
||||
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
|
||||
* tests/tr/Test.pm [tolower-F]: New test for the above fix.
|
||||
[upcase-xtra, dncase-xtra]: New tests, for a related code path.
|
||||
* NEWS: Mention the tr bug fix.
|
||||
|
||||
2008-01-02 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* .gitignore: Ignore lzma-compressed files, too.
|
||||
|
||||
Update copyright date.
|
||||
* tests/sample-test: Likewise.
|
||||
* doc/coreutils.texi: Likewise.
|
||||
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
Copying and distribution of this file, with or without
|
||||
modification, are permitted provided the copyright notice
|
||||
and this notice are preserved.
|
||||
71
GNUmakefile
71
GNUmakefile
@@ -1,71 +0,0 @@
|
||||
# Having a separate GNUmakefile lets me `include' the dynamically
|
||||
# generated rules created via Makefile.maint as well as Makefile.maint itself.
|
||||
# This makefile is used only if you run GNU Make.
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
# Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Systems where /bin/sh is not the default shell need this. The $(shell)
|
||||
# command below won't work with e.g. stock DOS/Windows shells.
|
||||
ifeq ($(wildcard /bin/s[h]),/bin/sh)
|
||||
SHELL = /bin/sh
|
||||
else
|
||||
# will be used only with the next shell-test line, then overwritten
|
||||
# by a configured-in value
|
||||
SHELL = sh
|
||||
endif
|
||||
|
||||
have-Makefile := $(shell test -f Makefile && echo yes)
|
||||
|
||||
# If the user runs GNU make but has not yet run ./configure,
|
||||
# give them a diagnostic.
|
||||
ifeq ($(have-Makefile),yes)
|
||||
|
||||
# Make tar archive easier to reproduce.
|
||||
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
||||
|
||||
include Makefile
|
||||
|
||||
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
||||
# for others: running autoreconf and recompiling everything isn't cheap.
|
||||
ifeq (0,$(MAKELEVEL))
|
||||
_is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
|
||||
ifneq (,$(_is-dist-target))
|
||||
_curr-ver := $(shell build-aux/git-version-gen .version)
|
||||
ifneq ($(_curr-ver),$(VERSION))
|
||||
$(info INFO: running autoreconf for new version string: $(_curr-ver))
|
||||
dummy := $(shell rm -rf autom4te.cache; autoreconf)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
include $(srcdir)/Makefile.cfg
|
||||
include $(srcdir)/Makefile.maint
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
@echo There seems to be no Makefile in this directory. 1>&2
|
||||
@echo "You must run ./configure before running \`make'." 1>&2
|
||||
@exit 1
|
||||
|
||||
endif
|
||||
|
||||
# Tell version 3.79 and up of GNU make to not build goals in this
|
||||
# directory in parallel. This is necessary in case someone tries to
|
||||
# build multiple targets on one command line.
|
||||
.NOTPARALLEL:
|
||||
425
HACKING
Normal file
425
HACKING
Normal file
@@ -0,0 +1,425 @@
|
||||
Coreutils Contribution Guidelines
|
||||
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
You will need the "git" version control tools.
|
||||
On Fedora-based systems, do "yum install git".
|
||||
On Debian-based ones install the "git-core" package.
|
||||
Then run "git --version". If that says it's older than
|
||||
version 1.4.4, then you'd do well to get a newer version.
|
||||
At worst, just download the latest stable release from
|
||||
http://git.or.cz/ and build from source.
|
||||
|
||||
For details on building the programs in this package, see
|
||||
the file, README-hacking.
|
||||
|
||||
|
||||
Use the latest upstream sources
|
||||
===============================
|
||||
Base any changes you make on the latest upstream sources.
|
||||
You can get a copy of the latest with this command:
|
||||
|
||||
git clone git://git.sv.gnu.org/coreutils
|
||||
|
||||
That downloads the entire repository, including revision control history
|
||||
dating back to 1991. The repository (the part you download, and which
|
||||
resides in coreutils/.git) currently weighs in at about 30MB. So you
|
||||
don't want to download it more often than necessary. Once downloaded,
|
||||
you can get incremental updates by running one of these commands from
|
||||
inside your new coreutils/ directory:
|
||||
|
||||
If you have made *no* changes:
|
||||
git pull
|
||||
|
||||
If you *have* made changes and mistakenly committed them to "master",
|
||||
do the following to put your changes on a private branch, "br", and
|
||||
to restore master to its unmodified (relative-to-upstream) state:
|
||||
git checkout -b br
|
||||
git checkout master
|
||||
git reset --hard origin
|
||||
|
||||
Then "git pull" should work.
|
||||
|
||||
|
||||
*Before* you commit changes
|
||||
===========================
|
||||
|
||||
In this project, we much prefer patches that automatically record
|
||||
authorship. That is important not just to give credit where due, but
|
||||
also from a legal standpoint (see below). To create author-annotated
|
||||
patches with git, you must first tell git who you are. That information
|
||||
is best recorded in your ~/.gitconfig file. Edit that file, creating
|
||||
it if needed, and put your name and email address in place of these
|
||||
example values:
|
||||
|
||||
[user]
|
||||
name = Joe X. User
|
||||
email = joe.user@example.com
|
||||
|
||||
|
||||
Your first commit: the quick and dirty way
|
||||
==========================================
|
||||
First of all, realize that to "commit" a change in git is a purely
|
||||
local operation. It affects only the local repository (the .git/ dir)
|
||||
in your current coreutils/ hierarchy.
|
||||
|
||||
To try this out, modify a file or two. If you create a new file, you'll
|
||||
need to tell git about it with "git add new-file.c". Commit all changes
|
||||
with "git commit -a". That prompts you for a log message, which should
|
||||
include a one-line summary, a blank line, and ChangeLog-style entries
|
||||
for all affected files. More on that below.
|
||||
|
||||
Once your change is committed, you can create a proper patch that includes
|
||||
a log message and authorship information as well as any permissions
|
||||
changes. Use this command to save that single, most-recent change set:
|
||||
|
||||
git format-patch --stdout -1 > DIFF
|
||||
|
||||
The trouble with this approach is that you've just checked in a change
|
||||
(remember, it's only local) on the "master" branch, and that's where new
|
||||
changes would normally appear when you pull the latest from "upstream".
|
||||
When you "pull" from a remote repository to get the latest, your local
|
||||
changes on "master" may well induce conflicts. For this reason, you
|
||||
may want to keep "master" free of any local changes, so that you can
|
||||
use it to track unadulterated upstream sources.
|
||||
|
||||
However, if your cloned directory is for a one-shot patch submission and
|
||||
you're going to remove it right afterwards, then this approach is fine.
|
||||
Otherwise, for a more sustainable (and more generally useful, IMHO)
|
||||
process, read on about "topic" branches.
|
||||
|
||||
|
||||
Make your changes on a private "topic" branch
|
||||
=============================================
|
||||
So you checked out coreutils like this:
|
||||
|
||||
git clone git://git.sv.gnu.org/coreutils
|
||||
|
||||
Now, cd into the coreutils/ directory and run:
|
||||
|
||||
git checkout -b my-topic
|
||||
|
||||
That creates the my-topic branch and puts you on it.
|
||||
To see which branch you're on, type "git branch".
|
||||
Right after the clone, you were on "master" (aka the trunk).
|
||||
To get back to the trunk, do this:
|
||||
|
||||
git checkout master
|
||||
|
||||
Note 1:
|
||||
Be careful to run "git pull" only when on the "master" branch,
|
||||
not when on a branch. With newer versions of git, you can't cause
|
||||
trouble if you forget, so this is a good reason to ensure you're
|
||||
using 1.5.3.1 or newer.
|
||||
|
||||
Note 2:
|
||||
It's best not to try to switch from one branch to another if
|
||||
you have pending (uncommitted) changes. Sometimes it works,
|
||||
sometimes the checkout will fail, telling you that your local
|
||||
modifications conflict with changes required to switch branches.
|
||||
However, in any case, you will *not* lose your uncommitted changes.
|
||||
|
||||
Anyhow, get back onto your just-created branch:
|
||||
|
||||
git checkout my-topic
|
||||
|
||||
Now, modify some file and commit it:
|
||||
|
||||
git commit some-file.c
|
||||
|
||||
Personally, no matter what package I'm working on, I find it useful to
|
||||
put the ChangeLog entries *only* in the commit log, initially, unless
|
||||
I plan to commit/push right away. Otherwise, I tend to get unnecessary
|
||||
merge conflicts with each rebase (see below). In coreutils, I've gone
|
||||
a step further, and no longer maintain an explicit ChangeLog file in
|
||||
version control. Instead, in a git working directory, you can view
|
||||
ChangeLog information via "git log". However, each distribution tarball
|
||||
does include a ChangeLog file that is automatically generated from the
|
||||
git logs.
|
||||
|
||||
So, you've committed a change. But it's only in your local repository,
|
||||
and only on your "my-topic" branch. Let's say you wait a day, and
|
||||
then see that someone else changed something and pushed it to the
|
||||
public repository. Now, you want to update your trunk and "rebase"
|
||||
your changes on the branch so that they are once again relative to the
|
||||
tip of the trunk. Currently, your branch is attached to the trunk at
|
||||
the next-to-last change set.
|
||||
|
||||
First: update the trunk from the public repo:
|
||||
[you've first made sure that "git diff" produces no output]
|
||||
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
Now, return to your branch, and "rebase" relative to trunk (master):
|
||||
|
||||
git checkout my-topic
|
||||
git rebase master
|
||||
|
||||
If there are no conflicts, this requires no more work from you.
|
||||
However, let's say there was one in ChangeLog, since you didn't
|
||||
follow my advice and modified it anyway.
|
||||
git rebase will tell you there was a conflict and in which
|
||||
file, and instruct you to resolve it and then resume with
|
||||
"git rebase --continue" once that's done.
|
||||
|
||||
So you resolve as usual, by editing ChangeLog (which has the
|
||||
usual conflict markers), then type "git rebase --continue".
|
||||
That will fail, with a diagnostic telling you to mark
|
||||
the file as "conflict resolved" by doing this:
|
||||
|
||||
git add ChangeLog
|
||||
|
||||
Then, finally, you can proceed (possibly onto more conflict resolution,
|
||||
if there are conflicts in other files):
|
||||
|
||||
git rebase --continue
|
||||
|
||||
Once it finishes, your changes on the branch are now relative to
|
||||
the tip of the trunk.
|
||||
|
||||
Now use git format-patch, as above.
|
||||
|
||||
|
||||
Amending the most recent change on your private branch
|
||||
======================================================
|
||||
Let's say you've just committed a change on your private
|
||||
branch, and then realize that something about it is not right.
|
||||
It's easy to adjust:
|
||||
|
||||
edit your files # this can include running "git add NEW" or "git rm BAD"
|
||||
git commit --amend -e -a
|
||||
git format-patch --stdout -1 > your-branch.diff
|
||||
|
||||
That replaces the most recent change-set with the revised one.
|
||||
|
||||
|
||||
|
||||
Coreutils-specific:
|
||||
|
||||
No more ChangeLog files
|
||||
=======================
|
||||
Do not modify any of the ChangeLog files in coreutils. Starting in
|
||||
2008, the policy changed. Before, we would insert the exact same text
|
||||
(or worse, sometimes slightly differing) into both the ChangeLog file
|
||||
and the commit log. Now we put that information only in the commit log,
|
||||
and generate the top-level ChangeLog file from logs at "make dist" time.
|
||||
As such, there are strict requirements on the form of the commit log
|
||||
messages.
|
||||
|
||||
|
||||
Commit log requirements
|
||||
=======================
|
||||
Your commit log should always start with a one-line summary, the second
|
||||
line should be blank, and the remaining lines are usually ChangeLog-style
|
||||
entries for all affected files. Omit the leading TABs that you're used
|
||||
to seeing in a "real" ChangeLog file.
|
||||
|
||||
Try to make the summary line fit one of the following forms:
|
||||
|
||||
program_name: change-description
|
||||
prog1, prog2: change-description
|
||||
doc: change-description
|
||||
tests: change-description
|
||||
|
||||
|
||||
Use SPACE-only indentation in new files.
|
||||
========================================
|
||||
In any new file, eliminate all leading TABs (e.g., via running GNU indent
|
||||
with --no-tabs) and put these lines at the end of the file:
|
||||
[FIXME: suggest vim syntax to do same thing, if it can be done safely.
|
||||
Most distros now "set nomodeline" by default for a good reason. ]
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*/
|
||||
|
||||
Do not change TABs to spaces or vice versa in any existing file.
|
||||
|
||||
|
||||
Send patches to the address listed in --help output
|
||||
===================================================
|
||||
Please follow the guidelines in the "Sending your patches." section of
|
||||
git's own SubmittingPatches:
|
||||
|
||||
http://git.kernel.org/?p=git/git.git;a=blob;f=Documentation/SubmittingPatches
|
||||
|
||||
|
||||
Add documentation
|
||||
=================
|
||||
If you add a feature or change some user-visible aspect of a program,
|
||||
document it. If you add an option, document it both in --help output
|
||||
(i.e., in the usage function that generates the --help output) and in
|
||||
doc/*.texi. The man pages are generated from --help output, so
|
||||
you shouldn't need to change anything under man/. User-visible changes
|
||||
are usually documented in NEWS, too.
|
||||
|
||||
When writing prose (documentation, comments, log entries), use an
|
||||
active voice, not a passive one. I.e., say "print the frobnozzle",
|
||||
not "the frobnozzle will be printed".
|
||||
|
||||
|
||||
Minor syntactic preferences
|
||||
===========================
|
||||
[I hesitate to write this one down, because it appears to be an
|
||||
acquired taste, at least for native-English speakers. It seems odd
|
||||
(if not truly backwards) to nearly anyone who doesn't have a strong
|
||||
mathematics background and perhaps a streak of something odd in their
|
||||
character ;-) ]
|
||||
In writing arithmetic comparisons, use "<" and "<=" rather than
|
||||
">" and ">=". For some justification, read this:
|
||||
http://thread.gmane.org/gmane.comp.version-control.git/3903/focus=4126
|
||||
|
||||
const placement:
|
||||
Write "Type const *var", not "const Type *var".
|
||||
FIXME: dig up justification
|
||||
|
||||
|
||||
Be nice to translators
|
||||
======================
|
||||
Don't change translatable strings if you can avoid it.
|
||||
If you must rearrange individual lines (e.g., in multi-line --help
|
||||
strings), extract and create new strings, rather than extracting
|
||||
and moving into existing blocks. This avoids making unnecessary
|
||||
work for translators.
|
||||
|
||||
|
||||
Add tests
|
||||
==========
|
||||
Nearly every significant change must be accompanied by a test suite
|
||||
addition that exercises it. If you fix a bug, add at least one test that
|
||||
fails without the patch, but that succeeds once your patch is applied.
|
||||
If you add a feature, add tests to exercise as much of the new code
|
||||
as possible. Note to run tests/misc/newtest in isolation you can do:
|
||||
|
||||
(cd tests && make check TESTS=misc/newtest VERBOSE=yes)
|
||||
|
||||
There are hundreds of tests in the tests/ directories. You can use
|
||||
tests/sample-test as a template, or one of the various Perl-based ones
|
||||
in tests/misc.
|
||||
|
||||
If writing tests is not your thing, don't worry too much about it,
|
||||
but do provide scenarios, input/output pairs, or whatever, along with
|
||||
examples of running the tool to demonstrate the new or changed feature,
|
||||
and someone else will massage that into a test (writing portable tests
|
||||
can be a challenge).
|
||||
|
||||
|
||||
Copyright assignment
|
||||
====================
|
||||
If your change is significant (i.e., if it adds more than ~10 lines),
|
||||
then you'll have to have a copyright assignment on file with the FSF.
|
||||
Since that involves first an email exchange between you and the FSF,
|
||||
and then the exchange (FSF to you, then back) of an actual sheet of paper
|
||||
with your signature on it, and finally, some administrative processing
|
||||
in Boston, the process can take a few weeks.
|
||||
|
||||
The forms to choose from are in gnulib's doc/Copyright/ directory.
|
||||
If you want to assign a single change, you should use the file,
|
||||
doc/Copyright/request-assign.changes:
|
||||
|
||||
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.changes;hb=HEAD
|
||||
|
||||
If you would like to assign past and future contributions to a project,
|
||||
you'd use doc/Copyright/request-assign.future:
|
||||
|
||||
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/Copyright/request-assign.future;hb=HEAD
|
||||
|
||||
You may make assignments for up to four projects at a time.
|
||||
|
||||
In case you're wondering why we bother with all of this, read this:
|
||||
|
||||
http://www.gnu.org/licenses/why-assign.html
|
||||
|
||||
|
||||
Run "make syntax-check", or even "make distcheck"
|
||||
================================================
|
||||
Making either of those targets runs many integrity and
|
||||
project-specific policy-conformance tests. For example, the former
|
||||
ensures that you add no trailing blanks and no uses of certain deprecated
|
||||
functions. The latter performs all "syntax-check" tests, and also
|
||||
ensures that the build completes with no warnings when using a certain
|
||||
set of gcc -W... options. Don't even bother running "make distcheck"
|
||||
unless you have a reasonably up to date installation including recent
|
||||
versions of gcc and the linux kernel, and modern GNU tools.
|
||||
|
||||
|
||||
Ensure that your changes are indented properly.
|
||||
===============================================
|
||||
Format the code the way GNU indent does.
|
||||
In a file with the "indent-tabs-mode: nil" directive at the end,
|
||||
running "indent --no-tabs" should induce no change.
|
||||
With other files, there will be some existing differences.
|
||||
Try not to add any more.
|
||||
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
Miscellaneous useful git commands
|
||||
=================================
|
||||
|
||||
* gitk: give a graphical view of the revision graph
|
||||
* git log: to get most of the same info in text form
|
||||
* git log -p: same as above, but with diffs
|
||||
* git log -p SOME_FILE: same as above, but limit to SOME_FILE
|
||||
* git reset --soft HEAD^: Commit the delta required to restore
|
||||
state to the revision just before HEAD (i.e., next-to-last).
|
||||
* git rebase -i master: run this from on a branch, and it gives
|
||||
you an interface with which you can reorder and modify arbitrary
|
||||
change sets on that branch.
|
||||
|
||||
* if you "misplace" a change set, i.e., via git reset --hard ..., so that
|
||||
it's no longer reachable by any branch, you can use "git fsck" to find
|
||||
its SHA1 and then tag it or cherry-pick it onto an existing branch.
|
||||
For example, run this:
|
||||
git fsck --lost-found HEAD && cd .git/lost-found/commit \
|
||||
&& for i in *; do git show $i|grep SOME_IDENTIFYING_STRING \
|
||||
&& echo $i; done
|
||||
The "git fsck ..." command creates the .git/lost-found/... hierarchy
|
||||
listing all unreachable objects. Then the for loop
|
||||
print SHA1s for commits that match via log or patch.
|
||||
For example, say that found 556fbb57216b119155cdda824c98dc579b8121c8,
|
||||
you could run "git show 556fbb57216b119" to examine the change set,
|
||||
or "git checkout -b found 556fbb5721" to give it a branch name.
|
||||
Finally, you might run "git checkout master && git cherry-pick 556fbb5721"
|
||||
to put that change on the tip of "master".
|
||||
|
||||
-------------------------------------------
|
||||
|
||||
Finding things to do
|
||||
====================
|
||||
If you don't know where to start, check out the TODO file for projects
|
||||
that look like they're at your skill-/interest-level. Another good
|
||||
option is always to improve tests. You never know what you might
|
||||
uncover when you improve test coverage, and even if you don't find
|
||||
any bugs your contribution is sure to be appreciated.
|
||||
|
||||
A good way to quickly assess current test coverage is to use "lcov"
|
||||
to generate HTML coverage reports. Follow these steps:
|
||||
|
||||
# configure with coverage information
|
||||
./configure CFLAGS="-g -fprofile-arcs -ftest-coverage"
|
||||
make
|
||||
# run whatever tests you want, i.e.:
|
||||
make check
|
||||
# run lcov
|
||||
lcov -t coreutils -q -d lib -b lib -o lib.lcov -c
|
||||
lcov -t coreutils -q -d src -b src -o src.lcov -c
|
||||
# generate HTML from the output
|
||||
genhtml -p `pwd` -t coreutils -q --output-directory lcov-html *.lcov
|
||||
|
||||
Then just open the index.html file (in the generated lcov-html directory)
|
||||
in your favorite web browser.
|
||||
|
||||
========================================================================
|
||||
Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the ``GNU Free
|
||||
Documentation License'' file as part of this distribution.
|
||||
60
Makefile.am
60
Makefile.am
@@ -1,6 +1,6 @@
|
||||
# Make coreutils. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1990, 1993-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1990, 1993-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -16,13 +16,17 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
SUBDIRS = lib src doc man po tests gnulib-tests
|
||||
EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
|
||||
EXTRA_DIST = cfg.mk maint.mk \
|
||||
.prev-version THANKS-to-translators THANKStt.in \
|
||||
.version \
|
||||
.vg-suppressions \
|
||||
.x-po-check \
|
||||
.x-sc_GPL_version \
|
||||
.x-sc_file_system .x-sc_obsolete_symbols \
|
||||
.x-sc_file_system \
|
||||
.x-sc_obsolete_symbols \
|
||||
.x-sc_po_check \
|
||||
.x-sc_program_name \
|
||||
.x-sc_prohibit_atoi_atof \
|
||||
.x-sc_prohibit_stat_st_blocks \
|
||||
.x-sc_prohibit_strcmp \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_space_tab .x-sc_sun_os_names \
|
||||
@@ -30,6 +34,9 @@ EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
|
||||
.x-sc_unmarked_diagnostics \
|
||||
.x-sc_useless_cpp_parens \
|
||||
ChangeLog-2005 \
|
||||
ChangeLog-2006 \
|
||||
ChangeLog-2007 \
|
||||
ChangeLog-2008 \
|
||||
bootstrap \
|
||||
bootstrap.conf \
|
||||
build-aux/cvsu \
|
||||
@@ -53,7 +60,7 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
# Some tests always need root privileges, others need them only sometimes.
|
||||
check-root:
|
||||
cd tests && $(MAKE) $@
|
||||
cd tests && $(MAKE) $@ SUBDIRS=
|
||||
|
||||
# Just prior to distribution, ...
|
||||
# transform the automake-generated rule that runs `rm -f rm'.
|
||||
@@ -65,22 +72,51 @@ check-root:
|
||||
rm_subst = \
|
||||
s!(rm -f (rm\b|\$$\(bin_PROGRAMS\)$$))!$$1 > /dev/null 2>&1 || /bin/$$1!
|
||||
|
||||
# Arrange so that .version appears only in distribution tarballs,
|
||||
# never in a checked-out repository.
|
||||
BUILT_SOURCES = .version
|
||||
.version:
|
||||
echo $(VERSION) > $@-t && mv $@-t $@
|
||||
|
||||
# Arrange so that .tarball-version appears only in the distribution
|
||||
# tarball, and never in a checked-out repository.
|
||||
# The perl substitution is to change some key uses of "rm" to "/bin/rm".
|
||||
# See the rm_subst comment for details.
|
||||
dist-hook:
|
||||
echo $(VERSION) > $(distdir)/.version
|
||||
dist-hook: gen-ChangeLog
|
||||
echo $(VERSION) > $(distdir)/.tarball-version
|
||||
perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
|
||||
|
||||
distcheck-hook:
|
||||
gen_start_date = 2008-02-08
|
||||
.PHONY: gen-ChangeLog
|
||||
gen-ChangeLog:
|
||||
if test -d .git; then \
|
||||
$(top_srcdir)/build-aux/gitlog-to-changelog \
|
||||
--since=$(gen_start_date) > $(distdir)/cl-t; \
|
||||
rm -f $(distdir)/ChangeLog; \
|
||||
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
|
||||
fi
|
||||
|
||||
distcheck-hook: check-ls-dircolors
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
DISTCLEANFILES = VERSION
|
||||
MAINTAINERCLEANFILES = THANKS-to-translators
|
||||
THANKS-to-translators: po/LINGUAS THANKStt.in
|
||||
( \
|
||||
cat $(srcdir)/THANKStt.in; \
|
||||
for lang in `cat $(srcdir)/po/LINGUAS`; do \
|
||||
echo http://www.iro.umontreal.ca/contrib/po/HTML/team-$$lang.html; \
|
||||
for lang in `cat $(srcdir)/po/LINGUAS`; do \
|
||||
echo http://translationproject.org/team/$$lang.html; \
|
||||
done; \
|
||||
) > $@-tmp && mv $@-tmp $@
|
||||
|
||||
# Ensure that the sets of two-letter codes in ls.c and dircolors.c
|
||||
# remain in sync.
|
||||
.PHONY: check-ls-dircolors
|
||||
check-ls-dircolors:
|
||||
dc=$$(sed -n '/static.*ls_codes\[/,/};'/p \
|
||||
$(srcdir)/src/dircolors.c \
|
||||
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|
||||
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
|
||||
ls=$$(sed -n '/static.*indicator_name\[/,/};'/\p \
|
||||
$(srcdir)/src/ls.c \
|
||||
|sed -n '/^ *"/p'|tr , '\n'|sed 's/^ *//' \
|
||||
|sed -n 's/^"\(..\)"/\1/p'|sort -u); \
|
||||
test "$$dc" = "$$ls"
|
||||
|
||||
38
Makefile.cfg
38
Makefile.cfg
@@ -1,38 +0,0 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003-2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
gnu_ftp_host-alpha = alpha.gnu.org
|
||||
gnu_ftp_host-beta = alpha.gnu.org
|
||||
gnu_ftp_host-major = ftp.gnu.org
|
||||
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||
|
||||
url_dir_list = \
|
||||
ftp://$(gnu_rel_host)/gnu/coreutils
|
||||
|
||||
# The GnuPG ID of the key used to sign the tarballs.
|
||||
gpg_key_ID = B9AB9A16
|
||||
|
||||
# Tests not to run as part of "make distcheck".
|
||||
# Exclude changelog-check here so that there's less churn in ChangeLog
|
||||
# files -- otherwise, you'd need to have the upcoming version number
|
||||
# at the top of the file for each `make distcheck' run.
|
||||
local-checks-to-skip = changelog-check strftime-check
|
||||
|
||||
# The local directory containing the checked-out copy of gnulib used in
|
||||
# this release. Used solely to get a date for the "announcement" target.
|
||||
gnulib_dir = /gnulib
|
||||
684
Makefile.maint
684
Makefile.maint
@@ -1,684 +0,0 @@
|
||||
# -*-Makefile-*-
|
||||
# This Makefile fragment is shared between the coreutils,
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2008 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This is reported not to work with make-3.79.1
|
||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
ME := Makefile.maint
|
||||
|
||||
# Do not save the original name or timestamp in the .tar.gz file.
|
||||
# Use --rsyncable if available.
|
||||
gzip_rsyncable := \
|
||||
$(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
|
||||
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
|
||||
|
||||
CVS = cvs
|
||||
GIT = git
|
||||
VC = $(GIT)
|
||||
VC-tag = git-tag -s -m '$(VERSION)'
|
||||
|
||||
CVS_LIST = build-aux/vc-list-files
|
||||
|
||||
CVS_LIST_EXCEPT = \
|
||||
$(CVS_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||
|
||||
ifeq ($(origin prev_version_file), undefined)
|
||||
prev_version_file = .prev-version
|
||||
endif
|
||||
|
||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
|
||||
ifeq ($(VC),$(GIT))
|
||||
this-vc-tag = v$(VERSION)
|
||||
this-vc-tag-regexp = v$(VERSION_REGEXP)
|
||||
else
|
||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||
tag-this-version = $(subst .,_,$(VERSION))
|
||||
this-vc-tag = $(tag-package)-$(tag-this-version)
|
||||
this-vc-tag-regexp = $(this-vc-tag)
|
||||
endif
|
||||
my_distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
# Old releases are stored here.
|
||||
# Used for diffs and xdeltas.
|
||||
release_archive_dir ?= ../release
|
||||
|
||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||
export LC_ALL = C
|
||||
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Sanity checks. ##
|
||||
## --------------- ##
|
||||
|
||||
# FIXME: add a check to prohibit definition in src/*.c of symbols defined
|
||||
# in system.h. E.g. today I removed from tail.c a useless definition of
|
||||
# ENOSYS. It was useless because system.h ensures it's defined.
|
||||
|
||||
# Collect the names of rules starting with `sc_'.
|
||||
syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(ME))
|
||||
.PHONY: $(syntax-check-rules)
|
||||
|
||||
# Checks that don't require cvs.
|
||||
# Run `changelog-check' last, as previous test may reveal problems requiring
|
||||
# new ChangeLog entries.
|
||||
local-checks-available = \
|
||||
po-check copyright-check m4-check author_mark_check \
|
||||
changelog-check patch-check strftime-check $(syntax-check-rules) \
|
||||
makefile_path_separator_check \
|
||||
makefile-check check-AUTHORS
|
||||
.PHONY: $(local-checks-available)
|
||||
|
||||
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||
|
||||
syntax-check: $(local-check)
|
||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||
# $$(find -type f -name '*.[chly]') && \
|
||||
# { echo '$(ME): found conditional include' 1>&2; \
|
||||
# exit 1; } || :
|
||||
|
||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||
# { echo '$(ME): FIXME' 1>&2; \
|
||||
# exit 1; } || :
|
||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||
|
||||
sc_cast_of_argument_to_free:
|
||||
@grep -nE '\<free \(\(' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast free argument' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_cast_of_x_alloc_return_value:
|
||||
@grep -nE '\*\) *x(m|c|re)alloc\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast x*alloc return value' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_cast_of_alloca_return_value:
|
||||
@grep -nE '\*\) *alloca\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_space_tab:
|
||||
@grep -n '[ ] ' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Don't use *scanf or the old ato* functions in `real' code.
|
||||
# They provide no error checking mechanism.
|
||||
# Instead, use strto* functions.
|
||||
sc_prohibit_atoi_atof:
|
||||
@grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, ato''q, or ss''canf' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||
sc_prohibit_strcmp:
|
||||
@grep -nE '! *str''cmp \(|\<str''cmp \([^)]+\) *==' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): use STREQ in place of the above uses of str''cmp' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||
sc_error_exit_success:
|
||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||
$$(find -type f -name '*.[chly]') && \
|
||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_file_system:
|
||||
@grep -ni 'file''system' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of "file''system";' \
|
||||
'rewrite to use "file system"' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_no_have_config_h:
|
||||
@grep -n 'HAVE''_CONFIG_H' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Nearly all .c files must include <config.h>.
|
||||
sc_require_config_h:
|
||||
@if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
grep -L '^# *include <config\.h>' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$') \
|
||||
| grep . && \
|
||||
{ echo '$(ME): the above files do not include <config.h>' \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||
sc_prohibit_assert_without_use:
|
||||
@if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '# *include <assert\.h>' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -L '\<assert (' $$files \
|
||||
| grep . && \
|
||||
{ echo "$(ME): the above files include <assert.h> but don't use it" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# Don't include quotearg.h unless you use one of its functions.
|
||||
sc_prohibit_quotearg_without_use:
|
||||
@if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '# *include "quotearg\.h"' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -LE '\<quotearg(_[^ ]+)? \(' $$files \
|
||||
| grep . && \
|
||||
{ echo "$(ME): the above files include "quotearg.h" but don't use it" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# Don't include quote.h unless you use one of its functions.
|
||||
sc_prohibit_quote_without_use:
|
||||
@if $(CVS_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '# *include "quote\.h"' \
|
||||
$$($(CVS_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -LE '\<quote(_n)? \(' $$files \
|
||||
| grep . && \
|
||||
{ echo "$(ME): the above files include "quote.h" but don't use it" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
sc_obsolete_symbols:
|
||||
@grep -nE '\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use HAVE''_FCNTL_H or O''_NDELAY' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||
|
||||
# Each nonempty line must start with a year number, or a TAB.
|
||||
sc_changelog:
|
||||
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||
# with the strings from the two affected variables.
|
||||
dd_c = $(srcdir)/src/dd.c
|
||||
sc_dd_max_sym_length:
|
||||
ifneq ($(wildcard $(dd_c)),)
|
||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||
| wc --max-line-length); \
|
||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||
|tr -d '"' | wc --max-line-length); \
|
||||
if test "$$len" = "$$max"; then :; else \
|
||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
|
||||
# Many m4 macros names once began with `jm_'.
|
||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||
# Make sure that none are inadvertently reintroduced.
|
||||
sc_prohibit_jm_in_m4:
|
||||
@grep -nE 'jm_[A-Z]' \
|
||||
$$($(CVS_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
|
||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_root_tests:
|
||||
@if test -d tests \
|
||||
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
|
||||
t1=sc-root.expected; t2=sc-root.actual; \
|
||||
grep -nl '^PRIV_CHECK_ARG=require-root' \
|
||||
$$($(CVS_LIST) tests) |sed s,tests,., |sort > $$t1; \
|
||||
sed -n 's, cd \([^ ]*\) .*MAKE..check TESTS=\(.*\),./\1/\2,p' \
|
||||
$(srcdir)/tests/Makefile.am |sort > $$t2; \
|
||||
diff -u $$t1 $$t2 || diff=1; \
|
||||
rm -f $$t1 $$t2; \
|
||||
test "$$diff" \
|
||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
headers_with_interesting_macro_defs = \
|
||||
exit.h \
|
||||
fcntl_.h \
|
||||
fnmatch_.h \
|
||||
intprops.h \
|
||||
inttypes_.h \
|
||||
lchown.h \
|
||||
openat.h \
|
||||
stat-macros.h \
|
||||
stdint_.h
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of macros that are guaranteed by parts of gnulib to be defined.
|
||||
.re-defmac:
|
||||
@(cd $(srcdir)/lib; \
|
||||
for f in $(headers_with_interesting_macro_defs); do \
|
||||
test -f $$f && \
|
||||
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
|
||||
done; \
|
||||
) | sort -u \
|
||||
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
|
||||
| sed 's/^/^# *define /' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Don't define macros that we already get from gnulib header files.
|
||||
sc_always_defined_macros: .re-defmac
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
|
||||
grep -f .re-defmac $$($(CVS_LIST)) \
|
||||
&& { echo '$(ME): define the above via some gnulib .h file' \
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of files included from system.h. Exclude a couple.
|
||||
.re-list:
|
||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
||||
| grep -Ev 'sys/(param|file)\.h' \
|
||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Files in src/ should not include directly any of
|
||||
# the headers already included via system.h.
|
||||
sc_system_h_headers: .re-list
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||
grep -nE -f .re-list \
|
||||
$$($(CVS_LIST) src | \
|
||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||
&& { echo '$(ME): the above are already included via system.h'\
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
sc_sun_os_names:
|
||||
@grep -nEi \
|
||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_the_the:
|
||||
@grep -ni '\<the ''the\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of "the ''the";' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_tight_scope:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
sc_trailing_blank:
|
||||
@grep -n '[ ]$$' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found trailing blank(s)' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Match lines like the following, but where there is only one space
|
||||
# between the options and the description:
|
||||
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
|
||||
longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
|
||||
sc_two_space_separator_in_usage:
|
||||
@grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
|
||||
$$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||
echo "$(ME): an option and its description"; \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Look for diagnostics that aren't marked for translation.
|
||||
# This won't find any for which error's format string is on a separate line.
|
||||
sc_unmarked_diagnostics:
|
||||
@grep -nE \
|
||||
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(CVS_LIST_EXCEPT)) \
|
||||
| grep -v '_''(' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Avoid useless parentheses like those in this example:
|
||||
# #if defined (SYMBOL) || defined (SYM2)
|
||||
sc_useless_cpp_parens:
|
||||
@grep -n '^# *if .*defined *(' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Require the latest GPL.
|
||||
sc_GPL_version:
|
||||
@grep -n 'either ''version [^3]' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): GPL vN, N!=3' 1>&2; exit 1; } || :
|
||||
|
||||
# Ensure that the c99-to-c89 patch applies cleanly.
|
||||
patch-check:
|
||||
rm -rf src-c89 $@.1 $@.2
|
||||
cp -a src src-c89
|
||||
(cd src-c89; patch -p1 -V never --fuzz=0) < src/c99-to-c89.diff \
|
||||
> $@.1 2>&1
|
||||
if test "$$REGEN_PATCH" = yes; then \
|
||||
diff -upr src src-c89 | sed 's,src-c89/,src/,' \
|
||||
| grep -v '^Only in' > new-diff || : ; fi
|
||||
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||
rm -f src-c89/*.o || msg='rm failed'; \
|
||||
$(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \
|
||||
|| msg='compile failure with extra options'; \
|
||||
test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
|
||||
test "$$msg" = ok
|
||||
|
||||
# Ensure that date's --help output stays in sync with the info
|
||||
# documentation for GNU strftime. The only exception is %N,
|
||||
# which date accepts but GNU strftime does not.
|
||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
||||
strftime-check:
|
||||
if test -f $(srcdir)/src/date.c; then \
|
||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
||||
| $(extract_char) > $@-src; \
|
||||
{ echo N; \
|
||||
info libc date calendar format | grep '^ `%.'\' \
|
||||
| $(extract_char); } | sort > $@-info; \
|
||||
diff -u $@-src $@-info || exit 1; \
|
||||
rm -f $@-src $@-info; \
|
||||
fi
|
||||
|
||||
check-AUTHORS:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
# Ensure that we use only the standard $(VAR) notation,
|
||||
# not @...@ in Makefile.am, now that we can rely on automake
|
||||
# to emit a definition for each substituted variable.
|
||||
makefile-check:
|
||||
grep -nE '@[A-Z_0-9]+@' `find . -name Makefile.am` \
|
||||
&& { echo 'Makefile.maint: use $$(...), not @...@' 1>&2; exit 1; } || :
|
||||
|
||||
news-date-check: NEWS
|
||||
today=`date +%Y-%m-%d`; \
|
||||
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "version or today's date is not in NEWS" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
changelog-check:
|
||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
m4-check:
|
||||
@grep -n 'AC_DEFUN([^[]' m4/*.m4 \
|
||||
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
# FIXME: don't hard-code file names below; use a more general mechanism.
|
||||
po-check:
|
||||
if test -f po/POTFILES.in; then \
|
||||
grep -E -v '^(#|$$)' po/POTFILES.in \
|
||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||
files=; \
|
||||
for file in $$($(CVS_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||
case $$file in \
|
||||
djgpp/* | man/*) continue;; \
|
||||
*/c99-to-c89.diff) continue;; \
|
||||
esac; \
|
||||
case $$file in \
|
||||
*.[ch]) \
|
||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||
esac; \
|
||||
files="$$files $$file"; \
|
||||
done; \
|
||||
grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
|
||||
| sort -u > $@-2; \
|
||||
diff -u $@-1 $@-2 || exit 1; \
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
# In a definition of #define AUTHORS "... and ..." where the RHS contains
|
||||
# the English word `and', the string must be marked with `N_ (...)' so that
|
||||
# gettext recognizes it as a string requiring translation.
|
||||
author_mark_check:
|
||||
@grep -n '^# *define AUTHORS "[^"]* and ' src/*.c |grep -v ' N_ (' && \
|
||||
{ echo 'Makefile.maint: enclose the above strings in N_ (...)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Sometimes it is useful to change the PATH environment variable
|
||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||
# and there probably aren't many projects with so many Makefile.am files
|
||||
# that we'd have to worry about limits on command line length.
|
||||
msg = 'Makefile.maint: Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||
makefile_path_separator_check:
|
||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||
|
||||
# Check that `make alpha' will not fail at the end of the process.
|
||||
writable-files:
|
||||
if test -d $(release_archive_dir); then :; else \
|
||||
mkdir $(release_archive_dir); \
|
||||
fi
|
||||
for file in $(distdir).tar.gz $(xd-delta) \
|
||||
$(release_archive_dir)/$(distdir).tar.gz \
|
||||
$(release_archive_dir)/$(xd-delta); do \
|
||||
test -e $$file || continue; \
|
||||
test -w $$file \
|
||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||
done; \
|
||||
test "$$fail" && exit 1 || :
|
||||
|
||||
v_etc_file = lib/version-etc.c
|
||||
sample-test = tests/sample-test
|
||||
texi = doc/$(PACKAGE).texi
|
||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||
# Do the same for the $(sample-test) and the main doc/.texi file.
|
||||
copyright-check:
|
||||
@if test -f $(v_etc_file); then \
|
||||
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(sample-test); then \
|
||||
grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(texi); then \
|
||||
grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(texi); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
|
||||
vc-diff-check:
|
||||
$(VC) diff > vc-diffs || :
|
||||
if test -s vc-diffs; then \
|
||||
cat vc-diffs; \
|
||||
echo "Some files are locally modified:" 1>&2; \
|
||||
exit 1; \
|
||||
else \
|
||||
rm vc-diffs; \
|
||||
fi
|
||||
|
||||
cvs-check: vc-diff-check
|
||||
|
||||
maintainer-distcheck:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
|
||||
# Don't make a distribution if checks fail.
|
||||
# Also, make sure the NEWS file is up-to-date.
|
||||
vc-dist: $(local-check) cvs-check maintainer-distcheck
|
||||
$(MAKE) dist
|
||||
|
||||
# Use this to make sure we don't run these programs when building
|
||||
# from a virgin tgz file, below.
|
||||
null_AM_MAKEFLAGS = \
|
||||
ACLOCAL=false \
|
||||
AUTOCONF=false \
|
||||
AUTOMAKE=false \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
|
||||
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||
bin=bin-$$$$
|
||||
|
||||
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||
|
||||
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||
# arithmetic problems with -Wpointer-arith.
|
||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||
# have to have a recent version of gcc and glibc headers.
|
||||
# The for-loop below ensures that there is a bin/ directory full of all
|
||||
# of the programs under test (except the few that are required for basic
|
||||
# Makefile rules), all symlinked to the just-built "false" program.
|
||||
# This is to ensure that if ever a test neglects to make PATH include
|
||||
# the build srcdir, these always-failing programs will run.
|
||||
# Otherwise, it is too easy to test the wrong programs.
|
||||
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz) check
|
||||
-rm -rf $(t)
|
||||
mkdir -p $(t)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& mkdir $(bin) \
|
||||
&& ($(write_loser)) > $(bin)/loser \
|
||||
&& chmod a+x $(bin)/loser \
|
||||
&& for i in $(built_programs); do \
|
||||
case $$i in \
|
||||
rm|expr|basename|echo|sort|ls|tr);; \
|
||||
cat|dirname|mv|wc);; \
|
||||
*) ln $(bin)/loser $(bin)/$$i;; \
|
||||
esac; \
|
||||
done \
|
||||
&& ln -sf ../src/true $(bin)/false \
|
||||
&& PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
|
||||
&& $(MAKE) -C gnulib-tests check \
|
||||
&& rm -rf $(bin) \
|
||||
&& $(MAKE) distclean
|
||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
if test -f $(srcdir)/src/c99-to-c89.diff; then \
|
||||
cd $(t)/$(distdir) \
|
||||
&& (cd src && patch -V never --fuzz=0 <c99-to-c89.diff) \
|
||||
&& ./configure --disable-largefile \
|
||||
CFLAGS='-Werror -ansi -Wno-long-long' \
|
||||
&& $(MAKE); \
|
||||
fi
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
WGET = wget
|
||||
WGETFLAGS = -C off
|
||||
|
||||
rel-check:
|
||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||
set -e; \
|
||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
||||
echo "$(md5) -" > $$md5_tmp; \
|
||||
md5sum -c $$md5_tmp < $$tarz
|
||||
|
||||
prev-tgz = $(PACKAGE)-$(PREV_VERSION).tar.gz
|
||||
|
||||
# FIXME: stop distributing xdelta files in 2008, unless someone speaks up.
|
||||
# So far, not one person has said they'd miss this.
|
||||
xd-delta = $(PACKAGE)-$(PREV_VERSION)-$(VERSION).xdelta
|
||||
|
||||
rel-files = $(xd-delta) $(DIST_ARCHIVES)
|
||||
|
||||
gnulib-version = $$(cd $(gnulib_dir) && git describe)
|
||||
|
||||
# Approximate the date of last gnulib "update" by the ChangeLog file's
|
||||
# mtime, and provide that date in the announcement.
|
||||
announcement: NEWS ChangeLog $(rel-files)
|
||||
@cl_date=$$(stat --printf @%Y $(gnulib_dir)/ChangeLog); \
|
||||
utc_date=$$(date -u --date $$cl_date '+%Y-%m-%d %T %z'); \
|
||||
./build-aux/announce-gen \
|
||||
--release-type=$(RELEASE_TYPE) \
|
||||
--package=$(PACKAGE) \
|
||||
--prev=$(PREV_VERSION) \
|
||||
--curr=$(VERSION) \
|
||||
--gpg-key-id=$(gpg_key_ID) \
|
||||
--news=NEWS \
|
||||
--bootstrap-tools=autoconf,automake,bison,gnulib \
|
||||
--gnulib-version=$(gnulib-version) \
|
||||
$(addprefix --url-dir=, $(url_dir_list))
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
## ---------------- ##
|
||||
|
||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||
www-gnu = http://www.gnu.org
|
||||
|
||||
# Use mv, if you don't have/want move-if-change.
|
||||
move_if_change ?= move-if-change
|
||||
|
||||
emit_upload_commands:
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
@echo "$(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \\"
|
||||
@echo " --to $(gnu_rel_host):$(PACKAGE) \\"
|
||||
@echo " $(rel-files)"
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
|
||||
$(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||
xdelta delta -9 $^ $@ || :
|
||||
|
||||
.PHONY: alpha beta major
|
||||
alpha beta major: $(local-check) writable-files
|
||||
test $@ = major \
|
||||
&& { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
|
||||
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
|
||||
|| :
|
||||
$(MAKE) vc-dist
|
||||
$(MAKE) news-date-check changelog-check
|
||||
$(MAKE) $(xd-delta)
|
||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
||||
ln $(rel-files) $(release_archive_dir)
|
||||
chmod a-w $(rel-files)
|
||||
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
||||
echo $(VERSION) > $(prev_version_file)
|
||||
$(VC) commit -m \
|
||||
'$(prev_version_file): Record previous version: $(VERSION).' \
|
||||
$(prev_version_file)
|
||||
293
NEWS
293
NEWS
@@ -1,5 +1,288 @@
|
||||
GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
* Noteworthy changes in release 7.1 (2009-02-21) [stable]
|
||||
|
||||
** New features
|
||||
|
||||
Add extended attribute support available on certain filesystems like ext2
|
||||
and XFS.
|
||||
cp: Tries to copy xattrs when --preserve=xattr or --preserve=all specified
|
||||
mv: Always tries to copy xattrs
|
||||
install: Never copies xattrs
|
||||
|
||||
cp and mv accept a new option, --no-clobber (-n): silently refrain
|
||||
from overwriting any existing destination file
|
||||
|
||||
dd accepts iflag=cio and oflag=cio to open the file in CIO (concurrent I/O)
|
||||
mode where this feature is available.
|
||||
|
||||
install accepts a new option, --compare (-C): compare each pair of source
|
||||
and destination files, and if the destination has identical content and
|
||||
any specified owner, group, permissions, and possibly SELinux context, then
|
||||
do not modify the destination at all.
|
||||
|
||||
ls --color now highlights hard linked files, too
|
||||
|
||||
stat -f recognizes the Lustre file system type
|
||||
|
||||
** Bug fixes
|
||||
|
||||
chgrp, chmod, chown --silent (--quiet, -f) no longer print some diagnostics
|
||||
[bug introduced in coreutils-5.1]
|
||||
|
||||
cp uses much less memory in some situations
|
||||
|
||||
cp -a now correctly tries to preserve SELinux context (announced in 6.9.90),
|
||||
doesn't inform about failure, unlike with --preserve=all
|
||||
|
||||
du --files0-from=FILE no longer reads all of FILE into RAM before
|
||||
processing the first file name
|
||||
|
||||
seq 9223372036854775807 9223372036854775808 now prints only two numbers
|
||||
on systems with extended long double support and good library support.
|
||||
Even with this patch, on some systems, it still produces invalid output,
|
||||
from 3 to at least 1026 lines long. [bug introduced in coreutils-6.11]
|
||||
|
||||
seq -w now accounts for a decimal point added to the last number
|
||||
to correctly print all numbers to the same width.
|
||||
|
||||
wc --files0-from=FILE no longer reads all of FILE into RAM, before
|
||||
processing the first file name, unless the list of names is known
|
||||
to be small enough.
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
cp and mv: the --reply={yes,no,query} option has been removed.
|
||||
Using it has elicited a warning for the last three years.
|
||||
|
||||
dd: user specified offsets that are too big are handled better.
|
||||
Previously, erroneous parameters to skip and seek could result
|
||||
in redundant reading of the file with no warnings or errors.
|
||||
|
||||
du: -H (initially equivalent to --si) is now equivalent to
|
||||
--dereference-args, and thus works as POSIX requires
|
||||
|
||||
shred: now does 3 overwrite passes by default rather than 25.
|
||||
|
||||
ls -l now marks SELinux-only files with the less obtrusive '.',
|
||||
rather than '+'. A file with any other combination of MAC and ACL
|
||||
is still marked with a '+'.
|
||||
|
||||
|
||||
* Noteworthy changes in release 7.0 (2008-10-05) [beta]
|
||||
|
||||
** New programs
|
||||
|
||||
timeout: Run a command with bounded time.
|
||||
truncate: Set the size of a file to a specified size.
|
||||
|
||||
** New features
|
||||
|
||||
chgrp, chmod, chown, chcon, du, rm: now all display linear performance,
|
||||
even when operating on million-entry directories on ext3 and ext4 file
|
||||
systems. Before, they would exhibit O(N^2) performance, due to linear
|
||||
per-entry seek time cost when operating on entries in readdir order.
|
||||
Rm was improved directly, while the others inherit the improvement
|
||||
from the newer version of fts in gnulib.
|
||||
|
||||
comm now verifies that the inputs are in sorted order. This check can
|
||||
be turned off with the --nocheck-order option.
|
||||
|
||||
comm accepts new option, --output-delimiter=STR, that allows specification
|
||||
of an output delimiter other than the default single TAB.
|
||||
|
||||
cp and mv: the deprecated --reply=X option is now also undocumented.
|
||||
|
||||
dd accepts iflag=fullblock to make it accumulate full input blocks.
|
||||
With this new option, after a short read, dd repeatedly calls read,
|
||||
until it fills the incomplete block, reaches EOF, or encounters an error.
|
||||
|
||||
df accepts a new option --total, which produces a grand total of all
|
||||
arguments after all arguments have been processed.
|
||||
|
||||
If the GNU MP library is available at configure time, factor and
|
||||
expr support arbitrarily large numbers. Pollard's rho algorithm is
|
||||
used to factor large numbers.
|
||||
|
||||
install accepts a new option --strip-program to specify the program used to
|
||||
strip binaries.
|
||||
|
||||
ls now colorizes files with capabilities if libcap is available
|
||||
|
||||
ls -v now uses filevercmp function as sort predicate (instead of strverscmp)
|
||||
|
||||
md5sum now accepts the new option, --quiet, to suppress the printing of
|
||||
'OK' messages. sha1sum, sha224sum, sha384sum, and sha512sum accept it, too.
|
||||
|
||||
sort accepts a new option, --files0-from=F, that specifies a file
|
||||
containing a null-separated list of files to sort. This list is used
|
||||
instead of filenames passed on the command-line to avoid problems with
|
||||
maximum command-line (argv) length.
|
||||
|
||||
sort accepts a new option --batch-size=NMERGE, where NMERGE
|
||||
represents the maximum number of inputs that will be merged at once.
|
||||
When processing more than NMERGE inputs, sort uses temporary files.
|
||||
|
||||
sort accepts a new option --version-sort (-V, --sort=version),
|
||||
specifying that ordering is to be based on filevercmp.
|
||||
|
||||
** Bug fixes
|
||||
|
||||
chcon --verbose now prints a newline after each message
|
||||
|
||||
od no longer suffers from platform bugs in printf(3). This is
|
||||
probably most noticeable when using 'od -tfL' to print long doubles.
|
||||
|
||||
seq -0.1 0.1 2 now prints 2,0 when locale's decimal point is ",".
|
||||
Before, it would mistakenly omit the final number in that example.
|
||||
|
||||
shuf honors the --zero-terminated (-z) option, even with --input-range=LO-HI
|
||||
|
||||
shuf --head-count is now correctly documented. The documentation
|
||||
previously claimed it was called --head-lines.
|
||||
|
||||
** Improvements
|
||||
|
||||
Improved support for access control lists (ACLs): On MacOS X, Solaris 7..10,
|
||||
HP-UX 11, Tru64, AIX, IRIX 6.5, and Cygwin, "ls -l" now displays the presence
|
||||
of an ACL on a file via a '+' sign after the mode, and "cp -p" copies ACLs.
|
||||
|
||||
join has significantly better performance due to better memory management
|
||||
|
||||
ls now uses constant memory when not sorting and using one_per_line format,
|
||||
no matter how many files are in a given directory
|
||||
|
||||
od now aligns fields across lines when printing multiple -t
|
||||
specifiers, and no longer prints fields that resulted entirely from
|
||||
padding the input out to the least common multiple width.
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
stat's --context (-Z) option has always been a no-op.
|
||||
Now it evokes a warning that it is obsolete and will be removed.
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.12 (2008-05-31) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
chcon, runcon: --help output now includes the bug-reporting address
|
||||
|
||||
cp -p copies permissions more portably. For example, on MacOS X 10.5,
|
||||
"cp -p some-fifo some-file" no longer fails while trying to copy the
|
||||
permissions from the some-fifo argument.
|
||||
|
||||
id with no options now prints the SELinux context only when invoked
|
||||
with no USERNAME argument.
|
||||
|
||||
id and groups once again print the AFS-specific nameless group-ID (PAG).
|
||||
Printing of such large-numbered, kernel-only (not in /etc/group) group-IDs
|
||||
was suppressed in 6.11 due to ignorance that they are useful.
|
||||
|
||||
uniq: avoid subtle field-skipping malfunction due to isblank misuse.
|
||||
In some locales on some systems, isblank(240) (aka  ) is nonzero.
|
||||
On such systems, uniq --skip-fields=N would fail to skip the proper
|
||||
number of fields for some inputs.
|
||||
|
||||
tac: avoid segfault with --regex (-r) and multiple files, e.g.,
|
||||
"echo > x; tac -r x x". [bug present at least in textutils-1.8b, from 1992]
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
install once again sets SELinux context, when possible
|
||||
[it was deliberately disabled in 6.9.90]
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.11 (2008-04-19) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
configure --enable-no-install-program=groups now works.
|
||||
|
||||
"cp -fR fifo E" now succeeds with an existing E. Before this fix, using
|
||||
-fR to copy a fifo or "special" file onto an existing file would fail
|
||||
with EEXIST. Now, it once again unlinks the destination before trying
|
||||
to create the destination file. [bug introduced in coreutils-5.90]
|
||||
|
||||
dd once again works with unnecessary options like if=/dev/stdin and
|
||||
of=/dev/stdout. [bug introduced in fileutils-4.0h]
|
||||
|
||||
id now uses getgrouplist, when possible. This results in
|
||||
much better performance when there are many users and/or groups.
|
||||
|
||||
ls no longer segfaults on files in /proc when linked with an older version
|
||||
of libselinux. E.g., ls -l /proc/sys would dereference a NULL pointer.
|
||||
|
||||
md5sum would segfault for invalid BSD-style input, e.g.,
|
||||
echo 'MD5 (' | md5sum -c - Now, md5sum ignores that line.
|
||||
sha1sum, sha224sum, sha384sum, and sha512sum are affected, too.
|
||||
[bug introduced in coreutils-5.1.0]
|
||||
|
||||
md5sum -c would accept a NUL-containing checksum string like "abcd\0..."
|
||||
and would unnecessarily read and compute the checksum of the named file,
|
||||
and then compare that checksum to the invalid one: guaranteed to fail.
|
||||
Now, it recognizes that the line is not valid and skips it.
|
||||
sha1sum, sha224sum, sha384sum, and sha512sum are affected, too.
|
||||
[bug present in the original version, in coreutils-4.5.1, 1995]
|
||||
|
||||
"mkdir -Z x dir" no longer segfaults when diagnosing invalid context "x"
|
||||
mkfifo and mknod would fail similarly. Now they're fixed.
|
||||
|
||||
mv would mistakenly unlink a destination file before calling rename,
|
||||
when the destination had two or more hard links. It no longer does that.
|
||||
[bug introduced in coreutils-5.3.0]
|
||||
|
||||
"paste -d'\' file" no longer overruns memory (heap since coreutils-5.1.2,
|
||||
stack before then) [bug present in the original version, in 1992]
|
||||
|
||||
"pr -e" with a mix of backspaces and TABs no longer corrupts the heap
|
||||
[bug present in the original version, in 1992]
|
||||
|
||||
"ptx -F'\' long-file-name" would overrun a malloc'd buffer and corrupt
|
||||
the heap. That was triggered by a lone backslash (or odd number of them)
|
||||
at the end of the option argument to --flag-truncation=STRING (-F),
|
||||
--word-regexp=REGEXP (-W), or --sentence-regexp=REGEXP (-S).
|
||||
|
||||
"rm -r DIR" would mistakenly declare to be "write protected" -- and
|
||||
prompt about -- full DIR-relative names longer than MIN (PATH_MAX, 8192).
|
||||
|
||||
"rmdir --ignore-fail-on-non-empty" detects and ignores the failure
|
||||
in more cases when a directory is empty.
|
||||
|
||||
"seq -f % 1" would issue the erroneous diagnostic "seq: memory exhausted"
|
||||
rather than reporting the invalid string format.
|
||||
[bug introduced in coreutils-6.0]
|
||||
|
||||
** New features
|
||||
|
||||
join now verifies that the inputs are in sorted order. This check can
|
||||
be turned off with the --nocheck-order option.
|
||||
|
||||
sort accepts the new option --sort=WORD, where WORD can be one of
|
||||
general-numeric, month, numeric or random. These are equivalent to the
|
||||
options --general-numeric-sort/-g, --month-sort/-M, --numeric-sort/-n
|
||||
and --random-sort/-R, resp.
|
||||
|
||||
** Improvements
|
||||
|
||||
id and groups work around an AFS-related bug whereby those programs
|
||||
would print an invalid group number, when given no user-name argument.
|
||||
|
||||
ls --color no longer outputs unnecessary escape sequences
|
||||
|
||||
seq gives better diagnostics for invalid formats.
|
||||
|
||||
** Portability
|
||||
|
||||
rm now works properly even on systems like BeOS and Haiku,
|
||||
which have negative errno values.
|
||||
|
||||
** Consistency
|
||||
|
||||
install, mkdir, rmdir and split now write --verbose output to stdout,
|
||||
not to stderr.
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.10 (2008-01-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
@@ -83,6 +366,11 @@ GNU coreutils NEWS -*- outline -*-
|
||||
* ls accepts a slightly modified -Z option.
|
||||
* ls: contrary to Fedora version, does not accept --lcontext and --scontext
|
||||
|
||||
The following commands and options now support the standard size
|
||||
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
|
||||
head -c, head -n, od -j, od -N, od -S, split -b, split -C,
|
||||
tail -c, tail -n.
|
||||
|
||||
cp -p tries to preserve the GID of a file even if preserving the UID
|
||||
is not possible.
|
||||
|
||||
@@ -128,7 +416,7 @@ GNU coreutils NEWS -*- outline -*-
|
||||
loss of the contents of a/f.
|
||||
|
||||
stty no longer silently accepts certain invalid hex values
|
||||
in its 35-colon commmand-line argument
|
||||
in its 35-colon command-line argument
|
||||
|
||||
** Bug fixes
|
||||
|
||||
@@ -2085,8 +2373,7 @@ packages, see ./old/*/NEWS.
|
||||
|
||||
========================================================================
|
||||
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 2001-2009 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
|
||||
44
README
44
README
@@ -13,15 +13,15 @@ The programs that can be built with this package are:
|
||||
link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup
|
||||
od paste pathchk pinky pr printenv printf ptx pwd readlink rm rmdir
|
||||
runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf
|
||||
sleep sort split stat stty su sum sync tac tail tee test touch tr true
|
||||
tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes
|
||||
sleep sort split stat stty su sum sync tac tail tee test timeout touch tr
|
||||
true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who
|
||||
whoami yes
|
||||
|
||||
See the file NEWS for a list of major changes in the current release.
|
||||
|
||||
If you obtained this file as part of a "cvs checkout" or "git clone",
|
||||
then see the README-hacking file. If this file came to you as part of a
|
||||
tar archive, then see the file INSTALL for compilation and installation
|
||||
instructions.
|
||||
If you obtained this file as part of a "git clone", then see the
|
||||
README-hacking file. If this file came to you as part of a tar archive,
|
||||
then see the file INSTALL for compilation and installation instructions.
|
||||
|
||||
These programs are intended to conform to POSIX (with BSD and other
|
||||
extensions), like the rest of the GNU system. By default they conform
|
||||
@@ -92,11 +92,15 @@ compiler, due to the use of declarations after non-declaration statements
|
||||
in several files in src/. There is code in configure to find and, if
|
||||
possible, enable an appropriate compiler. However, if configure doesn't
|
||||
find a C99 compiler, it continues nonetheless, and your build will fail.
|
||||
If that happens, simply apply the included patch using the following
|
||||
If that happens, simply[*] apply the included patch using the following
|
||||
command, and then run make again:
|
||||
|
||||
cd src && patch < c99-to-c89.diff
|
||||
|
||||
[*] however, as of coreutils-7.1, the "c99-to-c89.diff" file is no longer
|
||||
maintained, so even if the patches still apply, the result will be an
|
||||
incomplete conversion. It's been 10 years. Get a decent compiler! ;-)
|
||||
|
||||
|
||||
***********************
|
||||
HPUX 11.x build failure
|
||||
@@ -146,7 +150,7 @@ I find that it is best to unpack and build as a non-privileged
|
||||
user, and then to run the following command as that user in order
|
||||
to run the privilege-requiring tests:
|
||||
|
||||
sudo env NON_ROOT_USERNAME=$USER make -k check-root
|
||||
sudo env PATH="$PATH" NON_ROOT_USERNAME=$USER make -k check-root
|
||||
|
||||
If you can run the tests as root, please do so and report any
|
||||
problems. We get much less test coverage in that mode, and it's
|
||||
@@ -161,17 +165,13 @@ Reporting bugs:
|
||||
IMPORTANT: if you take the time to report a test failure,
|
||||
please be sure to include the output of running `make check'
|
||||
in verbose mode for each failing test. For example,
|
||||
if the test that fails is tests/mv/hard-link-1, then you
|
||||
would run this command:
|
||||
if the test that fails is tests/misc/df, then you would
|
||||
run this command:
|
||||
|
||||
env VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1
|
||||
(cd tests && make check TESTS=misc/df VERBOSE=yes) >> log 2>&1
|
||||
|
||||
For some tests, you can get even more detail by including
|
||||
DEBUG=yes in the environment:
|
||||
|
||||
env DEBUG=yes VERBOSE=yes make check -C tests/mv TESTS=hard-link-1 >> log 2>&1
|
||||
|
||||
and then include the contents of the file `log' in your bug report.
|
||||
For some tests, you can get even more detail by adding DEBUG=yes.
|
||||
Then include the contents of the file `log' in your bug report.
|
||||
|
||||
***************************************
|
||||
|
||||
@@ -185,14 +185,13 @@ If you sent a complete patch and, after a couple weeks you haven't
|
||||
received any acknowledgement, please ping us. A complete patch includes
|
||||
a well-written ChangeLog entry, unified (diff -u format) diffs relative
|
||||
to the most recent test release (or, better, relative to the latest
|
||||
sources in the CVS repository), an explanation for why the patch is
|
||||
sources in the public repository), an explanation for why the patch is
|
||||
necessary or useful, and if at all possible, enough information to
|
||||
reproduce whatever problem prompted it. Plus, you'll earn lots of
|
||||
karma if you include a test case to exercise any bug(s) you fix.
|
||||
Instructions for checking out the latest source via CVS are here:
|
||||
|
||||
http://savannah.gnu.org/cvs/?group=coreutils
|
||||
Here are instructions for checking out the latest development sources:
|
||||
|
||||
http://savannah.gnu.org/git/?group=coreutils
|
||||
|
||||
If your patch adds a new feature, please try to get some sort of consensus
|
||||
that it is a worthwhile change. One way to do that is to send mail to
|
||||
@@ -232,8 +231,7 @@ the address on the last line of --help output.
|
||||
|
||||
========================================================================
|
||||
|
||||
Copyright (C) 1998, 2002, 2003, 2004, 2005, 2006 Free Software
|
||||
Foundation, Inc.
|
||||
Copyright (C) 1998, 2002-2009 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
These notes intend to help people working on the checked-out sources.
|
||||
These requirements do not apply when building from a distribution tarball.
|
||||
See also HACKING for more detailed coreutils contribution guidlines.
|
||||
|
||||
* Requirements
|
||||
|
||||
We've opted to keep only the highest-level sources in the GIT repository.
|
||||
This eases our maintenance burden, (fewer merges etc.), but imposes more
|
||||
requirements on anyone wishing to build from the just-checked-out sources.
|
||||
For example, you have to use the latest stable versions of the maintainer
|
||||
tools we depend upon, including:
|
||||
Specific tools and versions will be checked for and listed by the
|
||||
bootstrap script shown below, and will include:
|
||||
|
||||
- Automake <http://www.gnu.org/software/automake/>
|
||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||
@@ -22,46 +23,44 @@ tools we depend upon, including:
|
||||
- Rsync <http://samba.anu.edu.au/rsync/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||
Valgrind supports your architecture.
|
||||
|
||||
Only building the initial full source tree will be a bit painful.
|
||||
Later, a plain `git pull && make' should be sufficient.
|
||||
|
||||
* LZMA
|
||||
- Valgrind
|
||||
|
||||
The coreutils build procedure can build distribution tarballs with the
|
||||
LZMA compression scheme. This feature is so new that it is not
|
||||
supported by the latest version of Automake. If you don't care about
|
||||
building LZMA tarballs, you can manually remove the string "dist-lzma"
|
||||
from configure.ac before bootstrapping.
|
||||
Valgrind <http://valgrind.org/> is also highly recommended, if
|
||||
Valgrind supports your architecture. See also README-valgrind.
|
||||
|
||||
If you do want to build LZMA tarballs, you'll need to make sure you
|
||||
have the latest stable version of the LZMA Utils
|
||||
<http://tukaani.org/lzma/>. Also, you'll need a version of
|
||||
Automake that supports the dist-lzma feature, like automake-1.10.1.
|
||||
- XZ utils (successor to LZMA)
|
||||
|
||||
This package's build procedure uses XZ to create a compressed
|
||||
distribution tarball. Using this feature of Automake requires
|
||||
version 1.10a or newer, as well as the xz program itself.
|
||||
Make sure you have the latest version of the XZ Utils from
|
||||
<http://tukaani.org/lzma/download>.
|
||||
|
||||
* First GIT checkout
|
||||
|
||||
You can get a copy of the source repository like this:
|
||||
|
||||
$ git clone git://git.sv.gnu.org/coreutils
|
||||
$ git clone git://git.sv.gnu.org/coreutils
|
||||
$ cd coreutils
|
||||
|
||||
The next step is to get other files needed to build, which are
|
||||
extracted from other source packages:
|
||||
The next step is to get and check other files needed to build,
|
||||
which are extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
$ ./bootstrap
|
||||
|
||||
And there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the GIT master copy:
|
||||
|
||||
$ git diff
|
||||
$ git diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
@@ -69,7 +68,7 @@ Enjoy!
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -83,3 +82,7 @@ GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Local Variables:
|
||||
indent-tabs-mode: nil
|
||||
End:
|
||||
|
||||
31
README-prereq
Normal file
31
README-prereq
Normal file
@@ -0,0 +1,31 @@
|
||||
Detailed below are concrete examples for
|
||||
getting the prerequisites for particular systems.
|
||||
|
||||
- linux - fedora
|
||||
|
||||
This shows the steps for getting the required tools to build coreutils 7.0
|
||||
on a Fedora 8 system. We try to use official packages where possible.
|
||||
The 3 methods described for making these required packages available, should
|
||||
help clarify build requirements on any linux system at least.
|
||||
|
||||
1. Make sure offical distro git package is installed
|
||||
# yum install git
|
||||
|
||||
2. The distro autoconf is too old, but there is a newer one available
|
||||
so we rebuild that and make it available to the full system:
|
||||
# yum install emacs #autoconf build requires emacs (20MB)
|
||||
# rpmbuild --rebuild http://download.fedora.redhat.com/pub/fedora/linux/development/source/SRPMS/autoconf-2.63-1.fc10.src.rpm
|
||||
# rpm -Uvh /usr/src/redhat/RPMS/noarch/autoconf-2.63-1.fc8.noarch.rpm
|
||||
Apply the same method to install the lzma package.
|
||||
[FIXME: mention xz when it's packaged]
|
||||
|
||||
3. The latest released automake (1.10.1) was not new enough, so we download
|
||||
and build automake-1.10a from its repository and make it available
|
||||
just to coreutils:
|
||||
# yum install help2man #required to build automake fully
|
||||
$ git clone git://git.sv.gnu.org/automake.git
|
||||
$ cd automake && ./configure --prefix=$HOME/coreutils/deps
|
||||
$ make install
|
||||
|
||||
Now we can build coreutils as described in README-hacking
|
||||
as long as $PATH starts with $HOME/coreutils/deps
|
||||
40
THANKS
40
THANKS
@@ -10,6 +10,7 @@ the bug-report mailing list (as seen on last line of e.g., cp --help).
|
||||
A Costa agcosta@gis.net
|
||||
Aaron Hawley ashawley@uvm.edu
|
||||
Achim Blumensath blume@corona.oche.de
|
||||
Adam Jimerson vendion@charter.net
|
||||
Adam Klein aklein@debian.org
|
||||
Adrian Bunk bunk@stusta.de
|
||||
AIDA Shinra shinra@j10n.org
|
||||
@@ -21,6 +22,9 @@ Albert Hopkins ahopkins@dynacare.com
|
||||
Alberto Accomazzi alberto@cfa0.harvard.edu
|
||||
aldomel aldomel@ix.netcom.com
|
||||
Alen Muzinic zveki@fly.cc.fer.hr
|
||||
Alexander V. Lukyanov lav@netis.ru
|
||||
Allen Hewes allen@decisiv.net
|
||||
Axel Dörfler axeld@pinc-software.de
|
||||
Alexandre Duret-Lutz duret_g@epita.fr
|
||||
Alexey Solovyov alekso@math.uu.se
|
||||
Alexey Vyskubov alexey@pippuri.mawhrin.net
|
||||
@@ -56,6 +60,7 @@ Augey Mikus mikus@dqc.org
|
||||
Aurelien Jarno aurel32@debian.org
|
||||
Austin Donnelly Austin.Donnelly@cl.cam.ac.uk
|
||||
Axel Kittenberger Anshil@gmx.net
|
||||
Barry Kelly http://barrkel.blogspot.com/
|
||||
Bauke Jan Douma bjdouma@xs4all.nl
|
||||
Ben Elliston bje@air.net.au
|
||||
Ben Harris bjh21@netbsd.org
|
||||
@@ -69,6 +74,7 @@ Bernhard Baehr bernhard.baehr@gmx.de
|
||||
Bernhard Gabler bernhard@uni-koblenz.de
|
||||
Bernhard Rosenkraenzer bero@redhat.de
|
||||
Bert Deknuydt Bert.Deknuydt@esat.kuleuven.ac.be
|
||||
Bert Wesarg bert.wesarg@googlemail.com
|
||||
Bill Peters peters@gaffel.as.arizona.edu
|
||||
Bjorn Helgaas helgaas@rsn.hp.com
|
||||
Bob McCracken kerouac@ravenet.com
|
||||
@@ -76,12 +82,15 @@ Bob Proulx rwp@fc.hp.com
|
||||
Branden Robinson branden@necrotic.deadbeast.net
|
||||
Brendan O'Dea bod@compusol.com.au
|
||||
Brian Kimball bfk@footbag.org
|
||||
Brian M. Carlson sandals@crustytoothpaste.ath.cx
|
||||
Brian Silverman bsilverman@conceptxdesign.com
|
||||
Brian Youmans 3diff@gnu.org
|
||||
Bruce Korb bkorb@veritas.com
|
||||
Bruce Robertson brucer@theodolite.dyndns.org
|
||||
Bruno Haible haible@clisp.cons.org
|
||||
Carl Johnson carlj@cjlinux.home.org
|
||||
Carl Lowenstein cdl@mpl.UCSD.EDU
|
||||
Carl Roth roth@urs.us
|
||||
Carlos Canau Carlos.Canau@relay.puug.pt
|
||||
Charles Karney karney@pppl.gov
|
||||
Charles Randall crandall@matchlogic.com
|
||||
@@ -104,12 +113,15 @@ Colin Plumb colin@nyx.net
|
||||
Colin Watson cjw44@riva.ucam.org
|
||||
Collin Rogowski collin@rogowski.de
|
||||
Cray-Cyber Project http://www.cray-cyber.org
|
||||
Cristian Cadar cristic@stanford.edu
|
||||
Cyril Bouthors cyril@bouthors.org
|
||||
Dale Scheetz dwarf@polaris.net
|
||||
Dameon G. Rogers dgr03@uark.edu
|
||||
Dan Hagerty hag@gnu.ai.it.edu
|
||||
Dan Jacobson http://www.geocities.com/jidani
|
||||
Dan Jacobson jidanni@jidanni.org
|
||||
Dan Pascu dan@services.iiruc.ro
|
||||
Daniel Bergstrom noa@melody.se
|
||||
Daniel Dunbar ddunbar@stanford.edu
|
||||
Daniel P. Berrangé berrange@redhat.com
|
||||
Dániel Varga danielv@axelero.hu
|
||||
Danny Levinson danny.levinson@overture.com
|
||||
@@ -124,8 +136,10 @@ David Godfrey dave@delta.demon.co.uk
|
||||
David Luyer david_luyer@pacific.net.au
|
||||
David Madore david.madore@ens.fr
|
||||
David Malone dwmalone@cnri.dit.ie
|
||||
Dawson Engler engler@stanford.edu
|
||||
Dean Gaudet dean-savannah@arctic.org
|
||||
Deepak Goel deego@gnufans.org
|
||||
Denis Excoffier denis.excoffier@airbus.com
|
||||
Dennis Henriksen opus@flamingo.osrl.dk
|
||||
Dennis Smit ds@nerds-incorporated.org
|
||||
Derek Clegg dclegg@next.com
|
||||
@@ -146,8 +160,11 @@ Edzer Pebesma Edzer.Pebesma@rivm.nl
|
||||
Egmont Koblinger egmont@uhulinux.hu
|
||||
Eirik Fuller eirik@hackrat.com
|
||||
Eivind eivindt@multinet.no
|
||||
Elbert Pol elbert.pol@gmail.com
|
||||
Eli Zaretskii eliz@is.elta.co.il
|
||||
Elias Pipping pipping@gentoo.org
|
||||
Emile LeBlanc leblanc@math.toronto.edu
|
||||
Erik Auerswald auerswal@unix-ag.uni-kl.de
|
||||
Eric Backus ericb@lsid.hp.com
|
||||
Eric Blake ebb9@byu.net
|
||||
Eric G. Miller egm2@jps.net
|
||||
@@ -173,6 +190,7 @@ Gabor Z. Papp gzp@gzp.org.hu
|
||||
Gaël Quéri gqueri@mail.dotcom.fr
|
||||
Galen Hazelwood galenh@micron.net
|
||||
Gary Anderson ganderson@clark.net
|
||||
Gary Johnson garyjohn@spk.agilent.com
|
||||
Gary V. Vaughan gary@gnu.org
|
||||
Gaute Hvoslef Kvalnes gaute@verdsveven.com
|
||||
Geoff Collyer geoff at collyer.net
|
||||
@@ -187,6 +205,7 @@ Guochun Shi gshi@ncsa.uiuc.edu
|
||||
GOTO Masanori gotom@debian.or.jp
|
||||
Greg Louis glouis@dynamicro.on.ca
|
||||
Greg McGary gkm@gnu.org
|
||||
Greg Metcalfe metcalfegreg@qwest.net
|
||||
Greg Schafer gschafer@zip.com.au
|
||||
Greg Troxel gdt@bbn.com
|
||||
Greg Wooledge gawooledge@sherwin.com
|
||||
@@ -201,6 +220,7 @@ Harald Dunkel harald.dunkel@t-online.de
|
||||
Harry Liu rliu@lek.ugcs.caltech.edu
|
||||
Harti Brandt brandt@fokus.fraunhofer.de
|
||||
Harvey Eneman Harvey.Eneman@oracle.com
|
||||
Heiko Marr h.marr@webmasters.de
|
||||
Helen Faulkner helen_ml_faulkner@yahoo.co.uk
|
||||
Herbert Xu herbert@gondor.apana.org.au
|
||||
Holger Berger hberger@ess.nec.de
|
||||
@@ -212,26 +232,32 @@ Ian Jackson ijackson@chiark.greenend.org.uk
|
||||
Ian Lance Taylor ian@cygnus.com
|
||||
Ian Turner vectro@pipeline.com
|
||||
Iida Yosiaki iida@gnu.org
|
||||
Ilya N. Golubev gin@mo.msk.ru
|
||||
Ingo Saitz ingo@debian.org
|
||||
Ivo Timmermans ivo@debian.org
|
||||
James james@albion.glarp.com
|
||||
James Antill jmanti%essex.ac.uk@seralph21.essex.ac.uk
|
||||
James Lemley James.Lemley@acxiom.com
|
||||
James Hunt jamesodhunt@hotmail.com
|
||||
James Ralston ralston@pobox.com
|
||||
James Sneeringer jvs@ocslink.com
|
||||
James Tanis jtt@soscorp.com
|
||||
James Youngman james+usenet@free-lunch.demon.co.uk
|
||||
Jamie Lokier jamie@imbolc.ucc.ie
|
||||
Jamie McClelland jm@mayfirst.org
|
||||
Jan Engelhardt jengelh@medozas.de
|
||||
Jan Fedak J.Fedak@sh.cvut.cz
|
||||
Jan Moringen jan.moringen@uni-bielefeld.de
|
||||
Jan Nieuwenhuizen janneke@gnu.org
|
||||
Janos Farkas chexum@shadow.banki.hu
|
||||
Jarkko Hietaniemi jhi@epsilon.hut.fi
|
||||
Jarod Wilson jwilson@redhat.com
|
||||
Jean Charles Delepine delepine@u-picardie.fr
|
||||
Jeff Moore jbm@mordor.com
|
||||
Jeff Sheinberg jeff@bsrd.net
|
||||
Jens Elkner elkner@imsgroup.de
|
||||
Jens Schmidt jms@jsds.hamburg.com
|
||||
Jeph Cowan jeph@ucar.edu
|
||||
Jeremy Maitin-Shepard jbms@cmu.edu
|
||||
Jerome Abela abela@hsc.fr
|
||||
Jérôme Zago bug-coreutils-ml@agt-the-walker.net
|
||||
@@ -262,6 +288,7 @@ Joost van Baal joostvb@xs4all.nl
|
||||
Jorge Stolfi stolfi@ic.unicamp.br
|
||||
Joseph S. Myers jsm28@cam.ac.uk
|
||||
Joshua Hudson joshudson@gmail.com
|
||||
Josselin Mouette joss@debian.org
|
||||
Juan F. Codagnone juam@arnet.com.ar
|
||||
Juan M. Guerrero st001906@hrz1.hrz.tu-darmstadt.de
|
||||
Jungshik Shin jshin@pantheon.yale.edu
|
||||
@@ -419,9 +446,11 @@ Peter Moulder reiter@netspace.net.au
|
||||
Peter O'Gorman bug-coreutils@mlists.thewrittenword.com
|
||||
Peter Samuelson psamuels@sampo.creighton.edu
|
||||
Peter Seebach seebs@taniemarie.solon.com
|
||||
Petr Uzel petr.uzel@suse.cz
|
||||
Petter Reinholdtsen pere@hungry.com
|
||||
Phelippe Neveu pneveu@pcigeomatics.com
|
||||
Phil Richards phil.richards@vf.vodafone.co.uk
|
||||
Philip Rowlands phr@doc.ic.ac.uk
|
||||
Philippe De Muyter phdm@macqel.be
|
||||
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
|
||||
Phillip Jones mouse@datastacks.com
|
||||
@@ -429,6 +458,7 @@ Piergiorgio Sartor sartor@sony.de
|
||||
Pieter Bowman bowman@math.utah.edu
|
||||
Piotr Kwapulinski kwap@univ.gda.pl
|
||||
Prashant TR tr@eth.net
|
||||
Priit Jõerüüt jemm4jemm@yahoo.com
|
||||
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
|
||||
Ralf W. Stephan stephan@tmt.de
|
||||
Ralf Wildenhues Ralf.Wildenhues@gmx.de
|
||||
@@ -464,7 +494,7 @@ Sander van Malssen svm@kozmix.ow.nl
|
||||
Santiago Vila Doncel sanvila@unex.es
|
||||
Savochkin Andrey Vladimirovich saw@msu.ru
|
||||
Scott Lurndal slurn@griffin.engr.sgi.com
|
||||
Sébastien Maret smaret@umich.edu
|
||||
Sébastien Maret smaret@umich.edu
|
||||
Shing-Shong Shei shei@cs.indiana.edu
|
||||
Soeren Sonnenburg sonnenburg@informatik.hu-berlin.de
|
||||
Solar Designer solar@owl.openwall.com
|
||||
@@ -482,12 +512,13 @@ Steven G. Johnson stevenj@alum.mit.edu
|
||||
Steven Mocking ufo@quicknet.nl
|
||||
Steven P Watson steven@magelico.net
|
||||
Stuart Kemp skemp@peter.bmc.com
|
||||
Sven Joachim sven_joachim@web.de
|
||||
Sven Joachim svenjoac@gmx.de
|
||||
Szakacsits Szabolcs szaka@sienet.hu
|
||||
Tadayoshi Funaba tadf@kt.rim.or.jp
|
||||
TAKAI Kousuke takai@vlsi.kuee.kyoto-u.ac.jp
|
||||
Theodore Ts'o tytso@rsts-11.mit.edu
|
||||
The Wanderer inverseparadox@comcast.net
|
||||
Theodoros V. Kalamatianos nyb@users.sourceforge.net
|
||||
Thomas Bushnell thomas@gnu.ai.mit.edu
|
||||
Thomas Goerlich thomas@schnappmatik.de
|
||||
Thomas Hood jdthood@yahoo.co.uk
|
||||
@@ -498,6 +529,7 @@ Thomas Schwinge tschwinge@gnu.org
|
||||
Thomas Wolff mined@towo.net
|
||||
Tim J. Robbins tjr@FreeBSD.org
|
||||
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
|
||||
Tim Ryan Tim_Ryan@bnz.co.nz
|
||||
Tim Smithers mouse@dmouse.com.au
|
||||
Tim Waugh twaugh@redhat
|
||||
Toby Peterson toby@opendarwin.org
|
||||
@@ -523,7 +555,9 @@ Uwe H. Steinfeld usteinfeld@gmx.net
|
||||
Vesselin Atanasov vesselin@bgnet.bg
|
||||
Vin Shelton acs@alumni.princeton.edu
|
||||
Vineet Chadha chadha@acis.ufl.edu
|
||||
Vitali Lovich vlovich@gmail.com
|
||||
Vitaly A. Ostanin vyt@altlinux.org
|
||||
Vito Caputo vcaputo@pengaru.com
|
||||
Vlada Macek tuttle@bbs.fsik.cvut.cz
|
||||
Volker Borchert bt@teknon.de
|
||||
Volker Paul vpaul@dohle.com
|
||||
|
||||
85
TODO
85
TODO
@@ -5,19 +5,30 @@ longer pertinent, please search the mailing list and post your intent
|
||||
before embarking on a big project.
|
||||
|
||||
==================================================
|
||||
Modify chmod so that it does not change an inode's st_ctime
|
||||
when the selected operation would have no other effect.
|
||||
First suggested by Hans Ecke <http://hans.ecke.ws> in
|
||||
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/2920
|
||||
Discussed more recently on <http://bugs.debian.org/497514>.
|
||||
|
||||
document the following in coreutils.texi:
|
||||
runcon
|
||||
chcon
|
||||
mktemp
|
||||
[
|
||||
pinky
|
||||
uptime
|
||||
Also document the SELinux changes.
|
||||
|
||||
comm: add an option, --output-delimiter=STR
|
||||
Files to change: src/comm.c, ChangeLog, NEWS, doc/coreutils.texi,
|
||||
Add a new file, tests/misc/comm (use another file in that directory as
|
||||
a template), to exercise the new option. Suggestion from Dan Jacobson.
|
||||
Suggestion from Paul Eggert:
|
||||
More generally, there's not that much use for imaxtostr nowadays,
|
||||
since the inttypes module and newer versions of gettext allow things
|
||||
like _("truncating %s at %" PRIdMAX " bytes") to work portably.
|
||||
I suspect that (if someone cares to take the time) we can remove
|
||||
all instances of imaxtostr and umaxtostr in coreutils and gnulib.
|
||||
|
||||
cp --recursive: use fts and *at functions to perform directory traversals
|
||||
in source and destination hierarchy rather than forming full file names.
|
||||
The latter (current) approach fails unnecessarily when the names
|
||||
become very long, and requires space and time that is quadratic in the
|
||||
depth of the hierarchy. [Bo Borgerson is working on this]
|
||||
|
||||
printf:
|
||||
Now that gnulib supports *printf("%a"), import one of the
|
||||
@@ -25,13 +36,15 @@ printf:
|
||||
platforms where the native *printf(3) is deficient.
|
||||
Suggestion from Eric Blake.
|
||||
|
||||
pwd:
|
||||
Implement the options -P and -L in a POSIX-compatible way.
|
||||
Note the instructions in the initial paragraph of this file
|
||||
before starting.
|
||||
|
||||
renice: POSIX utility, needs implementing.
|
||||
suggestion from Karl Berry (among others).
|
||||
Bob Proulx is working on this.
|
||||
|
||||
install: add an option to specify the program used to strip binaries.
|
||||
suggestion from Karl Berry
|
||||
|
||||
doc/coreutils.texi:
|
||||
Address this comment: FIXME: mv's behavior in this case is system-dependent
|
||||
Better still: fix the code so it's *not* system-dependent.
|
||||
@@ -46,14 +59,6 @@ And once that's done, add an exclusion so that `cp --link'
|
||||
no longer incurs the overhead of saving src. dev/ino and dest. filename
|
||||
in the hash table.
|
||||
|
||||
See if we can be consistent about where --verbose sends its output:
|
||||
These all send --verbose output to stdout:
|
||||
head, tail, rm, cp, mv, ln, chmod, chown, chgrp, install, ln
|
||||
These send it to stderr:
|
||||
shred mkdir split
|
||||
shred must write --verbose output to stderr
|
||||
readlink is different
|
||||
|
||||
Write an autoconf test to work around build failure in HPUX's 64-bit mode.
|
||||
See notes in README -- and remove them once there's a work-around.
|
||||
|
||||
@@ -67,12 +72,6 @@ Should printf '\0123' print "\n3"?
|
||||
|
||||
printf: consider adapting builtins/printf.def from bash
|
||||
|
||||
df: add `--total' option, suggested here http://bugs.debian.org/186007
|
||||
|
||||
seq: give better diagnostics for invalid formats:
|
||||
e.g. no or too many % directives
|
||||
seq: consider allowing format string to contain no %-directives
|
||||
|
||||
tail: don't use xlseek; it *exits*.
|
||||
Instead, maybe use a macro and return nonzero.
|
||||
|
||||
@@ -108,9 +107,8 @@ sort: Investigate better sorting algorithms; see Knuth vol. 3.
|
||||
5.3.1, who credits Lester Ford, Jr. and Selmer Johnson, American
|
||||
Mathematical Monthly 66 (1959), 387-389.
|
||||
|
||||
cp --recursive: perform dir traversals in source and dest hierarchy rather
|
||||
than forming full file names. The latter (current) approach fails
|
||||
unnecessarily when the names become very long.
|
||||
shred: Update shred as described here to conform to DoD 5220 rules:
|
||||
http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00075.html
|
||||
|
||||
Remove suspicious uses of alloca (ones that may allocate more than
|
||||
about 4k)
|
||||
@@ -118,6 +116,9 @@ Remove suspicious uses of alloca (ones that may allocate more than
|
||||
Adapt these contribution guidelines for coreutils:
|
||||
http://sources.redhat.com/automake/contribute.html
|
||||
|
||||
Improve test coverage.
|
||||
See HACKING for instructions on generating an html test coverage report.
|
||||
Find a program that has poor coverage and improve.
|
||||
|
||||
Changes expected to go in, someday.
|
||||
======================================
|
||||
@@ -132,18 +133,12 @@ Changes expected to go in, someday.
|
||||
an implicit --NO-dereference-command-line-symlink-to-dir meaning.
|
||||
Pointed out by Karl Berry.
|
||||
|
||||
A more efficient version of factor, and possibly one that
|
||||
accepts inputs of size 2^64 and larger.
|
||||
|
||||
dd: consider adding an option to suppress `bytes/block read/written'
|
||||
output to stderr. Suggested here:
|
||||
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045
|
||||
|
||||
Pending copyright papers:
|
||||
------------------------
|
||||
ls --color: Ed Avis' patch to suppress escape sequences for
|
||||
non-highlighted files
|
||||
|
||||
getpwnam from Bruce Korb
|
||||
|
||||
pb (progress bar) from Miika Pekkarinen
|
||||
@@ -157,27 +152,21 @@ Add a distcheck-time test to ensure that every distributed
|
||||
file is either read-only(indicating generated) or is
|
||||
version-controlled and up to date.
|
||||
|
||||
Implement Ulrich Drepper's suggestion to use getgrouplist rather
|
||||
than getugroups. This affects only `id', but makes a big difference
|
||||
on systems with many users and/or groups, and makes id usable once
|
||||
again on systems where access restrictions make getugroups fail.
|
||||
But first we'll need a run-test (either in an autoconf macro or at
|
||||
run time) to avoid the segfault bug in libc-2.3.2's getgrouplist.
|
||||
In that case, we'd revert to using a new (to-be-written) getgrouplist
|
||||
module that does most of what `id' already does. Or just avoid the
|
||||
buggy use of getgrouplist by never passing it a buffer of length zero.
|
||||
See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=200327
|
||||
|
||||
remove `%s' notation (now that they're all gone, add a Makefile.maint sc_
|
||||
remove `%s' notation (now that they're all gone, add a maint.mk sc_
|
||||
rule to ensure no new ones are added):
|
||||
grep -E "\`%.{,4}s'" src/*.c
|
||||
|
||||
remove all uses of the `register' keyword: Done. add a Makefile.maint rule
|
||||
remove all uses of the `register' keyword: Done. add a maint.mk rule
|
||||
for this, too.
|
||||
|
||||
remove or adjust chown's --changes option, since it
|
||||
can't always do what it currently says it does.
|
||||
|
||||
Support arbitrary-precision arithmetic in those tools for which it
|
||||
makes sense. Factor and expr already support this via libgmp.
|
||||
The "test" program is covered via its string-based comparison of
|
||||
integers. To be converted: seq.
|
||||
|
||||
Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be
|
||||
multibyte aware. The problem is that I want to avoid duplicating
|
||||
significant blocks of logic, yet I also want to incur only minimal
|
||||
@@ -185,11 +174,9 @@ Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be
|
||||
|
||||
pr's use of nstrftime can make it malloc a very large (up to SIZE_MAX) buffer
|
||||
|
||||
ls.c: use gettime rather than clock_gettime, gettimeofday, time
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
||||
252
bootstrap
252
bootstrap
@@ -2,7 +2,7 @@
|
||||
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -49,9 +49,12 @@ Options:
|
||||
not to have been checked out.
|
||||
--skip-po Do not download po files.
|
||||
|
||||
If the file bootstrap.conf exists in the current working directory, its
|
||||
If the file $0.conf exists in the same directory as this script, its
|
||||
contents are read as shell variables to configure the bootstrap.
|
||||
|
||||
For build prerequisites, environment variables like \$AUTOCONF and \$AMTAR
|
||||
are honored.
|
||||
|
||||
Running without arguments will suffice in most cases.
|
||||
"
|
||||
}
|
||||
@@ -96,6 +99,11 @@ package=`sed -n "$extract_package_name" configure.ac` || exit
|
||||
gnulib_name=lib$package
|
||||
|
||||
build_aux=build-aux
|
||||
source_base=lib
|
||||
m4_base=m4
|
||||
doc_base=doc
|
||||
tests_base=tests
|
||||
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
@@ -121,6 +129,9 @@ XGETTEXT_OPTIONS='\\\
|
||||
--flag=error:3:c-format --flag=error_at_line:5:c-format\\\
|
||||
'
|
||||
|
||||
# Package bug report address for gettext files
|
||||
MSGID_BUGS_ADDRESS=bug-$package@gnu.org
|
||||
|
||||
# Files we don't want to import.
|
||||
excluded_files=
|
||||
|
||||
@@ -138,7 +149,13 @@ copy=false
|
||||
vc_ignore=auto
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
test -r bootstrap.conf && . ./bootstrap.conf
|
||||
# Make sure that bootstrap.conf is sourced from the current directory
|
||||
# if we were invoked as "sh bootstrap".
|
||||
case "$0" in
|
||||
*/*) test -r "$0.conf" && . "$0.conf" ;;
|
||||
*) test -r "$0.conf" && . ./"$0.conf" ;;
|
||||
esac
|
||||
|
||||
|
||||
if test "$vc_ignore" = auto; then
|
||||
vc_ignore=
|
||||
@@ -157,7 +174,7 @@ do
|
||||
usage
|
||||
exit;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
|
||||
GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
@@ -181,7 +198,7 @@ insert_sorted_if_absent() {
|
||||
file=$1
|
||||
str=$2
|
||||
test -f $file || touch $file
|
||||
echo "$str" | sort -u - $file | cmp -s - $file \
|
||||
echo "$str" | sort -u - $file | cmp - $file > /dev/null \
|
||||
|| echo "$str" | sort -u - $file -o $file \
|
||||
|| exit 1
|
||||
}
|
||||
@@ -208,29 +225,161 @@ if test ! -d $build_aux; then
|
||||
done
|
||||
fi
|
||||
|
||||
# Note this deviates from the version comparison in automake
|
||||
# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
|
||||
# but this should suffice as we won't be specifying old
|
||||
# version formats or redundant trailing .0 in bootstrap.conf.
|
||||
# If we did want full compatibility then we should probably
|
||||
# use m4_version_compare from autoconf.
|
||||
sort_ver() { #sort -V is not generally available
|
||||
ver1="$1"
|
||||
ver2="$2"
|
||||
|
||||
#split on '.' and compare each component
|
||||
i=1
|
||||
while : ; do
|
||||
p1=$(echo "$ver1" | cut -d. -f$i)
|
||||
p2=$(echo "$ver2" | cut -d. -f$i)
|
||||
if [ ! "$p1" ]; then
|
||||
echo "$1 $2"
|
||||
break
|
||||
elif [ ! "$p2" ]; then
|
||||
echo "$2 $1"
|
||||
break
|
||||
elif [ ! "$p1" = "$p2" ]; then
|
||||
if [ "$p1" -gt "$p2" ] 2>/dev/null; then #numeric comparision
|
||||
echo "$2 $1"
|
||||
elif [ "$p2" -gt "$p1" ] 2>/dev/null; then #numeric comparision
|
||||
echo "$1 $2"
|
||||
else #numeric, then lexographic comparison
|
||||
lp=$(printf "$p1\n$p2\n" | LANG=C sort -n | tail -n1)
|
||||
if [ "$lp" = "$p2" ]; then
|
||||
echo "$1 $2"
|
||||
else
|
||||
echo "$2 $1"
|
||||
fi
|
||||
fi
|
||||
break
|
||||
fi
|
||||
i=$(($i+1))
|
||||
done
|
||||
}
|
||||
|
||||
get_version() {
|
||||
app=$1
|
||||
|
||||
$app --version >/dev/null 2>&1 || return 1
|
||||
|
||||
$app --version 2>&1 |
|
||||
sed -n 's/[^0-9.]*\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/p
|
||||
t done
|
||||
d
|
||||
:done
|
||||
q'
|
||||
}
|
||||
|
||||
check_versions() {
|
||||
ret=0
|
||||
|
||||
while read app req_ver; do
|
||||
# Honor $APP variables ($TAR, $AUTOCONF, etc.)
|
||||
appvar=`echo $app | tr '[a-z]' '[A-Z]'`
|
||||
test "$appvar" = TAR && appvar=AMTAR
|
||||
eval "app=\${$appvar-$app}"
|
||||
inst_ver=$(get_version $app)
|
||||
if [ ! "$inst_ver" ]; then
|
||||
echo "Error: '$app' not found" >&2
|
||||
ret=1
|
||||
elif [ ! "$req_ver" = "-" ]; then
|
||||
latest_ver=$(sort_ver $req_ver $inst_ver | cut -d' ' -f2)
|
||||
if [ ! "$latest_ver" = "$inst_ver" ]; then
|
||||
echo "Error: '$app' version == $inst_ver is too old" >&2
|
||||
echo " '$app' version >= $req_ver is required" >&2
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
print_versions() {
|
||||
echo "Program Min_version"
|
||||
echo "----------------------"
|
||||
printf "$buildreq"
|
||||
echo "----------------------"
|
||||
#can't depend on column -t
|
||||
}
|
||||
|
||||
if ! printf "$buildreq" | check_versions; then
|
||||
test -f README-prereq &&
|
||||
echo "Please see README-prereq for notes on obtaining these prerequisite programs:" >&2
|
||||
echo
|
||||
print_versions
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
# See if we can use gnulib's git-merge-changelog merge driver.
|
||||
if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
|
||||
if git config merge.merge-changelog.driver >/dev/null ; then
|
||||
:
|
||||
elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
|
||||
echo "initializing git-merge-changelog driver"
|
||||
git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver'
|
||||
git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B'
|
||||
else
|
||||
echo "consider installing git-merge-changelog from gnulib"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
cleanup_gnulib() {
|
||||
status=$?
|
||||
rm -fr gnulib
|
||||
exit $status
|
||||
}
|
||||
|
||||
git_modules_config () {
|
||||
GIT_CONFIG_LOCAL=.gitmodules git config "$@"
|
||||
}
|
||||
|
||||
# Get gnulib files.
|
||||
|
||||
case ${GNULIB_SRCDIR--} in
|
||||
-)
|
||||
if [ ! -d gnulib ]; then
|
||||
if git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule init || exit $?
|
||||
git submodule update || exit $?
|
||||
|
||||
elif [ ! -d gnulib ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
git clone --depth 2 git://git.sv.gnu.org/gnulib ||
|
||||
git clone --help|grep depth > /dev/null && depth='--depth 2' || depth=
|
||||
git clone $depth git://git.sv.gnu.org/gnulib ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
fi
|
||||
GNULIB_SRCDIR=gnulib
|
||||
;;
|
||||
*)
|
||||
# Redirect the gnulib submodule to the directory on the command line
|
||||
# if possible.
|
||||
if test -d "$GNULIB_SRCDIR"/.git && \
|
||||
git_modules_config submodule.gnulib.url >/dev/null; then
|
||||
git submodule init
|
||||
GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
|
||||
git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
|
||||
echo "$0: getting gnulib files..."
|
||||
git submodule update || exit $?
|
||||
GNULIB_SRCDIR=gnulib
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
@@ -265,15 +414,15 @@ update_po_files() {
|
||||
|
||||
langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'`
|
||||
test "$langs" = '*' && langs=x
|
||||
for po in `cd $ref_po_dir && echo *.po|sed 's/\.po//g'`; do
|
||||
for po in $langs; do
|
||||
case $po in x) continue;; esac
|
||||
new_po="$ref_po_dir/$po.po"
|
||||
cksum_file="$ref_po_dir/$po.s1"
|
||||
if ! test -f "$cksum_file" ||
|
||||
! test -f "$po_dir/$po.po" ||
|
||||
! sha1sum -c --status "$cksum_file" < "$new_po" > /dev/null; then
|
||||
! ${SHA1SUM-sha1sum} -c --status "$cksum_file" < "$new_po" > /dev/null; then
|
||||
echo "updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file"
|
||||
cp "$new_po" "$po_dir/$po.po" && ${SHA1SUM-sha1sum} < "$new_po" > "$cksum_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -375,9 +524,13 @@ cp_mark_as_generated()
|
||||
|
||||
if test -z "$c1"; then
|
||||
cmp -s "$cp_src" "$cp_dst" || {
|
||||
# Copy the file first to get proper permissions if it
|
||||
# doesn't already exist. Then overwrite the copy.
|
||||
echo "$0: cp -f $cp_src $cp_dst" &&
|
||||
rm -f "$cp_dst" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst"
|
||||
cp "$cp_src" "$cp_dst-t" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" &&
|
||||
mv -f "$cp_dst-t" "$cp_dst"
|
||||
}
|
||||
else
|
||||
# Copy the file first to get proper permissions if it
|
||||
@@ -386,6 +539,7 @@ cp_mark_as_generated()
|
||||
(
|
||||
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
|
||||
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
|
||||
echo '#line 1' &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src"
|
||||
) > $cp_dst-t &&
|
||||
if cmp -s "$cp_dst-t" "$cp_dst"; then
|
||||
@@ -406,7 +560,9 @@ version_controlled_file() {
|
||||
grep -F "/$file/" $dir/CVS/Entries 2>/dev/null |
|
||||
grep '^/[^/]*/[0-9]' > /dev/null && found=yes
|
||||
elif test -d .git; then
|
||||
git-rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
elif test -d .svn; then
|
||||
svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes
|
||||
else
|
||||
echo "$0: no version control for $dir/$file?" >&2
|
||||
fi
|
||||
@@ -429,7 +585,7 @@ slurp() {
|
||||
if test $file = Makefile.am; then
|
||||
copied=$copied${sep}$gnulib_mk; sep=$nl
|
||||
remove_intl='/^[^#].*\/intl/s/^/#/;'"s!$bt_regex/!!g"
|
||||
sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/$gnulib_mk || {
|
||||
sed "$remove_intl" $1/$dir/$file | cmp - $dir/$gnulib_mk > /dev/null || {
|
||||
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
|
||||
rm -f $dir/$gnulib_mk &&
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
|
||||
@@ -488,11 +644,11 @@ gnulib_tool_options="\
|
||||
--import\
|
||||
--no-changelog\
|
||||
--aux-dir $bt/$build_aux\
|
||||
--doc-base $bt/doc\
|
||||
--doc-base $bt/$doc_base\
|
||||
--lib $gnulib_name\
|
||||
--m4-base $bt/m4/\
|
||||
--source-base $bt/lib/\
|
||||
--tests-base $bt/tests\
|
||||
--m4-base $bt/$m4_base/\
|
||||
--source-base $bt/$source_base/\
|
||||
--tests-base $bt/$tests_base\
|
||||
--local-dir $local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
@@ -511,46 +667,46 @@ grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||
with_gettext=no
|
||||
|
||||
if test $with_gettext = yes; then
|
||||
echo "$0: (cd $bt2; autopoint) ..."
|
||||
echo "$0: (cd $bt2; ${AUTOPOINT-autopoint}) ..."
|
||||
cp configure.ac $bt2 &&
|
||||
(cd $bt2 && autopoint && rm configure.ac) &&
|
||||
(cd $bt2 && ${AUTOPOINT-autopoint} && rm configure.ac) &&
|
||||
slurp $bt2 $bt || exit
|
||||
|
||||
rm -fr $bt $bt2 || exit
|
||||
fi
|
||||
rm -fr $bt $bt2 || exit
|
||||
|
||||
# Coreutils is unusual in that it generates some of its test-related
|
||||
# Makefile.am files. That must be done before invoking automake.
|
||||
mam_template=tests/Makefile.am.in
|
||||
if test -f $mam_template; then
|
||||
PERL=perl
|
||||
for tool in cut head join pr sort tac tail test tr uniq wc; do
|
||||
m=tests/$tool/Makefile.am
|
||||
t=${m}t
|
||||
rm -f $m $t
|
||||
sed -n '1,/^##test-files-begin/p' $mam_template > $t
|
||||
echo "x = $tool" >> $t
|
||||
srcdir=tests/$tool
|
||||
$PERL -I$srcdir -w -- tests/mk-script $srcdir --list >> $t
|
||||
sed -n '/^##test-files-end/,$p' $mam_template >> $t
|
||||
chmod -w $t
|
||||
mv $t $m
|
||||
done
|
||||
fi
|
||||
# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
|
||||
# gnulib-populated directories. Such .m4 files would cause aclocal to fail.
|
||||
# The following requires GNU find 4.2.3 or newer. Considering the usual
|
||||
# portability constraints of this script, that may seem a very demanding
|
||||
# requirement, but it should be ok. Ignore any failure, which is fine,
|
||||
# since this is only a convenience to help developers avoid the relatively
|
||||
# unusual case in which a symlinked-to .m4 file is git-removed from gnulib
|
||||
# between successive runs of this script.
|
||||
find "$m4_base" "$source_base" \
|
||||
-depth \( -name '*.m4' -o -name '*.[ch]' \) \
|
||||
-type l -xtype l -delete > /dev/null 2>&1
|
||||
|
||||
# Reconfigure, getting other files.
|
||||
|
||||
for command in \
|
||||
libtool \
|
||||
'aclocal --force -I m4' \
|
||||
'autoconf --force' \
|
||||
'autoheader --force' \
|
||||
'automake --add-missing --copy --force-missing';
|
||||
"${ACLOCAL-aclocal} --force -I m4" \
|
||||
"${AUTOCONF-autoconf} --force" \
|
||||
"${AUTOHEADER-autoheader} --force" \
|
||||
"${AUTOMAKE-automake} --add-missing --copy --force-missing"
|
||||
do
|
||||
if test "$command" = libtool; then
|
||||
grep '^[ ]*AM_PROG_LIBTOOL\>' configure.ac >/dev/null ||
|
||||
continue
|
||||
command='libtoolize -c -f'
|
||||
use_libtool=0
|
||||
# We'd like to use grep -E, to see if any of LT_INIT,
|
||||
# AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
|
||||
# but that's not portable enough (e.g., for Solaris).
|
||||
grep '^[ ]*A[CM]_PROG_LIBTOOL' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
grep '^[ ]*LT_INIT' configure.ac >/dev/null \
|
||||
&& use_libtool=1
|
||||
test $use_libtool = 0 \
|
||||
&& continue
|
||||
command="${LIBTOOLIZE-libtoolize} -c -f"
|
||||
fi
|
||||
echo "$0: $command ..."
|
||||
$command || exit
|
||||
@@ -573,7 +729,7 @@ if test $with_gettext = yes; then
|
||||
rm -f po/Makevars
|
||||
sed '
|
||||
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= '"$MSGID_BUGS_ADDRESS"'/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
@@ -606,6 +762,4 @@ m=gnulib-tests/gnulib.mk
|
||||
sed 's,\.\./\.\.,..,g' $m > $m-t
|
||||
mv -f $m-t $m
|
||||
|
||||
chmod a+x gnulib-tests/test-*.sh
|
||||
|
||||
echo "$0: done. Now you can run './configure'."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -16,17 +16,17 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# We don't need these modules, even though gnulib-tool mistakenly
|
||||
# includes them because of gettext and fchdir dependencies.
|
||||
# We don't need these modules.
|
||||
avoided_gnulib_modules='
|
||||
--avoid=lock
|
||||
--avoid=canonicalize-lgpl
|
||||
--avoid=dummy
|
||||
--avoid=lock
|
||||
'
|
||||
|
||||
# These modules are obsolete and can probably be removed soon,
|
||||
# but leave them in for now to minimize changes.
|
||||
obsolete_gnulib_modules='
|
||||
atexit free memchr memcmp memcpy memmove memset rename
|
||||
atexit memchr memcmp memcpy memmove memset rename
|
||||
strcspn strtod strtol utime
|
||||
'
|
||||
|
||||
@@ -34,18 +34,23 @@ obsolete_gnulib_modules='
|
||||
gnulib_modules="
|
||||
$avoided_gnulib_modules
|
||||
$obsolete_gnulib_modules
|
||||
acl alloca announce-gen argmatch assert
|
||||
acl alloca announce-gen argmatch
|
||||
argv-iter
|
||||
assert
|
||||
autobuild
|
||||
backupfile base64
|
||||
c-strcase c-strtod
|
||||
c-strtold calloc canon-host canonicalize chown cloexec
|
||||
config-h configmake
|
||||
closein closeout
|
||||
crypto/md5 crypto/sha1
|
||||
crypto/md5
|
||||
crypto/sha1
|
||||
crypto/sha256
|
||||
crypto/sha512
|
||||
cycle-check
|
||||
d-ino d-type diacrit dirfd dirname dup2
|
||||
error euidaccess exclude exitfail fchdir fcntl fcntl-safer fdl
|
||||
file-type fileblocks filemode filenamecat fnmatch-gnu
|
||||
file-type fileblocks filemode filenamecat filevercmp fnmatch-gnu
|
||||
fopen-safer
|
||||
fprintftime
|
||||
fseeko
|
||||
@@ -55,15 +60,25 @@ gnulib_modules="
|
||||
getline getloadavg getndelim2 getopt getpagesize getpass-gnu
|
||||
gettext gettime gettimeofday getugroups getusershell
|
||||
git-version-gen
|
||||
gnu-make gnupload
|
||||
gitlog-to-changelog
|
||||
gnu-make gnumakefile gnupload
|
||||
group-member hard-locale hash hash-pjw host-os human idcache
|
||||
ignore-value
|
||||
inttostr inttypes isapipe
|
||||
lchmod lchown lib-ignore linebuffer link-follow
|
||||
long-options lstat malloc mbswidth memcasecmp mempcpy
|
||||
long-options lstat malloc
|
||||
mbrtowc
|
||||
mbswidth
|
||||
memcasecmp mempcpy
|
||||
memrchr mgetgroups
|
||||
mkancesdirs mkdir mkdir-p mkstemp mktime modechange
|
||||
mountlist mpsort obstack pathmax perl physmem
|
||||
posix-shell posixtm posixver putenv
|
||||
posix-shell
|
||||
posixtm
|
||||
posixver
|
||||
progname
|
||||
propername
|
||||
putenv
|
||||
quote quotearg raise readlink areadlink-with-size
|
||||
randint
|
||||
randperm
|
||||
@@ -75,17 +90,24 @@ gnulib_modules="
|
||||
safe-read same
|
||||
save-cwd savedir savewd
|
||||
selinux-at
|
||||
settime sig2str ssize_t stat-macros
|
||||
settime sig2str sigaction ssize_t stat-macros
|
||||
stat-time stdbool stdlib-safer stpcpy
|
||||
stpncpy
|
||||
strdup
|
||||
strftime
|
||||
strpbrk strtoimax strtoumax strverscmp sys_stat timespec tzset
|
||||
unicodeio unistd-safer unlink-busy unlinkdir unlocked-io
|
||||
uptime userspec utimecmp utimens
|
||||
uptime
|
||||
useless-if-before-free
|
||||
userspec utimecmp utimens
|
||||
vasprintf-posix
|
||||
verify version-etc-fsf
|
||||
vc-list-files
|
||||
verify version-etc-fsf verror
|
||||
warnings
|
||||
wcwidth winsz-ioctl winsz-termios write-any-file
|
||||
xalloc xgetcwd xgethostname
|
||||
xalloc
|
||||
xfreopen
|
||||
xgetcwd xgethostname
|
||||
xmemcoll xnanosleep
|
||||
xprintf
|
||||
xprintf-posix
|
||||
@@ -111,6 +133,14 @@ XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--flag=xprintf:1:c-format\\\
|
||||
'
|
||||
|
||||
# Append these, since we use the propername module.
|
||||
see_manual='"This is a proper name. See the gettext manual, section Names."'
|
||||
see_manual=\'"$see_manual"\'
|
||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--keyword=proper_name:1,'"$see_manual"'\\\
|
||||
--keyword=proper_name_utf8:1,'"$see_manual"'\\\
|
||||
'
|
||||
|
||||
# If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
|
||||
# appears in configure.ac, exclude some unnecessary files.
|
||||
# Without grep's -E option (not portable enough, pre-configure),
|
||||
@@ -139,3 +169,22 @@ if test $gettext_external = 1; then
|
||||
fi
|
||||
|
||||
gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
|
||||
|
||||
# Build prerequisites
|
||||
buildreq="\
|
||||
autoconf 2.61
|
||||
automake 1.10a
|
||||
autopoint -
|
||||
bison -
|
||||
gettext -
|
||||
git 1.4.4
|
||||
gperf -
|
||||
gzip -
|
||||
makeinfo -
|
||||
perl 5.5
|
||||
rsync -
|
||||
tar -
|
||||
"
|
||||
|
||||
# Automake requires that ChangeLog exist.
|
||||
touch ChangeLog
|
||||
|
||||
14
build-aux/.gitignore
vendored
14
build-aux/.gitignore
vendored
@@ -1,14 +0,0 @@
|
||||
announce-gen
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
git-version-gen
|
||||
gnupload
|
||||
install-sh
|
||||
link-warning.h
|
||||
mdate-sh
|
||||
missing
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
@@ -41,7 +41,7 @@ ENABLE_HARD_ERRORS = :
|
||||
|
||||
## We use GNU Make extensions (%-rules) inside GNU_MAKE checks,
|
||||
## and we override check-TESTS.
|
||||
AUTOMAKE_OPTIONS = -Wno-portability -Wno-override
|
||||
AUTOMAKE_OPTIONS += -Wno-portability -Wno-override
|
||||
|
||||
# Restructured Text title and section.
|
||||
am__rst_title = sed 's/.*/ & /;h;s/./=/g;p;x;p;g;p;s/.*//'
|
||||
@@ -89,18 +89,31 @@ tput sgr0 >/dev/null 2>&1 && \
|
||||
# by disabling -e (using the XSI extension "set +e") if it's set.
|
||||
SH_E_WORKAROUND = case $$- in *e*) set +e;; esac
|
||||
|
||||
# Emulate dirname with sed.
|
||||
_d_no_slash = s,^[^/]*$$,.,
|
||||
_d_strip_trailing = s,\([^/]\)//*$$,\1,
|
||||
_d_abs_trivial = s,^//*[^/]*$$,/,
|
||||
_d_rm_basename = s,\([^/]\)//*[^/]*$$,\1,
|
||||
_dirname = \
|
||||
sed '$(_d_no_slash);$(_d_strip_trailing);$(_d_abs_trivial);$(_d_rm_basename)'
|
||||
|
||||
# To be inserted before the command running the test. Creates the
|
||||
# directory for the log if needed. Stores in $dir the directory
|
||||
# containing $src, and passes TESTS_ENVIRONMENT.
|
||||
# Save and restore TERM around use of TESTS_ENVIRONMENT,
|
||||
# in case that unsets it.
|
||||
am__check_pre = \
|
||||
$(SH_E_WORKAROUND); \
|
||||
tst=`echo "$$src" | sed 's|^.*/||'`; \
|
||||
rm -f $@-t; \
|
||||
$(mkdir_p) "$$(dirname $@)" || exit; \
|
||||
trap 'st=$$?; rm -f '\''$(abs_builddir)/$@-t'\''; (exit $$st); exit $$st' \
|
||||
1 2 13 15; \
|
||||
$(mkdir_p) "$$(echo '$@'|$(_dirname))" || exit; \
|
||||
if test -f "./$$src"; then dir=./; \
|
||||
elif test -f "$$src"; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
$(TESTS_ENVIRONMENT) $(SHELL)
|
||||
__SAVED_TERM=$$TERM; \
|
||||
$(TESTS_ENVIRONMENT)
|
||||
|
||||
# To be appended to the command running the test. Handles the stdout
|
||||
# and stderr redirection, and catch the exit status.
|
||||
@@ -110,6 +123,7 @@ estatus=$$?; \
|
||||
if test $$estatus -eq 177; then \
|
||||
$(ENABLE_HARD_ERRORS) || estatus=1; \
|
||||
fi; \
|
||||
TERM=$$__SAVED_TERM; export TERM; \
|
||||
$(am__tty_colors); \
|
||||
xfailed=PASS; \
|
||||
for xfail in : $(XFAIL_TESTS); do \
|
||||
@@ -131,7 +145,7 @@ echo "$$res: $@ (exit: $$estatus)" | \
|
||||
cat $@-t >>$@; \
|
||||
rm $@-t
|
||||
|
||||
SUFFIXES = .html .log
|
||||
SUFFIXES += .html .log
|
||||
|
||||
# From a test (with no extension) to a log file.
|
||||
if GNU_MAKE
|
||||
@@ -145,8 +159,9 @@ CHECK-FORCE:
|
||||
DEPENDENCY = CHECK-FORCE
|
||||
$(TEST_LOGS): $(DEPENDENCY)
|
||||
@if test '$(DEPENDENCY)' = CHECK-FORCE; then \
|
||||
dst=$@; \
|
||||
exec $(MAKE) $(AM_MAKEFLAGS) DEPENDENCY='$(srcdir)'/$${dst%.log} $@;\
|
||||
dst=$@; src=$${dst%.log}; \
|
||||
test -x "$$src" || src='$(srcdir)'/$$src; \
|
||||
exec $(MAKE) $(AM_MAKEFLAGS) DEPENDENCY="$$src" $@; \
|
||||
else \
|
||||
src='$(DEPENDENCY)'; \
|
||||
$(am__check_pre) "$$dir$$src" $(am__check_post); \
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
# List the specified version-controlled files.
|
||||
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# List the specified version-controlled files.
|
||||
# With no argument, list them all.
|
||||
# This script must be run solely from the top of a $srcdir build directory.
|
||||
|
||||
# If there's an argument, it must be a single, "."-relative directory name.
|
||||
# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
|
||||
|
||||
dir=
|
||||
case $# in
|
||||
0) ;;
|
||||
1) dir=$1 ;;
|
||||
*) echo "$0: too many arguments" 1>&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
test "x$dir" = x && dir=.
|
||||
|
||||
if test -d CVS; then
|
||||
if test -x build-aux/cvsu; then
|
||||
build-aux/cvsu --find --types=AFGM "$dir"
|
||||
else
|
||||
awk -F/ '{ \
|
||||
if (!$1 && $3 !~ /^-/) { \
|
||||
f=FILENAME; \
|
||||
sub(/CVS\/Entries/, "", f); \
|
||||
print f $2; \
|
||||
}}' \
|
||||
$(find ${*-*} -name Entries -print) /dev/null;
|
||||
fi
|
||||
else
|
||||
git-ls-files "$dir"
|
||||
fi
|
||||
194
cfg.mk
Normal file
194
cfg.mk
Normal file
@@ -0,0 +1,194 @@
|
||||
# Customize maint.mk -*- makefile -*-
|
||||
# Copyright (C) 2003-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Use alpha.gnu.org for alpha and beta releases.
|
||||
# Use ftp.gnu.org for major releases.
|
||||
gnu_ftp_host-alpha = alpha.gnu.org
|
||||
gnu_ftp_host-beta = alpha.gnu.org
|
||||
gnu_ftp_host-major = ftp.gnu.org
|
||||
gnu_rel_host = $(gnu_ftp_host-$(RELEASE_TYPE))
|
||||
|
||||
url_dir_list = \
|
||||
ftp://$(gnu_rel_host)/gnu/coreutils
|
||||
|
||||
# The GnuPG ID of the key used to sign the tarballs.
|
||||
gpg_key_ID = B9AB9A16
|
||||
|
||||
# Tests not to run as part of "make distcheck".
|
||||
# Exclude changelog-check here so that there's less churn in ChangeLog
|
||||
# files -- otherwise, you'd need to have the upcoming version number
|
||||
# at the top of the file for each `make distcheck' run.
|
||||
local-checks-to-skip = changelog-check strftime-check
|
||||
|
||||
local-checks-to-skip += patch-check
|
||||
|
||||
# The local directory containing the checked-out copy of gnulib used in this
|
||||
# release. Used solely to get gnulib's SHA1 for the "announcement" target.
|
||||
gnulib_dir = /gnulib
|
||||
|
||||
# Now that we have better (check.mk) tests, make this the default.
|
||||
export VERBOSE = yes
|
||||
|
||||
old_NEWS_hash = 791cf10529d00853f6363ca67f360747 -
|
||||
|
||||
# Ensure that the list of O_ symbols used to compute O_FULLBLOCK is complete.
|
||||
dd = $(srcdir)/src/dd.c
|
||||
sc_dd_O_FLAGS:
|
||||
@rm -f $@.1 $@.2
|
||||
@{ echo O_FULLBLOCK; perl -nle '/MAX \((O_\w*),/ and print $$1' \
|
||||
$(dd); } | sort > $@.1
|
||||
@{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
|
||||
$(dd); } | sort > $@.2
|
||||
@diff -u $@.1 $@.2 || diff=1 || diff=; \
|
||||
rm -f $@.1 $@.2; \
|
||||
test "$$diff" \
|
||||
&& { echo '$(ME): $(dd) has inconsistent O_ flag lists'>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Ensure that dd's definition of LONGEST_SYMBOL stays in sync
|
||||
# with the strings from the two affected variables.
|
||||
dd_c = $(srcdir)/src/dd.c
|
||||
sc_dd_max_sym_length:
|
||||
ifneq ($(wildcard $(dd_c)),)
|
||||
@len=$$( (sed -n '/conversions\[\] =$$/,/^};/p' $(dd_c);\
|
||||
sed -n '/flags\[\] =$$/,/^};/p' $(dd_c) ) \
|
||||
|sed -n '/"/s/^[^"]*"\([^"]*\)".*/\1/p' \
|
||||
| wc --max-line-length); \
|
||||
max=$$(sed -n '/^#define LONGEST_SYMBOL /s///p' $(dd_c) \
|
||||
|tr -d '"' | wc --max-line-length); \
|
||||
if test "$$len" = "$$max"; then :; else \
|
||||
echo 'dd.c: LONGEST_SYMBOL is not longest' 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
|
||||
# Many m4 macros names once began with `jm_'.
|
||||
# On 2004-04-13, they were all changed to start with gl_ instead.
|
||||
# Make sure that none are inadvertently reintroduced.
|
||||
sc_prohibit_jm_in_m4:
|
||||
@grep -nE 'jm_[A-Z]' \
|
||||
$$($(VC_LIST) m4 |grep '\.m4$$'; echo /dev/null) && \
|
||||
{ echo '$(ME): do not use jm_ in m4 macro names' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Ensure that each root-requiring test is run via the "check-root" rule.
|
||||
sc_root_tests:
|
||||
@if test -d tests \
|
||||
&& grep check-root tests/Makefile.am>/dev/null 2>&1; then \
|
||||
t1=sc-root.expected; t2=sc-root.actual; \
|
||||
grep -nl '^require_root_$$' \
|
||||
$$($(VC_LIST) tests) |sed s,tests/,, |sort > $$t1; \
|
||||
sed -n '/^root_tests =[ ]*\\$$/,/[^\]$$/p' \
|
||||
$(srcdir)/tests/Makefile.am \
|
||||
| sed 's/^ *//;/^root_tests =/d' \
|
||||
| tr -s '\012\\' ' ' | fmt -1 | sort > $$t2; \
|
||||
diff -u $$t1 $$t2 || diff=1 || diff=; \
|
||||
rm -f $$t1 $$t2; \
|
||||
test "$$diff" \
|
||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
headers_with_interesting_macro_defs = \
|
||||
exit.h \
|
||||
fcntl_.h \
|
||||
fnmatch_.h \
|
||||
intprops.h \
|
||||
inttypes_.h \
|
||||
lchown.h \
|
||||
openat.h \
|
||||
stat-macros.h \
|
||||
stdint_.h
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of macros that are guaranteed by parts of gnulib to be defined.
|
||||
.re-defmac:
|
||||
@(cd $(srcdir)/lib; \
|
||||
for f in $(headers_with_interesting_macro_defs); do \
|
||||
test -f $$f && \
|
||||
sed -n '/^# *define \([^_ (][^ (]*\)[ (].*/s//\1/p' $$f; \
|
||||
done; \
|
||||
) | sort -u \
|
||||
| grep -Ev 'ATTRIBUTE_NORETURN|SIZE_MAX' \
|
||||
| sed 's/^/^# *define /' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Don't define macros that we already get from gnulib header files.
|
||||
sc_always_defined_macros: .re-defmac
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-defmac; exit $$rc' 0 1 2 3 15; \
|
||||
grep -f .re-defmac $$($(VC_LIST)) \
|
||||
&& { echo '$(ME): define the above via some gnulib .h file' \
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Create a list of regular expressions matching the names
|
||||
# of files included from system.h. Exclude a couple.
|
||||
.re-list:
|
||||
@sed -n '/^# *include /s///p' $(srcdir)/src/system.h \
|
||||
| grep -Ev 'sys/(param|file)\.h' \
|
||||
| sed 's/ .*//;;s/^["<]/^# *include [<"]/;s/\.h[">]$$/\\.h[">]/' \
|
||||
> $@-t
|
||||
@mv $@-t $@
|
||||
|
||||
# Files in src/ should not include directly any of
|
||||
# the headers already included via system.h.
|
||||
sc_system_h_headers: .re-list
|
||||
@if test -f $(srcdir)/src/system.h; then \
|
||||
trap 'rc=$$?; rm -f .re-list; exit $$rc' 0 1 2 3 15; \
|
||||
grep -nE -f .re-list \
|
||||
$$($(VC_LIST) src | \
|
||||
grep -Ev '((copy|system)\.h|parse-gram\.c)$$') \
|
||||
&& { echo '$(ME): the above are already included via system.h'\
|
||||
1>&2; exit 1; } || :; \
|
||||
fi
|
||||
|
||||
sc_sun_os_names:
|
||||
@grep -nEi \
|
||||
'solaris[^[:alnum:]]*2\.(7|8|9|[1-9][0-9])|sunos[^[:alnum:]][6-9]' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found misuse of Sun OS version numbers' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_tight_scope:
|
||||
@$(MAKE) -C src $@
|
||||
|
||||
# Perl-based tests used to exec perl from a #!/bin/sh script.
|
||||
# Now they all start with #!/usr/bin/perl and the portability
|
||||
# infrastructure is in tests/Makefile.am. Make sure no old-style
|
||||
# script sneaks back in.
|
||||
sc_no_exec_perl_coreutils:
|
||||
@if test -f $(srcdir)/tests/Coreutils.pm; then \
|
||||
grep '^exec *\$$PERL.*MCoreutils' $$($(VC_LIST) tests) && \
|
||||
{ echo 1>&2 '$(ME): found anachronistic Perl-based tests'; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Ensure that date's --help output stays in sync with the info
|
||||
# documentation for GNU strftime. The only exception is %N,
|
||||
# which date accepts but GNU strftime does not.
|
||||
extract_char = sed 's/^[^%][^%]*%\(.\).*/\1/'
|
||||
sc_strftime_check:
|
||||
@if test -f $(srcdir)/src/date.c; then \
|
||||
grep '^ %. ' $(srcdir)/src/date.c | sort \
|
||||
| $(extract_char) > $@-src; \
|
||||
{ echo N; \
|
||||
info libc date calendar format | grep '^ `%.'\' \
|
||||
| $(extract_char); } | sort > $@-info; \
|
||||
diff -u $@-src $@-info || exit 1; \
|
||||
rm -f $@-src $@-info; \
|
||||
fi
|
||||
159
configure.ac
159
configure.ac
@@ -18,21 +18,21 @@
|
||||
|
||||
dnl Written by Jim Meyering.
|
||||
|
||||
AC_PREREQ(2.61)
|
||||
AC_PREREQ([2.61])
|
||||
|
||||
# Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
|
||||
# indicates that it is built from the 219th delta (in _some_ repository)
|
||||
# following the v6.9 tag, and that 58ddd is a prefix of the commit SHA1.
|
||||
AC_INIT([GNU coreutils], m4_esyscmd([build-aux/git-version-gen .version]),
|
||||
AC_INIT([GNU coreutils],
|
||||
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
|
||||
[bug-coreutils@gnu.org])
|
||||
|
||||
AC_CONFIG_SRCDIR(src/ls.c)
|
||||
AC_CONFIG_SRCDIR([src/ls.c])
|
||||
|
||||
AC_CONFIG_AUX_DIR(build-aux)
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||
|
||||
AB_INIT()
|
||||
AM_INIT_AUTOMAKE([1.10 dist-lzma])
|
||||
AM_INIT_AUTOMAKE([1.10a dist-xz])
|
||||
|
||||
AC_PROG_CC_STDC
|
||||
AM_PROG_CC_C_O
|
||||
@@ -44,20 +44,53 @@ gl_EARLY
|
||||
gl_INIT
|
||||
coreutils_MACROS
|
||||
|
||||
AC_ARG_ENABLE([gcc-warnings],
|
||||
[AS_HELP_STRING([--enable-gcc-warnings],
|
||||
[turn on lots of GCC warnings (not recommended)])],
|
||||
[case $enableval in
|
||||
yes|no) ;;
|
||||
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
|
||||
esac
|
||||
gl_gcc_warnings=$enableval],
|
||||
[gl_gcc_warnings=no]
|
||||
)
|
||||
|
||||
if test "$gl_gcc_warnings" = yes; then
|
||||
gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
|
||||
AC_SUBST([WERROR_CFLAGS])
|
||||
gl_WARN_ADD([-Wall])
|
||||
gl_WARN_ADD([-Wextra])
|
||||
gl_WARN_ADD([-Wshadow])
|
||||
gl_WARN_ADD([-Wno-sign-compare])
|
||||
gl_WARN_ADD([-Wformat])
|
||||
gl_WARN_ADD([-Wformat-security])
|
||||
gl_WARN_ADD([-Wcast-align])
|
||||
gl_WARN_ADD([-Wpointer-arith])
|
||||
gl_WARN_ADD([-Wwrite-strings])
|
||||
gl_WARN_ADD([-Wbad-function-cast])
|
||||
gl_WARN_ADD([-Wmissing-declarations])
|
||||
gl_WARN_ADD([-Wmissing-prototypes])
|
||||
gl_WARN_ADD([-Wstrict-prototypes])
|
||||
AC_SUBST([WARN_CFLAGS])
|
||||
AC_DEFINE([lint], [1], [Define to 1 if the compiler is checking for lint.])
|
||||
AC_DEFINE([_FORTIFY_SOURCE], [2],
|
||||
[enable compile-time and run-time bounds-checking, and some warnings])
|
||||
fi
|
||||
|
||||
AC_FUNC_FORK
|
||||
|
||||
optional_bin_progs=
|
||||
AC_CHECK_FUNCS(uname,
|
||||
AC_CHECK_FUNCS([uname],
|
||||
gl_ADD_PROG([optional_bin_progs], [uname]))
|
||||
AC_CHECK_FUNCS(chroot,
|
||||
AC_CHECK_FUNCS([chroot],
|
||||
gl_ADD_PROG([optional_bin_progs], [chroot]))
|
||||
AC_CHECK_FUNCS(gethostid,
|
||||
AC_CHECK_FUNCS([gethostid],
|
||||
gl_ADD_PROG([optional_bin_progs], [hostid]))
|
||||
|
||||
gl_WINSIZE_IN_PTEM
|
||||
|
||||
AC_MSG_CHECKING(whether localtime caches TZ)
|
||||
AC_CACHE_VAL(utils_cv_localtime_cache,
|
||||
AC_MSG_CHECKING([whether localtime caches TZ])
|
||||
AC_CACHE_VAL([utils_cv_localtime_cache],
|
||||
[if test x$ac_cv_func_tzset = xyes; then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <time.h>
|
||||
#if STDC_HEADERS
|
||||
@@ -98,22 +131,22 @@ else
|
||||
# since we can't invalidate the cache if we don't have tzset.
|
||||
utils_cv_localtime_cache=no
|
||||
fi])dnl
|
||||
AC_MSG_RESULT($utils_cv_localtime_cache)
|
||||
AC_MSG_RESULT([$utils_cv_localtime_cache])
|
||||
if test $utils_cv_localtime_cache = yes; then
|
||||
AC_DEFINE(LOCALTIME_CACHE, 1, [FIXME])
|
||||
AC_DEFINE([LOCALTIME_CACHE], [1], [FIXME])
|
||||
fi
|
||||
|
||||
# SCO-ODT-3.0 is reported to need -los to link programs using initgroups
|
||||
AC_CHECK_FUNCS(initgroups)
|
||||
AC_CHECK_FUNCS([initgroups])
|
||||
if test $ac_cv_func_initgroups = no; then
|
||||
AC_CHECK_LIB(os, initgroups)
|
||||
AC_CHECK_LIB([os], [initgroups])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(syslog)
|
||||
AC_CHECK_FUNCS([syslog])
|
||||
if test $ac_cv_func_syslog = no; then
|
||||
# syslog is not in the default libraries. See if it's in some other.
|
||||
for lib in bsd socket inet; do
|
||||
AC_CHECK_LIB($lib, syslog, [AC_DEFINE(HAVE_SYSLOG, 1, [FIXME])
|
||||
AC_CHECK_LIB([$lib], [syslog], [AC_DEFINE([HAVE_SYSLOG], [1], [FIXME])
|
||||
LIBS="$LIBS -l$lib"; break])
|
||||
done
|
||||
fi
|
||||
@@ -147,29 +180,29 @@ AC_DEFUN([coreutils_DUMMY_1],
|
||||
])
|
||||
coreutils_DUMMY_1
|
||||
|
||||
AC_MSG_CHECKING(ut_host in struct utmp)
|
||||
AC_CACHE_VAL(su_cv_func_ut_host_in_utmp,
|
||||
AC_MSG_CHECKING([ut_host in struct utmp])
|
||||
AC_CACHE_VAL([su_cv_func_ut_host_in_utmp],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <utmp.h>]], [[struct utmp ut; return !sizeof ut.ut_host;]])],
|
||||
[su_cv_func_ut_host_in_utmp=yes],
|
||||
[su_cv_func_ut_host_in_utmp=no])])
|
||||
AC_MSG_RESULT($su_cv_func_ut_host_in_utmp)
|
||||
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmp])
|
||||
if test $su_cv_func_ut_host_in_utmp = yes; then
|
||||
have_ut_host=1
|
||||
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
|
||||
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
||||
fi
|
||||
|
||||
if test -z "$have_ut_host"; then
|
||||
AC_MSG_CHECKING(ut_host in struct utmpx)
|
||||
AC_CACHE_VAL(su_cv_func_ut_host_in_utmpx,
|
||||
AC_MSG_CHECKING([ut_host in struct utmpx])
|
||||
AC_CACHE_VAL([su_cv_func_ut_host_in_utmpx],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <utmpx.h>]], [[struct utmpx ut; return !sizeof ut.ut_host;]])],
|
||||
[su_cv_func_ut_host_in_utmpx=yes],
|
||||
[su_cv_func_ut_host_in_utmpx=no])])
|
||||
AC_MSG_RESULT($su_cv_func_ut_host_in_utmpx)
|
||||
AC_MSG_RESULT([$su_cv_func_ut_host_in_utmpx])
|
||||
if test $su_cv_func_ut_host_in_utmpx = yes; then
|
||||
AC_DEFINE(HAVE_UTMPX_H, 1, [FIXME])
|
||||
AC_DEFINE(HAVE_UT_HOST, 1, [FIXME])
|
||||
AC_DEFINE([HAVE_UTMPX_H], [1], [FIXME])
|
||||
AC_DEFINE([HAVE_UT_HOST], [1], [FIXME])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -181,24 +214,24 @@ gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
|
||||
if test $ac_cv_sys_posix_termios = yes; then
|
||||
gl_ADD_PROG([optional_bin_progs], [stty])
|
||||
|
||||
AC_MSG_CHECKING(whether termios.h needs _XOPEN_SOURCE)
|
||||
AC_CACHE_VAL(su_cv_sys_termios_needs_xopen_source,
|
||||
[AC_EGREP_CPP(yes, [#include <termios.h>
|
||||
AC_MSG_CHECKING([whether termios.h needs _XOPEN_SOURCE])
|
||||
AC_CACHE_VAL([su_cv_sys_termios_needs_xopen_source],
|
||||
[AC_EGREP_CPP([yes], [#include <termios.h>
|
||||
#ifdef IUCLC
|
||||
yes
|
||||
#endif], su_cv_sys_termios_needs_xopen_source=no,
|
||||
AC_EGREP_CPP(yes, [#define _XOPEN_SOURCE
|
||||
AC_EGREP_CPP([yes], [#define _XOPEN_SOURCE
|
||||
#include <termios.h>
|
||||
#ifdef IUCLC
|
||||
yes
|
||||
#endif], su_cv_sys_termios_needs_xopen_source=yes,
|
||||
su_cv_sys_termios_needs_xopen_source=no))])
|
||||
AC_MSG_RESULT($su_cv_sys_termios_needs_xopen_source)
|
||||
AC_MSG_RESULT([$su_cv_sys_termios_needs_xopen_source])
|
||||
test $su_cv_sys_termios_needs_xopen_source = yes &&
|
||||
AC_DEFINE(TERMIOS_NEEDS_XOPEN_SOURCE, 1, [FIXME])
|
||||
AC_DEFINE([TERMIOS_NEEDS_XOPEN_SOURCE], [1], [FIXME])
|
||||
|
||||
AC_MSG_CHECKING(c_line in struct termios)
|
||||
AC_CACHE_VAL(su_cv_sys_c_line_in_termios,
|
||||
AC_MSG_CHECKING([c_line in struct termios])
|
||||
AC_CACHE_VAL([su_cv_sys_c_line_in_termios],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if TERMIOS_NEEDS_XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE
|
||||
#endif
|
||||
@@ -206,9 +239,9 @@ yes
|
||||
#include <termios.h>]], [[struct termios t; return !sizeof t.c_line;]])],
|
||||
[su_cv_sys_c_line_in_termios=yes],
|
||||
[su_cv_sys_c_line_in_termios=no])])
|
||||
AC_MSG_RESULT($su_cv_sys_c_line_in_termios)
|
||||
AC_MSG_RESULT([$su_cv_sys_c_line_in_termios])
|
||||
test $su_cv_sys_c_line_in_termios = yes \
|
||||
&& AC_DEFINE(HAVE_C_LINE, 1, [FIXME])
|
||||
&& AC_DEFINE([HAVE_C_LINE], [1], [FIXME])
|
||||
fi
|
||||
|
||||
# FIXME: note that this macro appears above, too.
|
||||
@@ -219,8 +252,8 @@ gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H
|
||||
|
||||
if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
|
||||
test $gl_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
|
||||
AC_MSG_CHECKING(TIOCGWINSZ in sys/pty.h)
|
||||
AC_CACHE_VAL(su_cv_sys_tiocgwinsz_in_sys_pty_h,
|
||||
AC_MSG_CHECKING([TIOCGWINSZ in sys/pty.h])
|
||||
AC_CACHE_VAL([su_cv_sys_tiocgwinsz_in_sys_pty_h],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#ifdef WINSIZE_IN_PTEM
|
||||
# include <sys/stream.h>
|
||||
@@ -231,10 +264,10 @@ if test $gl_cv_sys_tiocgwinsz_needs_termios_h = no && \
|
||||
#include <sys/pty.h>]], [[int x = TIOCGWINSZ;]])],
|
||||
[su_cv_sys_tiocgwinsz_in_sys_pty_h=yes],
|
||||
[su_cv_sys_tiocgwinsz_in_sys_pty_h=no])])
|
||||
AC_MSG_RESULT($su_cv_sys_tiocgwinsz_in_sys_pty_h)
|
||||
AC_MSG_RESULT([$su_cv_sys_tiocgwinsz_in_sys_pty_h])
|
||||
|
||||
test $su_cv_sys_tiocgwinsz_in_sys_pty_h = yes \
|
||||
&& AC_DEFINE(GWINSZ_IN_SYS_PTY, 1,
|
||||
&& AC_DEFINE([GWINSZ_IN_SYS_PTY], [1],
|
||||
[Define if your system defines TIOCGWINSZ in sys/pty.h.])
|
||||
fi
|
||||
|
||||
@@ -244,6 +277,7 @@ AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
|
||||
#include <signal.h>])
|
||||
|
||||
cu_LIB_CHECK
|
||||
cu_GMP
|
||||
|
||||
# Build df only if there's a point to it.
|
||||
if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
|
||||
@@ -258,7 +292,7 @@ mk="$srcdir/src/Makefile.am"
|
||||
v=EXTRA_PROGRAMS
|
||||
for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
||||
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
||||
| tr -s '\\012\\\\' ' '`; do
|
||||
| tr -s '\\015\\012\\\\' ' '`; do
|
||||
gl_ADD_PROG([optional_bin_progs], $gl_i)
|
||||
done
|
||||
|
||||
@@ -267,7 +301,7 @@ done
|
||||
v=no_install__progs
|
||||
t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
||||
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
||||
| tr -s '\\012\\\\' ' '`
|
||||
| tr -s '\\015\\012\\\\' ' '`
|
||||
# Remove any trailing space.
|
||||
no_install_progs_default=`echo "$t"|sed 's/ $//'`
|
||||
|
||||
@@ -279,7 +313,8 @@ no_install_progs_default=`echo "$t"|sed 's/ $//'`
|
||||
# The compromise is to ensure that the space-separated list extracted
|
||||
# above matches the literal 2nd argument below.
|
||||
c="$srcdir/configure.ac"
|
||||
t=`sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])/{s//\1/;s/,/ /gp
|
||||
re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])'
|
||||
t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp
|
||||
}' $c`
|
||||
case $t in
|
||||
$no_install_progs_default) ;;
|
||||
@@ -308,10 +343,11 @@ case " $optional_bin_progs " in
|
||||
*) INSTALL_SU=no ;;
|
||||
esac
|
||||
|
||||
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'`
|
||||
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
|
||||
|
||||
# Change ginstall.1 to "install.h" in $MAN.
|
||||
MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done | tr '\012' ' '; echo`
|
||||
MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
|
||||
| tr '\015\012' ' '; echo`
|
||||
|
||||
# Remove [.1, since writing a portable rule for it in man/Makefile.am
|
||||
# is not practical. The sed LHS below uses the autoconf quadrigraph
|
||||
@@ -323,6 +359,8 @@ AC_SUBST([OPTIONAL_BIN_PROGS])
|
||||
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
|
||||
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
|
||||
|
||||
AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" = yes])
|
||||
|
||||
# Arrange to rerun configure whenever the file, src/Makefile.am,
|
||||
# containing the list of program names changes.
|
||||
CONFIG_STATUS_DEPENDENCIES='$(top_srcdir)/src/Makefile.am'
|
||||
@@ -332,6 +370,9 @@ AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
|
||||
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
|
||||
# For a test of uniq: it uses the $LOCALE_FR envvar.
|
||||
gt_LOCALE_FR
|
||||
|
||||
AC_CONFIG_FILES(
|
||||
Makefile
|
||||
doc/Makefile
|
||||
@@ -341,33 +382,5 @@ AC_CONFIG_FILES(
|
||||
src/Makefile
|
||||
tests/Makefile
|
||||
gnulib-tests/Makefile
|
||||
tests/chgrp/Makefile
|
||||
tests/chmod/Makefile
|
||||
tests/chown/Makefile
|
||||
tests/cp/Makefile
|
||||
tests/cut/Makefile
|
||||
tests/dd/Makefile
|
||||
tests/du/Makefile
|
||||
tests/head/Makefile
|
||||
tests/install/Makefile
|
||||
tests/join/Makefile
|
||||
tests/ln/Makefile
|
||||
tests/ls/Makefile
|
||||
tests/misc/Makefile
|
||||
tests/mkdir/Makefile
|
||||
tests/mv/Makefile
|
||||
tests/pr/Makefile
|
||||
tests/readlink/Makefile
|
||||
tests/rm/Makefile
|
||||
tests/rmdir/Makefile
|
||||
tests/sort/Makefile
|
||||
tests/tac/Makefile
|
||||
tests/tail-2/Makefile
|
||||
tests/tail/Makefile
|
||||
tests/test/Makefile
|
||||
tests/touch/Makefile
|
||||
tests/tr/Makefile
|
||||
tests/uniq/Makefile
|
||||
tests/wc/Makefile
|
||||
)
|
||||
AC_OUTPUT
|
||||
|
||||
15
doc/.gitignore
vendored
15
doc/.gitignore
vendored
@@ -1,5 +1,20 @@
|
||||
constants.texi
|
||||
coreutils.aux
|
||||
coreutils.cp
|
||||
coreutils.cps
|
||||
coreutils.dvi
|
||||
coreutils.fl
|
||||
coreutils.fn
|
||||
coreutils.html
|
||||
coreutils.info
|
||||
coreutils.ky
|
||||
coreutils.log
|
||||
coreutils.op
|
||||
coreutils.pdf
|
||||
coreutils.pg
|
||||
coreutils.toc
|
||||
coreutils.tp
|
||||
coreutils.vr
|
||||
fdl.texi
|
||||
getdate.texi
|
||||
stamp-vti
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Make coreutils documentation. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1995-1998, 2001-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-1998, 2001-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -29,10 +29,13 @@ EXTRA_DIST = perm.texi getdate.texi constants.texi fdl.texi
|
||||
# old systems.
|
||||
AM_MAKEINFOFLAGS = --no-split
|
||||
|
||||
constants.texi: $(top_srcdir)/src/tail.c
|
||||
constants.texi: $(top_srcdir)/src/tail.c $(top_srcdir)/src/shred.c
|
||||
LC_ALL=C \
|
||||
sed -n -e 's/^#define \(DEFAULT_MAX[_A-Z]*\) \(.*\)/@set \1 \2/p' \
|
||||
$(top_srcdir)/src/tail.c > t-$@
|
||||
LC_ALL=C \
|
||||
sed -n -e 's/.*\(DEFAULT_PASSES\)[ =]* \([0-9]*\).*/@set SHRED_\1 \2/p'\
|
||||
$(top_srcdir)/src/shred.c >> t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
MAINTAINERCLEANFILES = constants.texi
|
||||
@@ -50,13 +53,14 @@ syntax_checks = \
|
||||
sc-avoid-timezone \
|
||||
sc-avoid-zeroes \
|
||||
sc-exponent-grouping \
|
||||
sc-lower-case-var \
|
||||
sc-use-small-caps-NUL
|
||||
|
||||
.PHONY: $(syntax_checks) check-texinfo
|
||||
|
||||
# List words/regexps here that should not appear in the texinfo documentation.
|
||||
check-texinfo: $(syntax_checks)
|
||||
fail=0; \
|
||||
@fail=0; \
|
||||
grep '@url{' $(srcdir)/*.texi && fail=1; \
|
||||
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
|
||||
grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
|
||||
@@ -68,32 +72,50 @@ check-texinfo: $(syntax_checks)
|
||||
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
|
||||
$(EGREP) -i '$(_W)builtins?$(W_)' $(srcdir)/*.texi && fail=1; \
|
||||
$(EGREP) -i '$(_W)path(name)?s?$(W_)' $(srcdir)/*.texi \
|
||||
| $(EGREP) -v '@vindex PATH$$|@env[{]PATH[}]' && fail=1; \
|
||||
| $(EGREP) -v 'search path|@vindex PATH$$|@env[{]PATH[}]' && fail=1; \
|
||||
exit $$fail
|
||||
|
||||
# Use `time zone', not `timezone'.
|
||||
sc-avoid-timezone:
|
||||
$(EGREP) timezone $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) timezone $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# Check for insufficient exponent grouping, e.g.,
|
||||
# @math{2^64} should be @math{2^{64}}.
|
||||
sc-exponent-grouping:
|
||||
$(EGREP) '\{.*\^[0-9][0-9]' $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) '\{.*\^[0-9][0-9]' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# E.g., use @sc{nul}, not NUL.
|
||||
sc-use-small-caps-NUL:
|
||||
$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# Say I/O, not IO.
|
||||
sc-avoid-io:
|
||||
$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# I prefer nonzero over non-zero.
|
||||
sc-avoid-non-zero:
|
||||
$(EGREP) non-zero $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) non-zero $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
|
||||
sc-avoid-zeroes:
|
||||
$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
@$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# ME = $(subdir)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
ME = doc/Makefile
|
||||
|
||||
# The quantity inside @var{...} should not contain upper case letters.
|
||||
# The leading backslash exemption is to permit in-macro uses like
|
||||
# @var{\varName\} where the upper case letter is part of a parameter name.
|
||||
find_upper_case_var = \
|
||||
'/\@var{/ or next; \
|
||||
while (/\@var{(.+?)}/g) \
|
||||
{ \
|
||||
$$v = $$1; \
|
||||
$$v =~ /[A-Z]/ && $$v !~ /^\\/ and (print "$$ARGV:$$.:$$_"), $$m = 1 \
|
||||
} \
|
||||
END {$$m and (warn "$(ME): do not use upper case in \@var{...}\n"), exit 1}'
|
||||
sc-lower-case-var:
|
||||
@$(PERL) -e 1 2> /dev/null && \
|
||||
$(PERL) -lne $(find_upper_case_var) $(srcdir)/*.texi
|
||||
|
||||
check: check-texinfo
|
||||
|
||||
1842
doc/coreutils.texi
1842
doc/coreutils.texi
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,10 @@
|
||||
@c File mode bits
|
||||
|
||||
@c Copyright (C) 1994, 1996, 1999, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
@c Copyright (C) 1994, 1996, 1999-2001, 2003-2006, 2008
|
||||
@c Free Software Foundation, Inc.
|
||||
|
||||
@c Permission is granted to copy, distribute and/or modify this document
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
@c under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
@c any later version published by the Free Software Foundation; with no
|
||||
@c Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
@c Texts. A copy of the license is included in the ``GNU Free
|
||||
|
||||
117
gl/lib/argv-iter.c
Normal file
117
gl/lib/argv-iter.c
Normal file
@@ -0,0 +1,117 @@
|
||||
/* Iterate over arguments from argv or --files0-from=FILE
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#include <config.h>
|
||||
#include "argv-iter.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
struct argv_iterator
|
||||
{
|
||||
/* Test FP to determine whether in read-mode or argv-mode. */
|
||||
/* file-mode: fp records position */
|
||||
FILE *fp;
|
||||
size_t item_idx;
|
||||
char *tok;
|
||||
size_t buf_len;
|
||||
|
||||
/* argv-mode: record just argv and current pointer */
|
||||
char **arg_list;
|
||||
char **p;
|
||||
};
|
||||
|
||||
struct argv_iterator *
|
||||
argv_iter_init_argv (char **argv)
|
||||
{
|
||||
struct argv_iterator *ai = malloc (sizeof *ai);
|
||||
if (!ai)
|
||||
return NULL;
|
||||
ai->fp = NULL;
|
||||
ai->arg_list = argv;
|
||||
ai->p = argv;
|
||||
return ai;
|
||||
}
|
||||
|
||||
/* Initialize to read from the stream, FP.
|
||||
The input is expected to contain a list of NUL-delimited tokens. */
|
||||
struct argv_iterator *
|
||||
argv_iter_init_stream (FILE *fp)
|
||||
{
|
||||
struct argv_iterator *ai = malloc (sizeof *ai);
|
||||
if (!ai)
|
||||
return NULL;
|
||||
ai->fp = fp;
|
||||
ai->tok = NULL;
|
||||
ai->buf_len = 0;
|
||||
|
||||
ai->item_idx = 0;
|
||||
ai->arg_list = NULL;
|
||||
return ai;
|
||||
}
|
||||
|
||||
char *
|
||||
argv_iter (struct argv_iterator *ai, enum argv_iter_err *err)
|
||||
{
|
||||
if (ai->fp)
|
||||
{
|
||||
ssize_t len = getdelim (&ai->tok, &ai->buf_len, '\0', ai->fp);
|
||||
if (len < 0)
|
||||
{
|
||||
*err = feof (ai->fp) ? AI_ERR_EOF : AI_ERR_READ;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*err = AI_ERR_OK;
|
||||
ai->item_idx++;
|
||||
return ai->tok;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*(ai->p) == NULL)
|
||||
{
|
||||
*err = AI_ERR_EOF;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
*err = AI_ERR_OK;
|
||||
return *(ai->p++);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
size_t
|
||||
argv_iter_n_args (struct argv_iterator const *ai)
|
||||
{
|
||||
return ai->fp ? ai->item_idx : ai->p - ai->arg_list;
|
||||
}
|
||||
|
||||
void
|
||||
argv_iter_free (struct argv_iterator *ai)
|
||||
{
|
||||
if (ai->fp)
|
||||
free (ai->tok);
|
||||
free (ai);
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*/
|
||||
47
gl/lib/argv-iter.h
Normal file
47
gl/lib/argv-iter.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/* Iterate over arguments from argv or --files0-from=FILE
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct argv_iterator;
|
||||
enum argv_iter_err;
|
||||
|
||||
#undef _ATTRIBUTE_NONNULL_
|
||||
#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3 || 3 < __GNUC__
|
||||
# define _ATTRIBUTE_NONNULL_(m,...) __attribute__ ((__nonnull__ (m)))
|
||||
#else
|
||||
# define _ATTRIBUTE_NONNULL_(m,...)
|
||||
#endif
|
||||
|
||||
enum argv_iter_err
|
||||
{
|
||||
AI_ERR_OK = 1,
|
||||
AI_ERR_EOF,
|
||||
AI_ERR_MEM,
|
||||
AI_ERR_READ
|
||||
};
|
||||
|
||||
struct argv_iterator *argv_iter_init_argv (char **argv)
|
||||
_ATTRIBUTE_NONNULL_ (1);
|
||||
struct argv_iterator *argv_iter_init_stream (FILE *fp)
|
||||
_ATTRIBUTE_NONNULL_ (1);
|
||||
char *argv_iter (struct argv_iterator *, enum argv_iter_err *)
|
||||
_ATTRIBUTE_NONNULL_ (1, 2);
|
||||
size_t argv_iter_n_args (struct argv_iterator const *)
|
||||
_ATTRIBUTE_NONNULL_ (1);
|
||||
void argv_iter_free (struct argv_iterator *)
|
||||
_ATTRIBUTE_NONNULL_ (1);
|
||||
558
gl/lib/base64.c
558
gl/lib/base64.c
@@ -1,558 +0,0 @@
|
||||
/* base64.c -- Encode binary data using printable characters.
|
||||
Copyright (C) 1999, 2000, 2001, 2004, 2005, 2006, 2007 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Simon Josefsson. Partially adapted from GNU MailUtils
|
||||
* (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
|
||||
* from Paul Eggert, Bruno Haible, and Stepan Kasal.
|
||||
*
|
||||
* See also RFC 3548 <http://www.ietf.org/rfc/rfc3548.txt>.
|
||||
*
|
||||
* Be careful with error checking. Here is how you would typically
|
||||
* use these functions:
|
||||
*
|
||||
* bool ok = base64_decode_alloc (in, inlen, &out, &outlen);
|
||||
* if (!ok)
|
||||
* FAIL: input was not valid base64
|
||||
* if (out == NULL)
|
||||
* FAIL: memory allocation error
|
||||
* OK: data in OUT/OUTLEN
|
||||
*
|
||||
* size_t outlen = base64_encode_alloc (in, inlen, &out);
|
||||
* if (out == NULL && outlen == 0 && inlen != 0)
|
||||
* FAIL: input too long
|
||||
* if (out == NULL)
|
||||
* FAIL: memory allocation error
|
||||
* OK: data in OUT/OUTLEN.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Get prototype. */
|
||||
#include "base64.h"
|
||||
|
||||
/* Get malloc. */
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Get UCHAR_MAX. */
|
||||
#include <limits.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* C89 compliant way to cast 'char' to 'unsigned char'. */
|
||||
static inline unsigned char
|
||||
to_uchar (char ch)
|
||||
{
|
||||
return ch;
|
||||
}
|
||||
|
||||
/* Base64 encode IN array of size INLEN into OUT array of size OUTLEN.
|
||||
If OUTLEN is less than BASE64_LENGTH(INLEN), write as many bytes as
|
||||
possible. If OUTLEN is larger than BASE64_LENGTH(INLEN), also zero
|
||||
terminate the output buffer. */
|
||||
void
|
||||
base64_encode (const char *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen)
|
||||
{
|
||||
static const char b64str[64] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
while (inlen && outlen)
|
||||
{
|
||||
*out++ = b64str[(to_uchar (in[0]) >> 2) & 0x3f];
|
||||
if (!--outlen)
|
||||
break;
|
||||
*out++ = b64str[((to_uchar (in[0]) << 4)
|
||||
+ (--inlen ? to_uchar (in[1]) >> 4 : 0))
|
||||
& 0x3f];
|
||||
if (!--outlen)
|
||||
break;
|
||||
*out++ =
|
||||
(inlen
|
||||
? b64str[((to_uchar (in[1]) << 2)
|
||||
+ (--inlen ? to_uchar (in[2]) >> 6 : 0))
|
||||
& 0x3f]
|
||||
: '=');
|
||||
if (!--outlen)
|
||||
break;
|
||||
*out++ = inlen ? b64str[to_uchar (in[2]) & 0x3f] : '=';
|
||||
if (!--outlen)
|
||||
break;
|
||||
if (inlen)
|
||||
inlen--;
|
||||
if (inlen)
|
||||
in += 3;
|
||||
}
|
||||
|
||||
if (outlen)
|
||||
*out = '\0';
|
||||
}
|
||||
|
||||
/* Allocate a buffer and store zero terminated base64 encoded data
|
||||
from array IN of size INLEN, returning BASE64_LENGTH(INLEN), i.e.,
|
||||
the length of the encoded data, excluding the terminating zero. On
|
||||
return, the OUT variable will hold a pointer to newly allocated
|
||||
memory that must be deallocated by the caller. If output string
|
||||
length would overflow, 0 is returned and OUT is set to NULL. If
|
||||
memory allocation failed, OUT is set to NULL, and the return value
|
||||
indicates length of the requested memory block, i.e.,
|
||||
BASE64_LENGTH(inlen) + 1. */
|
||||
size_t
|
||||
base64_encode_alloc (const char *in, size_t inlen, char **out)
|
||||
{
|
||||
size_t outlen = 1 + BASE64_LENGTH (inlen);
|
||||
|
||||
/* Check for overflow in outlen computation.
|
||||
*
|
||||
* If there is no overflow, outlen >= inlen.
|
||||
*
|
||||
* If the operation (inlen + 2) overflows then it yields at most +1, so
|
||||
* outlen is 0.
|
||||
*
|
||||
* If the multiplication overflows, we lose at least half of the
|
||||
* correct value, so the result is < ((inlen + 2) / 3) * 2, which is
|
||||
* less than (inlen + 2) * 0.66667, which is less than inlen as soon as
|
||||
* (inlen > 4).
|
||||
*/
|
||||
if (inlen > outlen)
|
||||
{
|
||||
*out = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*out = malloc (outlen);
|
||||
if (!*out)
|
||||
return outlen;
|
||||
|
||||
base64_encode (in, inlen, *out, outlen);
|
||||
|
||||
return outlen - 1;
|
||||
}
|
||||
|
||||
/* With this approach this file works independent of the charset used
|
||||
(think EBCDIC). However, it does assume that the characters in the
|
||||
Base64 alphabet (A-Za-z0-9+/) are encoded in 0..255. POSIX
|
||||
1003.1-2001 require that char and unsigned char are 8-bit
|
||||
quantities, though, taking care of that problem. But this may be a
|
||||
potential problem on non-POSIX C99 platforms.
|
||||
|
||||
IBM C V6 for AIX mishandles "#define B64(x) ...'x'...", so use "_"
|
||||
as the formal parameter rather than "x". */
|
||||
#define B64(_) \
|
||||
((_) == 'A' ? 0 \
|
||||
: (_) == 'B' ? 1 \
|
||||
: (_) == 'C' ? 2 \
|
||||
: (_) == 'D' ? 3 \
|
||||
: (_) == 'E' ? 4 \
|
||||
: (_) == 'F' ? 5 \
|
||||
: (_) == 'G' ? 6 \
|
||||
: (_) == 'H' ? 7 \
|
||||
: (_) == 'I' ? 8 \
|
||||
: (_) == 'J' ? 9 \
|
||||
: (_) == 'K' ? 10 \
|
||||
: (_) == 'L' ? 11 \
|
||||
: (_) == 'M' ? 12 \
|
||||
: (_) == 'N' ? 13 \
|
||||
: (_) == 'O' ? 14 \
|
||||
: (_) == 'P' ? 15 \
|
||||
: (_) == 'Q' ? 16 \
|
||||
: (_) == 'R' ? 17 \
|
||||
: (_) == 'S' ? 18 \
|
||||
: (_) == 'T' ? 19 \
|
||||
: (_) == 'U' ? 20 \
|
||||
: (_) == 'V' ? 21 \
|
||||
: (_) == 'W' ? 22 \
|
||||
: (_) == 'X' ? 23 \
|
||||
: (_) == 'Y' ? 24 \
|
||||
: (_) == 'Z' ? 25 \
|
||||
: (_) == 'a' ? 26 \
|
||||
: (_) == 'b' ? 27 \
|
||||
: (_) == 'c' ? 28 \
|
||||
: (_) == 'd' ? 29 \
|
||||
: (_) == 'e' ? 30 \
|
||||
: (_) == 'f' ? 31 \
|
||||
: (_) == 'g' ? 32 \
|
||||
: (_) == 'h' ? 33 \
|
||||
: (_) == 'i' ? 34 \
|
||||
: (_) == 'j' ? 35 \
|
||||
: (_) == 'k' ? 36 \
|
||||
: (_) == 'l' ? 37 \
|
||||
: (_) == 'm' ? 38 \
|
||||
: (_) == 'n' ? 39 \
|
||||
: (_) == 'o' ? 40 \
|
||||
: (_) == 'p' ? 41 \
|
||||
: (_) == 'q' ? 42 \
|
||||
: (_) == 'r' ? 43 \
|
||||
: (_) == 's' ? 44 \
|
||||
: (_) == 't' ? 45 \
|
||||
: (_) == 'u' ? 46 \
|
||||
: (_) == 'v' ? 47 \
|
||||
: (_) == 'w' ? 48 \
|
||||
: (_) == 'x' ? 49 \
|
||||
: (_) == 'y' ? 50 \
|
||||
: (_) == 'z' ? 51 \
|
||||
: (_) == '0' ? 52 \
|
||||
: (_) == '1' ? 53 \
|
||||
: (_) == '2' ? 54 \
|
||||
: (_) == '3' ? 55 \
|
||||
: (_) == '4' ? 56 \
|
||||
: (_) == '5' ? 57 \
|
||||
: (_) == '6' ? 58 \
|
||||
: (_) == '7' ? 59 \
|
||||
: (_) == '8' ? 60 \
|
||||
: (_) == '9' ? 61 \
|
||||
: (_) == '+' ? 62 \
|
||||
: (_) == '/' ? 63 \
|
||||
: -1)
|
||||
|
||||
static const signed char b64[0x100] = {
|
||||
B64 (0), B64 (1), B64 (2), B64 (3),
|
||||
B64 (4), B64 (5), B64 (6), B64 (7),
|
||||
B64 (8), B64 (9), B64 (10), B64 (11),
|
||||
B64 (12), B64 (13), B64 (14), B64 (15),
|
||||
B64 (16), B64 (17), B64 (18), B64 (19),
|
||||
B64 (20), B64 (21), B64 (22), B64 (23),
|
||||
B64 (24), B64 (25), B64 (26), B64 (27),
|
||||
B64 (28), B64 (29), B64 (30), B64 (31),
|
||||
B64 (32), B64 (33), B64 (34), B64 (35),
|
||||
B64 (36), B64 (37), B64 (38), B64 (39),
|
||||
B64 (40), B64 (41), B64 (42), B64 (43),
|
||||
B64 (44), B64 (45), B64 (46), B64 (47),
|
||||
B64 (48), B64 (49), B64 (50), B64 (51),
|
||||
B64 (52), B64 (53), B64 (54), B64 (55),
|
||||
B64 (56), B64 (57), B64 (58), B64 (59),
|
||||
B64 (60), B64 (61), B64 (62), B64 (63),
|
||||
B64 (64), B64 (65), B64 (66), B64 (67),
|
||||
B64 (68), B64 (69), B64 (70), B64 (71),
|
||||
B64 (72), B64 (73), B64 (74), B64 (75),
|
||||
B64 (76), B64 (77), B64 (78), B64 (79),
|
||||
B64 (80), B64 (81), B64 (82), B64 (83),
|
||||
B64 (84), B64 (85), B64 (86), B64 (87),
|
||||
B64 (88), B64 (89), B64 (90), B64 (91),
|
||||
B64 (92), B64 (93), B64 (94), B64 (95),
|
||||
B64 (96), B64 (97), B64 (98), B64 (99),
|
||||
B64 (100), B64 (101), B64 (102), B64 (103),
|
||||
B64 (104), B64 (105), B64 (106), B64 (107),
|
||||
B64 (108), B64 (109), B64 (110), B64 (111),
|
||||
B64 (112), B64 (113), B64 (114), B64 (115),
|
||||
B64 (116), B64 (117), B64 (118), B64 (119),
|
||||
B64 (120), B64 (121), B64 (122), B64 (123),
|
||||
B64 (124), B64 (125), B64 (126), B64 (127),
|
||||
B64 (128), B64 (129), B64 (130), B64 (131),
|
||||
B64 (132), B64 (133), B64 (134), B64 (135),
|
||||
B64 (136), B64 (137), B64 (138), B64 (139),
|
||||
B64 (140), B64 (141), B64 (142), B64 (143),
|
||||
B64 (144), B64 (145), B64 (146), B64 (147),
|
||||
B64 (148), B64 (149), B64 (150), B64 (151),
|
||||
B64 (152), B64 (153), B64 (154), B64 (155),
|
||||
B64 (156), B64 (157), B64 (158), B64 (159),
|
||||
B64 (160), B64 (161), B64 (162), B64 (163),
|
||||
B64 (164), B64 (165), B64 (166), B64 (167),
|
||||
B64 (168), B64 (169), B64 (170), B64 (171),
|
||||
B64 (172), B64 (173), B64 (174), B64 (175),
|
||||
B64 (176), B64 (177), B64 (178), B64 (179),
|
||||
B64 (180), B64 (181), B64 (182), B64 (183),
|
||||
B64 (184), B64 (185), B64 (186), B64 (187),
|
||||
B64 (188), B64 (189), B64 (190), B64 (191),
|
||||
B64 (192), B64 (193), B64 (194), B64 (195),
|
||||
B64 (196), B64 (197), B64 (198), B64 (199),
|
||||
B64 (200), B64 (201), B64 (202), B64 (203),
|
||||
B64 (204), B64 (205), B64 (206), B64 (207),
|
||||
B64 (208), B64 (209), B64 (210), B64 (211),
|
||||
B64 (212), B64 (213), B64 (214), B64 (215),
|
||||
B64 (216), B64 (217), B64 (218), B64 (219),
|
||||
B64 (220), B64 (221), B64 (222), B64 (223),
|
||||
B64 (224), B64 (225), B64 (226), B64 (227),
|
||||
B64 (228), B64 (229), B64 (230), B64 (231),
|
||||
B64 (232), B64 (233), B64 (234), B64 (235),
|
||||
B64 (236), B64 (237), B64 (238), B64 (239),
|
||||
B64 (240), B64 (241), B64 (242), B64 (243),
|
||||
B64 (244), B64 (245), B64 (246), B64 (247),
|
||||
B64 (248), B64 (249), B64 (250), B64 (251),
|
||||
B64 (252), B64 (253), B64 (254), B64 (255)
|
||||
};
|
||||
|
||||
#if UCHAR_MAX == 255
|
||||
# define uchar_in_range(c) true
|
||||
#else
|
||||
# define uchar_in_range(c) ((c) <= 255)
|
||||
#endif
|
||||
|
||||
/* Return true if CH is a character from the Base64 alphabet, and
|
||||
false otherwise. Note that '=' is padding and not considered to be
|
||||
part of the alphabet. */
|
||||
bool
|
||||
isbase64 (char ch)
|
||||
{
|
||||
return uchar_in_range (to_uchar (ch)) && 0 <= b64[to_uchar (ch)];
|
||||
}
|
||||
|
||||
/* Initialize decode-context buffer, CTX. */
|
||||
void
|
||||
base64_decode_ctx_init (struct base64_decode_context *ctx)
|
||||
{
|
||||
ctx->i = 0;
|
||||
}
|
||||
|
||||
/* If CTX->i is 0 or 4, there are four or more bytes in [*IN..IN_END), and
|
||||
none of those four is a newline, then return *IN. Otherwise, copy up to
|
||||
4 - CTX->i non-newline bytes from that range into CTX->buf, starting at
|
||||
index CTX->i and setting CTX->i to reflect the number of bytes copied,
|
||||
and return CTX->buf. In either case, advance *IN to point to the byte
|
||||
after the last one processed, and set *N_NON_NEWLINE to the number of
|
||||
verified non-newline bytes accessible through the returned pointer. */
|
||||
static inline char *
|
||||
get_4 (struct base64_decode_context *ctx,
|
||||
char const *restrict *in, char const *restrict in_end,
|
||||
size_t *n_non_newline)
|
||||
{
|
||||
if (ctx->i == 4)
|
||||
ctx->i = 0;
|
||||
|
||||
if (ctx->i == 0)
|
||||
{
|
||||
char const *t = *in;
|
||||
if (4 <= in_end - *in && memchr (t, '\n', 4) == NULL)
|
||||
{
|
||||
/* This is the common case: no newline. */
|
||||
*in += 4;
|
||||
*n_non_newline = 4;
|
||||
return (char *) t;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
/* Copy non-newline bytes into BUF. */
|
||||
char const *p = *in;
|
||||
while (p < in_end)
|
||||
{
|
||||
char c = *p++;
|
||||
if (c != '\n')
|
||||
{
|
||||
ctx->buf[ctx->i++] = c;
|
||||
if (ctx->i == 4)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
*in = p;
|
||||
*n_non_newline = ctx->i;
|
||||
return ctx->buf;
|
||||
}
|
||||
}
|
||||
|
||||
#define return_false \
|
||||
do \
|
||||
{ \
|
||||
*outp = out; \
|
||||
return false; \
|
||||
} \
|
||||
while (false)
|
||||
|
||||
/* Decode up to four bytes of base64-encoded data, IN, of length INLEN
|
||||
into the output buffer, *OUT, of size *OUTLEN bytes. Return true if
|
||||
decoding is successful, false otherwise. If *OUTLEN is too small,
|
||||
as many bytes as possible are written to *OUT. On return, advance
|
||||
*OUT to point to the byte after the last one written, and decrement
|
||||
*OUTLEN to reflect the number of bytes remaining in *OUT. */
|
||||
static inline bool
|
||||
decode_4 (char const *restrict in, size_t inlen,
|
||||
char *restrict *outp, size_t *outleft)
|
||||
{
|
||||
char *out = *outp;
|
||||
if (inlen < 2)
|
||||
return false;
|
||||
|
||||
if (!isbase64 (in[0]) || !isbase64 (in[1]))
|
||||
return false;
|
||||
|
||||
if (*outleft)
|
||||
{
|
||||
*out++ = ((b64[to_uchar (in[0])] << 2)
|
||||
| (b64[to_uchar (in[1])] >> 4));
|
||||
--*outleft;
|
||||
}
|
||||
|
||||
if (inlen == 2)
|
||||
return_false;
|
||||
|
||||
if (in[2] == '=')
|
||||
{
|
||||
if (inlen != 4)
|
||||
return_false;
|
||||
|
||||
if (in[3] != '=')
|
||||
return_false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isbase64 (in[2]))
|
||||
return_false;
|
||||
|
||||
if (*outleft)
|
||||
{
|
||||
*out++ = (((b64[to_uchar (in[1])] << 4) & 0xf0)
|
||||
| (b64[to_uchar (in[2])] >> 2));
|
||||
--*outleft;
|
||||
}
|
||||
|
||||
if (inlen == 3)
|
||||
return_false;
|
||||
|
||||
if (in[3] == '=')
|
||||
{
|
||||
if (inlen != 4)
|
||||
return_false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isbase64 (in[3]))
|
||||
return_false;
|
||||
|
||||
if (*outleft)
|
||||
{
|
||||
*out++ = (((b64[to_uchar (in[2])] << 6) & 0xc0)
|
||||
| b64[to_uchar (in[3])]);
|
||||
--*outleft;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*outp = out;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Decode base64-encoded input array IN of length INLEN to output array
|
||||
OUT that can hold *OUTLEN bytes. The input data may be interspersed
|
||||
with newlines. Return true if decoding was successful, i.e. if the
|
||||
input was valid base64 data, false otherwise. If *OUTLEN is too
|
||||
small, as many bytes as possible will be written to OUT. On return,
|
||||
*OUTLEN holds the length of decoded bytes in OUT. Note that as soon
|
||||
as any non-alphabet, non-newline character is encountered, decoding
|
||||
is stopped and false is returned. If INLEN is zero, then process
|
||||
only whatever data is stored in CTX.
|
||||
|
||||
Initially, CTX must have been initialized via base64_decode_ctx_init.
|
||||
Subsequent calls to this function must reuse whatever state is recorded
|
||||
in that buffer. It is necessary for when a quadruple of base64 input
|
||||
bytes spans two input buffers. */
|
||||
|
||||
bool
|
||||
base64_decode (struct base64_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen)
|
||||
{
|
||||
size_t outleft = *outlen;
|
||||
bool flush_ctx = inlen == 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
size_t outleft_save = outleft;
|
||||
if (ctx->i == 0 && !flush_ctx)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
/* Save a copy of outleft, in case we need to re-parse this
|
||||
block of four bytes. */
|
||||
outleft_save = outleft;
|
||||
if (!decode_4 (in, inlen, &out, &outleft))
|
||||
break;
|
||||
|
||||
in += 4;
|
||||
inlen -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (inlen == 0 && !flush_ctx)
|
||||
break;
|
||||
|
||||
/* Handle the common case of 72-byte wrapped lines.
|
||||
This also handles any other multiple-of-4-byte wrapping. */
|
||||
if (inlen && *in == '\n')
|
||||
{
|
||||
++in;
|
||||
--inlen;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Restore OUT and OUTLEFT. */
|
||||
out -= outleft_save - outleft;
|
||||
outleft = outleft_save;
|
||||
|
||||
{
|
||||
char const *in_end = in + inlen;
|
||||
char const *non_nl = get_4 (ctx, &in, in_end, &inlen);
|
||||
|
||||
/* If the input is empty or consists solely of newlines (0 non-newlines),
|
||||
then we're done. Likewise if there are fewer than 4 bytes when not
|
||||
flushing context. */
|
||||
if (inlen == 0 || (inlen < 4 && !flush_ctx))
|
||||
{
|
||||
inlen = 0;
|
||||
break;
|
||||
}
|
||||
if (!decode_4 (non_nl, inlen, &out, &outleft))
|
||||
break;
|
||||
|
||||
inlen = in_end - in;
|
||||
}
|
||||
}
|
||||
|
||||
*outlen -= outleft;
|
||||
|
||||
return inlen == 0;
|
||||
}
|
||||
|
||||
/* Allocate an output buffer in *OUT, and decode the base64 encoded
|
||||
data stored in IN of size INLEN to the *OUT buffer. On return, the
|
||||
size of the decoded data is stored in *OUTLEN. OUTLEN may be NULL,
|
||||
if the caller is not interested in the decoded length. *OUT may be
|
||||
NULL to indicate an out of memory error, in which case *OUTLEN
|
||||
contains the size of the memory block needed. The function returns
|
||||
true on successful decoding and memory allocation errors. (Use the
|
||||
*OUT and *OUTLEN parameters to differentiate between successful
|
||||
decoding and memory error.) The function returns false if the
|
||||
input was invalid, in which case *OUT is NULL and *OUTLEN is
|
||||
undefined. */
|
||||
bool
|
||||
base64_decode_alloc (struct base64_decode_context *ctx,
|
||||
const char *in, size_t inlen, char **out,
|
||||
size_t *outlen)
|
||||
{
|
||||
/* This may allocate a few bytes too many, depending on input,
|
||||
but it's not worth the extra CPU time to compute the exact size.
|
||||
The exact size is 3 * inlen / 4, minus 1 if the input ends
|
||||
with "=" and minus another 1 if the input ends with "==".
|
||||
Dividing before multiplying avoids the possibility of overflow. */
|
||||
size_t needlen = 3 * (inlen / 4) + 2;
|
||||
|
||||
*out = malloc (needlen);
|
||||
if (!*out)
|
||||
return true;
|
||||
|
||||
if (!base64_decode (ctx, in, inlen, *out, &needlen))
|
||||
{
|
||||
free (*out);
|
||||
*out = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (outlen)
|
||||
*outlen = needlen;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/* base64.h -- Encode binary data using printable characters.
|
||||
Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
Written by Simon Josefsson.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef BASE64_H
|
||||
# define BASE64_H
|
||||
|
||||
/* Get size_t. */
|
||||
# include <stddef.h>
|
||||
|
||||
/* Get bool. */
|
||||
# include <stdbool.h>
|
||||
|
||||
/* This uses that the expression (n+(k-1))/k means the smallest
|
||||
integer >= n/k, i.e., the ceiling of n/k. */
|
||||
# define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4)
|
||||
|
||||
struct base64_decode_context
|
||||
{
|
||||
unsigned int i;
|
||||
char buf[4];
|
||||
};
|
||||
|
||||
extern bool isbase64 (char ch);
|
||||
|
||||
extern void base64_encode (const char *restrict in, size_t inlen,
|
||||
char *restrict out, size_t outlen);
|
||||
|
||||
extern size_t base64_encode_alloc (const char *in, size_t inlen, char **out);
|
||||
|
||||
extern void base64_decode_ctx_init (struct base64_decode_context *ctx);
|
||||
extern bool base64_decode (struct base64_decode_context *ctx,
|
||||
const char *restrict in, size_t inlen,
|
||||
char *restrict out, size_t *outlen);
|
||||
|
||||
extern bool base64_decode_alloc (struct base64_decode_context *ctx,
|
||||
const char *in, size_t inlen,
|
||||
char **out, size_t *outlen);
|
||||
|
||||
#endif /* BASE64_H */
|
||||
@@ -1,6 +1,6 @@
|
||||
/* mgetgroups.c -- return a list of the groups a user is in
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation.
|
||||
Copyright (C) 2007-2009 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -21,13 +21,30 @@
|
||||
|
||||
#include "mgetgroups.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_GETGROUPLIST
|
||||
# include <grp.h>
|
||||
#endif
|
||||
#include "getugroups.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
|
||||
static GETGROUPS_T *
|
||||
realloc_groupbuf (GETGROUPS_T *g, size_t num)
|
||||
{
|
||||
if (xalloc_oversized (num, sizeof (*g)))
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return realloc (g, num * sizeof (*g));
|
||||
}
|
||||
|
||||
/* Like getugroups, but store the result in malloc'd storage.
|
||||
Set *GROUPS to the malloc'd list of all group IDs of which USERNAME
|
||||
is a member. If GID is not -1, store it first. GID should be the
|
||||
@@ -37,12 +54,56 @@
|
||||
the number of groups. */
|
||||
|
||||
int
|
||||
mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups)
|
||||
mgetgroups (char const *username, gid_t gid, GETGROUPS_T **groups)
|
||||
{
|
||||
int max_n_groups;
|
||||
int ng;
|
||||
GETGROUPS_T *g;
|
||||
|
||||
#if HAVE_GETGROUPLIST
|
||||
/* We prefer to use getgrouplist if available, because it has better
|
||||
performance characteristics.
|
||||
|
||||
In glibc 2.3.2, getgrouplist is buggy. If you pass a zero as the
|
||||
length of the output buffer, getgrouplist will still write to the
|
||||
buffer. Contrary to what some versions of the getgrouplist
|
||||
manpage say, this doesn't happen with nonzero buffer sizes.
|
||||
Therefore our usage here just avoids a zero sized buffer. */
|
||||
if (username)
|
||||
{
|
||||
enum { N_GROUPS_INIT = 10 };
|
||||
max_n_groups = N_GROUPS_INIT;
|
||||
|
||||
g = realloc_groupbuf (NULL, max_n_groups);
|
||||
if (g == NULL)
|
||||
return -1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
GETGROUPS_T *h;
|
||||
|
||||
/* getgrouplist updates max_n_groups to num required. */
|
||||
ng = getgrouplist (username, gid, g, &max_n_groups);
|
||||
|
||||
if ((h = realloc_groupbuf (g, max_n_groups)) == NULL)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (g);
|
||||
errno = saved_errno;
|
||||
return -1;
|
||||
}
|
||||
g = h;
|
||||
|
||||
if (0 <= ng)
|
||||
{
|
||||
*groups = g;
|
||||
return ng;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* else no username, so fall through and use getgroups. */
|
||||
#endif
|
||||
|
||||
max_n_groups = (username
|
||||
? getugroups (0, NULL, username, gid)
|
||||
: getgroups (0, NULL));
|
||||
@@ -52,13 +113,7 @@ mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups)
|
||||
if (max_n_groups < 0)
|
||||
max_n_groups = 5;
|
||||
|
||||
if (xalloc_oversized (max_n_groups, sizeof *g))
|
||||
{
|
||||
errno = ENOMEM;
|
||||
return -1;
|
||||
}
|
||||
|
||||
g = malloc (max_n_groups * sizeof *g);
|
||||
g = realloc_groupbuf (NULL, max_n_groups);
|
||||
if (g == NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#ifndef SELINUX_CONTEXT_H
|
||||
# define SELINUX_CONTEXT_H
|
||||
|
||||
# include <errno.h>
|
||||
/* Some systems don't have ENOTSUP. */
|
||||
# ifndef ENOTSUP
|
||||
# ifdef ENOSYS
|
||||
# define ENOTSUP ENOSYS
|
||||
# else
|
||||
/* Some systems don't have ENOSYS either. */
|
||||
# define ENOTSUP EINVAL
|
||||
# endif
|
||||
# endif
|
||||
|
||||
typedef int context_t;
|
||||
static inline context_t context_new (char const *s)
|
||||
{ errno = ENOTSUP; return 0; }
|
||||
static inline char *context_str (context_t con)
|
||||
{ errno = ENOTSUP; return (void *) 0; }
|
||||
static inline void context_free (context_t c) {}
|
||||
|
||||
static inline int context_user_set (context_t sc, char const *s)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int context_role_set (context_t sc, char const *s)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int context_range_set (context_t sc, char const *s)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int context_type_set (context_t sc, char const *s)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
|
||||
#endif
|
||||
@@ -1,57 +0,0 @@
|
||||
#ifndef SELINUX_SELINUX_H
|
||||
# define SELINUX_SELINUX_H
|
||||
|
||||
# include <sys/types.h>
|
||||
# include <errno.h>
|
||||
/* Some systems don't have ENOTSUP. */
|
||||
# ifndef ENOTSUP
|
||||
# ifdef ENOSYS
|
||||
# define ENOTSUP ENOSYS
|
||||
# else
|
||||
/* Some systems don't have ENOSYS either. */
|
||||
# define ENOTSUP EINVAL
|
||||
# endif
|
||||
# endif
|
||||
|
||||
typedef unsigned short security_class_t;
|
||||
# define security_context_t char*
|
||||
# define is_selinux_enabled() 0
|
||||
|
||||
static inline int getcon (security_context_t *con) { errno = ENOTSUP; return -1; }
|
||||
static inline void freecon (security_context_t con) {}
|
||||
|
||||
|
||||
static inline int getfscreatecon (security_context_t *con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int setfscreatecon (security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int matchpathcon (char const *s, mode_t m,
|
||||
security_context_t *con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
|
||||
static inline int getfilecon (char const *s, security_context_t *con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int lgetfilecon (char const *s, security_context_t *con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int setfilecon (char const *s, security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int lsetfilecon (char const *s, security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int fsetfilecon (int fd, security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
|
||||
static inline int security_check_context (security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int security_check_context_raw (security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int setexeccon (security_context_t con)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int security_compute_create (security_context_t scon,
|
||||
security_context_t tcon,
|
||||
security_class_t tclass,
|
||||
security_context_t *newcon)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
static inline int matchpathcon_init_prefix (char const *path,
|
||||
char const *prefix)
|
||||
{ errno = ENOTSUP; return -1; }
|
||||
#endif
|
||||
41
gl/lib/xfreopen.c
Normal file
41
gl/lib/xfreopen.c
Normal file
@@ -0,0 +1,41 @@
|
||||
/* a wrapper for frepoen
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
#include "xfreopen.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include "error.h"
|
||||
#include "exitfail.h"
|
||||
#include "quote.h"
|
||||
|
||||
#include "gettext.h"
|
||||
#define _(msgid) gettext (msgid)
|
||||
|
||||
void
|
||||
xfreopen (char const *filename, char const *mode, FILE *fp)
|
||||
{
|
||||
if (!freopen (filename, mode, fp))
|
||||
{
|
||||
char const *f = (filename ? filename
|
||||
: (fp == stdin ? _("stdin")
|
||||
: (fp == stdout ? _("stdout")
|
||||
: (fp == stderr ? _("stderr")
|
||||
: _("unknown stream")))));
|
||||
error (exit_failure, errno, _("failed to reopen %s with mode %s"),
|
||||
quote_n (0, f), quote_n (1, mode));
|
||||
}
|
||||
}
|
||||
2
gl/lib/xfreopen.h
Normal file
2
gl/lib/xfreopen.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#include <stdio.h>
|
||||
void xfreopen (char const *filename, char const *mode, FILE *fp);
|
||||
@@ -1,10 +1,11 @@
|
||||
#serial 1
|
||||
dnl Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
#serial 3
|
||||
dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_MGETGROUPS],
|
||||
[
|
||||
AC_CHECK_FUNCS([getgrouplist])
|
||||
AC_LIBOBJ([mgetgroups])
|
||||
])
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# serial 1 -*- Autoconf -*-
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# From Jim Meyering
|
||||
# Provide <selinux/context.h>, if necessary.
|
||||
|
||||
AC_DEFUN([gl_HEADERS_SELINUX_CONTEXT_H],
|
||||
[
|
||||
# Check for <selinux/context.h>,
|
||||
AC_CHECK_HEADERS([selinux/context.h],
|
||||
[SELINUX_CONTEXT_H=],
|
||||
[SELINUX_CONTEXT_H=selinux/context.h])
|
||||
AC_SUBST([SELINUX_CONTEXT_H])
|
||||
])
|
||||
@@ -1,17 +0,0 @@
|
||||
# serial 1 -*- Autoconf -*-
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# From Jim Meyering
|
||||
# Provide <selinux/selinux.h>, if necessary.
|
||||
|
||||
AC_DEFUN([gl_HEADERS_SELINUX_SELINUX_H],
|
||||
[
|
||||
# Check for <selinux/selinux.h>,
|
||||
AC_CHECK_HEADERS([selinux/selinux.h],
|
||||
[SELINUX_SELINUX_H=],
|
||||
[SELINUX_SELINUX_H=selinux/selinux.h])
|
||||
AC_SUBST([SELINUX_SELINUX_H])
|
||||
])
|
||||
24
gl/modules/argv-iter
Normal file
24
gl/modules/argv-iter
Normal file
@@ -0,0 +1,24 @@
|
||||
Description:
|
||||
iterate through argv or a --files0-from=-specified file
|
||||
|
||||
Files:
|
||||
lib/argv-iter.c
|
||||
lib/argv-iter.h
|
||||
|
||||
Depends-on:
|
||||
getdelim
|
||||
stdbool
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += argv-iter.c argv-iter.h
|
||||
|
||||
Include:
|
||||
"argv-iter.h"
|
||||
|
||||
License
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
Jim Meyering
|
||||
10
gl/modules/argv-iter-tests
Normal file
10
gl/modules/argv-iter-tests
Normal file
@@ -0,0 +1,10 @@
|
||||
Files:
|
||||
tests/test-argv-iter.c
|
||||
|
||||
Depends-on:
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
TESTS += test-argv-iter
|
||||
check_PROGRAMS += test-argv-iter
|
||||
@@ -1,16 +1,13 @@
|
||||
Index: modules/getloadavg
|
||||
===================================================================
|
||||
RCS file: /sources/gnulib/gnulib/modules/getloadavg,v
|
||||
retrieving revision 1.13
|
||||
diff -u -p -r1.13 getloadavg
|
||||
--- modules/getloadavg 22 Sep 2006 12:47:55 -0000 1.13
|
||||
+++ modules/getloadavg 23 Sep 2006 16:41:36 -0000
|
||||
@@ -14,7 +14,7 @@ stdbool
|
||||
diff --git a/modules/getloadavg b/modules/getloadavg
|
||||
index 2fbeb40..b79aaca 100644
|
||||
--- a/modules/getloadavg
|
||||
+++ b/modules/getloadavg
|
||||
@@ -16,7 +16,7 @@ stdbool
|
||||
fcntl-safer
|
||||
|
||||
configure.ac:
|
||||
-gl_GETLOADAVG([$gl_source_base])
|
||||
+gl_GETLOADAVG([lib])
|
||||
gl_STDLIB_MODULE_INDICATOR([getloadavg])
|
||||
|
||||
Makefile.am:
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ lib/mgetgroups.h
|
||||
m4/mgetgroups.m4
|
||||
|
||||
Depends-on:
|
||||
free
|
||||
getugroups
|
||||
xalloc
|
||||
|
||||
|
||||
@@ -13,12 +13,13 @@ configure.ac:
|
||||
# For runcon.
|
||||
AC_CHECK_HEADERS([selinux/flask.h])
|
||||
AC_LIBOBJ([selinux-at])
|
||||
ac_save_LIBS="$LIBS"
|
||||
AC_SEARCH_LIBS(setfilecon, selinux,
|
||||
gl_save_LIBS=$LIBS
|
||||
LIB_SELINUX=
|
||||
AC_SEARCH_LIBS([setfilecon], [selinux],
|
||||
[test "$ac_cv_search_setfilecon" = "none required" ||
|
||||
LIB_SELINUX=$ac_cv_search_setfilecon])
|
||||
AC_SUBST(LIB_SELINUX)
|
||||
LIBS="$ac_save_LIBS"
|
||||
LIBS=$gl_save_LIBS
|
||||
|
||||
Makefile.am:
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
Description:
|
||||
SELinux-related headers for systems that lack them.
|
||||
|
||||
Files:
|
||||
lib/se-context.in.h
|
||||
lib/se-selinux.in.h
|
||||
m4/selinux-context-h.m4
|
||||
m4/selinux-selinux-h.m4
|
||||
|
||||
Depends-on:
|
||||
|
||||
configure.ac:
|
||||
gl_HEADERS_SELINUX_SELINUX_H
|
||||
gl_HEADERS_SELINUX_CONTEXT_H
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += se-context.in.h se-selinux.in.h
|
||||
|
||||
BUILT_SOURCES += $(SELINUX_SELINUX_H)
|
||||
selinux/selinux.h: se-selinux.in.h
|
||||
mkdir -p selinux
|
||||
cp $(srcdir)/se-selinux.in.h $@-t
|
||||
chmod a-x $@-t
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += selinux/selinux.h selinux/selinux.h-t
|
||||
|
||||
BUILT_SOURCES += $(SELINUX_CONTEXT_H)
|
||||
selinux/context.h: se-context.in.h
|
||||
mkdir -p selinux
|
||||
cp $(srcdir)/se-context.in.h $@-t
|
||||
chmod a-x $@-t
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += selinux/context.h selinux/context.h-t
|
||||
MOSTLYCLEANDIRS += selinux
|
||||
|
||||
Include:
|
||||
#include <selinux/selinux.h>
|
||||
#include <selinux/context.h>
|
||||
|
||||
License:
|
||||
LGPL
|
||||
|
||||
Maintainer:
|
||||
Jim Meyering
|
||||
|
||||
# lib/selinux-at.c
|
||||
#
|
||||
# # For runcon.
|
||||
# AC_CHECK_HEADERS([selinux/flask.h])
|
||||
#
|
||||
# ac_save_LIBS="$LIBS"
|
||||
# AC_SEARCH_LIBS(setfilecon, selinux,
|
||||
# [test "$ac_cv_search_setfilecon" = "none required" ||
|
||||
# LIB_SELINUX=$ac_cv_search_setfilecon])
|
||||
# AC_SUBST(LIB_SELINUX)
|
||||
# LIBS="$ac_save_LIBS"
|
||||
25
gl/modules/xfreopen
Normal file
25
gl/modules/xfreopen
Normal file
@@ -0,0 +1,25 @@
|
||||
Description:
|
||||
a wrapper for frepoen
|
||||
|
||||
Files:
|
||||
lib/xfreopen.c
|
||||
lib/xfreopen.h
|
||||
|
||||
Depends-on:
|
||||
error
|
||||
exitfail
|
||||
quote
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += xfreopen.c xfreopen.h
|
||||
|
||||
Include:
|
||||
"xfreopen.h"
|
||||
|
||||
License:
|
||||
LGPL
|
||||
|
||||
Maintainer:
|
||||
Jim Meyering
|
||||
120
gl/tests/test-argv-iter.c
Normal file
120
gl/tests/test-argv-iter.c
Normal file
@@ -0,0 +1,120 @@
|
||||
/* Test argv iterator
|
||||
Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
|
||||
#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
|
||||
#define ASSERT(expr) \
|
||||
do \
|
||||
{ \
|
||||
if (!(expr)) \
|
||||
{ \
|
||||
fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
|
||||
fflush (stderr); \
|
||||
abort (); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#include "argv-iter.h"
|
||||
|
||||
static FILE *
|
||||
write_nul_delimited_argv (char **argv)
|
||||
{
|
||||
FILE *fp = tmpfile ();
|
||||
ASSERT (fp);
|
||||
while (*argv)
|
||||
{
|
||||
size_t len = strlen (*argv) + 1;
|
||||
ASSERT (fwrite (*argv, len, 1, fp) == 1);
|
||||
argv++;
|
||||
}
|
||||
ASSERT (fflush (fp) == 0);
|
||||
rewind (fp);
|
||||
return fp;
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
/* set_program_name (argv[0]); placate overzealous "syntax-check" test. */
|
||||
static char *av[][4] = {
|
||||
{NULL},
|
||||
{"1", NULL},
|
||||
{"1", "2", NULL},
|
||||
{"1", "2", "3", NULL}
|
||||
};
|
||||
|
||||
int use_stream;
|
||||
for (use_stream = 0; use_stream < 2; use_stream++)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < ARRAY_CARDINALITY (av); i++)
|
||||
{
|
||||
FILE *fp;
|
||||
struct argv_iterator *ai;
|
||||
if (use_stream)
|
||||
{
|
||||
/* Generate an identical list to be read via FP. */
|
||||
ASSERT ((fp = write_nul_delimited_argv (av[i])) != NULL);
|
||||
ai = argv_iter_init_stream (fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fp = NULL;
|
||||
ai = argv_iter_init_argv (av[i]);
|
||||
}
|
||||
ASSERT (ai);
|
||||
|
||||
size_t n_found = 0;
|
||||
while (1)
|
||||
{
|
||||
enum argv_iter_err ai_err;
|
||||
char *s = argv_iter (ai, &ai_err);
|
||||
ASSERT ((i == n_found) == (ai_err == AI_ERR_EOF));
|
||||
ASSERT ((s == NULL) ^ (ai_err == AI_ERR_OK));
|
||||
ASSERT (ai_err == AI_ERR_OK || ai_err == AI_ERR_EOF);
|
||||
if (ai_err == AI_ERR_OK)
|
||||
++n_found;
|
||||
if (ai_err == AI_ERR_EOF)
|
||||
break;
|
||||
/* In stream mode, the strings are equal, but
|
||||
in argv mode the actual pointers are equal. */
|
||||
ASSERT (use_stream
|
||||
? STREQ (s, av[i][n_found - 1])
|
||||
: s == av[i][n_found - 1]);
|
||||
}
|
||||
ASSERT (argv_iter_n_args (ai) == i);
|
||||
argv_iter_free (ai);
|
||||
if (fp)
|
||||
ASSERT (fclose (fp) == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* indent-tabs-mode: nil
|
||||
* End:
|
||||
*/
|
||||
@@ -1 +1,6 @@
|
||||
include gnulib.mk
|
||||
|
||||
TEST_LOGS = $(TESTS:=.log)
|
||||
|
||||
# Parallel replacement of Automake's check-TESTS target.
|
||||
include $(top_srcdir)/build-aux/check.mk
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
include gnulib.mk
|
||||
|
||||
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
|
||||
AM_CFLAGS = $(WARN_CFLAGS) # $(WERROR_CFLAGS)
|
||||
|
||||
libcoreutils_a_SOURCES += \
|
||||
buffer-lcm.c buffer-lcm.h \
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Invoke open, but return either a desired file descriptor or -1.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -31,15 +31,13 @@
|
||||
int
|
||||
fd_reopen (int desired_fd, char const *file, int flags, mode_t mode)
|
||||
{
|
||||
int fd;
|
||||
int fd = open (file, flags, mode);
|
||||
|
||||
close (desired_fd);
|
||||
fd = open (file, flags, mode);
|
||||
if (fd == desired_fd || fd < 0)
|
||||
return fd;
|
||||
else
|
||||
{
|
||||
int fd2 = fcntl (fd, F_DUPFD, desired_fd);
|
||||
int fd2 = dup2 (fd, desired_fd);
|
||||
int saved_errno = errno;
|
||||
close (fd);
|
||||
errno = saved_errno;
|
||||
|
||||
545
lib/sha256.c
545
lib/sha256.c
@@ -1,545 +0,0 @@
|
||||
/* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or
|
||||
memory blocks according to the NIST specification FIPS-180-2.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by David Madore, considerably copypasting from
|
||||
Scott G. Miller's sha1.c
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "sha256.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#if USE_UNLOCKED_IO
|
||||
# include "unlocked-io.h"
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define SWAP(n) (n)
|
||||
#else
|
||||
# define SWAP(n) \
|
||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||
#endif
|
||||
|
||||
#define BLOCKSIZE 4096
|
||||
#if BLOCKSIZE % 64 != 0
|
||||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
64-byte boundary. */
|
||||
static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
||||
|
||||
/*
|
||||
Takes a pointer to a 256 bit block of data (eight 32 bit ints) and
|
||||
intializes it to the start constants of the SHA256 algorithm. This
|
||||
must be called before using hash in the call to sha256_hash
|
||||
*/
|
||||
void
|
||||
sha256_init_ctx (struct sha256_ctx *ctx)
|
||||
{
|
||||
ctx->state[0] = 0x6a09e667UL;
|
||||
ctx->state[1] = 0xbb67ae85UL;
|
||||
ctx->state[2] = 0x3c6ef372UL;
|
||||
ctx->state[3] = 0xa54ff53aUL;
|
||||
ctx->state[4] = 0x510e527fUL;
|
||||
ctx->state[5] = 0x9b05688cUL;
|
||||
ctx->state[6] = 0x1f83d9abUL;
|
||||
ctx->state[7] = 0x5be0cd19UL;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
void
|
||||
sha224_init_ctx (struct sha256_ctx *ctx)
|
||||
{
|
||||
ctx->state[0] = 0xc1059ed8UL;
|
||||
ctx->state[1] = 0x367cd507UL;
|
||||
ctx->state[2] = 0x3070dd17UL;
|
||||
ctx->state[3] = 0xf70e5939UL;
|
||||
ctx->state[4] = 0xffc00b31UL;
|
||||
ctx->state[5] = 0x68581511UL;
|
||||
ctx->state[6] = 0x64f98fa7UL;
|
||||
ctx->state[7] = 0xbefa4fa4UL;
|
||||
|
||||
ctx->total[0] = ctx->total[1] = 0;
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 32 bytes following RESBUF. The result
|
||||
must be in little endian byte order.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32-bit value. */
|
||||
void *
|
||||
sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
((uint32_t *) resbuf)[i] = SWAP (ctx->state[i]);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
void *
|
||||
sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
((uint32_t *) resbuf)[i] = SWAP (ctx->state[i]);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* Process the remaining bytes in the internal buffer and the usual
|
||||
prolog according to the standard and write the result to RESBUF.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32-bit value. */
|
||||
static void
|
||||
sha256_conclude_ctx (struct sha256_ctx *ctx)
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
uint32_t bytes = ctx->buflen;
|
||||
size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] += bytes;
|
||||
if (ctx->total[0] < bytes)
|
||||
++ctx->total[1];
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
|
||||
ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3);
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes);
|
||||
|
||||
/* Process last bytes. */
|
||||
sha256_process_block (ctx->buffer, size * 4, ctx);
|
||||
}
|
||||
|
||||
void *
|
||||
sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
|
||||
{
|
||||
sha256_conclude_ctx (ctx);
|
||||
return sha256_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
void *
|
||||
sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf)
|
||||
{
|
||||
sha256_conclude_ctx (ctx);
|
||||
return sha224_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute SHA256 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 32 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int
|
||||
sha256_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
struct sha256_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha256_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
|
||||
if (sum == BLOCKSIZE)
|
||||
break;
|
||||
|
||||
if (n == 0)
|
||||
{
|
||||
/* Check for the error flag IFF N == 0, so that we don't
|
||||
exit the loop after a partial read due to e.g., EAGAIN
|
||||
or EWOULDBLOCK. */
|
||||
if (ferror (stream))
|
||||
return 1;
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* We've read at least one byte, so ignore errors. But always
|
||||
check for EOF, since feof may be true even though N > 0.
|
||||
Otherwise, we could end up calling fread after EOF. */
|
||||
if (feof (stream))
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
sha256_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
process_partial_block:;
|
||||
|
||||
/* Process any remaining bytes. */
|
||||
if (sum > 0)
|
||||
sha256_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha256_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: Avoid code duplication */
|
||||
int
|
||||
sha224_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
struct sha256_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha224_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
|
||||
if (sum == BLOCKSIZE)
|
||||
break;
|
||||
|
||||
if (n == 0)
|
||||
{
|
||||
/* Check for the error flag IFF N == 0, so that we don't
|
||||
exit the loop after a partial read due to e.g., EAGAIN
|
||||
or EWOULDBLOCK. */
|
||||
if (ferror (stream))
|
||||
return 1;
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* We've read at least one byte, so ignore errors. But always
|
||||
check for EOF, since feof may be true even though N > 0.
|
||||
Otherwise, we could end up calling fread after EOF. */
|
||||
if (feof (stream))
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 64 == 0
|
||||
*/
|
||||
sha256_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
process_partial_block:;
|
||||
|
||||
/* Process any remaining bytes. */
|
||||
if (sum > 0)
|
||||
sha256_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha224_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *
|
||||
sha256_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha256_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha256_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
sha256_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha256_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void *
|
||||
sha224_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha256_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha224_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 64 bytes. */
|
||||
sha256_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha224_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void
|
||||
sha256_process_bytes (const void *buffer, size_t len, struct sha256_ctx *ctx)
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 128 - left_over > len ? len : 128 - left_over;
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (ctx->buflen > 64)
|
||||
{
|
||||
sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
|
||||
|
||||
ctx->buflen &= 63;
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer,
|
||||
&((char *) ctx->buffer)[(left_over + add) & ~63],
|
||||
ctx->buflen);
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len >= 64)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 64)
|
||||
{
|
||||
sha256_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
|
||||
buffer = (const char *) buffer + 64;
|
||||
len -= 64;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sha256_process_block (buffer, len & ~63, ctx);
|
||||
buffer = (const char *) buffer + (len & ~63);
|
||||
len &= 63;
|
||||
}
|
||||
}
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
|
||||
left_over += len;
|
||||
if (left_over >= 64)
|
||||
{
|
||||
sha256_process_block (ctx->buffer, 64, ctx);
|
||||
left_over -= 64;
|
||||
memcpy (ctx->buffer, &ctx->buffer[16], left_over);
|
||||
}
|
||||
ctx->buflen = left_over;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Code below is the primary difference between sha1.c and sha256.c --- */
|
||||
|
||||
/* SHA256 round constants */
|
||||
#define K(I) sha256_round_constants[I]
|
||||
static const uint32_t sha256_round_constants[64] = {
|
||||
0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL,
|
||||
0x3956c25bUL, 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL,
|
||||
0xd807aa98UL, 0x12835b01UL, 0x243185beUL, 0x550c7dc3UL,
|
||||
0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, 0xc19bf174UL,
|
||||
0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL,
|
||||
0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL,
|
||||
0x983e5152UL, 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL,
|
||||
0xc6e00bf3UL, 0xd5a79147UL, 0x06ca6351UL, 0x14292967UL,
|
||||
0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, 0x53380d13UL,
|
||||
0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL,
|
||||
0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL,
|
||||
0xd192e819UL, 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL,
|
||||
0x19a4c116UL, 0x1e376c08UL, 0x2748774cUL, 0x34b0bcb5UL,
|
||||
0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, 0x682e6ff3UL,
|
||||
0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL,
|
||||
0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL,
|
||||
};
|
||||
|
||||
/* Round functions. */
|
||||
#define F2(A,B,C) ( ( A & B ) | ( C & ( A | B ) ) )
|
||||
#define F1(E,F,G) ( G ^ ( E & ( F ^ G ) ) )
|
||||
|
||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||
It is assumed that LEN % 64 == 0.
|
||||
Most of this code comes from GnuPG's cipher/sha1.c. */
|
||||
|
||||
void
|
||||
sha256_process_block (const void *buffer, size_t len, struct sha256_ctx *ctx)
|
||||
{
|
||||
const uint32_t *words = buffer;
|
||||
size_t nwords = len / sizeof (uint32_t);
|
||||
const uint32_t *endp = words + nwords;
|
||||
uint32_t x[16];
|
||||
uint32_t a = ctx->state[0];
|
||||
uint32_t b = ctx->state[1];
|
||||
uint32_t c = ctx->state[2];
|
||||
uint32_t d = ctx->state[3];
|
||||
uint32_t e = ctx->state[4];
|
||||
uint32_t f = ctx->state[5];
|
||||
uint32_t g = ctx->state[6];
|
||||
uint32_t h = ctx->state[7];
|
||||
|
||||
/* First increment the byte count. FIPS PUB 180-2 specifies the possible
|
||||
length of the file up to 2^64 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] += len;
|
||||
if (ctx->total[0] < len)
|
||||
++ctx->total[1];
|
||||
|
||||
#define rol(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
|
||||
#define S0(x) (rol(x,25)^rol(x,14)^(x>>3))
|
||||
#define S1(x) (rol(x,15)^rol(x,13)^(x>>10))
|
||||
#define SS0(x) (rol(x,30)^rol(x,19)^rol(x,10))
|
||||
#define SS1(x) (rol(x,26)^rol(x,21)^rol(x,7))
|
||||
|
||||
#define M(I) ( tm = S1(x[(I-2)&0x0f]) + x[(I-7)&0x0f] \
|
||||
+ S0(x[(I-15)&0x0f]) + x[I&0x0f] \
|
||||
, x[I&0x0f] = tm )
|
||||
|
||||
#define R(A,B,C,D,E,F,G,H,K,M) do { t0 = SS0(A) + F2(A,B,C); \
|
||||
t1 = H + SS1(E) \
|
||||
+ F1(E,F,G) \
|
||||
+ K \
|
||||
+ M; \
|
||||
D += t1; H = t0 + t1; \
|
||||
} while(0)
|
||||
|
||||
while (words < endp)
|
||||
{
|
||||
uint32_t tm;
|
||||
uint32_t t0, t1;
|
||||
int t;
|
||||
/* FIXME: see sha1.c for a better implementation. */
|
||||
for (t = 0; t < 16; t++)
|
||||
{
|
||||
x[t] = SWAP (*words);
|
||||
words++;
|
||||
}
|
||||
|
||||
R( a, b, c, d, e, f, g, h, K( 0), x[ 0] );
|
||||
R( h, a, b, c, d, e, f, g, K( 1), x[ 1] );
|
||||
R( g, h, a, b, c, d, e, f, K( 2), x[ 2] );
|
||||
R( f, g, h, a, b, c, d, e, K( 3), x[ 3] );
|
||||
R( e, f, g, h, a, b, c, d, K( 4), x[ 4] );
|
||||
R( d, e, f, g, h, a, b, c, K( 5), x[ 5] );
|
||||
R( c, d, e, f, g, h, a, b, K( 6), x[ 6] );
|
||||
R( b, c, d, e, f, g, h, a, K( 7), x[ 7] );
|
||||
R( a, b, c, d, e, f, g, h, K( 8), x[ 8] );
|
||||
R( h, a, b, c, d, e, f, g, K( 9), x[ 9] );
|
||||
R( g, h, a, b, c, d, e, f, K(10), x[10] );
|
||||
R( f, g, h, a, b, c, d, e, K(11), x[11] );
|
||||
R( e, f, g, h, a, b, c, d, K(12), x[12] );
|
||||
R( d, e, f, g, h, a, b, c, K(13), x[13] );
|
||||
R( c, d, e, f, g, h, a, b, K(14), x[14] );
|
||||
R( b, c, d, e, f, g, h, a, K(15), x[15] );
|
||||
R( a, b, c, d, e, f, g, h, K(16), M(16) );
|
||||
R( h, a, b, c, d, e, f, g, K(17), M(17) );
|
||||
R( g, h, a, b, c, d, e, f, K(18), M(18) );
|
||||
R( f, g, h, a, b, c, d, e, K(19), M(19) );
|
||||
R( e, f, g, h, a, b, c, d, K(20), M(20) );
|
||||
R( d, e, f, g, h, a, b, c, K(21), M(21) );
|
||||
R( c, d, e, f, g, h, a, b, K(22), M(22) );
|
||||
R( b, c, d, e, f, g, h, a, K(23), M(23) );
|
||||
R( a, b, c, d, e, f, g, h, K(24), M(24) );
|
||||
R( h, a, b, c, d, e, f, g, K(25), M(25) );
|
||||
R( g, h, a, b, c, d, e, f, K(26), M(26) );
|
||||
R( f, g, h, a, b, c, d, e, K(27), M(27) );
|
||||
R( e, f, g, h, a, b, c, d, K(28), M(28) );
|
||||
R( d, e, f, g, h, a, b, c, K(29), M(29) );
|
||||
R( c, d, e, f, g, h, a, b, K(30), M(30) );
|
||||
R( b, c, d, e, f, g, h, a, K(31), M(31) );
|
||||
R( a, b, c, d, e, f, g, h, K(32), M(32) );
|
||||
R( h, a, b, c, d, e, f, g, K(33), M(33) );
|
||||
R( g, h, a, b, c, d, e, f, K(34), M(34) );
|
||||
R( f, g, h, a, b, c, d, e, K(35), M(35) );
|
||||
R( e, f, g, h, a, b, c, d, K(36), M(36) );
|
||||
R( d, e, f, g, h, a, b, c, K(37), M(37) );
|
||||
R( c, d, e, f, g, h, a, b, K(38), M(38) );
|
||||
R( b, c, d, e, f, g, h, a, K(39), M(39) );
|
||||
R( a, b, c, d, e, f, g, h, K(40), M(40) );
|
||||
R( h, a, b, c, d, e, f, g, K(41), M(41) );
|
||||
R( g, h, a, b, c, d, e, f, K(42), M(42) );
|
||||
R( f, g, h, a, b, c, d, e, K(43), M(43) );
|
||||
R( e, f, g, h, a, b, c, d, K(44), M(44) );
|
||||
R( d, e, f, g, h, a, b, c, K(45), M(45) );
|
||||
R( c, d, e, f, g, h, a, b, K(46), M(46) );
|
||||
R( b, c, d, e, f, g, h, a, K(47), M(47) );
|
||||
R( a, b, c, d, e, f, g, h, K(48), M(48) );
|
||||
R( h, a, b, c, d, e, f, g, K(49), M(49) );
|
||||
R( g, h, a, b, c, d, e, f, K(50), M(50) );
|
||||
R( f, g, h, a, b, c, d, e, K(51), M(51) );
|
||||
R( e, f, g, h, a, b, c, d, K(52), M(52) );
|
||||
R( d, e, f, g, h, a, b, c, K(53), M(53) );
|
||||
R( c, d, e, f, g, h, a, b, K(54), M(54) );
|
||||
R( b, c, d, e, f, g, h, a, K(55), M(55) );
|
||||
R( a, b, c, d, e, f, g, h, K(56), M(56) );
|
||||
R( h, a, b, c, d, e, f, g, K(57), M(57) );
|
||||
R( g, h, a, b, c, d, e, f, K(58), M(58) );
|
||||
R( f, g, h, a, b, c, d, e, K(59), M(59) );
|
||||
R( e, f, g, h, a, b, c, d, K(60), M(60) );
|
||||
R( d, e, f, g, h, a, b, c, K(61), M(61) );
|
||||
R( c, d, e, f, g, h, a, b, K(62), M(62) );
|
||||
R( b, c, d, e, f, g, h, a, K(63), M(63) );
|
||||
|
||||
a = ctx->state[0] += a;
|
||||
b = ctx->state[1] += b;
|
||||
c = ctx->state[2] += c;
|
||||
d = ctx->state[3] += d;
|
||||
e = ctx->state[4] += e;
|
||||
f = ctx->state[5] += f;
|
||||
g = ctx->state[6] += g;
|
||||
h = ctx->state[7] += h;
|
||||
}
|
||||
}
|
||||
87
lib/sha256.h
87
lib/sha256.h
@@ -1,87 +0,0 @@
|
||||
/* Declarations of functions and data types used for SHA256 and SHA224 sum
|
||||
library functions.
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SHA256_H
|
||||
# define SHA256_H 1
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdint.h>
|
||||
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha256_ctx
|
||||
{
|
||||
uint32_t state[8];
|
||||
|
||||
uint32_t total[2];
|
||||
uint32_t buflen;
|
||||
uint32_t buffer[32];
|
||||
};
|
||||
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha256_init_ctx (struct sha256_ctx *ctx);
|
||||
extern void sha224_init_ctx (struct sha256_ctx *ctx);
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 64!!! */
|
||||
extern void sha256_process_block (const void *buffer, size_t len,
|
||||
struct sha256_ctx *ctx);
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 64. */
|
||||
extern void sha256_process_bytes (const void *buffer, size_t len,
|
||||
struct sha256_ctx *ctx);
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 32 (28) bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF be correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
|
||||
extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Put result from CTX in first 32 (28) bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
|
||||
extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Compute SHA256 (SHA224) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 32 (28) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha256_stream (FILE *stream, void *resblock);
|
||||
extern int sha224_stream (FILE *stream, void *resblock);
|
||||
|
||||
/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *sha256_buffer (const char *buffer, size_t len, void *resblock);
|
||||
extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
|
||||
|
||||
#endif
|
||||
595
lib/sha512.c
595
lib/sha512.c
@@ -1,595 +0,0 @@
|
||||
/* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or
|
||||
memory blocks according to the NIST specification FIPS-180-2.
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by David Madore, considerably copypasting from
|
||||
Scott G. Miller's sha1.c
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "sha512.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#if USE_UNLOCKED_IO
|
||||
# include "unlocked-io.h"
|
||||
#endif
|
||||
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
# define SWAP(n) (n)
|
||||
#else
|
||||
# define SWAP(n) \
|
||||
u64or (u64or (u64or (u64shl (n, 56), \
|
||||
u64shl (u64and (n, u64lo (0x0000ff00)), 40)), \
|
||||
u64or (u64shl (u64and (n, u64lo (0x00ff0000)), 24), \
|
||||
u64shl (u64and (n, u64lo (0xff000000)), 8))), \
|
||||
u64or (u64or (u64and (u64shr (n, 8), u64lo (0xff000000)), \
|
||||
u64and (u64shr (n, 24), u64lo (0x00ff0000))), \
|
||||
u64or (u64and (u64shr (n, 40), u64lo (0x0000ff00)), \
|
||||
u64shr (n, 56))))
|
||||
#endif
|
||||
|
||||
#define BLOCKSIZE 4096
|
||||
#if BLOCKSIZE % 128 != 0
|
||||
# error "invalid BLOCKSIZE"
|
||||
#endif
|
||||
|
||||
/* This array contains the bytes used to pad the buffer to the next
|
||||
128-byte boundary. */
|
||||
static const unsigned char fillbuf[128] = { 0x80, 0 /* , 0, 0, ... */ };
|
||||
|
||||
|
||||
/*
|
||||
Takes a pointer to a 512 bit block of data (eight 64 bit ints) and
|
||||
intializes it to the start constants of the SHA512 algorithm. This
|
||||
must be called before using hash in the call to sha512_hash
|
||||
*/
|
||||
void
|
||||
sha512_init_ctx (struct sha512_ctx *ctx)
|
||||
{
|
||||
ctx->state[0] = u64hilo (0x6a09e667, 0xf3bcc908);
|
||||
ctx->state[1] = u64hilo (0xbb67ae85, 0x84caa73b);
|
||||
ctx->state[2] = u64hilo (0x3c6ef372, 0xfe94f82b);
|
||||
ctx->state[3] = u64hilo (0xa54ff53a, 0x5f1d36f1);
|
||||
ctx->state[4] = u64hilo (0x510e527f, 0xade682d1);
|
||||
ctx->state[5] = u64hilo (0x9b05688c, 0x2b3e6c1f);
|
||||
ctx->state[6] = u64hilo (0x1f83d9ab, 0xfb41bd6b);
|
||||
ctx->state[7] = u64hilo (0x5be0cd19, 0x137e2179);
|
||||
|
||||
ctx->total[0] = ctx->total[1] = u64lo (0);
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
void
|
||||
sha384_init_ctx (struct sha512_ctx *ctx)
|
||||
{
|
||||
ctx->state[0] = u64hilo (0xcbbb9d5d, 0xc1059ed8);
|
||||
ctx->state[1] = u64hilo (0x629a292a, 0x367cd507);
|
||||
ctx->state[2] = u64hilo (0x9159015a, 0x3070dd17);
|
||||
ctx->state[3] = u64hilo (0x152fecd8, 0xf70e5939);
|
||||
ctx->state[4] = u64hilo (0x67332667, 0xffc00b31);
|
||||
ctx->state[5] = u64hilo (0x8eb44a87, 0x68581511);
|
||||
ctx->state[6] = u64hilo (0xdb0c2e0d, 0x64f98fa7);
|
||||
ctx->state[7] = u64hilo (0x47b5481d, 0xbefa4fa4);
|
||||
|
||||
ctx->total[0] = ctx->total[1] = u64lo (0);
|
||||
ctx->buflen = 0;
|
||||
}
|
||||
|
||||
/* Put result from CTX in first 64 bytes following RESBUF. The result
|
||||
must be in little endian byte order.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 64-bit value. */
|
||||
void *
|
||||
sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
((u64 *) resbuf)[i] = SWAP (ctx->state[i]);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
void *
|
||||
sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
((u64 *) resbuf)[i] = SWAP (ctx->state[i]);
|
||||
|
||||
return resbuf;
|
||||
}
|
||||
|
||||
/* Process the remaining bytes in the internal buffer and the usual
|
||||
prolog according to the standard and write the result to RESBUF.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 64-bit value. */
|
||||
static void
|
||||
sha512_conclude_ctx (struct sha512_ctx *ctx)
|
||||
{
|
||||
/* Take yet unprocessed bytes into account. */
|
||||
size_t bytes = ctx->buflen;
|
||||
size_t size = (bytes < 112) ? 128 / 8 : 128 * 2 / 8;
|
||||
|
||||
/* Now count remaining bytes. */
|
||||
ctx->total[0] = u64plus (ctx->total[0], u64lo (bytes));
|
||||
if (u64lt (ctx->total[0], u64lo (bytes)))
|
||||
ctx->total[1] = u64plus (ctx->total[1], u64lo (1));
|
||||
|
||||
/* Put the 64-bit file length in *bits* at the end of the buffer. */
|
||||
ctx->buffer[size - 2] = SWAP (u64or (u64shl (ctx->total[1], 3),
|
||||
u64shr (ctx->total[0], 61)));
|
||||
ctx->buffer[size - 1] = SWAP (u64shl (ctx->total[0], 3));
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 8 - bytes);
|
||||
|
||||
/* Process last bytes. */
|
||||
sha512_process_block (ctx->buffer, size * 8, ctx);
|
||||
}
|
||||
|
||||
void *
|
||||
sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
|
||||
{
|
||||
sha512_conclude_ctx (ctx);
|
||||
return sha512_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
void *
|
||||
sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf)
|
||||
{
|
||||
sha512_conclude_ctx (ctx);
|
||||
return sha384_read_ctx (ctx, resbuf);
|
||||
}
|
||||
|
||||
/* Compute SHA512 message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 64 bytes
|
||||
beginning at RESBLOCK. */
|
||||
int
|
||||
sha512_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
struct sha512_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha512_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
|
||||
if (sum == BLOCKSIZE)
|
||||
break;
|
||||
|
||||
if (n == 0)
|
||||
{
|
||||
/* Check for the error flag IFF N == 0, so that we don't
|
||||
exit the loop after a partial read due to e.g., EAGAIN
|
||||
or EWOULDBLOCK. */
|
||||
if (ferror (stream))
|
||||
return 1;
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* We've read at least one byte, so ignore errors. But always
|
||||
check for EOF, since feof may be true even though N > 0.
|
||||
Otherwise, we could end up calling fread after EOF. */
|
||||
if (feof (stream))
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 128 == 0
|
||||
*/
|
||||
sha512_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
process_partial_block:;
|
||||
|
||||
/* Process any remaining bytes. */
|
||||
if (sum > 0)
|
||||
sha512_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha512_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: Avoid code duplication */
|
||||
int
|
||||
sha384_stream (FILE *stream, void *resblock)
|
||||
{
|
||||
struct sha512_ctx ctx;
|
||||
char buffer[BLOCKSIZE + 72];
|
||||
size_t sum;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha384_init_ctx (&ctx);
|
||||
|
||||
/* Iterate over full file contents. */
|
||||
while (1)
|
||||
{
|
||||
/* We read the file in blocks of BLOCKSIZE bytes. One call of the
|
||||
computation function processes the whole buffer so that with the
|
||||
next round of the loop another block can be read. */
|
||||
size_t n;
|
||||
sum = 0;
|
||||
|
||||
/* Read block. Take care for partial reads. */
|
||||
while (1)
|
||||
{
|
||||
n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
|
||||
|
||||
sum += n;
|
||||
|
||||
if (sum == BLOCKSIZE)
|
||||
break;
|
||||
|
||||
if (n == 0)
|
||||
{
|
||||
/* Check for the error flag IFF N == 0, so that we don't
|
||||
exit the loop after a partial read due to e.g., EAGAIN
|
||||
or EWOULDBLOCK. */
|
||||
if (ferror (stream))
|
||||
return 1;
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* We've read at least one byte, so ignore errors. But always
|
||||
check for EOF, since feof may be true even though N > 0.
|
||||
Otherwise, we could end up calling fread after EOF. */
|
||||
if (feof (stream))
|
||||
goto process_partial_block;
|
||||
}
|
||||
|
||||
/* Process buffer with BLOCKSIZE bytes. Note that
|
||||
BLOCKSIZE % 128 == 0
|
||||
*/
|
||||
sha512_process_block (buffer, BLOCKSIZE, &ctx);
|
||||
}
|
||||
|
||||
process_partial_block:;
|
||||
|
||||
/* Process any remaining bytes. */
|
||||
if (sum > 0)
|
||||
sha512_process_bytes (buffer, sum, &ctx);
|
||||
|
||||
/* Construct result in desired memory. */
|
||||
sha384_finish_ctx (&ctx, resblock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Compute SHA512 message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
void *
|
||||
sha512_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha512_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha512_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 128 bytes. */
|
||||
sha512_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha512_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void *
|
||||
sha384_buffer (const char *buffer, size_t len, void *resblock)
|
||||
{
|
||||
struct sha512_ctx ctx;
|
||||
|
||||
/* Initialize the computation context. */
|
||||
sha384_init_ctx (&ctx);
|
||||
|
||||
/* Process whole buffer but last len % 128 bytes. */
|
||||
sha512_process_bytes (buffer, len, &ctx);
|
||||
|
||||
/* Put result in desired memory area. */
|
||||
return sha384_finish_ctx (&ctx, resblock);
|
||||
}
|
||||
|
||||
void
|
||||
sha512_process_bytes (const void *buffer, size_t len, struct sha512_ctx *ctx)
|
||||
{
|
||||
/* When we already have some bits in our internal buffer concatenate
|
||||
both inputs first. */
|
||||
if (ctx->buflen != 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
size_t add = 256 - left_over > len ? len : 256 - left_over;
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
|
||||
ctx->buflen += add;
|
||||
|
||||
if (ctx->buflen > 128)
|
||||
{
|
||||
sha512_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
|
||||
|
||||
ctx->buflen &= 127;
|
||||
/* The regions in the following copy operation cannot overlap. */
|
||||
memcpy (ctx->buffer,
|
||||
&((char *) ctx->buffer)[(left_over + add) & ~127],
|
||||
ctx->buflen);
|
||||
}
|
||||
|
||||
buffer = (const char *) buffer + add;
|
||||
len -= add;
|
||||
}
|
||||
|
||||
/* Process available complete blocks. */
|
||||
if (len >= 128)
|
||||
{
|
||||
#if !_STRING_ARCH_unaligned
|
||||
# define alignof(type) offsetof (struct { char c; type x; }, x)
|
||||
# define UNALIGNED_P(p) (((size_t) p) % alignof (u64) != 0)
|
||||
if (UNALIGNED_P (buffer))
|
||||
while (len > 128)
|
||||
{
|
||||
sha512_process_block (memcpy (ctx->buffer, buffer, 128), 128, ctx);
|
||||
buffer = (const char *) buffer + 128;
|
||||
len -= 128;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sha512_process_block (buffer, len & ~127, ctx);
|
||||
buffer = (const char *) buffer + (len & ~127);
|
||||
len &= 127;
|
||||
}
|
||||
}
|
||||
|
||||
/* Move remaining bytes in internal buffer. */
|
||||
if (len > 0)
|
||||
{
|
||||
size_t left_over = ctx->buflen;
|
||||
|
||||
memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
|
||||
left_over += len;
|
||||
if (left_over >= 128)
|
||||
{
|
||||
sha512_process_block (ctx->buffer, 128, ctx);
|
||||
left_over -= 128;
|
||||
memcpy (ctx->buffer, &ctx->buffer[16], left_over);
|
||||
}
|
||||
ctx->buflen = left_over;
|
||||
}
|
||||
}
|
||||
|
||||
/* --- Code below is the primary difference between sha1.c and sha512.c --- */
|
||||
|
||||
/* SHA512 round constants */
|
||||
#define K(I) sha512_round_constants[I]
|
||||
static u64 const sha512_round_constants[80] = {
|
||||
u64init (0x428a2f98, 0xd728ae22), u64init (0x71374491, 0x23ef65cd),
|
||||
u64init (0xb5c0fbcf, 0xec4d3b2f), u64init (0xe9b5dba5, 0x8189dbbc),
|
||||
u64init (0x3956c25b, 0xf348b538), u64init (0x59f111f1, 0xb605d019),
|
||||
u64init (0x923f82a4, 0xaf194f9b), u64init (0xab1c5ed5, 0xda6d8118),
|
||||
u64init (0xd807aa98, 0xa3030242), u64init (0x12835b01, 0x45706fbe),
|
||||
u64init (0x243185be, 0x4ee4b28c), u64init (0x550c7dc3, 0xd5ffb4e2),
|
||||
u64init (0x72be5d74, 0xf27b896f), u64init (0x80deb1fe, 0x3b1696b1),
|
||||
u64init (0x9bdc06a7, 0x25c71235), u64init (0xc19bf174, 0xcf692694),
|
||||
u64init (0xe49b69c1, 0x9ef14ad2), u64init (0xefbe4786, 0x384f25e3),
|
||||
u64init (0x0fc19dc6, 0x8b8cd5b5), u64init (0x240ca1cc, 0x77ac9c65),
|
||||
u64init (0x2de92c6f, 0x592b0275), u64init (0x4a7484aa, 0x6ea6e483),
|
||||
u64init (0x5cb0a9dc, 0xbd41fbd4), u64init (0x76f988da, 0x831153b5),
|
||||
u64init (0x983e5152, 0xee66dfab), u64init (0xa831c66d, 0x2db43210),
|
||||
u64init (0xb00327c8, 0x98fb213f), u64init (0xbf597fc7, 0xbeef0ee4),
|
||||
u64init (0xc6e00bf3, 0x3da88fc2), u64init (0xd5a79147, 0x930aa725),
|
||||
u64init (0x06ca6351, 0xe003826f), u64init (0x14292967, 0x0a0e6e70),
|
||||
u64init (0x27b70a85, 0x46d22ffc), u64init (0x2e1b2138, 0x5c26c926),
|
||||
u64init (0x4d2c6dfc, 0x5ac42aed), u64init (0x53380d13, 0x9d95b3df),
|
||||
u64init (0x650a7354, 0x8baf63de), u64init (0x766a0abb, 0x3c77b2a8),
|
||||
u64init (0x81c2c92e, 0x47edaee6), u64init (0x92722c85, 0x1482353b),
|
||||
u64init (0xa2bfe8a1, 0x4cf10364), u64init (0xa81a664b, 0xbc423001),
|
||||
u64init (0xc24b8b70, 0xd0f89791), u64init (0xc76c51a3, 0x0654be30),
|
||||
u64init (0xd192e819, 0xd6ef5218), u64init (0xd6990624, 0x5565a910),
|
||||
u64init (0xf40e3585, 0x5771202a), u64init (0x106aa070, 0x32bbd1b8),
|
||||
u64init (0x19a4c116, 0xb8d2d0c8), u64init (0x1e376c08, 0x5141ab53),
|
||||
u64init (0x2748774c, 0xdf8eeb99), u64init (0x34b0bcb5, 0xe19b48a8),
|
||||
u64init (0x391c0cb3, 0xc5c95a63), u64init (0x4ed8aa4a, 0xe3418acb),
|
||||
u64init (0x5b9cca4f, 0x7763e373), u64init (0x682e6ff3, 0xd6b2b8a3),
|
||||
u64init (0x748f82ee, 0x5defb2fc), u64init (0x78a5636f, 0x43172f60),
|
||||
u64init (0x84c87814, 0xa1f0ab72), u64init (0x8cc70208, 0x1a6439ec),
|
||||
u64init (0x90befffa, 0x23631e28), u64init (0xa4506ceb, 0xde82bde9),
|
||||
u64init (0xbef9a3f7, 0xb2c67915), u64init (0xc67178f2, 0xe372532b),
|
||||
u64init (0xca273ece, 0xea26619c), u64init (0xd186b8c7, 0x21c0c207),
|
||||
u64init (0xeada7dd6, 0xcde0eb1e), u64init (0xf57d4f7f, 0xee6ed178),
|
||||
u64init (0x06f067aa, 0x72176fba), u64init (0x0a637dc5, 0xa2c898a6),
|
||||
u64init (0x113f9804, 0xbef90dae), u64init (0x1b710b35, 0x131c471b),
|
||||
u64init (0x28db77f5, 0x23047d84), u64init (0x32caab7b, 0x40c72493),
|
||||
u64init (0x3c9ebe0a, 0x15c9bebc), u64init (0x431d67c4, 0x9c100d4c),
|
||||
u64init (0x4cc5d4be, 0xcb3e42b6), u64init (0x597f299c, 0xfc657e2a),
|
||||
u64init (0x5fcb6fab, 0x3ad6faec), u64init (0x6c44198c, 0x4a475817),
|
||||
};
|
||||
|
||||
/* Round functions. */
|
||||
#define F2(A, B, C) u64or (u64and (A, B), u64and (C, u64or (A, B)))
|
||||
#define F1(E, F, G) u64xor (G, u64and (E, u64xor (F, G)))
|
||||
|
||||
/* Process LEN bytes of BUFFER, accumulating context into CTX.
|
||||
It is assumed that LEN % 128 == 0.
|
||||
Most of this code comes from GnuPG's cipher/sha1.c. */
|
||||
|
||||
void
|
||||
sha512_process_block (const void *buffer, size_t len, struct sha512_ctx *ctx)
|
||||
{
|
||||
u64 const *words = buffer;
|
||||
u64 const *endp = words + len / sizeof (u64);
|
||||
u64 x[16];
|
||||
u64 a = ctx->state[0];
|
||||
u64 b = ctx->state[1];
|
||||
u64 c = ctx->state[2];
|
||||
u64 d = ctx->state[3];
|
||||
u64 e = ctx->state[4];
|
||||
u64 f = ctx->state[5];
|
||||
u64 g = ctx->state[6];
|
||||
u64 h = ctx->state[7];
|
||||
|
||||
/* First increment the byte count. FIPS PUB 180-2 specifies the possible
|
||||
length of the file up to 2^128 bits. Here we only compute the
|
||||
number of bytes. Do a double word increment. */
|
||||
ctx->total[0] = u64plus (ctx->total[0], u64lo (len));
|
||||
if (u64lt (ctx->total[0], u64lo (len)))
|
||||
ctx->total[1] = u64plus (ctx->total[1], u64lo (1));
|
||||
|
||||
#define S0(x) u64xor (u64rol(x, 63), u64xor (u64rol (x, 56), u64shr (x, 7)))
|
||||
#define S1(x) u64xor (u64rol (x, 45), u64xor (u64rol (x, 3), u64shr (x, 6)))
|
||||
#define SS0(x) u64xor (u64rol (x, 36), u64xor (u64rol (x, 30), u64rol (x, 25)))
|
||||
#define SS1(x) u64xor (u64rol(x, 50), u64xor (u64rol (x, 46), u64rol (x, 23)))
|
||||
|
||||
#define M(I) (x[(I) & 15] \
|
||||
= u64plus (x[(I) & 15], \
|
||||
u64plus (S1 (x[((I) - 2) & 15]), \
|
||||
u64plus (x[((I) - 7) & 15], \
|
||||
S0 (x[((I) - 15) & 15])))))
|
||||
|
||||
#define R(A, B, C, D, E, F, G, H, K, M) \
|
||||
do \
|
||||
{ \
|
||||
u64 t0 = u64plus (SS0 (A), F2 (A, B, C)); \
|
||||
u64 t1 = \
|
||||
u64plus (H, u64plus (SS1 (E), \
|
||||
u64plus (F1 (E, F, G), u64plus (K, M)))); \
|
||||
D = u64plus (D, t1); \
|
||||
H = u64plus (t0, t1); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
while (words < endp)
|
||||
{
|
||||
int t;
|
||||
/* FIXME: see sha1.c for a better implementation. */
|
||||
for (t = 0; t < 16; t++)
|
||||
{
|
||||
x[t] = SWAP (*words);
|
||||
words++;
|
||||
}
|
||||
|
||||
R( a, b, c, d, e, f, g, h, K( 0), x[ 0] );
|
||||
R( h, a, b, c, d, e, f, g, K( 1), x[ 1] );
|
||||
R( g, h, a, b, c, d, e, f, K( 2), x[ 2] );
|
||||
R( f, g, h, a, b, c, d, e, K( 3), x[ 3] );
|
||||
R( e, f, g, h, a, b, c, d, K( 4), x[ 4] );
|
||||
R( d, e, f, g, h, a, b, c, K( 5), x[ 5] );
|
||||
R( c, d, e, f, g, h, a, b, K( 6), x[ 6] );
|
||||
R( b, c, d, e, f, g, h, a, K( 7), x[ 7] );
|
||||
R( a, b, c, d, e, f, g, h, K( 8), x[ 8] );
|
||||
R( h, a, b, c, d, e, f, g, K( 9), x[ 9] );
|
||||
R( g, h, a, b, c, d, e, f, K(10), x[10] );
|
||||
R( f, g, h, a, b, c, d, e, K(11), x[11] );
|
||||
R( e, f, g, h, a, b, c, d, K(12), x[12] );
|
||||
R( d, e, f, g, h, a, b, c, K(13), x[13] );
|
||||
R( c, d, e, f, g, h, a, b, K(14), x[14] );
|
||||
R( b, c, d, e, f, g, h, a, K(15), x[15] );
|
||||
R( a, b, c, d, e, f, g, h, K(16), M(16) );
|
||||
R( h, a, b, c, d, e, f, g, K(17), M(17) );
|
||||
R( g, h, a, b, c, d, e, f, K(18), M(18) );
|
||||
R( f, g, h, a, b, c, d, e, K(19), M(19) );
|
||||
R( e, f, g, h, a, b, c, d, K(20), M(20) );
|
||||
R( d, e, f, g, h, a, b, c, K(21), M(21) );
|
||||
R( c, d, e, f, g, h, a, b, K(22), M(22) );
|
||||
R( b, c, d, e, f, g, h, a, K(23), M(23) );
|
||||
R( a, b, c, d, e, f, g, h, K(24), M(24) );
|
||||
R( h, a, b, c, d, e, f, g, K(25), M(25) );
|
||||
R( g, h, a, b, c, d, e, f, K(26), M(26) );
|
||||
R( f, g, h, a, b, c, d, e, K(27), M(27) );
|
||||
R( e, f, g, h, a, b, c, d, K(28), M(28) );
|
||||
R( d, e, f, g, h, a, b, c, K(29), M(29) );
|
||||
R( c, d, e, f, g, h, a, b, K(30), M(30) );
|
||||
R( b, c, d, e, f, g, h, a, K(31), M(31) );
|
||||
R( a, b, c, d, e, f, g, h, K(32), M(32) );
|
||||
R( h, a, b, c, d, e, f, g, K(33), M(33) );
|
||||
R( g, h, a, b, c, d, e, f, K(34), M(34) );
|
||||
R( f, g, h, a, b, c, d, e, K(35), M(35) );
|
||||
R( e, f, g, h, a, b, c, d, K(36), M(36) );
|
||||
R( d, e, f, g, h, a, b, c, K(37), M(37) );
|
||||
R( c, d, e, f, g, h, a, b, K(38), M(38) );
|
||||
R( b, c, d, e, f, g, h, a, K(39), M(39) );
|
||||
R( a, b, c, d, e, f, g, h, K(40), M(40) );
|
||||
R( h, a, b, c, d, e, f, g, K(41), M(41) );
|
||||
R( g, h, a, b, c, d, e, f, K(42), M(42) );
|
||||
R( f, g, h, a, b, c, d, e, K(43), M(43) );
|
||||
R( e, f, g, h, a, b, c, d, K(44), M(44) );
|
||||
R( d, e, f, g, h, a, b, c, K(45), M(45) );
|
||||
R( c, d, e, f, g, h, a, b, K(46), M(46) );
|
||||
R( b, c, d, e, f, g, h, a, K(47), M(47) );
|
||||
R( a, b, c, d, e, f, g, h, K(48), M(48) );
|
||||
R( h, a, b, c, d, e, f, g, K(49), M(49) );
|
||||
R( g, h, a, b, c, d, e, f, K(50), M(50) );
|
||||
R( f, g, h, a, b, c, d, e, K(51), M(51) );
|
||||
R( e, f, g, h, a, b, c, d, K(52), M(52) );
|
||||
R( d, e, f, g, h, a, b, c, K(53), M(53) );
|
||||
R( c, d, e, f, g, h, a, b, K(54), M(54) );
|
||||
R( b, c, d, e, f, g, h, a, K(55), M(55) );
|
||||
R( a, b, c, d, e, f, g, h, K(56), M(56) );
|
||||
R( h, a, b, c, d, e, f, g, K(57), M(57) );
|
||||
R( g, h, a, b, c, d, e, f, K(58), M(58) );
|
||||
R( f, g, h, a, b, c, d, e, K(59), M(59) );
|
||||
R( e, f, g, h, a, b, c, d, K(60), M(60) );
|
||||
R( d, e, f, g, h, a, b, c, K(61), M(61) );
|
||||
R( c, d, e, f, g, h, a, b, K(62), M(62) );
|
||||
R( b, c, d, e, f, g, h, a, K(63), M(63) );
|
||||
R( a, b, c, d, e, f, g, h, K(64), M(64) );
|
||||
R( h, a, b, c, d, e, f, g, K(65), M(65) );
|
||||
R( g, h, a, b, c, d, e, f, K(66), M(66) );
|
||||
R( f, g, h, a, b, c, d, e, K(67), M(67) );
|
||||
R( e, f, g, h, a, b, c, d, K(68), M(68) );
|
||||
R( d, e, f, g, h, a, b, c, K(69), M(69) );
|
||||
R( c, d, e, f, g, h, a, b, K(70), M(70) );
|
||||
R( b, c, d, e, f, g, h, a, K(71), M(71) );
|
||||
R( a, b, c, d, e, f, g, h, K(72), M(72) );
|
||||
R( h, a, b, c, d, e, f, g, K(73), M(73) );
|
||||
R( g, h, a, b, c, d, e, f, K(74), M(74) );
|
||||
R( f, g, h, a, b, c, d, e, K(75), M(75) );
|
||||
R( e, f, g, h, a, b, c, d, K(76), M(76) );
|
||||
R( d, e, f, g, h, a, b, c, K(77), M(77) );
|
||||
R( c, d, e, f, g, h, a, b, K(78), M(78) );
|
||||
R( b, c, d, e, f, g, h, a, K(79), M(79) );
|
||||
|
||||
a = ctx->state[0] = u64plus (ctx->state[0], a);
|
||||
b = ctx->state[1] = u64plus (ctx->state[1], b);
|
||||
c = ctx->state[2] = u64plus (ctx->state[2], c);
|
||||
d = ctx->state[3] = u64plus (ctx->state[3], d);
|
||||
e = ctx->state[4] = u64plus (ctx->state[4], e);
|
||||
f = ctx->state[5] = u64plus (ctx->state[5], f);
|
||||
g = ctx->state[6] = u64plus (ctx->state[6], g);
|
||||
h = ctx->state[7] = u64plus (ctx->state[7], h);
|
||||
}
|
||||
}
|
||||
88
lib/sha512.h
88
lib/sha512.h
@@ -1,88 +0,0 @@
|
||||
/* Declarations of functions and data types used for SHA512 and SHA384 sum
|
||||
library functions.
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SHA512_H
|
||||
# define SHA512_H 1
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
# include "u64.h"
|
||||
|
||||
/* Structure to save state of computation between the single steps. */
|
||||
struct sha512_ctx
|
||||
{
|
||||
u64 state[8];
|
||||
|
||||
u64 total[2];
|
||||
size_t buflen;
|
||||
u64 buffer[32];
|
||||
};
|
||||
|
||||
|
||||
/* Initialize structure containing state of computation. */
|
||||
extern void sha512_init_ctx (struct sha512_ctx *ctx);
|
||||
extern void sha384_init_ctx (struct sha512_ctx *ctx);
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is necessary that LEN is a multiple of 128!!! */
|
||||
extern void sha512_process_block (const void *buffer, size_t len,
|
||||
struct sha512_ctx *ctx);
|
||||
|
||||
/* Starting with the result of former calls of this function (or the
|
||||
initialization function update the context for the next LEN bytes
|
||||
starting at BUFFER.
|
||||
It is NOT required that LEN is a multiple of 128. */
|
||||
extern void sha512_process_bytes (const void *buffer, size_t len,
|
||||
struct sha512_ctx *ctx);
|
||||
|
||||
/* Process the remaining bytes in the buffer and put result from CTX
|
||||
in first 64 (48) bytes following RESBUF. The result is always in little
|
||||
endian byte order, so that a byte-wise output yields to the wanted
|
||||
ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF be correctly
|
||||
aligned for a 64 bits value. */
|
||||
extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
|
||||
extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Put result from CTX in first 64 (48) bytes following RESBUF. The result is
|
||||
always in little endian byte order, so that a byte-wise output yields
|
||||
to the wanted ASCII representation of the message digest.
|
||||
|
||||
IMPORTANT: On some systems it is required that RESBUF is correctly
|
||||
aligned for a 32 bits value. */
|
||||
extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
|
||||
extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
|
||||
|
||||
|
||||
/* Compute SHA512 (SHA384) message digest for bytes read from STREAM. The
|
||||
resulting message digest number will be written into the 64 (48) bytes
|
||||
beginning at RESBLOCK. */
|
||||
extern int sha512_stream (FILE *stream, void *resblock);
|
||||
extern int sha384_stream (FILE *stream, void *resblock);
|
||||
|
||||
/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER. The
|
||||
result is always in little endian byte order, so that a byte-wise
|
||||
output yields to the wanted ASCII representation of the message
|
||||
digest. */
|
||||
extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
|
||||
extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
|
||||
|
||||
#endif
|
||||
159
lib/u64.h
159
lib/u64.h
@@ -1,159 +0,0 @@
|
||||
/* uint64_t-like operations that work even on hosts lacking uint64_t
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/* Return X rotated left by N bits, where 0 < N < 64. */
|
||||
#define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n))
|
||||
|
||||
#ifdef UINT64_MAX
|
||||
|
||||
/* Native implementations are trivial. See below for comments on what
|
||||
these operations do. */
|
||||
typedef uint64_t u64;
|
||||
# define u64hilo(hi, lo) ((u64) (((u64) (hi) << 32) + (lo)))
|
||||
# define u64init(hi, lo) u64hilo (hi, lo)
|
||||
# define u64lo(x) ((u64) (x))
|
||||
# define u64lt(x, y) ((x) < (y))
|
||||
# define u64and(x, y) ((x) & (y))
|
||||
# define u64or(x, y) ((x) | (y))
|
||||
# define u64xor(x, y) ((x) ^ (y))
|
||||
# define u64plus(x, y) ((x) + (y))
|
||||
# define u64shl(x, n) ((x) << (n))
|
||||
# define u64shr(x, n) ((x) >> (n))
|
||||
|
||||
#else
|
||||
|
||||
/* u64 is a 64-bit unsigned integer value.
|
||||
u64init (HI, LO), is like u64hilo (HI, LO), but for use in
|
||||
initializer contexts. */
|
||||
# ifdef WORDS_BIGENDIAN
|
||||
typedef struct { uint32_t hi, lo; } u64;
|
||||
# define u64init(hi, lo) { hi, lo }
|
||||
# else
|
||||
typedef struct { uint32_t lo, hi; } u64;
|
||||
# define u64init(hi, lo) { lo, hi }
|
||||
# endif
|
||||
|
||||
/* Given the high and low-order 32-bit quantities HI and LO, return a u64
|
||||
value representing (HI << 32) + LO. */
|
||||
static inline u64
|
||||
u64hilo (uint32_t hi, uint32_t lo)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = hi;
|
||||
r.lo = lo;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return a u64 value representing LO. */
|
||||
static inline u64
|
||||
u64lo (uint32_t lo)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = 0;
|
||||
r.lo = lo;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X < Y. */
|
||||
static inline int
|
||||
u64lt (u64 x, u64 y)
|
||||
{
|
||||
return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo);
|
||||
}
|
||||
|
||||
/* Return X & Y. */
|
||||
static inline u64
|
||||
u64and (u64 x, u64 y)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = x.hi & y.hi;
|
||||
r.lo = x.lo & y.lo;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X | Y. */
|
||||
static inline u64
|
||||
u64or (u64 x, u64 y)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = x.hi | y.hi;
|
||||
r.lo = x.lo | y.lo;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X ^ Y. */
|
||||
static inline u64
|
||||
u64xor (u64 x, u64 y)
|
||||
{
|
||||
u64 r;
|
||||
r.hi = x.hi ^ y.hi;
|
||||
r.lo = x.lo ^ y.lo;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X + Y. */
|
||||
static inline u64
|
||||
u64plus (u64 x, u64 y)
|
||||
{
|
||||
u64 r;
|
||||
r.lo = x.lo + y.lo;
|
||||
r.hi = x.hi + y.hi + (r.lo < x.lo);
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X << N. */
|
||||
static inline u64
|
||||
u64shl (u64 x, int n)
|
||||
{
|
||||
u64 r;
|
||||
if (n < 32)
|
||||
{
|
||||
r.hi = (x.hi << n) | (x.lo >> (32 - n));
|
||||
r.lo = x.lo << n;
|
||||
}
|
||||
else
|
||||
{
|
||||
r.hi = x.lo << (n - 32);
|
||||
r.lo = 0;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Return X >> N. */
|
||||
static inline u64
|
||||
u64shr (u64 x, int n)
|
||||
{
|
||||
u64 r;
|
||||
if (n < 32)
|
||||
{
|
||||
r.hi = x.hi >> n;
|
||||
r.lo = (x.hi << (32 - n)) | (x.lo >> n);
|
||||
}
|
||||
else
|
||||
{
|
||||
r.hi = 0;
|
||||
r.lo = x.hi >> (n - 32);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -52,9 +52,9 @@ xmemxfrm (char *restrict dest, size_t destsize,
|
||||
if (errno)
|
||||
{
|
||||
error (0, errno, _("string transformation failed"));
|
||||
error (0, 0, _("Set LC_ALL='C' to work around the problem."));
|
||||
error (0, 0, _("set LC_ALL='C' to work around the problem"));
|
||||
error (exit_failure, 0,
|
||||
_("The untransformed string was %s."),
|
||||
_("the untransformed string was %s"),
|
||||
quotearg_n_style_mem (0, locale_quoting_style, src, srcsize));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
2008-03-02 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
* prereq.m4: Don't require gl_SHA256 or gl_SHA512.
|
||||
|
||||
2007-08-30 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* jm-macros.m4 (coreutils_MACROS): Remove GNU_PACKAGE.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# boottime.m4 serial 3
|
||||
# boottime.m4 serial 4
|
||||
# Determine whether this system has infrastructure for obtaining the boot time.
|
||||
|
||||
# Copyright (C) 1996, 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996, 2000, 2002-2004, 2006, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -20,14 +20,14 @@
|
||||
* ----------------------------------------------------------
|
||||
AC_DEFUN([GNULIB_BOOT_TIME],
|
||||
[
|
||||
AC_CHECK_FUNCS(sysctl)
|
||||
AC_CHECK_HEADERS_ONCE(sys/param.h)
|
||||
AC_CHECK_HEADERS(sys/sysctl.h, [], [],
|
||||
AC_CHECK_FUNCS([sysctl])
|
||||
AC_CHECK_HEADERS_ONCE([sys/param.h])
|
||||
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
|
||||
[AC_INCLUDES_DEFAULT
|
||||
[#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif]])
|
||||
AC_CHECK_HEADERS_ONCE(utmp.h utmpx.h OS.h)
|
||||
AC_CHECK_HEADERS_ONCE([utmp.h utmpx.h OS.h])
|
||||
AC_CACHE_CHECK(
|
||||
[whether we can get the system boot time],
|
||||
[gnulib_cv_have_boot_time],
|
||||
@@ -57,8 +57,8 @@ AC_DEFUN([GNULIB_BOOT_TIME],
|
||||
please_tell_us_how_to_determine_boot_time_on_your_system
|
||||
#endif
|
||||
]])],
|
||||
gnulib_cv_have_boot_time=yes,
|
||||
gnulib_cv_have_boot_time=no)
|
||||
[gnulib_cv_have_boot_time=yes],
|
||||
[gnulib_cv_have_boot_time=no])
|
||||
])
|
||||
AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
|
||||
])
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#serial 23
|
||||
#serial 24
|
||||
# Check declarations for this package.
|
||||
|
||||
dnl Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
dnl Copyright (C) 1997-2001, 2003-2006, 2008
|
||||
dnl Free Software Foundation, Inc.
|
||||
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
@@ -16,7 +16,7 @@ AC_DEFUN([gl_CHECK_DECLS],
|
||||
[
|
||||
AC_REQUIRE([AC_HEADER_TIME])
|
||||
|
||||
AC_CHECK_HEADERS_ONCE(grp.h pwd.h)
|
||||
AC_CHECK_HEADERS_ONCE([grp.h pwd.h])
|
||||
headers='
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
36
m4/gmp.m4
Normal file
36
m4/gmp.m4
Normal file
@@ -0,0 +1,36 @@
|
||||
# Tests for GNU GMP (or any compatible replacement).
|
||||
|
||||
dnl Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl Written by James Youngman.
|
||||
|
||||
dnl Check for libgmp. We avoid use of AC_CHECK_LIBS because we don't want to
|
||||
dnl add this to $LIBS for all targets.
|
||||
AC_DEFUN([cu_GMP],
|
||||
[
|
||||
LIB_GMP=
|
||||
AC_SUBST([LIB_GMP])
|
||||
|
||||
AC_ARG_WITH([gmp],
|
||||
AS_HELP_STRING([--without-gmp],
|
||||
[do not use the GNU MP library for arbitrary precision
|
||||
calculation (default: use it if available)]),
|
||||
[cu_use_gmp=$withval],
|
||||
[cu_use_gmp=auto])
|
||||
|
||||
if test $cu_use_gmp != no; then
|
||||
cu_saved_libs=$LIBS
|
||||
AC_SEARCH_LIBS([__gmpz_init], [gmp],
|
||||
[test "$ac_cv_search___gmpz_init" = "none required" ||
|
||||
{
|
||||
LIB_GMP=$ac_cv_search___gmpz_init
|
||||
AC_DEFINE([HAVE_GMP], [1],
|
||||
[Define if you have GNU libgmp (or replacement)])
|
||||
}])
|
||||
LIBS=$cu_saved_libs
|
||||
fi
|
||||
])
|
||||
@@ -1,8 +1,8 @@
|
||||
#serial 106 -*- autoconf -*-
|
||||
#serial 109 -*- autoconf -*-
|
||||
|
||||
dnl Misc type-related macros for coreutils.
|
||||
|
||||
# Copyright (C) 1998, 2000-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998, 2000-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -22,7 +22,7 @@ dnl Misc type-related macros for coreutils.
|
||||
AC_DEFUN([coreutils_MACROS],
|
||||
[
|
||||
AM_MISSING_PROG(HELP2MAN, help2man)
|
||||
AC_SUBST(MAN)
|
||||
AC_SUBST([MAN])
|
||||
|
||||
dnl This macro actually runs replacement code. See isc-posix.m4.
|
||||
AC_REQUIRE([AC_ISC_POSIX])dnl
|
||||
@@ -36,15 +36,21 @@ AC_DEFUN([coreutils_MACROS],
|
||||
AC_REQUIRE([AC_FUNC_FSEEKO])
|
||||
|
||||
# By default, argmatch should fail calling usage (1).
|
||||
AC_DEFINE(ARGMATCH_DIE, [usage (1)],
|
||||
AC_DEFINE([ARGMATCH_DIE], [usage (1)],
|
||||
[Define to the function xargmatch calls on failures.])
|
||||
AC_DEFINE(ARGMATCH_DIE_DECL, [void usage ()],
|
||||
AC_DEFINE([ARGMATCH_DIE_DECL], [void usage (int _e)],
|
||||
[Define to the declaration of the xargmatch failure function.])
|
||||
|
||||
# used by ls
|
||||
AC_REQUIRE([gl_CLOCK_TIME])
|
||||
# used by shred
|
||||
AC_CHECK_FUNCS_ONCE(directio)
|
||||
AC_CHECK_FUNCS_ONCE([directio])
|
||||
|
||||
# Used by install.c.
|
||||
AC_CHECK_FUNCS_ONCE([matchpathcon_init_prefix])
|
||||
|
||||
# Used by sort.c.
|
||||
AC_CHECK_FUNCS_ONCE([nl_langinfo])
|
||||
|
||||
AC_CHECK_FUNCS_ONCE( \
|
||||
endgrent \
|
||||
@@ -73,24 +79,38 @@ AC_DEFUN([coreutils_MACROS],
|
||||
[test "$ac_cv_search_fdatasync" = "none required" ||
|
||||
LIB_FDATASYNC=$ac_cv_search_fdatasync])
|
||||
AC_SUBST([LIB_FDATASYNC])
|
||||
AC_CHECK_FUNCS(fdatasync)
|
||||
AC_CHECK_FUNCS([fdatasync])
|
||||
LIBS=$coreutils_saved_libs
|
||||
|
||||
# Check whether libcap is usable -- for ls --color support
|
||||
AC_ARG_ENABLE([libcap],
|
||||
AC_HELP_STRING([--disable-libcap], [disable libcap support]),
|
||||
AC_MSG_WARN([libcap support disabled by user]),
|
||||
[AC_CHECK_LIB([cap], [cap_get_file],
|
||||
[AC_CHECK_HEADER([sys/capability.h],
|
||||
[LIB_CAP=-lcap
|
||||
AC_DEFINE([HAVE_CAP], [1], [libcap usability])],
|
||||
[AC_MSG_WARN([header sys/capability.h was not found, support for libcap will not be built])]
|
||||
)],
|
||||
[AC_MSG_WARN([libcap library was not found or not usable, support for libcap will not be built])])
|
||||
])
|
||||
AC_SUBST([LIB_CAP])
|
||||
|
||||
# See if linking `seq' requires -lm.
|
||||
# It does on nearly every system. The single exception (so far) is
|
||||
# BeOS which has all the math functions in the normal runtime library
|
||||
# and doesn't have a separate math library.
|
||||
|
||||
AC_SUBST(SEQ_LIBM)
|
||||
AC_SUBST([SEQ_LIBM])
|
||||
ac_seq_body='
|
||||
static double x, y;
|
||||
x = floor (x);
|
||||
x = rint (x);
|
||||
x = modf (x, &y);'
|
||||
AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
|
||||
AC_TRY_LINK([#include <math.h>], [$ac_seq_body], ,
|
||||
[ac_seq_save_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lm"
|
||||
AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
|
||||
AC_TRY_LINK([#include <math.h>], [$ac_seq_body], [SEQ_LIBM=-lm])
|
||||
LIBS="$ac_seq_save_LIBS"
|
||||
])
|
||||
|
||||
@@ -113,7 +133,7 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS],
|
||||
syslog.h \
|
||||
termios.h \
|
||||
)
|
||||
AC_CHECK_HEADERS(sys/sysctl.h, [], [],
|
||||
AC_CHECK_HEADERS([sys/sysctl.h], [], [],
|
||||
[AC_INCLUDES_DEFAULT
|
||||
[#if HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
@@ -134,10 +154,9 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
|
||||
AC_REQUIRE([AM_C_PROTOTYPES])
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
AC_REQUIRE([gl_BIGENDIAN])
|
||||
AC_REQUIRE([AC_C_VOLATILE])
|
||||
AC_REQUIRE([AC_C_INLINE])
|
||||
AC_REQUIRE([AC_C_LONG_DOUBLE])
|
||||
AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
|
||||
|
||||
AC_REQUIRE([gl_CHECK_ALL_HEADERS])
|
||||
@@ -155,12 +174,12 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
|
||||
AC_REQUIRE([AC_TYPE_PID_T])
|
||||
AC_REQUIRE([AC_TYPE_SIZE_T])
|
||||
AC_REQUIRE([AC_TYPE_UID_T])
|
||||
AC_CHECK_TYPE(ino_t, unsigned long int)
|
||||
AC_CHECK_TYPE([ino_t], [unsigned long int])
|
||||
|
||||
dnl This relies on the fact that Autoconf's implementation of
|
||||
dnl AC_CHECK_TYPE checks includes unistd.h.
|
||||
AC_CHECK_TYPE(major_t, unsigned int)
|
||||
AC_CHECK_TYPE(minor_t, unsigned int)
|
||||
AC_CHECK_TYPE([major_t], [unsigned int])
|
||||
AC_CHECK_TYPE([minor_t], [unsigned int])
|
||||
|
||||
AC_REQUIRE([AC_HEADER_MAJOR])
|
||||
])
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#serial 10
|
||||
#serial 11
|
||||
|
||||
dnl Misc lib-related macros for coreutils.
|
||||
|
||||
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004,
|
||||
# 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-1997, 2000-2001, 2003-2006, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -24,20 +24,20 @@ AC_DEFUN([cu_LIB_CHECK],
|
||||
[
|
||||
|
||||
# Check for libypsec.a on Dolphin M88K machines.
|
||||
AC_CHECK_LIB(ypsec, main)
|
||||
AC_CHECK_LIB([ypsec], [main])
|
||||
|
||||
# m88k running dgux 5.4 needs this
|
||||
AC_CHECK_LIB(ldgc, main)
|
||||
AC_CHECK_LIB([ldgc], [main])
|
||||
|
||||
# The -lsun library is required for YP support on Irix-4.0.5 systems.
|
||||
# m88k/svr3 DolphinOS systems using YP need -lypsec for id.
|
||||
AC_SEARCH_LIBS(yp_match, [sun ypsec])
|
||||
AC_SEARCH_LIBS([yp_match], [sun ypsec])
|
||||
|
||||
# SysV needs -lsec, older versions of Linux need -lshadow for
|
||||
# shadow passwords. UnixWare 7 needs -lgen.
|
||||
AC_SEARCH_LIBS(getspnam, [shadow sec gen])
|
||||
AC_SEARCH_LIBS([getspnam], [shadow sec gen])
|
||||
|
||||
AC_CHECK_HEADERS(shadow.h)
|
||||
AC_CHECK_HEADERS([shadow.h])
|
||||
|
||||
# Requirements for su.c.
|
||||
shadow_includes="\
|
||||
@@ -47,14 +47,14 @@ $ac_includes_default
|
||||
#endif
|
||||
"
|
||||
AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
|
||||
AC_CHECK_FUNCS(getspnam)
|
||||
AC_CHECK_FUNCS([getspnam])
|
||||
|
||||
# SCO-ODT-3.0 is reported to need -lufc for crypt.
|
||||
# NetBSD needs -lcrypt for crypt.
|
||||
cu_saved_libs="$LIBS"
|
||||
AC_SEARCH_LIBS(crypt, [ufc crypt],
|
||||
AC_SEARCH_LIBS([crypt], [ufc crypt],
|
||||
[test "$ac_cv_search_crypt" = "none required" ||
|
||||
LIB_CRYPT="$ac_cv_search_crypt"])
|
||||
LIBS="$cu_saved_libs"
|
||||
AC_SUBST(LIB_CRYPT)
|
||||
AC_SUBST([LIB_CRYPT])
|
||||
])
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#serial 74
|
||||
#serial 76
|
||||
|
||||
dnl We use gl_ for non Autoconf macros.
|
||||
m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
|
||||
@@ -7,7 +7,7 @@ m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
|
||||
# directory of the coreutils package.
|
||||
|
||||
|
||||
# Copyright (C) 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1998, 2000, 2001, 2003-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -38,10 +38,9 @@ AC_DEFUN([gl_PREREQ],
|
||||
# handles that; see ../bootstrap.conf.
|
||||
AC_REQUIRE([gl_EUIDACCESS_STAT])
|
||||
AC_REQUIRE([gl_FD_REOPEN])
|
||||
AC_REQUIRE([gl_FUNC_XATTR])
|
||||
AC_REQUIRE([gl_FUNC_XFTS])
|
||||
AC_REQUIRE([gl_MEMXFRM])
|
||||
AC_REQUIRE([gl_SHA256])
|
||||
AC_REQUIRE([gl_SHA512])
|
||||
AC_REQUIRE([gl_STRINTCMP])
|
||||
AC_REQUIRE([gl_STRNUMCMP])
|
||||
])
|
||||
|
||||
15
m4/sha256.m4
15
m4/sha256.m4
@@ -1,15 +0,0 @@
|
||||
# sha256.m4 serial 1
|
||||
dnl Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_SHA256],
|
||||
[
|
||||
AC_LIBSOURCES([sha256.c, sha256.h])
|
||||
AC_LIBOBJ([sha256])
|
||||
|
||||
dnl Prerequisites of lib/sha256.c.
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
:
|
||||
])
|
||||
15
m4/sha512.m4
15
m4/sha512.m4
@@ -1,15 +0,0 @@
|
||||
# sha512.m4 serial 2
|
||||
dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
AC_DEFUN([gl_SHA512],
|
||||
[
|
||||
AC_LIBSOURCES([sha512.c, sha512.h, u64.h])
|
||||
AC_LIBOBJ([sha512])
|
||||
|
||||
dnl Prerequisites of lib/sha512.c.
|
||||
AC_REQUIRE([AC_C_BIGENDIAN])
|
||||
:
|
||||
])
|
||||
@@ -1,7 +1,7 @@
|
||||
# stat-prog.m4 serial 5
|
||||
# stat-prog.m4 serial 6
|
||||
# Record the prerequisites of src/stat.c from the coreutils package.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2004, 2006, 2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -68,7 +68,7 @@ AC_INCLUDES_DEFAULT
|
||||
[$statvfs_includes],
|
||||
[static statvfs s;
|
||||
return (s.s_fsid ^ 0) == 0;])],
|
||||
[AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], 1,
|
||||
[AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
|
||||
[Define to 1 if the f_fsid member of struct statvfs is an integer.])])
|
||||
else
|
||||
AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type],,,
|
||||
@@ -79,7 +79,7 @@ AC_INCLUDES_DEFAULT
|
||||
[$statfs_includes],
|
||||
[static statfs s;
|
||||
return (s.s_fsid ^ 0) == 0;])],
|
||||
[AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], 1,
|
||||
[AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], [1],
|
||||
[Define to 1 if the f_fsid member of struct statfs is an integer.])])
|
||||
fi
|
||||
fi
|
||||
|
||||
36
m4/xattr.m4
Normal file
36
m4/xattr.m4
Normal file
@@ -0,0 +1,36 @@
|
||||
# xattr.m4 - check for Extended Attributes (Linux)
|
||||
|
||||
# Copyright (C) 2003, 2008-2009 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# Originally written by Andreas Gruenbacher.
|
||||
# http://www.suse.de/~agruen/coreutils/5.91/coreutils-xattr.diff
|
||||
|
||||
AC_DEFUN([gl_FUNC_XATTR],
|
||||
[
|
||||
AC_ARG_ENABLE([xattr],
|
||||
AC_HELP_STRING([--disable-xattr],
|
||||
[do not support extended attributes]),
|
||||
[use_xattr=$enableval], [use_xattr=yes])
|
||||
|
||||
if test "$use_xattr" = "yes"; then
|
||||
AC_CHECK_HEADERS([attr/error_context.h attr/libattr.h])
|
||||
if test $ac_cv_header_attr_libattr_h = yes \
|
||||
&& test $ac_cv_header_attr_error_context_h = yes; then
|
||||
use_xattr=1
|
||||
else
|
||||
use_xattr=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([USE_XATTR], [$use_xattr],
|
||||
[Define if you want extended attribute support.])
|
||||
xattr_saved_LIBS=$LIBS
|
||||
AC_SEARCH_LIBS([attr_copy_file], [attr],
|
||||
[test "$ac_cv_search_attr_copy_file" = "none required" ||
|
||||
LIB_XATTR=$ac_cv_search_attr_copy_file])
|
||||
AC_CHECK_FUNCS([attr_copy_file])
|
||||
LIBS=$xattr_saved_LIBS
|
||||
AC_SUBST([LIB_XATTR])
|
||||
fi
|
||||
])
|
||||
826
maint.mk
Normal file
826
maint.mk
Normal file
@@ -0,0 +1,826 @@
|
||||
# -*-Makefile-*-
|
||||
# This Makefile fragment tries to be general-purpose enough to be
|
||||
# used by at least coreutils, idutils, CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2009 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
## the Free Software Foundation, either version 3 of the License, or
|
||||
## (at your option) any later version.
|
||||
##
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This is reported not to work with make-3.79.1
|
||||
# ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
|
||||
ME := maint.mk
|
||||
|
||||
# Do not save the original name or timestamp in the .tar.gz file.
|
||||
# Use --rsyncable if available.
|
||||
gzip_rsyncable := \
|
||||
$(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null && echo --rsyncable)
|
||||
GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
|
||||
|
||||
GIT = git
|
||||
VC = $(GIT)
|
||||
VC-tag = git tag -s -m '$(VERSION)'
|
||||
|
||||
VC_LIST = $(srcdir)/build-aux/vc-list-files
|
||||
|
||||
VC_LIST_EXCEPT = \
|
||||
$(VC_LIST) | if test -f .x-$@; then grep -vEf .x-$@; else grep -v ChangeLog; fi
|
||||
|
||||
ifeq ($(origin prev_version_file), undefined)
|
||||
prev_version_file = $(srcdir)/.prev-version
|
||||
endif
|
||||
|
||||
PREV_VERSION := $(shell cat $(prev_version_file))
|
||||
VERSION_REGEXP = $(subst .,\.,$(VERSION))
|
||||
PREV_VERSION_REGEXP = $(subst .,\.,$(PREV_VERSION))
|
||||
|
||||
ifeq ($(VC),$(GIT))
|
||||
this-vc-tag = v$(VERSION)
|
||||
this-vc-tag-regexp = v$(VERSION_REGEXP)
|
||||
else
|
||||
tag-package = $(shell echo "$(PACKAGE)" | tr '[:lower:]' '[:upper:]')
|
||||
tag-this-version = $(subst .,_,$(VERSION))
|
||||
this-vc-tag = $(tag-package)-$(tag-this-version)
|
||||
this-vc-tag-regexp = $(this-vc-tag)
|
||||
endif
|
||||
my_distdir = $(PACKAGE)-$(VERSION)
|
||||
|
||||
# Old releases are stored here.
|
||||
release_archive_dir ?= ../release
|
||||
|
||||
# Prevent programs like 'sort' from considering distinct strings to be equal.
|
||||
# Doing it here saves us from having to set LC_ALL elsewhere in this file.
|
||||
export LC_ALL = C
|
||||
|
||||
## --------------- ##
|
||||
## Sanity checks. ##
|
||||
## --------------- ##
|
||||
|
||||
# Collect the names of rules starting with `sc_'.
|
||||
syntax-check-rules := $(shell sed -n 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
|
||||
$(srcdir)/$(ME) $(srcdir)/cfg.mk)
|
||||
.PHONY: $(syntax-check-rules)
|
||||
|
||||
local-checks-available = \
|
||||
patch-check $(syntax-check-rules) \
|
||||
makefile-check check-AUTHORS
|
||||
.PHONY: $(local-checks-available)
|
||||
|
||||
# Arrange to print the name of each syntax-checking rule just before running it.
|
||||
$(syntax-check-rules): %: %.m
|
||||
$(patsubst %, %.m, $(syntax-check-rules)):
|
||||
@echo $(patsubst sc_%.m, %, $@)
|
||||
|
||||
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||
|
||||
syntax-check: $(local-check)
|
||||
# @grep -nE '# *include <(limits|std(def|arg|bool))\.h>' \
|
||||
# $$(find -type f -name '*.[chly]') && \
|
||||
# { echo '$(ME): found conditional include' 1>&2; \
|
||||
# exit 1; } || :
|
||||
|
||||
# grep -nE '^# *include <(string|stdlib)\.h>' \
|
||||
# $(srcdir)/{lib,src}/*.[chy] && \
|
||||
# { echo '$(ME): FIXME' 1>&2; \
|
||||
# exit 1; } || :
|
||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||
|
||||
# By default, _prohibit_regexp does not ignore case.
|
||||
export ignore_case =
|
||||
_ignore_case = $$(test -n "$$ignore_case" && echo -i || :)
|
||||
|
||||
# There are many rules below that prohibit constructs in this package.
|
||||
# If the offending construct can be matched with a grep-E-style regexp,
|
||||
# use this macro. The shell variables "re" and "msg" must be defined.
|
||||
define _prohibit_regexp
|
||||
dummy=; : so we do not need a semicolon before each use \
|
||||
test "x$$re" != x || { echo '$(ME): re not defined' 1>&2; exit 1; }; \
|
||||
test "x$$msg" != x || { echo '$(ME): msg not defined' 1>&2; exit 1; };\
|
||||
grep $(_ignore_case) -nE "$$re" $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): '"$$msg" 1>&2; exit 1; } || :
|
||||
endef
|
||||
|
||||
sc_avoid_if_before_free:
|
||||
@$(srcdir)/build-aux/useless-if-before-free \
|
||||
$(useless_free_options) \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless "if" before "free" above' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_cast_of_argument_to_free:
|
||||
@re='\<free *\( *\(' msg='don'\''t cast free argument' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_x_alloc_return_value:
|
||||
@re='\*\) *x(m|c|re)alloc\>' \
|
||||
msg='don'\''t cast x*alloc return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_cast_of_alloca_return_value:
|
||||
@re='\*\) *alloca\>' msg='don'\''t cast alloca return value' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_space_tab:
|
||||
@re='[ ] ' msg='found SPACE-TAB sequence; remove the SPACE' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Don't use *scanf or the old ato* functions in `real' code.
|
||||
# They provide no error checking mechanism.
|
||||
# Instead, use strto* functions.
|
||||
sc_prohibit_atoi_atof:
|
||||
@re='\<([fs]?scanf|ato([filq]|ll)) *\(' \
|
||||
msg='do not use *scan''f, ato''f, ato''i, ato''l, ato''ll or ato''q' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Use STREQ rather than comparing strcmp == 0, or != 0.
|
||||
sc_prohibit_strcmp:
|
||||
@grep -nE '! *str''cmp *\(|\<str''cmp *\([^)]+\) *==' \
|
||||
$$($(VC_LIST_EXCEPT)) \
|
||||
| grep -vE ':# *define STREQ\(' && \
|
||||
{ echo '$(ME): use STREQ in place of the above uses of str''cmp' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Using EXIT_SUCCESS as the first argument to error is misleading,
|
||||
# since when that parameter is 0, error does not exit. Use `0' instead.
|
||||
sc_error_exit_success:
|
||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||
$$(find -type f -name '*.[chly]') && \
|
||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# `FATAL:' should be fully upper-cased in error messages
|
||||
# `WARNING:' should be fully upper-cased, or fully lower-cased
|
||||
sc_error_message_warn_fatal:
|
||||
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -E '"Warning|"Fatal|"fatal' && \
|
||||
{ echo '$(ME): use FATAL, WARNING or warning' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Error messages should not start with a capital letter
|
||||
sc_error_message_uppercase:
|
||||
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -E '"[A-Z]' \
|
||||
| grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' && \
|
||||
{ echo '$(ME): found capitalized error message' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Error messages should not end with a period
|
||||
sc_error_message_period:
|
||||
@grep -nEA2 '[^rp]error \(' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -E '[^."]\."' && \
|
||||
{ echo '$(ME): found error message ending in period' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
sc_file_system:
|
||||
@re=file''system ignore_case=1 \
|
||||
msg='found use of "file''system"; spell it "file system"' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Don't use cpp tests of this symbol. All code assumes config.h is included.
|
||||
sc_prohibit_have_config_h:
|
||||
@grep -n '^# *if.*HAVE''_CONFIG_H' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found use of HAVE''_CONFIG_H; remove' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Nearly all .c files must include <config.h>.
|
||||
sc_require_config_h:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
grep -L '^# *include <config\.h>' \
|
||||
$$($(VC_LIST_EXCEPT) | grep '\.c$$') \
|
||||
| grep . && \
|
||||
{ echo '$(ME): the above files do not include <config.h>' \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# You must include <config.h> before including any other header file.
|
||||
sc_require_config_h_first:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
fail=0; \
|
||||
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
|
||||
grep '^# *include\>' $$i | sed 1q \
|
||||
| grep '^# *include <config\.h>' > /dev/null \
|
||||
|| { echo $$i; fail=1; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo '$(ME): the above files include some other header' \
|
||||
'before <config.h>' 1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
sc_prohibit_HAVE_MBRTOWC:
|
||||
@re='\bHAVE_MBRTOWC\b' msg="do not use $$re; it is always defined" \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# To use this "command" macro, you must first define two shell variables:
|
||||
# h: the header, enclosed in <> or ""
|
||||
# re: a regular expression that matches IFF something provided by $h is used.
|
||||
define _header_without_use
|
||||
h_esc=`echo "$$h"|sed 's/\./\\./'`; \
|
||||
if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '^# *include '"$$h_esc" \
|
||||
$$($(VC_LIST_EXCEPT) | grep '\.c$$')) && \
|
||||
grep -LE "$$re" $$files | grep . && \
|
||||
{ echo "$(ME): the above files include $$h but don't use it" \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
endef
|
||||
|
||||
# Prohibit the inclusion of assert.h without an actual use of assert.
|
||||
sc_prohibit_assert_without_use:
|
||||
@h='<assert.h>' re='\<assert *\(' $(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of getopt.h without an actual use.
|
||||
sc_prohibit_getopt_without_use:
|
||||
@h='<getopt.h>' re='\<getopt(_long)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include quotearg.h unless you use one of its functions.
|
||||
sc_prohibit_quotearg_without_use:
|
||||
@h='"quotearg.h"' re='\<quotearg(_[^ ]+)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include quote.h unless you use one of its functions.
|
||||
sc_prohibit_quote_without_use:
|
||||
@h='"quote.h"' re='\<quote(_n)? *\(' $(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_long_options_without_use:
|
||||
@h='"long-options.h"' re='\<parse_long_options *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_inttostr_without_use:
|
||||
@h='"inttostr.h"' re='\<(off|[iu]max|uint)tostr *\(' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Don't include this header unless you use one of its functions.
|
||||
sc_prohibit_error_without_use:
|
||||
@h='"error.h"' \
|
||||
re='\<error(_at_line|_print_progname|_one_per_line|_message_count)? *\('\
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_safe_read_without_use:
|
||||
@h='"safe-read.h"' re='(\<SAFE_READ_ERROR\>|\<safe_read *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_argmatch_without_use:
|
||||
@h='"argmatch.h"' \
|
||||
re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<argmatch(_exit_fn|_(in)?valid) *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
sc_prohibit_root_dev_ino_without_use:
|
||||
@h='"root-dev-ino.h"' \
|
||||
re='(\<ROOT_DEV_INO_(CHECK|WARN)\>|\<get_root_dev_ino *\()' \
|
||||
$(_header_without_use)
|
||||
|
||||
# Prohibit the inclusion of c-ctype.h without an actual use.
|
||||
ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
|
||||
|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper
|
||||
sc_prohibit_c_ctype_without_use:
|
||||
@h='[<"]c-ctype.h[">]' re='\<c_($(ctype_re)) *\(' $(_header_without_use)
|
||||
|
||||
sc_obsolete_symbols:
|
||||
@re='\<(HAVE''_FCNTL_H|O''_NDELAY)\>' \
|
||||
msg='do not use HAVE''_FCNTL_H or O'_NDELAY \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# FIXME: warn about definitions of EXIT_FAILURE, EXIT_SUCCESS, STREQ
|
||||
|
||||
# Each nonempty line must start with a year number, or a TAB.
|
||||
sc_changelog:
|
||||
@grep -n '^[^12 ]' $$(find . -maxdepth 2 -name ChangeLog) && \
|
||||
{ echo '$(ME): found unexpected prefix in a ChangeLog' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Ensure that each .c file containing a "main" function also
|
||||
# calls set_program_name.
|
||||
sc_program_name:
|
||||
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
|
||||
files=$$(grep -l '^main *(' $$($(VC_LIST_EXCEPT) | grep '\.c$$')); \
|
||||
grep -LE 'set_program_name *\(m?argv\[0\]\);' $$files \
|
||||
| grep . && \
|
||||
{ echo '$(ME): the above files do not call set_program_name' \
|
||||
1>&2; exit 1; } || :; \
|
||||
else :; \
|
||||
fi
|
||||
|
||||
# Require that the final line of each test-lib.sh-using test be this one:
|
||||
# Exit $fail
|
||||
# Note: this test requires GNU grep's --label= option.
|
||||
sc_require_test_exit_idiom:
|
||||
@if test -f $(srcdir)/tests/test-lib.sh; then \
|
||||
die=0; \
|
||||
for i in $$(grep -l -F /../test-lib.sh $$($(VC_LIST) tests)); do \
|
||||
tail -n1 $$i | grep '^Exit \$$fail$$' > /dev/null \
|
||||
&& : || { die=1; echo $$i; } \
|
||||
done; \
|
||||
test $$die = 1 && \
|
||||
{ echo 1>&2 '$(ME): the final line in each of the above is not:'; \
|
||||
echo 1>&2 'Exit $$fail'; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
sc_the_the:
|
||||
@re='\<the ''the\>' \
|
||||
ignore_case=1 msg='found use of "the ''the";' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_trailing_blank:
|
||||
@re='[ ]$$' \
|
||||
ignore_case=1 msg='found trailing blank(s)' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Match lines like the following, but where there is only one space
|
||||
# between the options and the description:
|
||||
# -D, --all-repeated[=delimit-method] print all duplicate lines\n
|
||||
longopt_re = --[a-z][0-9A-Za-z-]*(\[?=[0-9A-Za-z-]*\]?)?
|
||||
sc_two_space_separator_in_usage:
|
||||
@grep -nE '^ *(-[A-Za-z],)? $(longopt_re) [^ ].*\\$$' \
|
||||
$$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo "$(ME): help2man requires at least two spaces between"; \
|
||||
echo "$(ME): an option and its description"; \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Look for diagnostics that aren't marked for translation.
|
||||
# This won't find any for which error's format string is on a separate line.
|
||||
sc_unmarked_diagnostics:
|
||||
@grep -nE \
|
||||
'\<error \([^"]*"[^"]*[a-z]{3}' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -v '_''(' && \
|
||||
{ echo '$(ME): found unmarked diagnostic(s)' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Avoid useless parentheses like those in this example:
|
||||
# #if defined (SYMBOL) || defined (SYM2)
|
||||
sc_useless_cpp_parens:
|
||||
@grep -n '^# *if .*defined *(' $$($(VC_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): found useless parentheses in cpp directive' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Require the latest GPL.
|
||||
sc_GPL_version:
|
||||
@re='either ''version [^3]' msg='GPL vN, N!=3' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
cvs_keywords = \
|
||||
Author|Date|Header|Id|Name|Locker|Log|RCSfile|Revision|Source|State
|
||||
|
||||
sc_prohibit_cvs_keyword:
|
||||
@re='\$$($(cvs_keywords))\$$' \
|
||||
msg='do not use CVS keyword expansion' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't use st_blocks. Use ST_NBLOCKS instead.
|
||||
# This is a bit of a kludge, since it prevents use of the string
|
||||
# even in comments, but for now it does the job with no false positives.
|
||||
sc_prohibit_stat_st_blocks:
|
||||
@re='[.>]st_blocks' msg='do not use st_blocks; use ST_NBLOCKS' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Make sure we don't define any S_IS* macros in src/*.c files.
|
||||
# They're already defined via gnulib's sys/stat.h replacement.
|
||||
sc_prohibit_S_IS_definition:
|
||||
@re='^ *# *define *S_IS' \
|
||||
msg='do not define S_IS* macros; include <sys/stat.h>' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
# Each program that uses proper_name_utf8 must link with
|
||||
# one of the ICONV libraries.
|
||||
sc_proper_name_utf8_requires_ICONV:
|
||||
@progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
|
||||
if test "x$$progs" != x; then \
|
||||
fail=0; \
|
||||
for p in $$progs; do \
|
||||
dir=$$(dirname "$$p"); \
|
||||
base=$$(basename "$$p" .c); \
|
||||
grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
|
||||
|| { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
|
||||
done; \
|
||||
test $$fail = 1 && \
|
||||
{ echo 1>&2 '$(ME): the above do not link with any ICONV library'; \
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
# Warn about "c0nst struct Foo const foo[]",
|
||||
# but not about "char const *const foo" or "#define const const".
|
||||
sc_redundant_const:
|
||||
@re='\bconst\b[[:space:][:alnum:]]{2,}\bconst\b' \
|
||||
msg='redundant "const" in declarations' \
|
||||
$(_prohibit_regexp)
|
||||
|
||||
sc_const_long_option:
|
||||
@grep '^ *static.*struct option ' $$($(VC_LIST_EXCEPT)) \
|
||||
| grep -Ev 'const struct option|struct option const' && { \
|
||||
echo 1>&2 '$(ME): add "const" to the above declarations'; \
|
||||
exit 1; } || :
|
||||
|
||||
NEWS_hash = \
|
||||
$$(sed -n '/^\*.* $(PREV_VERSION_REGEXP) ([0-9-]*)/,$$p' \
|
||||
$(srcdir)/NEWS | grep -v '^Copyright .*Free Software' | md5sum -)
|
||||
|
||||
# Ensure that we don't accidentally insert an entry into an old NEWS block.
|
||||
sc_immutable_NEWS:
|
||||
@if test -f $(srcdir)/NEWS; then \
|
||||
test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \
|
||||
{ echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \
|
||||
fi
|
||||
|
||||
# Update the hash stored above. Do this after each release and
|
||||
# for any corrections to old entries.
|
||||
update-NEWS-hash: NEWS
|
||||
perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
|
||||
$(srcdir)/cfg.mk
|
||||
|
||||
epoch_date = 1970-01-01 00:00:00.000000000 +0000
|
||||
# Ensure that the c99-to-c89 patch applies cleanly.
|
||||
patch-check:
|
||||
rm -rf src-c89 $@.1 $@.2
|
||||
cp -a $(srcdir)/src src-c89
|
||||
if test "x$(srcdir)" != x.; then \
|
||||
cp -a src/* src-c89; \
|
||||
dotfiles=`ls src/.[!.]* 2>/dev/null`; \
|
||||
test -z "$$dotfiles" || cp -a src/.[!.]* src-c89; \
|
||||
fi
|
||||
(cd src-c89; patch -p1 -V never --fuzz=0) < $(srcdir)/src/c99-to-c89.diff \
|
||||
> $@.1 2>&1
|
||||
if test "$(REGEN_PATCH)" = yes; then \
|
||||
diff -upr $(srcdir)/src src-c89 | sed 's,$(srcdir)/src-c89/,src/,' \
|
||||
| grep -vE '^(Only in|File )' \
|
||||
| perl -pe 's/^((?:\+\+\+|---) \S+\t).*/$${1}$(epoch_date)/;' \
|
||||
-e 's/^ $$//' \
|
||||
> new-diff || : ; fi
|
||||
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||
rm -f src-c89/*.o || msg='rm failed'; \
|
||||
$(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \
|
||||
|| msg='compile failure with extra options'; \
|
||||
test "$$msg" = ok && rm -rf src-c89 $@.1 $@.2 || echo "$$msg" 1>&2; \
|
||||
test "$$msg" = ok
|
||||
|
||||
check-AUTHORS:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
# Ensure that we use only the standard $(VAR) notation,
|
||||
# not @...@ in Makefile.am, now that we can rely on automake
|
||||
# to emit a definition for each substituted variable.
|
||||
# We use perl rather than "grep -nE ..." to exempt a single
|
||||
# use of an @...@-delimited variable name in src/Makefile.am.
|
||||
makefile-check:
|
||||
@perl -ne '/\@[A-Z_0-9]+\@/ && !/^cu_install_program =/' \
|
||||
-e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}' \
|
||||
$$($(VC_LIST_EXCEPT) | grep -E '(^|/)Makefile\.am$$') \
|
||||
&& { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
|
||||
|
||||
news-date-check: NEWS
|
||||
today=`date +%Y-%m-%d`; \
|
||||
if head NEWS | grep '^\*.* $(VERSION_REGEXP) ('$$today')' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "version or today's date is not in NEWS" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
changelog-check:
|
||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
sc_m4_quote_check:
|
||||
@grep -nE '(AC_DEFINE(_UNQUOTED)?|AC_DEFUN)\([^[]' \
|
||||
$$($(VC_LIST_EXCEPT) | grep -E '(^configure\.ac|\.m4)$$') \
|
||||
&& { echo '$(ME): quote the first arg to AC_DEF*' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
fix_po_file_diag = \
|
||||
'you have changed the set of files with translatable diagnostics;\n\
|
||||
apply the above patch\n'
|
||||
|
||||
# Verify that all source files using _() are listed in po/POTFILES.in.
|
||||
po_file = po/POTFILES.in
|
||||
sc_po_check:
|
||||
@if test -f $(po_file); then \
|
||||
grep -E -v '^(#|$$)' $(po_file) \
|
||||
| grep -v '^src/false\.c$$' | sort > $@-1; \
|
||||
files=; \
|
||||
for file in $$($(VC_LIST_EXCEPT)) lib/*.[ch]; do \
|
||||
case $$file in \
|
||||
*.?|*.??) ;; \
|
||||
*) continue;; \
|
||||
esac; \
|
||||
case $$file in \
|
||||
*.[ch]) \
|
||||
base=`expr " $$file" : ' \(.*\)\..'`; \
|
||||
{ test -f $$base.l || test -f $$base.y; } && continue;; \
|
||||
esac; \
|
||||
files="$$files $$file"; \
|
||||
done; \
|
||||
grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
|
||||
| sort -u > $@-2; \
|
||||
diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
|
||||
|| { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
# Sometimes it is useful to change the PATH environment variable
|
||||
# in Makefiles. When doing so, it's better not to use the Unix-centric
|
||||
# path separator of `:', but rather the automake-provided `@PATH_SEPARATOR@'.
|
||||
# It'd be better to use `find -print0 ...|xargs -0 ...', but less portable,
|
||||
# and there probably aren't many projects with so many Makefile.am files
|
||||
# that we'd have to worry about limits on command line length.
|
||||
msg = '$(ME): Do not use `:'\'' above; use @PATH_SEPARATOR@ instead'
|
||||
sc_makefile_path_separator_check:
|
||||
@grep -n 'PATH=.*:' `find $(srcdir) -name Makefile.am` \
|
||||
&& { echo $(msg) 1>&2; exit 1; } || :
|
||||
|
||||
# Check that `make alpha' will not fail at the end of the process.
|
||||
writable-files:
|
||||
if test -d $(release_archive_dir); then :; else \
|
||||
for file in $(distdir).tar.gz \
|
||||
$(release_archive_dir)/$(distdir).tar.gz; do \
|
||||
test -e $$file || continue; \
|
||||
test -w $$file \
|
||||
|| { echo ERROR: $$file is not writable; fail=1; }; \
|
||||
done; \
|
||||
test "$$fail" && exit 1 || : ; \
|
||||
fi
|
||||
|
||||
v_etc_file = lib/version-etc.c
|
||||
sample-test = tests/sample-test
|
||||
texi = doc/$(PACKAGE).texi
|
||||
# Make sure that the copyright date in $(v_etc_file) is up to date.
|
||||
# Do the same for the $(sample-test) and the main doc/.texi file.
|
||||
sc_copyright_check:
|
||||
@if test -f $(v_etc_file); then \
|
||||
grep 'enum { COPYRIGHT_YEAR = '$$(date +%Y)' };' $(v_etc_file) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(sample-test); then \
|
||||
grep '# Copyright (C) '$$(date +%Y)' Free' $(sample-test) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(sample-test); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
@if test -f $(texi); then \
|
||||
grep 'Copyright @copyright{} .*'$$(date +%Y)' Free' $(texi) \
|
||||
>/dev/null \
|
||||
|| { echo 'out of date copyright in $(texi); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
|
||||
vc-diff-check:
|
||||
$(VC) diff > vc-diffs || :
|
||||
if test -s vc-diffs; then \
|
||||
cat vc-diffs; \
|
||||
echo "Some files are locally modified:" 1>&2; \
|
||||
exit 1; \
|
||||
else \
|
||||
rm vc-diffs; \
|
||||
fi
|
||||
|
||||
cvs-check: vc-diff-check
|
||||
|
||||
maintainer-distcheck:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) taint-distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
|
||||
# Don't make a distribution if checks fail.
|
||||
# Also, make sure the NEWS file is up-to-date.
|
||||
vc-dist: $(local-check) cvs-check maintainer-distcheck
|
||||
$(MAKE) dist
|
||||
|
||||
# Use this to make sure we don't run these programs when building
|
||||
# from a virgin tgz file, below.
|
||||
null_AM_MAKEFLAGS = \
|
||||
ACLOCAL=false \
|
||||
AUTOCONF=false \
|
||||
AUTOMAKE=false \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
|
||||
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||
bin=bin-$$$$
|
||||
|
||||
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
pfx=$(t)/i
|
||||
|
||||
# More than once, tainted build and source directory names would
|
||||
# have caused at least one "make check" test to apply "chmod 700"
|
||||
# to all directories under $HOME. Make sure it doesn't happen again.
|
||||
tp := $(shell echo "$(TMPDIR)/$(PACKAGE)-$$$$")
|
||||
t_prefix = $(tp)/a
|
||||
t_taint = '$(t_prefix) b'
|
||||
fake_home = $(tp)/home
|
||||
|
||||
# Ensure that tests run from tainted build and src dir names work,
|
||||
# and don't affect anything in $HOME. Create witness files in $HOME,
|
||||
# record their attributes, and build/test. Then ensure that the
|
||||
# witnesses were not affected.
|
||||
taint-distcheck: $(DIST_ARCHIVES)
|
||||
test -d $(t_taint) && chmod -R 700 $(t_taint) || :
|
||||
-rm -rf $(t_taint) $(fake_home)
|
||||
mkdir -p $(t_prefix) $(t_taint) $(fake_home)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t_taint) -zxf $(distdir).tar.gz
|
||||
mkfifo $(fake_home)/fifo
|
||||
touch $(fake_home)/f
|
||||
mkdir -p $(fake_home)/d/e
|
||||
ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-before
|
||||
cd $(t_taint)/$(distdir) \
|
||||
&& ./configure \
|
||||
&& $(MAKE) \
|
||||
&& HOME=$(fake_home) $(MAKE) check \
|
||||
&& ls -lR $(fake_home) $(t_prefix) > $(tp)/.ls-after \
|
||||
&& diff $(tp)/.ls-before $(tp)/.ls-after \
|
||||
&& test -d $(t_prefix)
|
||||
rm -rf $(tp)
|
||||
|
||||
# Verify that a twisted use of --program-transform-name=PROGRAM works.
|
||||
define install-transform-check
|
||||
echo running install-transform-check \
|
||||
&& rm -rf $(pfx) \
|
||||
&& $(MAKE) program_transform_name='s/.*/zyx/' \
|
||||
prefix=$(pfx) install \
|
||||
&& test "$$(echo $(pfx)/bin/*)" = "$(pfx)/bin/zyx" \
|
||||
&& test "$$(find $(pfx)/share/man -type f|sed 's,.*/,,;s,\..*,,')" = "zyx"
|
||||
endef
|
||||
|
||||
# Install, then verify that all binaries and man pages are in place.
|
||||
# Note that neither the binary, ginstall, nor the ].1 man page is installed.
|
||||
define my-instcheck
|
||||
$(MAKE) prefix=$(pfx) install \
|
||||
&& test ! -f $(pfx)/bin/ginstall \
|
||||
&& { fail=0; \
|
||||
for i in $(built_programs); do \
|
||||
test "$$i" = ginstall && i=install; \
|
||||
for j in "$(pfx)/bin/$$i" \
|
||||
"$(pfx)/share/man/man1/$$i.1"; do \
|
||||
case $$j in *'[.1') continue;; esac; \
|
||||
test -f "$$j" && : \
|
||||
|| { echo "$$j not installed"; fail=1; }; \
|
||||
done; \
|
||||
done; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
define coreutils-path-check
|
||||
{ \
|
||||
if test -f $(srcdir)/src/true.c; then \
|
||||
fail=1; \
|
||||
mkdir $(bin) \
|
||||
&& ($(write_loser)) > $(bin)/loser \
|
||||
&& chmod a+x $(bin)/loser \
|
||||
&& for i in $(built_programs); do \
|
||||
case $$i in \
|
||||
rm|expr|basename|echo|sort|ls|tr);; \
|
||||
cat|dirname|mv|wc);; \
|
||||
*) ln $(bin)/loser $(bin)/$$i;; \
|
||||
esac; \
|
||||
done \
|
||||
&& ln -sf ../src/true $(bin)/false \
|
||||
&& PATH=`pwd`/$(bin):$$PATH $(MAKE) -C tests check \
|
||||
&& { test -d gnulib-tests \
|
||||
&& $(MAKE) -C gnulib-tests check \
|
||||
|| :; } \
|
||||
&& rm -rf $(bin) \
|
||||
&& fail=0; \
|
||||
else \
|
||||
fail=0; \
|
||||
fi; \
|
||||
test $$fail = 1 && exit 1 || :; \
|
||||
}
|
||||
endef
|
||||
|
||||
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||
# arithmetic problems with -Wpointer-arith.
|
||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||
# have to have a recent version of gcc and glibc headers.
|
||||
# The hard-linking for-loop below ensures that there is a bin/ directory
|
||||
# full of all of the programs under test (except the ones that are required
|
||||
# for basic Makefile rules), all symlinked to the just-built "false" program.
|
||||
# This is to ensure that if ever a test neglects to make PATH include
|
||||
# the build srcdir, these always-failing programs will run.
|
||||
# Otherwise, it is too easy to test the wrong programs.
|
||||
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||
my-distcheck: $(DIST_ARCHIVES) $(local-check)
|
||||
$(MAKE) syntax-check
|
||||
$(MAKE) check
|
||||
-rm -rf $(t)
|
||||
mkdir -p $(t)
|
||||
GZIP=$(GZIP_ENV) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz
|
||||
cd $(t)/$(distdir) \
|
||||
&& ./configure --disable-nls \
|
||||
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(install-transform-check) \
|
||||
&& $(my-instcheck) \
|
||||
&& $(coreutils-path-check) \
|
||||
&& $(MAKE) distclean
|
||||
(cd $(t) && mv $(distdir) $(distdir).old \
|
||||
&& $(AMTAR) -zxf - ) < $(distdir).tar.gz
|
||||
diff -ur $(t)/$(distdir).old $(t)/$(distdir)
|
||||
-rm -rf $(t)
|
||||
@echo "========================"; \
|
||||
echo "$(distdir).tar.gz is ready for distribution"; \
|
||||
echo "========================"
|
||||
|
||||
WGET = wget
|
||||
WGETFLAGS = -C off
|
||||
|
||||
rel-check:
|
||||
tarz=/tmp/rel-check-tarz-$$$$; \
|
||||
md5_tmp=/tmp/rel-check-md5-$$$$; \
|
||||
set -e; \
|
||||
trap 'status=$$?; rm -f $$tarz $$md5_tmp; exit $$status' 0 1 2 3 15; \
|
||||
$(WGET) $(WGETFLAGS) -q --output-document=$$tarz $(url); \
|
||||
echo "$(md5) -" > $$md5_tmp; \
|
||||
md5sum -c $$md5_tmp < $$tarz
|
||||
|
||||
rel-files = $(DIST_ARCHIVES)
|
||||
|
||||
gnulib-version = $$(cd $(gnulib_dir) && git describe)
|
||||
|
||||
announcement: NEWS ChangeLog $(rel-files)
|
||||
@./build-aux/announce-gen \
|
||||
--release-type=$(RELEASE_TYPE) \
|
||||
--package=$(PACKAGE) \
|
||||
--prev=$(PREV_VERSION) \
|
||||
--curr=$(VERSION) \
|
||||
--gpg-key-id=$(gpg_key_ID) \
|
||||
--news=NEWS \
|
||||
--bootstrap-tools=autoconf,automake,bison,gnulib \
|
||||
--gnulib-version=$(gnulib-version) \
|
||||
$(addprefix --url-dir=, $(url_dir_list))
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
## ---------------- ##
|
||||
|
||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||
www-gnu = http://www.gnu.org
|
||||
|
||||
# Use mv, if you don't have/want move-if-change.
|
||||
move_if_change ?= move-if-change
|
||||
|
||||
emit_upload_commands:
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
@echo "$(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \\"
|
||||
@echo " --to $(gnu_rel_host):$(PACKAGE) \\"
|
||||
@echo " $(rel-files)"
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
|
||||
noteworthy = * Noteworthy changes in release ?.? (????-??-??) [?]
|
||||
define emit-commit-log
|
||||
printf '%s\n' 'post-release administrivia' '' \
|
||||
'* NEWS: Add header line for next release.' \
|
||||
'* .prev-version: Record previous version.' \
|
||||
'* cfg.mk (old_NEWS_hash): Auto-update.'
|
||||
endef
|
||||
|
||||
.PHONY: alpha beta major
|
||||
alpha beta major: $(local-check) writable-files
|
||||
test $@ = major \
|
||||
&& { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$' \
|
||||
|| { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
|
||||
|| :
|
||||
$(MAKE) vc-dist
|
||||
$(MAKE) news-date-check
|
||||
$(MAKE) -s announcement RELEASE_TYPE=$@ > /tmp/announce-$(my_distdir)
|
||||
if test -d $(release_archive_dir); then \
|
||||
ln $(rel-files) $(release_archive_dir); \
|
||||
chmod a-w $(rel-files); \
|
||||
fi
|
||||
$(MAKE) -s emit_upload_commands RELEASE_TYPE=$@
|
||||
echo $(VERSION) > $(prev_version_file)
|
||||
$(MAKE) update-NEWS-hash
|
||||
perl -pi -e '$$. == 3 and print "$(noteworthy)\n\n\n"' NEWS
|
||||
$(emit-commit-log) > .ci-msg
|
||||
$(VC) commit -F .ci-msg -a
|
||||
@@ -1,6 +1,6 @@
|
||||
# Make coreutils man pages. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 2002-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2009 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@@ -15,15 +15,15 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
dist_man_MANS = groups.1 $(MAN)
|
||||
dist_man1_MANS = $(MAN)
|
||||
|
||||
man_aux = $(dist_man_MANS:.1=.x)
|
||||
man_aux = $(dist_man1_MANS:.1=.x)
|
||||
|
||||
EXTRA_DIST = $(man_aux) $(NO_INSTALL_PROGS_DEFAULT:%=%.x) help2man
|
||||
MAINTAINERCLEANFILES = $(dist_man_MANS)
|
||||
MAINTAINERCLEANFILES = $(dist_man1_MANS)
|
||||
|
||||
# Depend on configure.ac to get version number changes.
|
||||
common_dep = $(top_srcdir)/configure.ac
|
||||
# Depend on ../.version to get version number changes.
|
||||
common_dep = ../.version
|
||||
|
||||
# Note that arch depends on uname.c
|
||||
arch.1: $(common_dep) $(srcdir)/arch.x ../src/uname.c
|
||||
@@ -59,7 +59,7 @@ factor.1: $(common_dep) $(srcdir)/factor.x ../src/factor.c
|
||||
false.1: $(common_dep) $(srcdir)/false.x ../src/false.c
|
||||
fmt.1: $(common_dep) $(srcdir)/fmt.x ../src/fmt.c
|
||||
fold.1: $(common_dep) $(srcdir)/fold.x ../src/fold.c
|
||||
groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.sh
|
||||
groups.1: $(common_dep) $(srcdir)/groups.x ../src/groups.c
|
||||
head.1: $(common_dep) $(srcdir)/head.x ../src/head.c
|
||||
hostid.1: $(common_dep) $(srcdir)/hostid.x ../src/hostid.c
|
||||
hostname.1: $(common_dep) $(srcdir)/hostname.x ../src/hostname.c
|
||||
@@ -113,9 +113,11 @@ tac.1: $(common_dep) $(srcdir)/tac.x ../src/tac.c
|
||||
tail.1: $(common_dep) $(srcdir)/tail.x ../src/tail.c
|
||||
tee.1: $(common_dep) $(srcdir)/tee.x ../src/tee.c
|
||||
test.1: $(common_dep) $(srcdir)/test.x ../src/test.c
|
||||
timeout.1: $(common_dep) $(srcdir)/timeout.x ../src/timeout.c
|
||||
touch.1: $(common_dep) $(srcdir)/touch.x ../src/touch.c
|
||||
tr.1: $(common_dep) $(srcdir)/tr.x ../src/tr.c
|
||||
true.1: $(common_dep) $(srcdir)/true.x ../src/true.c
|
||||
truncate.1: $(common_dep) $(srcdir)/truncate.x ../src/truncate.c
|
||||
tsort.1: $(common_dep) $(srcdir)/tsort.x ../src/tsort.c
|
||||
tty.1: $(common_dep) $(srcdir)/tty.x ../src/tty.c
|
||||
uname.1: $(common_dep) $(srcdir)/uname.x ../src/uname.c
|
||||
@@ -130,6 +132,10 @@ who.1: $(common_dep) $(srcdir)/who.x ../src/who.c
|
||||
whoami.1: $(common_dep) $(srcdir)/whoami.x ../src/whoami.c
|
||||
yes.1: $(common_dep) $(srcdir)/yes.x ../src/yes.c
|
||||
|
||||
# This is required so that changes to e.g., emit_bug_reporting_address
|
||||
# provoke regeneration of all $(MAN) files.
|
||||
$(MAN): $(top_srcdir)/src/system.h
|
||||
|
||||
SUFFIXES = .x .1
|
||||
|
||||
# Ensure that help2man runs the ../src/ginstall binary as
|
||||
@@ -159,7 +165,6 @@ mapped_name = `echo $*|sed 's/^install$$/ginstall/; s/^test$$/[/'`
|
||||
--output=$t/$@ $t/$*; \
|
||||
} \
|
||||
&& sed 's|$*\.td/||g' $t/$@ > $@ \
|
||||
&& chmod a-w $@ \
|
||||
&& rm -rf $t ;; \
|
||||
esac
|
||||
|
||||
@@ -171,7 +176,7 @@ distcheck-hook: check-x-vs-1 check-programs-vs-x
|
||||
ASSORT = LC_ALL=C sort
|
||||
|
||||
# Ensure that for each .x file in this directory, there is a
|
||||
# corresponding .1 file in the definition of $(dist_man_MANS) above.
|
||||
# corresponding .1 file in the definition of $(dist_man1_MANS) above.
|
||||
# But since that expansion usually lacks programs like su and arch,
|
||||
# add them here manually.
|
||||
.PHONY: check-x-vs-1
|
||||
@@ -179,7 +184,7 @@ check-x-vs-1:
|
||||
PATH=../src$(PATH_SEPARATOR)$$PATH; export PATH; \
|
||||
t=ls-files.$$$$; \
|
||||
(cd $(srcdir) && ls -1 *.x) | sed 's/\.x$$//' | $(ASSORT) > $$t;\
|
||||
(echo $(dist_man_MANS) $(NO_INSTALL_PROGS_DEFAULT) \
|
||||
(echo $(dist_man1_MANS) $(NO_INSTALL_PROGS_DEFAULT) \
|
||||
| tr -s ' ' '\n' | sed 's/\.1$$//') \
|
||||
| $(ASSORT) -u | diff - $$t || { rm $$t; exit 1; }; \
|
||||
rm $$t
|
||||
|
||||
@@ -2,3 +2,12 @@
|
||||
date \- print or set the system date and time
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[DATE STRING]
|
||||
.\" NOTE: keep this paragraph in sync with the one in touch.x
|
||||
The --date=STRING is a mostly free format human readable date string
|
||||
such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
|
||||
even "next Thursday". A date string may contain items indicating
|
||||
calendar date, time of day, time zone, day of week, relative time,
|
||||
relative date, and numbers. An empty string indicates the beginning
|
||||
of the day. The date string format is more complex than is easily
|
||||
documented here but is fully described in the info documentation.
|
||||
|
||||
2
man/du.x
2
man/du.x
@@ -19,7 +19,7 @@ will match any files whose names end in
|
||||
.BR .o .
|
||||
Therefore, the command
|
||||
.IP
|
||||
.B du --exclude='*.o'
|
||||
.B du --exclude=\(aq*.o\(aq
|
||||
.PP
|
||||
will skip all files and subdirectories ending in
|
||||
.BR .o
|
||||
|
||||
13
man/help2man
13
man/help2man
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# Generate a short man page from --help and --version output.
|
||||
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2008, 2009
|
||||
# Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
@@ -34,7 +34,7 @@ my $have_gettext;
|
||||
BEGIN {
|
||||
eval {
|
||||
require Locale::gettext;
|
||||
Locale::gettext->import;
|
||||
Locale::gettext->import (qw(gettext textdomain));
|
||||
$have_gettext = 1;
|
||||
};
|
||||
|
||||
@@ -134,7 +134,7 @@ die $help_info unless @ARGV == 1;
|
||||
die "$this_program: no locale support (Locale::gettext required)\n"
|
||||
unless $locale eq 'C' or $have_gettext;
|
||||
|
||||
# Set localisation of date and executable's ouput.
|
||||
# Set localization of date and executable's output.
|
||||
delete @ENV{qw(LANGUAGE LC_MESSAGES LANG)};
|
||||
setlocale LC_ALL, $ENV{LC_ALL} = $locale;
|
||||
|
||||
@@ -368,7 +368,7 @@ s/^\./\x80/mg;
|
||||
s/^'/\x81/mg;
|
||||
s/\\/\x82/g;
|
||||
|
||||
my $PAT_BUGS = _('Report +bugs|Email +bug +reports +to');
|
||||
my $PAT_BUGS = _('Report +(?:\w+ +)?bugs|Email +bug +reports +to');
|
||||
my $PAT_AUTHOR = _('Written +by');
|
||||
my $PAT_OPTIONS = _('Options');
|
||||
my $PAT_EXAMPLES = _('Examples');
|
||||
@@ -567,7 +567,7 @@ and
|
||||
.B %s
|
||||
programs are properly installed at your site, the command
|
||||
.IP
|
||||
.B info %s
|
||||
.B info coreutils \(aq%s invocation\(aq
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
EOT
|
||||
@@ -607,6 +607,9 @@ for my $sect (@pre, (grep ! /^($filter)$/o, @include), @post)
|
||||
# Convert some latin1 chars to troff equivalents
|
||||
s/\xa0/\\ /g; # non-breaking space
|
||||
|
||||
$sect eq 'REPORTING BUGS'
|
||||
and s/\n(.)/\n.br\n$1/g;
|
||||
|
||||
print;
|
||||
}
|
||||
}
|
||||
|
||||
2
man/id.x
2
man/id.x
@@ -1,4 +1,4 @@
|
||||
[NAME]
|
||||
id \- print user identity
|
||||
id \- print real and effective user and group IDs
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
printf \- format and print data
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[SEE ALSO]
|
||||
printf(3)
|
||||
|
||||
6
man/timeout.x
Normal file
6
man/timeout.x
Normal file
@@ -0,0 +1,6 @@
|
||||
[NAME]
|
||||
timeout \- run a command with a time limit
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[SEE ALSO]
|
||||
kill(1)
|
||||
@@ -2,3 +2,12 @@
|
||||
touch \- change file timestamps
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[DATE STRING]
|
||||
.\" NOTE: keep this paragraph in sync with the one in date.x
|
||||
The --date=STRING is a mostly free format human readable date string
|
||||
such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or
|
||||
even "next Thursday". A date string may contain items indicating
|
||||
calendar date, time of day, time zone, day of week, relative time,
|
||||
relative date, and numbers. An empty string indicates the beginning
|
||||
of the day. The date string format is more complex than is easily
|
||||
documented here but is fully described in the info documentation.
|
||||
|
||||
6
man/truncate.x
Normal file
6
man/truncate.x
Normal file
@@ -0,0 +1,6 @@
|
||||
[NAME]
|
||||
truncate \- shrink or extend the size of a file to the specifed size
|
||||
[DESCRIPTION]
|
||||
.\" Add any additional description here
|
||||
[SEE ALSO]
|
||||
dd(1), truncate(2), ftruncate(2)
|
||||
@@ -753,7 +753,7 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the ``GNU Free
|
||||
|
||||
@@ -277,7 +277,7 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the ``GNU Free
|
||||
|
||||
@@ -465,7 +465,7 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2006 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2 or
|
||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
||||
Texts. A copy of the license is included in the ``GNU Free
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# List of files which contain translatable strings.
|
||||
# Copyright (C) 1996-2007 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2009 Free Software Foundation, Inc.
|
||||
|
||||
# These are nominally temporary...
|
||||
lib/acl.c
|
||||
lib/argmatch.c
|
||||
lib/closein.c
|
||||
lib/closeout.c
|
||||
lib/copy-acl.c
|
||||
lib/error.c
|
||||
lib/euidaccess-stat.c
|
||||
lib/file-type.c
|
||||
@@ -19,10 +19,13 @@ lib/randread.c
|
||||
lib/regcomp.c
|
||||
lib/root-dev-ino.h
|
||||
lib/rpmatch.c
|
||||
lib/set-mode-acl.c
|
||||
lib/unicodeio.c
|
||||
lib/userspec.c
|
||||
lib/verror.c
|
||||
lib/version-etc.c
|
||||
lib/xalloc-die.c
|
||||
lib/xfreopen.c
|
||||
lib/xfts.c
|
||||
lib/xmemcoll.c
|
||||
lib/xmemxfrm.c
|
||||
@@ -60,6 +63,9 @@ src/factor.c
|
||||
src/false.c
|
||||
src/fmt.c
|
||||
src/fold.c
|
||||
src/getlimits.c
|
||||
src/group-list.c
|
||||
src/groups.c
|
||||
src/head.c
|
||||
src/hostid.c
|
||||
src/hostname.c
|
||||
@@ -81,6 +87,7 @@ src/nice.c
|
||||
src/nl.c
|
||||
src/nohup.c
|
||||
src/od.c
|
||||
src/operand2sig.c
|
||||
src/paste.c
|
||||
src/pathchk.c
|
||||
src/pinky.c
|
||||
@@ -112,9 +119,11 @@ src/tac.c
|
||||
src/tail.c
|
||||
src/tee.c
|
||||
src/test.c
|
||||
src/timeout.c
|
||||
src/touch.c
|
||||
src/tr.c
|
||||
src/true.c
|
||||
src/truncate.c
|
||||
src/tsort.c
|
||||
src/tty.c
|
||||
src/uname.c
|
||||
|
||||
5
src/.gitignore
vendored
5
src/.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
*.exe
|
||||
\[
|
||||
arch
|
||||
base64
|
||||
basename
|
||||
cat
|
||||
@@ -30,6 +31,7 @@ false
|
||||
fmt
|
||||
fold
|
||||
fs.h
|
||||
getlimits
|
||||
ginstall
|
||||
groups
|
||||
head
|
||||
@@ -38,6 +40,7 @@ hostname
|
||||
id
|
||||
join
|
||||
kill
|
||||
libver.a
|
||||
link
|
||||
ln
|
||||
localedir.h
|
||||
@@ -86,9 +89,11 @@ tac
|
||||
tail
|
||||
tee
|
||||
test
|
||||
timeout
|
||||
touch
|
||||
tr
|
||||
true
|
||||
truncate
|
||||
tsort
|
||||
tty
|
||||
uname
|
||||
|
||||
162
src/Makefile.am
162
src/Makefile.am
@@ -1,6 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in -*-Makefile-*-
|
||||
|
||||
## Copyright (C) 1990, 1991, 1993-2008 Free Software Foundation, Inc.
|
||||
## Copyright (C) 1990, 1991, 1993-2009 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software: you can redistribute it and/or modify
|
||||
## it under the terms of the GNU General Public License as published by
|
||||
@@ -26,6 +26,8 @@ no_install__progs = \
|
||||
build_if_possible__progs = \
|
||||
chroot df hostid nice pinky stty su uname uptime users who
|
||||
|
||||
AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
|
||||
|
||||
EXTRA_PROGRAMS = \
|
||||
$(no_install__progs) \
|
||||
$(build_if_possible__progs) \
|
||||
@@ -33,19 +35,18 @@ EXTRA_PROGRAMS = \
|
||||
ginstall link ln dir vdir ls mkdir \
|
||||
mkfifo mknod mktemp \
|
||||
mv nohup readlink rm rmdir shred stat sync touch unlink \
|
||||
cat cksum comm csplit cut expand fmt fold head join md5sum \
|
||||
cat cksum comm csplit cut expand fmt fold head join groups md5sum \
|
||||
nl od paste pr ptx sha1sum sha224sum sha256sum sha384sum sha512sum \
|
||||
shuf sort split sum tac tail tr tsort unexpand uniq wc \
|
||||
basename date dirname echo env expr factor false \
|
||||
id kill logname pathchk printenv printf pwd \
|
||||
runcon seq sleep tee \
|
||||
test true tty whoami yes \
|
||||
test timeout true truncate tty whoami yes \
|
||||
base64
|
||||
|
||||
bin_SCRIPTS = groups
|
||||
bin_PROGRAMS = $(OPTIONAL_BIN_PROGS)
|
||||
|
||||
noinst_PROGRAMS = setuidgid
|
||||
noinst_PROGRAMS = setuidgid getlimits
|
||||
|
||||
noinst_HEADERS = \
|
||||
chown-core.h \
|
||||
@@ -53,7 +54,10 @@ noinst_HEADERS = \
|
||||
cp-hash.h \
|
||||
dircolors.h \
|
||||
fs.h \
|
||||
group-list.h \
|
||||
ls.h \
|
||||
operand2sig.h \
|
||||
prog-fprintf.h \
|
||||
remove.h \
|
||||
system.h \
|
||||
wheel-size.h \
|
||||
@@ -61,18 +65,30 @@ noinst_HEADERS = \
|
||||
uname.h
|
||||
|
||||
EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \
|
||||
groups.sh wheel-gen.pl extract-magic c99-to-c89.diff
|
||||
wheel-gen.pl extract-magic c99-to-c89.diff
|
||||
BUILT_SOURCES =
|
||||
CLEANFILES = $(SCRIPTS) su
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lib
|
||||
|
||||
noinst_LIBRARIES = libver.a
|
||||
nodist_libver_a_SOURCES = version.c version.h
|
||||
|
||||
# Sometimes, the expansion of $(LIBINTL) includes -lc which may
|
||||
# include modules defining variables like `optind', so libcoreutils.a
|
||||
# must precede $(LIBINTL) in order to ensure we use GNU getopt.
|
||||
# But libcoreutils.a must also follow $(LIBINTL), since libintl uses
|
||||
# replacement functions defined in libcoreutils.a.
|
||||
LDADD = ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a
|
||||
LDADD = libver.a ../lib/libcoreutils.a $(LIBINTL) ../lib/libcoreutils.a
|
||||
|
||||
cat_LDADD = $(LDADD)
|
||||
df_LDADD = $(LDADD)
|
||||
du_LDADD = $(LDADD)
|
||||
getlimits_LDADD = $(LDADD)
|
||||
ptx_LDADD = $(LDADD)
|
||||
split_LDADD = $(LDADD)
|
||||
timeout_LDADD = $(LDADD)
|
||||
truncate_LDADD = $(LDADD)
|
||||
|
||||
# for eaccess in lib/euidaccess.c.
|
||||
chcon_LDADD = $(LDADD) $(LIB_SELINUX)
|
||||
@@ -91,14 +107,15 @@ __LDADD = $(LDADD) $(LIB_EACCESS)
|
||||
|
||||
# for clock_gettime and fdatasync
|
||||
dd_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
|
||||
dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
||||
dir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
||||
id_LDADD = $(LDADD) $(LIB_SELINUX)
|
||||
ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
||||
ls_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
||||
mktemp_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||
pr_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
||||
shred_LDADD = $(LDADD) $(LIB_GETHRXTIME) $(LIB_FDATASYNC)
|
||||
shuf_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||
mktemp_LDADD = $(LDADD) $(LIB_GETHRXTIME)
|
||||
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX)
|
||||
tac_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
|
||||
vdir_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_SELINUX) $(LIB_CAP)
|
||||
|
||||
## If necessary, add -lm to resolve use of pow in lib/strtod.c.
|
||||
sort_LDADD = $(LDADD) $(POW_LIB) $(LIB_GETHRXTIME)
|
||||
@@ -118,6 +135,12 @@ seq_LDADD = $(LDADD) $(POW_LIB)
|
||||
# and the `nanosleep' reference in lib/xnanosleep.c.
|
||||
nanosec_libs = $(LDADD) $(POW_LIB) $(LIB_NANOSLEEP)
|
||||
|
||||
# for various GMP functions
|
||||
expr_LDADD = $(LDADD) $(LIB_GMP)
|
||||
|
||||
# for various GMP functions
|
||||
factor_LDADD = $(LDADD) $(LIB_GMP)
|
||||
|
||||
sleep_LDADD = $(nanosec_libs)
|
||||
tail_LDADD = $(nanosec_libs)
|
||||
|
||||
@@ -129,12 +152,27 @@ su_LDADD = $(LDADD) $(LIB_CRYPT)
|
||||
dir_LDADD += $(LIB_ACL)
|
||||
ls_LDADD += $(LIB_ACL)
|
||||
vdir_LDADD += $(LIB_ACL)
|
||||
cp_LDADD += $(LIB_ACL)
|
||||
mv_LDADD += $(LIB_ACL)
|
||||
ginstall_LDADD += $(LIB_ACL)
|
||||
cp_LDADD += $(LIB_ACL) $(LIB_XATTR)
|
||||
mv_LDADD += $(LIB_ACL) $(LIB_XATTR)
|
||||
ginstall_LDADD += $(LIB_ACL) $(LIB_XATTR)
|
||||
|
||||
stat_LDADD = $(LDADD) $(LIB_SELINUX)
|
||||
|
||||
# Append $(LIBICONV) to each program that uses proper_name_utf8.
|
||||
cat_LDADD += $(LIBICONV)
|
||||
cp_LDADD += $(LIBICONV)
|
||||
df_LDADD += $(LIBICONV)
|
||||
du_LDADD += $(LIBICONV)
|
||||
getlimits_LDADD += $(LIBICONV)
|
||||
ptx_LDADD += $(LIBICONV)
|
||||
split_LDADD += $(LIBICONV)
|
||||
timeout_LDADD += $(LIBICONV)
|
||||
truncate_LDADD += $(LIBICONV)
|
||||
|
||||
# programs that use getaddrinfo (e.g., via canon_host)
|
||||
pinky_LDADD = $(LDADD) $(GETADDRINFO_LIB)
|
||||
who_LDADD = $(LDADD) $(GETADDRINFO_LIB)
|
||||
|
||||
$(PROGRAMS): ../lib/libcoreutils.a
|
||||
|
||||
# Get the release year from ../lib/version-etc.c.
|
||||
@@ -142,20 +180,6 @@ RELEASE_YEAR = \
|
||||
`sed -n '/.*COPYRIGHT_YEAR = \([0-9][0-9][0-9][0-9]\) };/s//\1/p' \
|
||||
$(top_srcdir)/lib/version-etc.c`
|
||||
|
||||
# This depends on 'Makefile', so that version changes
|
||||
#(reflected in Makefile's VERSION definition)
|
||||
# are reflected into groups --version also between releases.
|
||||
groups: groups.sh Makefile
|
||||
rm -f $@ $@-t
|
||||
sed \
|
||||
-e 's!@''bindir''@!$(bindir)!' \
|
||||
-e 's/@''RELEASE_YEAR'@/$(RELEASE_YEAR)/ \
|
||||
-e 's/@''PACKAGE_NAME''@/$(PACKAGE_NAME)/' \
|
||||
-e 's/@''PACKAGE_BUGREPORT''@/$(PACKAGE_BUGREPORT)/' \
|
||||
-e 's/@''VERSION''@/$(VERSION)/' $(srcdir)/groups.sh > $@-t
|
||||
chmod +x $@-t
|
||||
mv $@-t $@
|
||||
|
||||
all-local: su$(EXEEXT)
|
||||
|
||||
installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
|
||||
@@ -170,7 +194,7 @@ install_su = \
|
||||
echo " chown root $(installed_su)"; \
|
||||
chown root $(installed_su); \
|
||||
echo " chmod $(setuid_root_mode) $(installed_su)"; \
|
||||
chmod $(setuid_root_mode) $(installed_su) \
|
||||
chmod $(setuid_root_mode) $(installed_su); \
|
||||
else \
|
||||
:; \
|
||||
fi
|
||||
@@ -216,8 +240,8 @@ copy_sources = copy.c cp-hash.c
|
||||
# confusion with the `install' target. The install rule transforms `ginstall'
|
||||
# to install before applying any user-specified name transformations.
|
||||
|
||||
transform = s/ginstall/install/; @program_transform_name@
|
||||
ginstall_SOURCES = install.c $(copy_sources)
|
||||
transform = s/ginstall/install/; $(program_transform_name)
|
||||
ginstall_SOURCES = install.c prog-fprintf.c $(copy_sources)
|
||||
|
||||
# This is for the '[' program. Automake transliterates '[' to '_'.
|
||||
__SOURCES = lbracket.c
|
||||
@@ -225,14 +249,21 @@ __SOURCES = lbracket.c
|
||||
cp_SOURCES = cp.c $(copy_sources)
|
||||
dir_SOURCES = ls.c ls-dir.c
|
||||
vdir_SOURCES = ls.c ls-vdir.c
|
||||
id_SOURCES = id.c group-list.c
|
||||
groups_SOURCES = groups.c group-list.c
|
||||
ln_SOURCES = ln.c
|
||||
ls_SOURCES = ls.c ls-ls.c
|
||||
chown_SOURCES = chown.c chown-core.c
|
||||
chgrp_SOURCES = chgrp.c chown-core.c
|
||||
kill_SOURCES = kill.c operand2sig.c
|
||||
timeout_SOURCES = timeout.c operand2sig.c
|
||||
|
||||
mv_SOURCES = mv.c remove.c $(copy_sources)
|
||||
rm_SOURCES = rm.c remove.c
|
||||
|
||||
mkdir_SOURCES = mkdir.c prog-fprintf.c
|
||||
rmdir_SOURCES = rmdir.c prog-fprintf.c
|
||||
|
||||
uname_SOURCES = uname.c uname-uname.c
|
||||
arch_SOURCES = uname.c uname-arch.c
|
||||
|
||||
@@ -249,6 +280,8 @@ sha384sum_CPPFLAGS = -DHASH_ALGO_SHA384=1 $(AM_CPPFLAGS)
|
||||
sha512sum_SOURCES = md5sum.c
|
||||
sha512sum_CPPFLAGS = -DHASH_ALGO_SHA512=1 $(AM_CPPFLAGS)
|
||||
|
||||
ginstall_CPPFLAGS = -DENABLE_MATCHPATHCON=1 $(AM_CPPFLAGS)
|
||||
|
||||
editpl = sed -e 's,@''PERL''@,$(PERL),g'
|
||||
|
||||
BUILT_SOURCES += dircolors.h
|
||||
@@ -286,6 +319,22 @@ fs.h: stat.c extract-magic
|
||||
@chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
BUILT_SOURCES += version.c
|
||||
version.c: Makefile
|
||||
rm -f $@
|
||||
printf '#include <config.h>\n' > $@t
|
||||
printf 'char const *Version = "$(PACKAGE_VERSION)";\n' >> $@t
|
||||
@chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
BUILT_SOURCES += version.h
|
||||
version.h: Makefile
|
||||
rm -f $@
|
||||
printf 'extern char const *Version;\n' > $@t
|
||||
@chmod a-w $@t
|
||||
mv $@t $@
|
||||
|
||||
DISTCLEANFILES = version.c version.h
|
||||
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
|
||||
|
||||
# Sort in traditional ASCII order, regardless of the current locale;
|
||||
@@ -300,7 +349,7 @@ all_programs = \
|
||||
|
||||
built_programs.list:
|
||||
@echo $(bin_PROGRAMS) $(bin_SCRIPTS) | tr ' ' '\n' \
|
||||
| sed -e 's,$(EXEEXT)$$,,' | $(ASSORT) -u
|
||||
| sed -e 's,$(EXEEXT)$$,,' | $(ASSORT) -u | tr '\n' ' '
|
||||
|
||||
all_programs.list:
|
||||
@echo $(all_programs) | tr ' ' '\n' | sed -e 's,$(EXEEXT)$$,,' \
|
||||
@@ -310,7 +359,7 @@ pm = progs-makefile
|
||||
pr = progs-readme
|
||||
# Ensure that the list of programs in README matches the list
|
||||
# of programs we can build.
|
||||
check: check-README check-misc check-duplicate-no-install
|
||||
check: check-README check-duplicate-no-install
|
||||
.PHONY: check-README
|
||||
check-README:
|
||||
rm -rf $(pr) $(pm)
|
||||
@@ -333,8 +382,8 @@ au_dotdot = authors-dotdot
|
||||
au_actual = authors-actual
|
||||
.PHONY: check-AUTHORS
|
||||
check-AUTHORS: $(all_programs)
|
||||
rm -f $(au_actual) $(au_dotdot)
|
||||
for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
|
||||
@rm -f $(au_actual) $(au_dotdot)
|
||||
@for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
|
||||
| $(ASSORT) -u`; do \
|
||||
test "$$i" = '[' && continue; \
|
||||
exe=$$i; \
|
||||
@@ -343,23 +392,12 @@ check-AUTHORS: $(all_programs)
|
||||
elif test "$$i" = test; then \
|
||||
exe='['; \
|
||||
fi; \
|
||||
./$$exe --version \
|
||||
LC_ALL=en_US.UTF-8 ./$$exe --version \
|
||||
| perl -0 -pi -e 's/,\n/, /gm' \
|
||||
|sed -n '/Written by /{ s//'"$$i"': /; s/,* and /, /; s/\.$$//; p; }'; \
|
||||
done > $(au_actual)
|
||||
sed -n '/:/p' $(top_srcdir)/AUTHORS > $(au_dotdot)
|
||||
diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot)
|
||||
|
||||
# Make sure we don't define any S_IS* macros in src/*.c files.
|
||||
# Not a big deal, but they're already defined via system.h.
|
||||
#
|
||||
# Also make sure we don't use st_blocks. Use ST_NBLOCKS instead.
|
||||
# This is a bit of a kludge, since it prevents use of the string
|
||||
# even in comments, but for now it does the job with no false positives.
|
||||
.PHONY: check-misc
|
||||
check-misc:
|
||||
cd $(srcdir); grep '^# *define *S_IS' $(SOURCES) && exit 1 || :
|
||||
cd $(srcdir); grep st_blocks $(SOURCES) && exit 1 || :
|
||||
cd $(srcdir); grep '^# *define .*defined' $(SOURCES) && exit 1 || :
|
||||
@sed -n '/^[^ ][^ ]*:/p' $(top_srcdir)/AUTHORS > $(au_dotdot)
|
||||
@diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot)
|
||||
|
||||
# Extract the list of authors from each file.
|
||||
sed_filter = s/^ *//;s/N_ (//;s/^"//;s/")*$$//
|
||||
@@ -400,19 +438,33 @@ s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}'
|
||||
sc_tight_scope: $(all_programs)
|
||||
@t=exceptions-$$$$; \
|
||||
trap "s=$$?; rm -f $$t; exit $$s" 0 1 2 13 15; \
|
||||
( printf '^main$$\n^usage$$\n'; \
|
||||
grep -h -A1 '^extern .*[^;]$$' $(SOURCES) \
|
||||
| grep -vE '^(extern |--)' |sed 's/^/^/;s/ .*/$$/' ) > $$t; \
|
||||
src=`for f in $(SOURCES); do \
|
||||
test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
|
||||
hdr=`for f in $(noinst_HEADERS); do \
|
||||
test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \
|
||||
( printf 'main\nusage\n'; \
|
||||
grep -h -A1 '^extern .*[^;]$$' $$src \
|
||||
| grep -vE '^(extern |--)' | sed 's/ .*//'; \
|
||||
perl -ne '/^extern \S+ (\S*) \(/ and print "$$1\n"' $$hdr; \
|
||||
) | $(ASSORT) -u | sed 's/^/^/;s/$$/$$/' > $$t; \
|
||||
nm -e *.$(OBJEXT) \
|
||||
| sed -n 's/.* T //p' \
|
||||
| grep -Ev -f $$t && \
|
||||
{ echo 'the above functions should have static scope' 1>&2; \
|
||||
exit 1; } || : ; \
|
||||
( printf '^program_name$$\n'; \
|
||||
sed -n 's/^extern int \([^ ][^ ]*\);$$/^\1$$/p' \
|
||||
$(noinst_HEADERS) ) > $$t; \
|
||||
perl -ne '/^extern .*?\**(\w+);/ and print "^$$1\$$\n"' \
|
||||
$$hdr *.h ) | $(ASSORT) -u > $$t; \
|
||||
nm -e *.$(OBJEXT) \
|
||||
| sed -n 's/.* [BD] //p' \
|
||||
| grep -Ev -f $$t && \
|
||||
{ echo 'the above variables should have static scope' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
# Use the just-built ./ginstall, when not cross-compiling.
|
||||
if CROSS_COMPILING
|
||||
cu_install_program = @INSTALL_PROGRAM@
|
||||
else
|
||||
cu_install_program = ./ginstall
|
||||
endif
|
||||
INSTALL_PROGRAM = $(cu_install_program)
|
||||
|
||||
30
src/base64.c
30
src/base64.c
@@ -1,5 +1,5 @@
|
||||
/* Base64 encode/decode strings or files.
|
||||
Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004-2008 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Base64.
|
||||
|
||||
@@ -35,24 +35,20 @@
|
||||
/* The official name of this program (e.g., no `g' prefix). */
|
||||
#define PROGRAM_NAME "base64"
|
||||
|
||||
#define AUTHOR "Simon Josefsson"
|
||||
#define AUTHORS proper_name ("Simon Josefsson")
|
||||
|
||||
/* The invocation name of this program. */
|
||||
char *program_name;
|
||||
|
||||
static const struct option long_options[] = {
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
{"decode", no_argument, 0, 'd'},
|
||||
{"wrap", required_argument, 0, 'w'},
|
||||
{"ignore-garbage", no_argument, 0, 'i'},
|
||||
{"help", no_argument, 0, GETOPT_HELP_CHAR},
|
||||
{"version", no_argument, 0, GETOPT_VERSION_CHAR},
|
||||
|
||||
{GETOPT_HELP_OPTION_DECL},
|
||||
{GETOPT_VERSION_OPTION_DECL},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static void
|
||||
void
|
||||
usage (int status)
|
||||
{
|
||||
if (status != EXIT_SUCCESS)
|
||||
@@ -61,7 +57,7 @@ usage (int status)
|
||||
else
|
||||
{
|
||||
printf (_("\
|
||||
Usage: %s [OPTION] [FILE]\n\
|
||||
Usage: %s [OPTION]... [FILE]\n\
|
||||
Base64 encode or decode FILE, or standard input, to standard output.\n\
|
||||
\n"), program_name);
|
||||
fputs (_("\
|
||||
@@ -218,12 +214,12 @@ do_decode (FILE *in, FILE *out, bool ignore_garbage)
|
||||
However, when it processes the final input buffer, we want
|
||||
to iterate it one additional time, but with an indicator
|
||||
telling it to flush what is in CTX. */
|
||||
for (k = 0; k < 1 + feof (in); k++)
|
||||
for (k = 0; k < 1 + !!feof (in); k++)
|
||||
{
|
||||
if (k == 1 && ctx.i == 0)
|
||||
break;
|
||||
n = BLOCKSIZE;
|
||||
ok = base64_decode (&ctx, inbuf, (k == 0 ? sum : 0), outbuf, &n);
|
||||
ok = base64_decode_ctx (&ctx, inbuf, (k == 0 ? sum : 0), outbuf, &n);
|
||||
|
||||
if (fwrite (outbuf, 1, n, out) < n)
|
||||
error (EXIT_FAILURE, errno, _("write error"));
|
||||
@@ -242,22 +238,22 @@ main (int argc, char **argv)
|
||||
FILE *input_fh;
|
||||
const char *infile;
|
||||
|
||||
/* True if --decode has bene given and we should decode data. */
|
||||
/* True if --decode has been given and we should decode data. */
|
||||
bool decode = false;
|
||||
/* True if we should ignore non-alphabetic characters. */
|
||||
/* True if we should ignore non-base64-alphabetic characters. */
|
||||
bool ignore_garbage = false;
|
||||
/* Wrap encoded base64 data around the 76:th column, by default. */
|
||||
uintmax_t wrap_column = 76;
|
||||
|
||||
initialize_main (&argc, &argv);
|
||||
program_name = argv[0];
|
||||
set_program_name (argv[0]);
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
atexit (close_stdout);
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "dqiw:", long_options, NULL)) != -1)
|
||||
while ((opt = getopt_long (argc, argv, "diw:", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case 'd':
|
||||
@@ -276,7 +272,7 @@ main (int argc, char **argv)
|
||||
|
||||
case_GETOPT_HELP_CHAR;
|
||||
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHOR);
|
||||
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
|
||||
|
||||
default:
|
||||
usage (EXIT_FAILURE);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user