mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
762 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1440ca24fd | ||
|
|
9675ed627d | ||
|
|
ec8e146a6d | ||
|
|
9783d76bf6 | ||
|
|
27d1636b33 | ||
|
|
0702758ca4 | ||
|
|
1a8e00ef27 | ||
|
|
d2e298b45d | ||
|
|
f088d94d25 | ||
|
|
9e8a6b696e | ||
|
|
daf28a3110 | ||
|
|
e4c0fce73c | ||
|
|
8ad8aa5322 | ||
|
|
e52a7c28ac | ||
|
|
6d80b05c5a | ||
|
|
424feb6301 | ||
|
|
e80379051b | ||
|
|
0c3544ddc2 | ||
|
|
b84880d980 | ||
|
|
2deb4bd589 | ||
|
|
ab1c9b54b1 | ||
|
|
a54e8bb8a5 | ||
|
|
db58094e11 | ||
|
|
9b76bc2b54 | ||
|
|
fd12e98f36 | ||
|
|
6efd10462d | ||
|
|
df8c2bcfe0 | ||
|
|
092a7e3e4b | ||
|
|
d1cfc46855 | ||
|
|
bad0510aea | ||
|
|
eef4fff743 | ||
|
|
012f96b95d | ||
|
|
c3cac089b1 | ||
|
|
2fc00bda8c | ||
|
|
8ddc5056f2 | ||
|
|
875e96efab | ||
|
|
bbc55e488d | ||
|
|
e19a5aa428 | ||
|
|
d1dba816fb | ||
|
|
7477cd1662 | ||
|
|
e657807596 | ||
|
|
d11bfb0454 | ||
|
|
7407dc042a | ||
|
|
4245876e23 | ||
|
|
291eb90a0a | ||
|
|
de5b055bbf | ||
|
|
f16499e4d5 | ||
|
|
d7ed77980b | ||
|
|
ecec47635a | ||
|
|
681dc1ee01 | ||
|
|
b1a1db5900 | ||
|
|
6bbbf0314e | ||
|
|
5891814f34 | ||
|
|
cc5f0b31b2 | ||
|
|
98b872c48a | ||
|
|
bb5c20212f | ||
|
|
065db950f0 | ||
|
|
f25ce1bc94 | ||
|
|
214d27e146 | ||
|
|
ab73462d4b | ||
|
|
e7c03171d1 | ||
|
|
0d9438bb87 | ||
|
|
9fed2e35c0 | ||
|
|
20ef6c7b9c | ||
|
|
b64119bc54 | ||
|
|
317413874c | ||
|
|
9db1c230c4 | ||
|
|
94a2bd5bf7 | ||
|
|
0db207c66c | ||
|
|
d7ed3bcb8d | ||
|
|
688073771d | ||
|
|
9962f24cc4 | ||
|
|
4352534a0c | ||
|
|
77f8502ea7 | ||
|
|
9696161574 | ||
|
|
3a60f14cbb | ||
|
|
ac8a9a1ff0 | ||
|
|
9d0a315369 | ||
|
|
910267665e | ||
|
|
3669d2b820 | ||
|
|
ada15fc823 | ||
|
|
0125fd0fcb | ||
|
|
a382db6a04 | ||
|
|
5c11250915 | ||
|
|
cbc06bb639 | ||
|
|
ad8fbe0dd2 | ||
|
|
0e9b06482e | ||
|
|
849c3830dc | ||
|
|
7794100ef8 | ||
|
|
fe9033c309 | ||
|
|
2bdc481219 | ||
|
|
fa636dcf6a | ||
|
|
4e732c7379 | ||
|
|
2fb649815c | ||
|
|
32f31bad5e | ||
|
|
a9805326e4 | ||
|
|
98ed526f44 | ||
|
|
e81fce4a73 | ||
|
|
93914c7b12 | ||
|
|
a03811f519 | ||
|
|
6076d0ae2f | ||
|
|
a2f12f2e41 | ||
|
|
fe18e9f7e5 | ||
|
|
1379ed974f | ||
|
|
f77576a775 | ||
|
|
9c31db8cc4 | ||
|
|
2ed532618f | ||
|
|
47a46c844c | ||
|
|
9c59b53d8b | ||
|
|
92490afb6d | ||
|
|
8e412d1ac0 | ||
|
|
c369e79c60 | ||
|
|
080ac77850 | ||
|
|
b7c2db6766 | ||
|
|
ba34974090 | ||
|
|
56e3106e93 | ||
|
|
ca5b9746c8 | ||
|
|
656c37d630 | ||
|
|
17d3924e9e | ||
|
|
3bf4bb761c | ||
|
|
d471effd85 | ||
|
|
25e3dd5365 | ||
|
|
b8da93bee9 | ||
|
|
4c9b376271 | ||
|
|
ae559eabcd | ||
|
|
8beb69b148 | ||
|
|
0814422a7d | ||
|
|
a860ca32b0 | ||
|
|
3e3f8f0161 | ||
|
|
c70fc8d87b | ||
|
|
e556eaa59e | ||
|
|
636f0e101a | ||
|
|
d1986f81d0 | ||
|
|
094e533fad | ||
|
|
accad81d2b | ||
|
|
75d6936a08 | ||
|
|
8c8bf861de | ||
|
|
5654415595 | ||
|
|
b00f87cfa3 | ||
|
|
b8e8d02861 | ||
|
|
b63b1b4ce2 | ||
|
|
0cc7aa3a29 | ||
|
|
cb75780b50 | ||
|
|
3e9a0b87d7 | ||
|
|
89157ad207 | ||
|
|
973d42b90d | ||
|
|
e1bb6139fb | ||
|
|
709a27ba48 | ||
|
|
39e668ce5b | ||
|
|
68c33a103d | ||
|
|
6555874879 | ||
|
|
39639a8a6a | ||
|
|
1f05c616d2 | ||
|
|
2e270515f7 | ||
|
|
5d9cb87197 | ||
|
|
cdd44f674b | ||
|
|
e80f3acc36 | ||
|
|
3c6e338b0f | ||
|
|
35eca590ad | ||
|
|
edb5faa297 | ||
|
|
0edca4f61f | ||
|
|
ffc29e91c4 | ||
|
|
b924d0380e | ||
|
|
def157c927 | ||
|
|
758a615bb5 | ||
|
|
433a31d3dc | ||
|
|
74695771cb | ||
|
|
ffa639900b | ||
|
|
a64e33f79b | ||
|
|
af5d0c363a | ||
|
|
c365bafa81 | ||
|
|
b1ab7101aa | ||
|
|
60a5ad4b94 | ||
|
|
a34bea4976 | ||
|
|
4319cbc0a1 | ||
|
|
5dabe472b0 | ||
|
|
736b78af4f | ||
|
|
18e4c15198 | ||
|
|
2a0e737cfd | ||
|
|
84c3fb94ac | ||
|
|
b81697cd4a | ||
|
|
b69049da7b | ||
|
|
3e53920470 | ||
|
|
4597f40b7f | ||
|
|
91bef1af62 | ||
|
|
b75e3b8569 | ||
|
|
c25152b455 | ||
|
|
e6f4b28275 | ||
|
|
689186b88c | ||
|
|
035a5ca2b0 | ||
|
|
847fbc4eba | ||
|
|
a5fa9f9cc9 | ||
|
|
99b039fead | ||
|
|
7eab7d027e | ||
|
|
58a7ead41d | ||
|
|
696f4a8042 | ||
|
|
11d4de7eb3 | ||
|
|
abdb73fc11 | ||
|
|
f62f1d302a | ||
|
|
fbaf2fbb18 | ||
|
|
b4148f567d | ||
|
|
068fa34adc | ||
|
|
f8cd8d524c | ||
|
|
43d0c30bf0 | ||
|
|
a7acdf85e4 | ||
|
|
7ba2dd8082 | ||
|
|
1641186cb3 | ||
|
|
545cbc2cc8 | ||
|
|
5cf961f0ea | ||
|
|
1b8c8befd9 | ||
|
|
65ee3d9630 | ||
|
|
17f0d568d3 | ||
|
|
3c98f1d3ee | ||
|
|
329982b723 | ||
|
|
5b0e904272 | ||
|
|
491c54ca99 | ||
|
|
beaa39a649 | ||
|
|
23d293cbc2 | ||
|
|
0359c2e1ca | ||
|
|
e2a6cbca3b | ||
|
|
49e002db5e | ||
|
|
1b246cc692 | ||
|
|
a7ec8caffe | ||
|
|
920b4416c1 | ||
|
|
ebeb56f9df | ||
|
|
308adf1691 | ||
|
|
5d0c06a24a | ||
|
|
cbade34401 | ||
|
|
dbab417753 | ||
|
|
ed2a9e9637 | ||
|
|
d423f4a14b | ||
|
|
2983e54536 | ||
|
|
57c4cb5d88 | ||
|
|
d96a863cf5 | ||
|
|
56f1bd10fc | ||
|
|
fbae6a7b39 | ||
|
|
53d36aaf9a | ||
|
|
10d190b8b6 | ||
|
|
5cb2610710 | ||
|
|
a669dfdabb | ||
|
|
0539705768 | ||
|
|
44629cf147 | ||
|
|
eb3f59b7e1 | ||
|
|
1529be6051 | ||
|
|
47b7234de3 | ||
|
|
d62bdb30f7 | ||
|
|
be23f60132 | ||
|
|
570fd054c6 | ||
|
|
b10817d9bd | ||
|
|
03a08a4cd0 | ||
|
|
28f1844cef | ||
|
|
7455bf9432 | ||
|
|
74ffe86ed0 | ||
|
|
a0cbaa4fc8 | ||
|
|
aa3a727dc0 | ||
|
|
fd9f53cfdf | ||
|
|
ec2064acc8 | ||
|
|
18b3231bbf | ||
|
|
ceb5b04614 | ||
|
|
33173e867a | ||
|
|
df0beae1eb | ||
|
|
c840cd4334 | ||
|
|
7a6a30b8a2 | ||
|
|
5c2f8101c5 | ||
|
|
eaa1c07fa1 | ||
|
|
500eccdbe4 | ||
|
|
e70487cda7 | ||
|
|
0fb836f179 | ||
|
|
4055cd5a26 | ||
|
|
d0bd493a2a | ||
|
|
698091be0e | ||
|
|
e4637b48b5 | ||
|
|
3ed2b48d10 | ||
|
|
2c57c49cc3 | ||
|
|
5fabec7fb6 | ||
|
|
940c1a61f4 | ||
|
|
6873756075 | ||
|
|
3637b9572b | ||
|
|
89907ec099 | ||
|
|
42a4957361 | ||
|
|
624d125cee | ||
|
|
bfe49f506f | ||
|
|
8138613746 | ||
|
|
4b11f24c64 | ||
|
|
58ddd2c5a1 | ||
|
|
35755454e4 | ||
|
|
adfc479d47 | ||
|
|
d6d5658df6 | ||
|
|
c370a7e62f | ||
|
|
cbdbbc4a58 | ||
|
|
505eee2f38 | ||
|
|
ddb029b0f0 | ||
|
|
a2f768f65e | ||
|
|
eea7d892c4 | ||
|
|
6e3e819f4b | ||
|
|
ec06465572 | ||
|
|
ee84700f76 | ||
|
|
d71657c17b | ||
|
|
8f3cb068fc | ||
|
|
bcc1a1625c | ||
|
|
0ea19fb55c | ||
|
|
dbb6c7b2e7 | ||
|
|
90b11ce665 | ||
|
|
d02e4e7775 | ||
|
|
22ed81c410 | ||
|
|
173524ed7d | ||
|
|
144fe359e1 | ||
|
|
2005de6be9 | ||
|
|
0918810a7d | ||
|
|
55539fc6bd | ||
|
|
a5153c5b06 | ||
|
|
fba081f923 | ||
|
|
741f851bf6 | ||
|
|
6dfe8fc30d | ||
|
|
feed02af9d | ||
|
|
a05ae2f716 | ||
|
|
b78c6b68f7 | ||
|
|
d2e5e366a1 | ||
|
|
e069d38d35 | ||
|
|
535a9fe512 | ||
|
|
9ee7933b5c | ||
|
|
e769e6e632 | ||
|
|
1490f2dbf3 | ||
|
|
ed31c612c1 | ||
|
|
d243c0e840 | ||
|
|
e1e97eccb7 | ||
|
|
8c8f3467f5 | ||
|
|
23183bb36b | ||
|
|
8188c3b48d | ||
|
|
33f95a9ab6 | ||
|
|
674ea8b2dc | ||
|
|
df03463679 | ||
|
|
fd9a6e860b | ||
|
|
3b03442c54 | ||
|
|
1b6f200c8e | ||
|
|
288524b39b | ||
|
|
26468bd5a2 | ||
|
|
813d66cea7 | ||
|
|
c12bf5fb7f | ||
|
|
9d8e077ca1 | ||
|
|
71aa3ea880 | ||
|
|
5f606e6f1f | ||
|
|
7326d1f1a6 | ||
|
|
cd098ea199 | ||
|
|
a0c8d0e0fe | ||
|
|
366aaf59dc | ||
|
|
0cf6181947 | ||
|
|
1f2c2d7053 | ||
|
|
7465b002f9 | ||
|
|
8062509aa7 | ||
|
|
0a744370bb | ||
|
|
065109af86 | ||
|
|
1e07a21459 | ||
|
|
78adb282a7 | ||
|
|
1ff9e235e7 | ||
|
|
916fcda554 | ||
|
|
d26ba897eb | ||
|
|
cee14cc42f | ||
|
|
13b2b9c342 | ||
|
|
e345806d93 | ||
|
|
89dc019451 | ||
|
|
471d33582e | ||
|
|
264021699c | ||
|
|
33342c1a0a | ||
|
|
578332c0e2 | ||
|
|
86e4b778b1 | ||
|
|
55c53863a8 | ||
|
|
432a7c21f0 | ||
|
|
43d86d8c95 | ||
|
|
7b5c057f5f | ||
|
|
17cc46a11a | ||
|
|
e7368caf47 | ||
|
|
1cea914143 | ||
|
|
685d3c3f2a | ||
|
|
e0066f36c2 | ||
|
|
b8031ff7c7 | ||
|
|
25e9ed1354 | ||
|
|
4b9ab62580 | ||
|
|
36ce675bb4 | ||
|
|
519d7a95a3 | ||
|
|
a0304574e9 | ||
|
|
01616c9404 | ||
|
|
2b25436813 | ||
|
|
811901cb41 | ||
|
|
0adc02a086 | ||
|
|
063aa30a3d | ||
|
|
c23c89db0f | ||
|
|
cdec7e6e93 | ||
|
|
cad884a245 | ||
|
|
6a0dea3ca0 | ||
|
|
85c3924ce5 | ||
|
|
a780166b41 | ||
|
|
ae60d5bc4d | ||
|
|
e1afd98589 | ||
|
|
016af51031 | ||
|
|
b1b0f5c556 | ||
|
|
6c95b3f2bf | ||
|
|
e9c3d73c14 | ||
|
|
d43b54fa51 | ||
|
|
6d8bb4df3d | ||
|
|
536ac0ff6e | ||
|
|
1211a2cc2c | ||
|
|
ca7c786f62 | ||
|
|
e82c7ddd47 | ||
|
|
8ab7f351a1 | ||
|
|
9e450601b1 | ||
|
|
a6a447fc58 | ||
|
|
ae5717158f | ||
|
|
607614ae96 | ||
|
|
02599650b1 | ||
|
|
a49f45acbe | ||
|
|
5ab25eb05b | ||
|
|
ab4f4bdc18 | ||
|
|
b3414967d5 | ||
|
|
f4a5097ea3 | ||
|
|
893ac688cc | ||
|
|
16385191ce | ||
|
|
e06252480a | ||
|
|
cdd66362dc | ||
|
|
283dadf095 | ||
|
|
3affac54ed | ||
|
|
ab402c29f9 | ||
|
|
bf8cfacd24 | ||
|
|
2539b53760 | ||
|
|
4e89cf8fb8 | ||
|
|
aa3f52d17b | ||
|
|
60f3c362f5 | ||
|
|
cebbc9ee6d | ||
|
|
0de4ae4b25 | ||
|
|
0e8bf7bffe | ||
|
|
3d19a12976 | ||
|
|
5c82d3f1ce | ||
|
|
0361f46554 | ||
|
|
9213769933 | ||
|
|
383713e030 | ||
|
|
1d85945321 | ||
|
|
25b8a7a987 | ||
|
|
14816cf338 | ||
|
|
74932c721b | ||
|
|
395fcee97a | ||
|
|
f839bfad73 | ||
|
|
4d484fe09f | ||
|
|
d63623eb7c | ||
|
|
abdf924333 | ||
|
|
a3b65a63a0 | ||
|
|
0b39324840 | ||
|
|
a301ea6697 | ||
|
|
e4e19d87a0 | ||
|
|
848bd19d21 | ||
|
|
aefac2c02e | ||
|
|
add8b36148 | ||
|
|
c6922b6f7e | ||
|
|
c2bbd117f5 | ||
|
|
447b254923 | ||
|
|
301fbaf431 | ||
|
|
8a86223d45 | ||
|
|
adcfd944a8 | ||
|
|
85ddc626be | ||
|
|
5a7fe9c0f8 | ||
|
|
3459fe4506 | ||
|
|
380c858b71 | ||
|
|
1411a53dc1 | ||
|
|
e80cace874 | ||
|
|
23c34b8bd9 | ||
|
|
e4779654bd | ||
|
|
da538a3975 | ||
|
|
5349e96a32 | ||
|
|
5a233cb81e | ||
|
|
5dd7f137b7 | ||
|
|
1532bea5b5 | ||
|
|
5320d0fef1 | ||
|
|
bc5faec34a | ||
|
|
4010e2d077 | ||
|
|
8c94771b88 | ||
|
|
3ea540c757 | ||
|
|
85d6c618b0 | ||
|
|
7e591c1009 | ||
|
|
87516b80a5 | ||
|
|
56fc172d11 | ||
|
|
8487f9c6bd | ||
|
|
0f63eebd1e | ||
|
|
a0faff1a58 | ||
|
|
59312fa3f9 | ||
|
|
2fa23f1f86 | ||
|
|
311b6df344 | ||
|
|
2e6e036896 | ||
|
|
b60a32376e | ||
|
|
1efda4faf3 | ||
|
|
de73024977 | ||
|
|
beeade1473 | ||
|
|
c634bb97af | ||
|
|
c3abd70c67 | ||
|
|
85fb8411dd | ||
|
|
804bdc3001 | ||
|
|
25cdc8248d | ||
|
|
826ff082db | ||
|
|
59e889f0f3 | ||
|
|
3440b65ecf | ||
|
|
a59975a3fd | ||
|
|
373c95c45a | ||
|
|
c63f4506cc | ||
|
|
85de525557 | ||
|
|
13e4c87ff6 | ||
|
|
de540a76eb | ||
|
|
02b2e48b12 | ||
|
|
5bc4b89be8 | ||
|
|
93ff956de7 | ||
|
|
553d347d3e | ||
|
|
b1d89070f6 | ||
|
|
20bc0790a7 | ||
|
|
7828d1b4e2 | ||
|
|
5b3313c120 | ||
|
|
0edae5eee6 | ||
|
|
11f43d2e22 | ||
|
|
87c54fa0ae | ||
|
|
3715c01f8e | ||
|
|
d2c7d7b58f | ||
|
|
d1e5a7af56 | ||
|
|
369aaf7e5d | ||
|
|
39e85b7258 | ||
|
|
487e5317be | ||
|
|
112b9537dd | ||
|
|
24045feb85 | ||
|
|
64f972e94b | ||
|
|
0c1e917d6c | ||
|
|
1e7a0f088b | ||
|
|
fd6fc97156 | ||
|
|
04131454e3 | ||
|
|
bc86cb44e3 | ||
|
|
0a538a2488 | ||
|
|
ca4f28bc83 | ||
|
|
36aeb30081 | ||
|
|
fe3fbf2f54 | ||
|
|
d9079b12e3 | ||
|
|
222b7c46bd | ||
|
|
4bf9fe82c0 | ||
|
|
fe068c60fb | ||
|
|
e3864a430e | ||
|
|
2639ed8208 | ||
|
|
09aab8cb41 | ||
|
|
9abd8baaaa | ||
|
|
551bed87fa | ||
|
|
b7a568ece8 | ||
|
|
2871ad3b45 | ||
|
|
f0537a71f1 | ||
|
|
1187f011d3 | ||
|
|
c872a5f7bb | ||
|
|
fe4f1227a5 | ||
|
|
13a4b23e79 | ||
|
|
b655a2154e | ||
|
|
272d99e7a3 | ||
|
|
262963212b | ||
|
|
ea42025c70 | ||
|
|
7daf29845b | ||
|
|
5703f662b7 | ||
|
|
b3b6f52fad | ||
|
|
f6f2846bd8 | ||
|
|
e5dbc71841 | ||
|
|
b2a48ec240 | ||
|
|
c62a7156c5 | ||
|
|
195108489b | ||
|
|
55bc95b4d3 | ||
|
|
d480544281 | ||
|
|
817d0261eb | ||
|
|
898d3df2f8 | ||
|
|
9317cccb8f | ||
|
|
cc2d4f6c46 | ||
|
|
471eca0dd6 | ||
|
|
e98137ddd4 | ||
|
|
1b2056c435 | ||
|
|
f92a08e171 | ||
|
|
3ea177e3fa | ||
|
|
75460e090c | ||
|
|
90390c6a92 | ||
|
|
63813d0950 | ||
|
|
2e140cfb42 | ||
|
|
33176a7269 | ||
|
|
813de08e50 | ||
|
|
5a8a00e16e | ||
|
|
54bdcc09ae | ||
|
|
cb121d8f36 | ||
|
|
3a9070dce7 | ||
|
|
93f9b9be84 | ||
|
|
4e73fea3e3 | ||
|
|
c450b625b4 | ||
|
|
f48ca7f500 | ||
|
|
c25841e0d4 | ||
|
|
45a35825dc | ||
|
|
cc388d140c | ||
|
|
c46549dc38 | ||
|
|
2d2255272d | ||
|
|
4cf919bcdf | ||
|
|
d7226387a9 | ||
|
|
dd99d05b4a | ||
|
|
fd32ffb4da | ||
|
|
c363fcb9f0 | ||
|
|
e189deb855 | ||
|
|
aeb892e592 | ||
|
|
6819756293 | ||
|
|
c95bb0c6f0 | ||
|
|
d07d81df27 | ||
|
|
516f42ab40 | ||
|
|
d163cd681a | ||
|
|
0d8ca457b3 | ||
|
|
e152d05d82 | ||
|
|
a09b047947 | ||
|
|
bbb61fa617 | ||
|
|
0c2d21d3f2 | ||
|
|
d282370566 | ||
|
|
b28a8851ed | ||
|
|
1c73876f5f | ||
|
|
251f774621 | ||
|
|
1d72903faf | ||
|
|
6d8e33952a | ||
|
|
82276cbd2e | ||
|
|
c5d2da8ac8 | ||
|
|
31bb8a431a | ||
|
|
c544a36826 | ||
|
|
bbe4be0c9a | ||
|
|
9f2adbf0be | ||
|
|
449a3751d1 | ||
|
|
e4eaba04dd | ||
|
|
fc9b328ab4 | ||
|
|
c1f8d48387 | ||
|
|
e7420f9781 | ||
|
|
2b0483aa03 | ||
|
|
8fb6d7a9b9 | ||
|
|
9140950afb | ||
|
|
cee06314e1 | ||
|
|
ebc2235bd7 | ||
|
|
cece28a8bc | ||
|
|
e0b3b059b2 | ||
|
|
2d2a0c8311 | ||
|
|
11b626c20f | ||
|
|
a16f807d7e | ||
|
|
a0b2bc8de7 | ||
|
|
a0d74a99b7 | ||
|
|
124adb3a19 | ||
|
|
054defae19 | ||
|
|
1f7d56fda5 | ||
|
|
f33168da95 | ||
|
|
590a3f5b08 | ||
|
|
94986c1d0a | ||
|
|
bdbd5d31f8 | ||
|
|
3d63c453d5 | ||
|
|
e175f0d5b2 | ||
|
|
fd77348fef | ||
|
|
03b1e07ae0 | ||
|
|
0928c2414a | ||
|
|
d1ad73e0bf | ||
|
|
1e23a1785a | ||
|
|
54050ea91d | ||
|
|
aa5a4fc172 | ||
|
|
bb4112b407 | ||
|
|
c12e44d891 | ||
|
|
9c88531fb0 | ||
|
|
9afcb30571 | ||
|
|
4e2fd4cca6 | ||
|
|
c6357f0cab | ||
|
|
fbcbba4b94 | ||
|
|
48545b5756 | ||
|
|
b5f1873022 | ||
|
|
dad7d86d57 | ||
|
|
bce110cdd5 | ||
|
|
37bcc27707 | ||
|
|
ab58de37e6 | ||
|
|
4082e3be7c | ||
|
|
11bcfcc72a | ||
|
|
aa6a5547b3 | ||
|
|
c8e51ae68a | ||
|
|
2ed0544df4 | ||
|
|
3b933f1e33 | ||
|
|
99d9e13b9c | ||
|
|
419aa62c46 | ||
|
|
482366105a | ||
|
|
f28e07f81d | ||
|
|
8563b4c051 | ||
|
|
f0b5e513d9 | ||
|
|
3b8560a637 | ||
|
|
b5ef9617c4 | ||
|
|
747e7a8da8 | ||
|
|
d2ec687c1c | ||
|
|
457b4e69f5 | ||
|
|
d08d66ebc6 | ||
|
|
5017d1b4e1 | ||
|
|
841d9a7d5d | ||
|
|
67b9752cd1 | ||
|
|
88891aef7e | ||
|
|
bbcfef38a3 | ||
|
|
2eea35fcf2 | ||
|
|
f20cd37e51 | ||
|
|
4b9e987554 | ||
|
|
f24ff8f42b | ||
|
|
699188aa87 | ||
|
|
a828a78563 | ||
|
|
2d4cd37758 | ||
|
|
f0ee72aa01 | ||
|
|
c8ef95eaed | ||
|
|
d69fc66d81 | ||
|
|
4e48b4ce33 | ||
|
|
6f005c8491 | ||
|
|
6f3efa15eb | ||
|
|
33de42f2a8 | ||
|
|
c97742932a | ||
|
|
a6a1e73c0a | ||
|
|
c3154b2947 | ||
|
|
24852bf5b5 | ||
|
|
56007809c3 | ||
|
|
629214eaf8 | ||
|
|
ae3f43d3eb | ||
|
|
ec95137cc3 | ||
|
|
ae3ee95eb8 | ||
|
|
a6895a8da2 | ||
|
|
8d550c12b8 | ||
|
|
0ee9adb1fa | ||
|
|
0473e718e6 | ||
|
|
dab023dec1 | ||
|
|
939c480a79 | ||
|
|
07af816554 | ||
|
|
6b49da0dc3 | ||
|
|
f044d2d51c | ||
|
|
565b165115 | ||
|
|
9f1b96313e | ||
|
|
fc92148eac | ||
|
|
a4f7b723f0 | ||
|
|
e7f7dcb9d1 | ||
|
|
545df07893 | ||
|
|
8406e92795 | ||
|
|
1ea616697a | ||
|
|
5e585ffe84 | ||
|
|
370370c8e4 | ||
|
|
ba45154d8e | ||
|
|
6e7e2709c8 | ||
|
|
aa0fb1e032 | ||
|
|
1ddf7faf11 | ||
|
|
db7092bed3 | ||
|
|
97136cb93f | ||
|
|
9b06af3367 | ||
|
|
a45772d52d | ||
|
|
a43ee65ee5 | ||
|
|
549bbdf7b4 | ||
|
|
5e2f415d17 | ||
|
|
d6a37dfa3b | ||
|
|
8ec7811e82 | ||
|
|
08dcc35470 | ||
|
|
17a7d2c81b | ||
|
|
a23c91026d | ||
|
|
1ce71652fc | ||
|
|
1b95d5ee81 | ||
|
|
6b7c67ad88 | ||
|
|
02e24f2593 | ||
|
|
5891b7ce21 | ||
|
|
c8092e5db0 | ||
|
|
8cafe0070a | ||
|
|
d0275e280e | ||
|
|
37012effc9 | ||
|
|
a409011bba | ||
|
|
a3ae3e8085 | ||
|
|
3ccd02d5b9 | ||
|
|
5272c6daa1 | ||
|
|
e750c5cac8 | ||
|
|
92210636da |
13
.cvsignore
13
.cvsignore
@@ -1,13 +0,0 @@
|
||||
*.cache
|
||||
*.lineno
|
||||
*.log
|
||||
.kludge-stamp
|
||||
ABOUT-NLS
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
THANKS-to-translators
|
||||
aclocal.m4
|
||||
config.status
|
||||
configure
|
||||
coreutils-*
|
||||
33
.gitignore
vendored
33
.gitignore
vendored
@@ -1,11 +1,11 @@
|
||||
*.1
|
||||
*.I[12]
|
||||
*.[EIOX]
|
||||
*.gmo
|
||||
*.o
|
||||
*/.deps
|
||||
*~
|
||||
.kludge-stamp
|
||||
.gdb-history
|
||||
.version
|
||||
ABOUT-NLS
|
||||
INSTALL
|
||||
Makefile
|
||||
@@ -23,17 +23,46 @@ coreutils-*.tar.bz2
|
||||
coreutils-*.tar.bz2.sig
|
||||
coreutils-*.tar.gz
|
||||
coreutils-*.tar.gz.sig
|
||||
coreutils-*.tar.lzma
|
||||
coreutils-*.tar.lzma.sig
|
||||
coreutils-*.xdelta
|
||||
coreutils-*.xdelta.sig
|
||||
lib/.cvsignore
|
||||
lib/.gitignore
|
||||
lib/charset.alias
|
||||
lib/configmake.h
|
||||
lib/uniwidth/
|
||||
m4/.cvsignore
|
||||
m4/.gitignore
|
||||
po/*.gmo
|
||||
po/*.po
|
||||
po/LINGUAS
|
||||
po/Makefile.in
|
||||
po/Makevars
|
||||
po/POTFILES
|
||||
po/coreutils.pot
|
||||
po/stamp-po
|
||||
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
|
||||
|
||||
147
.hgignore
147
.hgignore
@@ -1,147 +0,0 @@
|
||||
.*/Makefile$
|
||||
.*/Makefile\.in$
|
||||
.*/\.deps/
|
||||
.*\.1$
|
||||
.*\.o$
|
||||
.*~$
|
||||
^Makefile$
|
||||
^Makefile\.in$
|
||||
^THANKS-to-translators$
|
||||
^aclocal\.m4$
|
||||
^autom4te\.cache/
|
||||
^config\.h$
|
||||
^config\.hin$
|
||||
^config\.log$
|
||||
^config\.status$
|
||||
^configure$
|
||||
^doc/constants\.texi$
|
||||
^doc/coreutils\.info$
|
||||
^doc/stamp-vti$
|
||||
^doc/version\.texi$
|
||||
^lib/alloca\.h$
|
||||
^lib/charset\.alias$
|
||||
^lib/getdate\.c$
|
||||
^lib/libcoreutils\.a$
|
||||
^lib/ref-add\.sed$
|
||||
^lib/ref-del\.sed$
|
||||
^lib/t-fpending$
|
||||
^po/.*\.gmo$
|
||||
^po/.*\.po$
|
||||
^po/POTFILES$
|
||||
^po/stamp-po$
|
||||
^po/remove-potcdate.sed$
|
||||
^src/\[$
|
||||
^src/base64$
|
||||
^src/basename$
|
||||
^src/cat$
|
||||
^src/chgrp$
|
||||
^src/chmod$
|
||||
^src/chown$
|
||||
^src/chroot$
|
||||
^src/cksum$
|
||||
^src/comm$
|
||||
^src/cp$
|
||||
^src/csplit$
|
||||
^src/cut$
|
||||
^src/date$
|
||||
^src/dd$
|
||||
^src/df$
|
||||
^src/dir$
|
||||
^src/dircolors$
|
||||
^src/dircolors\.h$
|
||||
^src/dirname$
|
||||
^src/du$
|
||||
^src/echo$
|
||||
^src/env$
|
||||
^src/expand$
|
||||
^src/expr$
|
||||
^src/factor$
|
||||
^src/false$
|
||||
^src/fmt$
|
||||
^src/fold$
|
||||
^src/fs\.h$
|
||||
^src/ginstall$
|
||||
^src/groups$
|
||||
^src/head$
|
||||
^src/hostid$
|
||||
^src/hostname$
|
||||
^src/id$
|
||||
^src/join$
|
||||
^src/kill$
|
||||
^src/link$
|
||||
^src/ln$
|
||||
^src/localedir\.h$
|
||||
^src/logname$
|
||||
^src/ls$
|
||||
^src/md5sum$
|
||||
^src/mkdir$
|
||||
^src/mkfifo$
|
||||
^src/mknod$
|
||||
^src/mv$
|
||||
^src/nice$
|
||||
^src/nl$
|
||||
^src/nohup$
|
||||
^src/od$
|
||||
^src/paste$
|
||||
^src/pathchk$
|
||||
^src/pinky$
|
||||
^src/pr$
|
||||
^src/printenv$
|
||||
^src/printf$
|
||||
^src/ptx$
|
||||
^src/pwd$
|
||||
^src/readlink$
|
||||
^src/rm$
|
||||
^src/rmdir$
|
||||
^src/seq$
|
||||
^src/setuidgid$
|
||||
^src/sha1sum$
|
||||
^src/sha224sum$
|
||||
^src/sha256sum$
|
||||
^src/sha384sum$
|
||||
^src/sha512sum$
|
||||
^src/shred$
|
||||
^src/sleep$
|
||||
^src/sort$
|
||||
^src/split$
|
||||
^src/stat$
|
||||
^src/stty$
|
||||
^src/su$
|
||||
^src/sum$
|
||||
^src/sync$
|
||||
^src/tac$
|
||||
^src/tail$
|
||||
^src/tee$
|
||||
^src/test$
|
||||
^src/touch$
|
||||
^src/tr$
|
||||
^src/true$
|
||||
^src/tsort$
|
||||
^src/tty$
|
||||
^src/uname$
|
||||
^src/unexpand$
|
||||
^src/uniq$
|
||||
^src/unlink$
|
||||
^src/uptime$
|
||||
^src/users$
|
||||
^src/vdir$
|
||||
^src/wc$
|
||||
^src/wheel-size\.h$
|
||||
^src/wheel\.h$
|
||||
^src/who$
|
||||
^src/whoami$
|
||||
^src/yes$
|
||||
^stamp-h1$
|
||||
^tests/.*\.I[12]$
|
||||
^tests/.*\.[EIOX]$
|
||||
^tests/cut/cut-tests$
|
||||
^tests/head/head-tests$
|
||||
^tests/join/join-tests$
|
||||
^tests/pr/pr-tests$
|
||||
^tests/sort/sort-tests$
|
||||
^tests/tac/tac-tests$
|
||||
^tests/tail/tail-tests$
|
||||
^tests/test/test-tests$
|
||||
^tests/tr/tr-tests$
|
||||
^tests/uniq/uniq-tests$
|
||||
^tests/wc/wc-tests$
|
||||
@@ -1 +1 @@
|
||||
6.5
|
||||
6.9.92
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# Suppress valgrind diagnostics we don't care about.
|
||||
|
||||
# Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2004, 2006-2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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,
|
||||
@@ -13,9 +13,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
{
|
||||
libc_dl_open
|
||||
@@ -77,3 +75,18 @@
|
||||
fun:strlen
|
||||
fun:fillin_rpath
|
||||
}
|
||||
{
|
||||
libc-getpwuid-leak
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:nss_parse_service_list
|
||||
fun:__nss_database_lookup
|
||||
obj:*
|
||||
obj:*
|
||||
fun:getpwuid_r@@GLIBC_2.2.5
|
||||
fun:getpwuid
|
||||
fun:getuser
|
||||
fun:format_user_width
|
||||
fun:gobble_file
|
||||
fun:main
|
||||
}
|
||||
|
||||
1
.x-sc_GPL_version
Normal file
1
.x-sc_GPL_version
Normal file
@@ -0,0 +1 @@
|
||||
^build-aux/check\.mk$
|
||||
@@ -5,3 +5,4 @@ config-log
|
||||
po/
|
||||
src/df.c
|
||||
src/stat.c
|
||||
tests/misc/df-P
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
^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$
|
||||
|
||||
2
.x-sc_prohibit_strcmp
Normal file
2
.x-sc_prohibit_strcmp
Normal file
@@ -0,0 +1,2 @@
|
||||
^src/system\.h
|
||||
ChangeLog
|
||||
@@ -26,3 +26,5 @@
|
||||
^src/ls-vdir\.c$
|
||||
^src/rand-isaac\.c$
|
||||
^src/tac-pipe\.c$
|
||||
^src/uname-arch\.c$
|
||||
^src/uname-uname\.c$
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
^lib/strtod.c
|
||||
^lib/xstrtol.c
|
||||
^m4/
|
||||
^tests/misc/pwd-unreadable-parent
|
||||
|
||||
4
AUTHORS
4
AUTHORS
@@ -1,9 +1,11 @@
|
||||
Here are the names of the programs in this package,
|
||||
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
|
||||
chcon: Russell Coker, Jim Meyering
|
||||
chgrp: David MacKenzie, Jim Meyering
|
||||
chmod: David MacKenzie, Jim Meyering
|
||||
chown: David MacKenzie, Jim Meyering
|
||||
@@ -44,6 +46,7 @@ md5sum: Ulrich Drepper, Scott Miller, David Madore
|
||||
mkdir: David MacKenzie
|
||||
mkfifo: David MacKenzie
|
||||
mknod: David MacKenzie
|
||||
mktemp: Jim Meyering
|
||||
mv: Mike Parker, David MacKenzie, Jim Meyering
|
||||
nice: David MacKenzie
|
||||
nl: Scott Bartram, David MacKenzie
|
||||
@@ -60,6 +63,7 @@ pwd: Jim Meyering
|
||||
readlink: Dmitry V. Levin
|
||||
rm: Paul Rubin, David MacKenzie, Richard Stallman, Jim Meyering
|
||||
rmdir: David MacKenzie
|
||||
runcon: Russell Coker
|
||||
seq: Ulrich Drepper
|
||||
sha1sum: Ulrich Drepper, Scott Miller, David Madore
|
||||
sha224sum: Ulrich Drepper, Scott Miller, David Madore
|
||||
|
||||
841
COPYING
841
COPYING
@@ -1,285 +1,626 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
0. Definitions.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
1. Source Code.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
2. Basic Permissions.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
14. Revised Versions of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
NO WARRANTY
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
16. Limitation of Liability.
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2 of the License, or
|
||||
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,
|
||||
@@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
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, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
29
GNUmakefile
29
GNUmakefile
@@ -4,21 +4,20 @@
|
||||
# It is necessary if you want to build targets usually of interest
|
||||
# only to the maintainer.
|
||||
|
||||
# Copyright (C) 2001, 2003, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
# 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.
|
||||
@@ -40,6 +39,20 @@ ifeq ($(have-Makefile),yes)
|
||||
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
|
||||
|
||||
|
||||
46
Makefile.am
46
Makefile.am
@@ -1,11 +1,10 @@
|
||||
# Make coreutils. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1990, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
# 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1990, 1993-2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,29 +13,27 @@
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
SUBDIRS = lib src doc man po tests
|
||||
SUBDIRS = lib src doc man po tests gnulib-tests
|
||||
EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
|
||||
.gitignore \
|
||||
.hgignore \
|
||||
.kludge-stamp .prev-version THANKS-to-translators THANKStt.in \
|
||||
.prev-version THANKS-to-translators THANKStt.in \
|
||||
.vg-suppressions \
|
||||
.x-po-check \
|
||||
.x-sc_GPL_version \
|
||||
.x-sc_file_system .x-sc_obsolete_symbols \
|
||||
.x-sc_prohibit_atoi_atof \
|
||||
.x-sc_prohibit_strcmp \
|
||||
.x-sc_require_config_h \
|
||||
.x-sc_space_tab .x-sc_sun_os_names \
|
||||
.x-sc_trailing_blank \
|
||||
.x-sc_unmarked_diagnostics \
|
||||
.x-sc_useless_cpp_parens \
|
||||
ChangeLog-2005 \
|
||||
announce-gen \
|
||||
bootstrap \
|
||||
bootstrap.conf \
|
||||
build-aux/cvsu \
|
||||
build-aux/git-version-gen \
|
||||
build-aux/vc-list-files \
|
||||
gl/modules/getloadavg.diff \
|
||||
m4/ChangeLog \
|
||||
@@ -58,12 +55,6 @@ ACLOCAL_AMFLAGS = -I m4
|
||||
check-root:
|
||||
cd tests && $(MAKE) $@
|
||||
|
||||
dist-hook:
|
||||
test -x $(srcdir)/build-aux/install-sh
|
||||
|
||||
distcheck-hook:
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
# Just prior to distribution, ...
|
||||
# transform the automake-generated rule that runs `rm -f rm'.
|
||||
# On some systems, that command would fail with a diagnostic like
|
||||
@@ -71,16 +62,21 @@ distcheck-hook:
|
||||
# in the shell's search path that running `rm' would run the `rm'
|
||||
# executable in the current directory.
|
||||
# Similarly, adjust the clean-binPROGRAMS rule.
|
||||
|
||||
rm_subst = \
|
||||
s!(rm -f (rm|\$$\(bin_PROGRAMS\)))$$!$$1 > /dev/null 2>&1 || /bin/$$1!
|
||||
MAINTAINERCLEANFILES = .kludge-stamp
|
||||
.kludge-stamp: $(srcdir)/src/Makefile.in
|
||||
perl -pi -e '$(rm_subst)' $(srcdir)/src/Makefile.in
|
||||
touch $@
|
||||
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.
|
||||
# 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
|
||||
perl -pi -e '$(rm_subst)' $(distdir)/src/Makefile.in
|
||||
|
||||
MAINTAINERCLEANFILES += THANKS-to-translators
|
||||
distcheck-hook:
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
MAINTAINERCLEANFILES = THANKS-to-translators
|
||||
THANKS-to-translators: po/LINGUAS THANKStt.in
|
||||
( \
|
||||
cat $(srcdir)/THANKStt.in; \
|
||||
|
||||
20
Makefile.cfg
20
Makefile.cfg
@@ -1,10 +1,10 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# Copyright (C) 2003-2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
# 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
|
||||
@@ -12,9 +12,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# 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.
|
||||
@@ -27,10 +25,14 @@ url_dir_list = \
|
||||
ftp://$(gnu_rel_host)/gnu/coreutils
|
||||
|
||||
# The GnuPG ID of the key used to sign the tarballs.
|
||||
gpg_key_ID = D333CBA1
|
||||
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
|
||||
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
|
||||
|
||||
246
Makefile.maint
246
Makefile.maint
@@ -2,12 +2,12 @@
|
||||
# This Makefile fragment is shared between the coreutils,
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2006 Free Software Foundation, Inc.
|
||||
## Copyright (C) 2001-2008 Free Software Foundation, Inc.
|
||||
##
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## 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 2, or (at your option)
|
||||
## any later version.
|
||||
## 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
|
||||
@@ -15,9 +15,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, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301, USA.
|
||||
## 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))
|
||||
@@ -32,6 +30,7 @@ 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
|
||||
|
||||
@@ -45,9 +44,15 @@ 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.
|
||||
@@ -68,23 +73,23 @@ export LC_ALL = C
|
||||
# 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 writable-files m4-check author_mark_check \
|
||||
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))
|
||||
local-check := $(filter-out $(local-checks-to-skip), $(local-checks-available))
|
||||
|
||||
# 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)
|
||||
|
||||
syntax-check: $(syntax-check-rules)
|
||||
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; \
|
||||
@@ -97,21 +102,17 @@ syntax-check: $(syntax-check-rules)
|
||||
# FIXME: don't allow `#include .strings\.h' anywhere
|
||||
|
||||
sc_cast_of_argument_to_free:
|
||||
@grep -nE '\<free \(\(' $(srcdir)/{lib,src}/*.[chly] && \
|
||||
@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 --exclude=$(srcdir)/lib/xalloc.h \
|
||||
--exclude=$(srcdir)/lib/regex.c \
|
||||
'\*\) *x(m|c|re)alloc\>' \
|
||||
$(srcdir)/{lib,src}/*.[chy] && \
|
||||
@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\>' \
|
||||
$(srcdir)/src/*.[chy] && \
|
||||
@grep -nE '\*\) *alloca\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): don'\''t cast alloca return value' 1>&2; \
|
||||
exit 1; } || :
|
||||
|
||||
@@ -120,18 +121,25 @@ sc_space_tab:
|
||||
{ echo '$(ME): found SPACE-TAB sequence; remove the SPACE' \
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
# Don't use the old ato* functions in `real' code.
|
||||
# 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 '\<ato([filq]|ll)\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
||||
@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,' \
|
||||
@grep -nF 'error (EXIT_SUCCESS,' \
|
||||
$$(find -type f -name '*.[chly]') && \
|
||||
{ echo '$(ME): found error (EXIT_SUCCESS' 1>&2; \
|
||||
exit 1; } || :
|
||||
@@ -170,6 +178,30 @@ sc_prohibit_assert_without_use:
|
||||
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)) && \
|
||||
@@ -211,7 +243,9 @@ sc_prohibit_jm_in_m4:
|
||||
1>&2; exit 1; } || :
|
||||
|
||||
sc_root_tests:
|
||||
@t1=sc-root.expected; t2=sc-root.actual; \
|
||||
@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' \
|
||||
@@ -220,7 +254,8 @@ sc_root_tests:
|
||||
rm -f $$t1 $$t2; \
|
||||
test "$$diff" \
|
||||
&& { echo 'tests/Makefile.am: missing check-root action'>&2; \
|
||||
exit 1; } || :
|
||||
exit 1; } || :; \
|
||||
fi
|
||||
|
||||
headers_with_interesting_macro_defs = \
|
||||
exit.h \
|
||||
@@ -300,7 +335,7 @@ sc_trailing_blank:
|
||||
# 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-]*\])?
|
||||
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)) && \
|
||||
@@ -324,18 +359,27 @@ sc_useless_cpp_parens:
|
||||
{ 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 -V never --fuzz=0) < src/c99-to-c89.diff \
|
||||
(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 || :
|
||||
if test "$${REGEN_PATCH+set}" = set; then \
|
||||
diff -upr src src-c89 > new-diff || : ; fi
|
||||
fail=0; test -s $@.2 && fail=1 || : ; \
|
||||
rm -rf src-c89 $@.1 $@.2; \
|
||||
test $$fail = 0
|
||||
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,
|
||||
@@ -363,22 +407,22 @@ makefile-check:
|
||||
&& { 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; \
|
||||
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; \
|
||||
if head ChangeLog | grep 'Version $(VERSION_REGEXP)\.$$' \
|
||||
>/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
m4-check:
|
||||
@@ -396,6 +440,7 @@ po-check:
|
||||
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]) \
|
||||
@@ -444,7 +489,10 @@ writable-files:
|
||||
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) \
|
||||
@@ -452,21 +500,17 @@ copyright-check:
|
||||
|| { echo 'out of date copyright in $(v_etc_file); update it' 1>&2; \
|
||||
exit 1; }; \
|
||||
fi
|
||||
|
||||
|
||||
# Sanity checks with the repository.
|
||||
# Abort early if this tag has already been used.
|
||||
vc-tag-check:
|
||||
used=no; \
|
||||
if $(VC) --help | grep CVS; then \
|
||||
$(CVS) -n log -h README|grep -e $(this-vc-tag): >/dev/null \
|
||||
&& used=yes; \
|
||||
else \
|
||||
$(GIT) tag -l '^$(this-vc-tag)$$' && used=yes; \
|
||||
fi; \
|
||||
if test "$$used" = yes; then \
|
||||
echo "$(this-vc-tag) has already been used; not tagging" 1>&2; \
|
||||
exit 1; \
|
||||
@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:
|
||||
@@ -479,18 +523,16 @@ vc-diff-check:
|
||||
rm vc-diffs; \
|
||||
fi
|
||||
|
||||
cvs-check: vc-diff-check vc-tag-check
|
||||
cvs-check: vc-diff-check
|
||||
|
||||
maintainer-distcheck:
|
||||
$(MAKE) distcheck
|
||||
$(MAKE) my-distcheck
|
||||
|
||||
|
||||
# Tag before making distribution. Also, don't make a distribution if
|
||||
# checks fail. Also, make sure the NEWS file is up-to-date.
|
||||
# FIXME: use dist-hook/my-dist like distcheck-hook/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
|
||||
$(VC) tag $(this-vc-tag)
|
||||
$(MAKE) dist
|
||||
|
||||
# Use this to make sure we don't run these programs when building
|
||||
@@ -502,29 +544,61 @@ null_AM_MAKEFLAGS = \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
# Detect format-string/arg-list mismatches that would normally be obscured
|
||||
# by the use of _(). The --disable-nls effectively defines away that macro,
|
||||
# and building with CFLAGS='-Wformat -Werror' causes any format warning to be
|
||||
# treated as a failure. Also, check for shadowing problems with -Wshadow,
|
||||
# and for pointer arithmetic problems with -Wpointer-arith.
|
||||
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)
|
||||
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='-Werror -Wall -Wformat -Wshadow -Wpointer-arith' \
|
||||
&& $(MAKE) CFLAGS='$(warn_cflags)' \
|
||||
AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \
|
||||
&& $(MAKE) dvi \
|
||||
&& $(MAKE) check \
|
||||
&& 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"; \
|
||||
@@ -543,19 +617,30 @@ rel-check:
|
||||
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)
|
||||
@./announce-gen \
|
||||
@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 \
|
||||
$(addprefix --url-dir=, $(url_dir_list)) \
|
||||
|
||||
--bootstrap-tools=autoconf,automake,bison,gnulib \
|
||||
--gnulib-version=$(gnulib-version) \
|
||||
$(addprefix --url-dir=, $(url_dir_list))
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
@@ -571,7 +656,7 @@ emit_upload_commands:
|
||||
@echo =====================================
|
||||
@echo =====================================
|
||||
@echo "$(srcdir)/build-aux/gnupload $(GNUPLOADFLAGS) \\"
|
||||
@echo " --to $(gnu_rel_host):coreutils \\"
|
||||
@echo " --to $(gnu_rel_host):$(PACKAGE) \\"
|
||||
@echo " $(rel-files)"
|
||||
@echo '# send the /tmp/announcement e-mail'
|
||||
@echo =====================================
|
||||
@@ -581,12 +666,13 @@ $(xd-delta): $(release_archive_dir)/$(prev-tgz) $(distdir).tar.gz
|
||||
xdelta delta -9 $^ $@ || :
|
||||
|
||||
.PHONY: alpha beta major
|
||||
alpha beta major: news-date-check changelog-check $(local-check)
|
||||
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)
|
||||
|
||||
337
NEWS
337
NEWS
@@ -1,5 +1,342 @@
|
||||
GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
* Noteworthy changes in release 6.10 (2008-01-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
Fix a non-portable use of sed in configure.ac.
|
||||
[bug introduced in coreutils-6.9.92]
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.9.92 (2008-01-12) [beta]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
cp --parents no longer uses uninitialized memory when restoring the
|
||||
permissions of a just-created destination directory.
|
||||
[bug introduced in coreutils-6.9.90]
|
||||
|
||||
tr's case conversion would fail in a locale with differing numbers
|
||||
of lower case and upper case characters. E.g., this would fail:
|
||||
env LC_CTYPE=en_US.ISO-8859-1 tr '[:upper:]' '[:lower:]'
|
||||
[bug introduced in coreutils-6.9.90]
|
||||
|
||||
** Improvements
|
||||
|
||||
"touch -d now writable-but-owned-by-someone-else" now succeeds
|
||||
whenever that same command would succeed without "-d now".
|
||||
Before, it would work fine with no -d option, yet it would
|
||||
fail with the ostensibly-equivalent "-d now".
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.9.91 (2007-12-15) [beta]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
"ls -l" would not output "+" on SELinux hosts unless -Z was also given.
|
||||
|
||||
"rm" would fail to unlink a non-directory when run in an environment
|
||||
in which the user running rm is capable of unlinking a directory.
|
||||
[bug introduced in coreutils-6.9]
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.9.90 (2007-12-01) [beta]
|
||||
|
||||
** New programs
|
||||
|
||||
arch: equivalent to uname -m, not installed by default
|
||||
But don't install this program on Solaris systems.
|
||||
|
||||
chcon: change the SELinux security context of a file
|
||||
|
||||
mktemp: create a temporary file or directory (or names)
|
||||
|
||||
runcon: run a program in a different SELinux security context
|
||||
|
||||
** Programs no longer installed by default
|
||||
|
||||
hostname, su
|
||||
|
||||
** Changes in behavior
|
||||
|
||||
cp, by default, refuses to copy through a dangling destination symlink
|
||||
Set POSIXLY_CORRECT if you require the old, risk-prone behavior.
|
||||
|
||||
pr -F no longer suppresses the footer or the first two blank lines in
|
||||
the header. This is for compatibility with BSD and POSIX.
|
||||
|
||||
tr now warns about an unescaped backslash at end of string.
|
||||
The tr from coreutils-5.2.1 and earlier would fail for such usage,
|
||||
and Solaris' tr ignores that final byte.
|
||||
|
||||
** New features
|
||||
|
||||
Add SELinux support, based on the patch from Fedora:
|
||||
* cp accepts new --preserve=context option.
|
||||
* "cp -a" works with SELinux:
|
||||
Now, cp -a attempts to preserve context, but failure to do so does
|
||||
not change cp's exit status. However "cp --preserve=context" is
|
||||
similar, but failure *does* cause cp to exit with nonzero status.
|
||||
* install accepts new "-Z, --context=C" option.
|
||||
* id accepts new "-Z" option.
|
||||
* stat honors the new %C format directive: SELinux security context string
|
||||
* ls accepts a slightly modified -Z option.
|
||||
* ls: contrary to Fedora version, does not accept --lcontext and --scontext
|
||||
|
||||
cp -p tries to preserve the GID of a file even if preserving the UID
|
||||
is not possible.
|
||||
|
||||
uniq accepts a new option: --zero-terminated (-z). As with the sort
|
||||
option of the same name, this makes uniq consume and produce
|
||||
NUL-terminated lines rather than newline-terminated lines.
|
||||
|
||||
wc no longer warns about character decoding errors in multibyte locales.
|
||||
This means for example that "wc /bin/sh" now produces normal output
|
||||
(though the word count will have no real meaning) rather than many
|
||||
error messages.
|
||||
|
||||
** New build options
|
||||
|
||||
By default, "make install" no longer attempts to install (or even build) su.
|
||||
To change that, use ./configure --enable-install-program=su.
|
||||
If you also want to install the new "arch" program, do this:
|
||||
./configure --enable-install-program=arch,su.
|
||||
|
||||
You can inhibit the compilation and installation of selected programs
|
||||
at configure time. For example, to avoid installing "hostname" and
|
||||
"uptime", use ./configure --enable-no-install-program=hostname,uptime
|
||||
Note: currently, "make check" passes, even when arch and su are not
|
||||
built (that's the new default). However, if you inhibit the building
|
||||
and installation of other programs, don't be surprised if some parts
|
||||
of "make check" fail.
|
||||
|
||||
** Remove deprecated options
|
||||
|
||||
df no longer accepts the --kilobytes option.
|
||||
du no longer accepts the --kilobytes or --megabytes options.
|
||||
ls no longer accepts the --kilobytes option.
|
||||
ptx longer accepts the --copyright option.
|
||||
who no longer accepts -i or --idle.
|
||||
|
||||
** Improved robustness
|
||||
|
||||
ln -f can no longer silently clobber a just-created hard link.
|
||||
In some cases, ln could be seen as being responsible for data loss.
|
||||
For example, given directories a, b, c, and files a/f and b/f, we
|
||||
should be able to do this safely: ln -f a/f b/f c && rm -f a/f b/f
|
||||
However, before this change, ln would succeed, and thus cause the
|
||||
loss of the contents of a/f.
|
||||
|
||||
stty no longer silently accepts certain invalid hex values
|
||||
in its 35-colon commmand-line argument
|
||||
|
||||
** Bug fixes
|
||||
|
||||
chmod no longer ignores a dangling symlink. Now, chmod fails
|
||||
with a diagnostic saying that it cannot operate on such a file.
|
||||
[bug introduced in coreutils-5.1.0]
|
||||
|
||||
cp attempts to read a regular file, even if stat says it is empty.
|
||||
Before, "cp /proc/cpuinfo c" would create an empty file when the kernel
|
||||
reports stat.st_size == 0, while "cat /proc/cpuinfo > c" would "work",
|
||||
and create a nonempty one. [bug introduced in coreutils-6.0]
|
||||
|
||||
cp --parents no longer mishandles symlinks to directories in file
|
||||
name components in the source, e.g., "cp --parents symlink/a/b d"
|
||||
no longer fails. Also, 'cp' no longer considers a destination
|
||||
symlink to be the same as the referenced file when copying links
|
||||
or making backups. For example, if SYM is a symlink to FILE,
|
||||
"cp -l FILE SYM" now reports an error instead of silently doing
|
||||
nothing. The behavior of 'cp' is now better documented when the
|
||||
destination is a symlink.
|
||||
|
||||
"cp -i --update older newer" no longer prompts; same for mv
|
||||
|
||||
"cp -i" now detects read errors on standard input, and no longer consumes
|
||||
too much seekable input; same for ln, install, mv, and rm.
|
||||
|
||||
cut now diagnoses a range starting with zero (e.g., -f 0-2) as invalid;
|
||||
before, it would treat it as if it started with 1 (-f 1-2).
|
||||
|
||||
"cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
|
||||
|
||||
cut now diagnoses the '-' in "cut -f -" as an invalid range, rather
|
||||
than interpreting it as the unlimited range, "1-".
|
||||
|
||||
date -d now accepts strings of the form e.g., 'YYYYMMDD +N days',
|
||||
in addition to the usual 'YYYYMMDD N days'.
|
||||
|
||||
du -s now includes the size of any stat'able-but-inaccessible directory
|
||||
in the total size.
|
||||
|
||||
du (without -s) prints whatever it knows of the size of an inaccessible
|
||||
directory. Before, du would print nothing for such a directory.
|
||||
|
||||
ls -x DIR would sometimes output the wrong string in place of the
|
||||
first entry. [introduced in coreutils-6.8]
|
||||
|
||||
ls --color would mistakenly color a dangling symlink as if it were
|
||||
a regular symlink. This would happen only when the dangling symlink
|
||||
was not a command-line argument and in a directory with d_type support.
|
||||
[introduced in coreutils-6.0]
|
||||
|
||||
ls --color, (with a custom LS_COLORS envvar value including the
|
||||
ln=target attribute) would mistakenly output the string "target"
|
||||
before the name of each symlink. [introduced in coreutils-6.0]
|
||||
|
||||
od's --skip (-j) option now works even when the kernel says that a
|
||||
nonempty regular file has stat.st_size = 0. This happens at least
|
||||
with files in /proc and linux-2.6.22.
|
||||
|
||||
"od -j L FILE" had a bug: when the number of bytes to skip, L, is exactly
|
||||
the same as the length of FILE, od would skip *no* bytes. When the number
|
||||
of bytes to skip is exactly the sum of the lengths of the first N files,
|
||||
od would skip only the first N-1 files. [introduced in textutils-2.0.9]
|
||||
|
||||
./printf %.10000000f 1 could get an internal ENOMEM error and generate
|
||||
no output, yet erroneously exit with status 0. Now it diagnoses the error
|
||||
and exits with nonzero status. [present in initial implementation]
|
||||
|
||||
seq no longer mishandles obvious cases like "seq 0 0.000001 0.000003",
|
||||
so workarounds like "seq 0 0.000001 0.0000031" are no longer needed.
|
||||
|
||||
seq would mistakenly reject some valid format strings containing %%,
|
||||
and would mistakenly accept some invalid ones. e.g., %g%% and %%g, resp.
|
||||
|
||||
"seq .1 .1" would mistakenly generate no output on some systems
|
||||
|
||||
Obsolete sort usage with an invalid ordering-option character, e.g.,
|
||||
"env _POSIX2_VERSION=199209 sort +1x" no longer makes sort free an
|
||||
invalid pointer [introduced in coreutils-6.5]
|
||||
|
||||
sorting very long lines (relative to the amount of available memory)
|
||||
no longer provokes unaligned memory access
|
||||
|
||||
split --line-bytes=N (-C N) no longer creates an empty file
|
||||
[this bug is present at least as far back as textutils-1.22 (Jan, 1997)]
|
||||
|
||||
tr -c no longer aborts when translating with Set2 larger than the
|
||||
complement of Set1. [present in the original version, in 1992]
|
||||
|
||||
tr no longer rejects an unmatched [:lower:] or [:upper:] in SET1.
|
||||
[present in the original version]
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.9 (2007-03-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
cp -x (--one-file-system) would fail to set mount point permissions
|
||||
|
||||
The default block size and output format for df -P are now unaffected by
|
||||
the DF_BLOCK_SIZE, BLOCK_SIZE, and BLOCKSIZE environment variables. It
|
||||
is still affected by POSIXLY_CORRECT, though.
|
||||
|
||||
Using pr -m -s (i.e. merging files, with TAB as the output separator)
|
||||
no longer inserts extraneous spaces between output columns.
|
||||
|
||||
* Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
chgrp, chmod, and chown now honor the --preserve-root option.
|
||||
Before, they would warn, yet continuing traversing and operating on /.
|
||||
|
||||
chmod no longer fails in an environment (e.g., a chroot) with openat
|
||||
support but with insufficient /proc support.
|
||||
|
||||
"cp --parents F/G D" no longer creates a directory D/F when F is not
|
||||
a directory (and F/G is therefore invalid).
|
||||
|
||||
"cp --preserve=mode" would create directories that briefly had
|
||||
too-generous permissions in some cases. For example, when copying a
|
||||
directory with permissions 777 the destination directory might
|
||||
temporarily be setgid on some file systems, which would allow other
|
||||
users to create subfiles with the same group as the directory. Fix
|
||||
similar problems with 'install' and 'mv'.
|
||||
|
||||
cut no longer dumps core for usage like "cut -f2- f1 f2" with two or
|
||||
more file arguments. This was due to a double-free bug, introduced
|
||||
in coreutils-5.3.0.
|
||||
|
||||
dd bs= operands now silently override any later ibs= and obs=
|
||||
operands, as POSIX and tradition require.
|
||||
|
||||
"ls -FRL" always follows symbolic links on Linux. Introduced in
|
||||
coreutils-6.0.
|
||||
|
||||
A cross-partition "mv /etc/passwd ~" (by non-root) now prints
|
||||
a reasonable diagnostic. Before, it would print this:
|
||||
"mv: cannot remove `/etc/passwd': Not a directory".
|
||||
|
||||
pwd and "readlink -e ." no longer fail unnecessarily when a parent
|
||||
directory is unreadable.
|
||||
|
||||
rm (without -f) could prompt when it shouldn't, or fail to prompt
|
||||
when it should, when operating on a full name longer than 511 bytes
|
||||
and getting an ENOMEM error while trying to form the long name.
|
||||
|
||||
rm could mistakenly traverse into the wrong directory under unusual
|
||||
conditions: when a full name longer than 511 bytes specifies a search-only
|
||||
directory, and when forming that name fails with ENOMEM, rm would attempt
|
||||
to open a truncated-to-511-byte name with the first five bytes replaced
|
||||
with "[...]". If such a directory were to actually exist, rm would attempt
|
||||
to remove it.
|
||||
|
||||
"rm -rf /etc/passwd" (run by non-root) now prints a diagnostic.
|
||||
Before it would print nothing.
|
||||
|
||||
"rm --interactive=never F" no longer prompts for an unwritable F
|
||||
|
||||
"rm -rf D" would emit an misleading diagnostic when failing to
|
||||
remove a symbolic link within the unwritable directory, D.
|
||||
Introduced in coreutils-6.0. Similarly, when a cross-partition
|
||||
"mv" fails because the source directory is unwritable, it now gives
|
||||
a reasonable diagnostic. Before, this would print
|
||||
$ mkdir /tmp/x; touch /tmp/x/y; chmod -w /tmp/x;
|
||||
$ test $(stat -c %d /tmp/x) -ne $(stat -c %d .) && mv /tmp/x/y .
|
||||
mv: cannot remove `/tmp/x/y': Not a directory
|
||||
Now it prints this:
|
||||
mv: cannot remove `/tmp/x/y': Permission denied.
|
||||
|
||||
** New features
|
||||
|
||||
sort's new --compress-program=PROG option specifies a compression
|
||||
program to use when writing and reading temporary files.
|
||||
This can help save both time and disk space when sorting large inputs.
|
||||
|
||||
sort accepts the new option -C, which acts like -c except no diagnostic
|
||||
is printed. Its --check option now accepts an optional argument, and
|
||||
--check=quiet and --check=silent are now aliases for -C, while
|
||||
--check=diagnose-first is an alias for -c or plain --check.
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.7 (2006-12-08) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
When cp -p copied a file with special mode bits set, the same bits
|
||||
were set on the copy even when ownership could not be preserved.
|
||||
This could result in files that were setuid to the wrong user.
|
||||
To fix this, special mode bits are now set in the copy only if its
|
||||
ownership is successfully preserved. Similar problems were fixed
|
||||
with mv when copying across file system boundaries. This problem
|
||||
affects all versions of coreutils through 6.6.
|
||||
|
||||
cp --preserve=ownership would create output files that temporarily
|
||||
had too-generous permissions in some cases. For example, when
|
||||
copying a file with group A and mode 644 into a group-B sticky
|
||||
directory, the output file was briefly readable by group B.
|
||||
Fix similar problems with cp options like -p that imply
|
||||
--preserve=ownership, with install -d when combined with either -o
|
||||
or -g, and with mv when copying across file system boundaries.
|
||||
This bug affects all versions of coreutils through 6.6.
|
||||
|
||||
du --one-file-system (-x) would skip subdirectories of any directory
|
||||
listed as second or subsequent command line argument. This bug affects
|
||||
coreutils-6.4, 6.5 and 6.6.
|
||||
|
||||
|
||||
* Noteworthy changes in release 6.6 (2006-11-22) [stable]
|
||||
|
||||
** Bug fixes
|
||||
|
||||
60
README
60
README
@@ -7,18 +7,21 @@ arbitrary limits.
|
||||
|
||||
The programs that can be built with this package are:
|
||||
|
||||
[ base64 basename cat chgrp chmod chown chroot cksum comm cp csplit cut date
|
||||
dd df dir dircolors dirname du echo env expand expr factor false fmt fold
|
||||
ginstall groups head hostid hostname id join kill link ln logname ls
|
||||
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
|
||||
printenv printf ptx pwd readlink rm rmdir 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
|
||||
[ arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
|
||||
csplit cut date dd df dir dircolors dirname du echo env expand expr
|
||||
factor false fmt fold groups head hostid hostname id install join kill
|
||||
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
|
||||
|
||||
See the file NEWS for a list of major changes in the current release.
|
||||
|
||||
See the file INSTALL for compilation and installation instructions.
|
||||
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.
|
||||
|
||||
These programs are intended to conform to POSIX (with BSD and other
|
||||
extensions), like the rest of the GNU system. By default they conform
|
||||
@@ -55,9 +58,28 @@ and from the corresponding --help usage message. Patches to the template
|
||||
files (man/*.x) are welcome. However, the authoritative documentation
|
||||
is in texinfo form in the doc directory.
|
||||
|
||||
If you run the tests on a SunOS4.1.4 system, expect the ctime-part of
|
||||
the ls `time-1' test to fail. I believe that is due to a bug in the
|
||||
way Sun implemented link(2) and chmod(2).
|
||||
|
||||
*****************************************
|
||||
On Mac OS X 10.5.1 (Darwin 9.1), test failure
|
||||
-----------------------------------------
|
||||
|
||||
Mac OS X 10.5.1 (Darwin 9.1) provides only partial (and incompatible)
|
||||
ACL support, so although "./configure && make" succeeds, "make check"
|
||||
exposes numerous failures. The solution is to turn off ACL support
|
||||
manually via "./configure --disable-acl". For details, see
|
||||
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12292/focus=12318>.
|
||||
|
||||
|
||||
*****************************************
|
||||
Test failure with NLS and gettext <= 0.17
|
||||
-----------------------------------------
|
||||
|
||||
Due to a conflict between libintl.h and gnulib's new xprintf module,
|
||||
when you configure with NLS support, and with a gettext installation
|
||||
older than 0.17.1 (not yet released, at the time of this writing),
|
||||
then some tests fail, at least on NetBSD 1.6. To work around it in
|
||||
the mean time, you can configure with --disable-nls. For details,
|
||||
see <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/12015/>.
|
||||
|
||||
|
||||
***********************
|
||||
@@ -97,6 +119,18 @@ Here is one possible patch to correct the problem:
|
||||
+#ifndef __LP64__
|
||||
|
||||
|
||||
************************
|
||||
OSF/1 4.0d build failure
|
||||
------------------------
|
||||
|
||||
If you use /usr/bin/make on an OSF/1 4.0d system, it will fail due
|
||||
to the presence of the "[" target. That version of make appears to
|
||||
treat "[" as some syntax relating to locks. To work around that,
|
||||
the best solution is to use GNU make. Otherwise, simply remove
|
||||
all mention of "[$(EXEEXT)" from src/Makefile.
|
||||
|
||||
|
||||
|
||||
**********************
|
||||
Running tests as root:
|
||||
----------------------
|
||||
@@ -112,7 +146,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
|
||||
sudo env 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
|
||||
|
||||
70
README-cvs
70
README-cvs
@@ -1,70 +0,0 @@
|
||||
-*- outline -*-
|
||||
|
||||
These notes intend to help people working on the CVS version of
|
||||
this package.
|
||||
|
||||
* Requirements
|
||||
|
||||
Only the sources are installed in the CVS repository (to ease the
|
||||
maintenance, merges etc.), therefore you will have to get the latest
|
||||
stable versions of the maintainer tools we depend upon, including:
|
||||
|
||||
- Automake <http://www.gnu.org/software/automake/>
|
||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||
- Bison <http://www.gnu.org/software/bison/>
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Tar <http://www.gnu.org/software/tar/>
|
||||
- Wget <http://www.gnu.org/software/wget/>
|
||||
|
||||
As of this writing, the latest stable version of Gzip is 1.2.4 but we
|
||||
suggest using test version 1.3.5 (or later, if one becomes available).
|
||||
|
||||
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 `cvs update -P && make' should be sufficient.
|
||||
|
||||
* First CVS checkout
|
||||
|
||||
Obviously, if you are reading these notes, you did manage to check out
|
||||
this package from CVS. The next step is to get other files needed to
|
||||
build, which are extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
And there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the CVS master copy:
|
||||
|
||||
$ cvs diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
Enjoy!
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002, 2003, 2004, 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 2, 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, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA.
|
||||
85
README-hacking
Normal file
85
README-hacking
Normal file
@@ -0,0 +1,85 @@
|
||||
-*- outline -*-
|
||||
|
||||
These notes intend to help people working on the checked-out sources.
|
||||
These requirements do not apply when building from a distribution tarball.
|
||||
|
||||
* 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:
|
||||
|
||||
- Automake <http://www.gnu.org/software/automake/>
|
||||
- Autoconf <http://www.gnu.org/software/autoconf/>
|
||||
- Bison <http://www.gnu.org/software/bison/>
|
||||
- Gettext <http://www.gnu.org/software/gettext/>
|
||||
- Git <http://git.or.cz/>
|
||||
- Gperf <http://www.gnu.org/software/gperf/>
|
||||
- Gzip <http://www.gnu.org/software/gzip/>
|
||||
- Perl <http://www.cpan.org/>
|
||||
- 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
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
* First GIT checkout
|
||||
|
||||
You can get a copy of the source repository like this:
|
||||
|
||||
$ git clone git://git.sv.gnu.org/coreutils
|
||||
|
||||
The next step is to get other files needed to build, which are
|
||||
extracted from other source packages:
|
||||
|
||||
$ ./bootstrap
|
||||
|
||||
And there you are! Just
|
||||
|
||||
$ ./configure
|
||||
$ make
|
||||
$ make check
|
||||
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the GIT master copy:
|
||||
|
||||
$ git diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
Enjoy!
|
||||
|
||||
-----
|
||||
|
||||
Copyright (C) 2002-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/>.
|
||||
@@ -1,6 +1,9 @@
|
||||
As of 2002-09-01, the GNU fileutils, textutils, and sh-utils
|
||||
packages have been merged into one, called the GNU coreutils.
|
||||
See http://www.gnu.org/software/coreutils/ for a description.
|
||||
Here's the FAQ list:
|
||||
|
||||
http://www.gnu.org/software/coreutils/faq/
|
||||
|
||||
For information on the mailing lists associated with the
|
||||
coreutils package, see these:
|
||||
@@ -10,4 +13,6 @@ coreutils package, see these:
|
||||
|
||||
mailing list archives are here:
|
||||
|
||||
http://mail.gnu.org/pipermail/bug-coreutils/
|
||||
http://news.gmane.org/gmane.comp.gnu.coreutils.announce
|
||||
http://news.gmane.org/gmane.comp.gnu.core-utils.bugs (up to the minute)
|
||||
http://mail.gnu.org/pipermail/bug-coreutils/ (updated every 12 hours)
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,9 +14,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Convert Makefile.am files:
|
||||
# find tests -name Makefile.am | xargs grep -wl PATH|xargs perl -pi -e \
|
||||
|
||||
25
THANKS
25
THANKS
@@ -12,6 +12,7 @@ Aaron Hawley ashawley@uvm.edu
|
||||
Achim Blumensath blume@corona.oche.de
|
||||
Adam Klein aklein@debian.org
|
||||
Adrian Bunk bunk@stusta.de
|
||||
AIDA Shinra shinra@j10n.org
|
||||
Akim Demaille demaille@inf.enst.fr
|
||||
Alain Magloire alain@qnx.com
|
||||
Alan Iwi iwi@atm.ox.ac.uk
|
||||
@@ -26,6 +27,7 @@ Alexey Vyskubov alexey@pippuri.mawhrin.net
|
||||
Alfred M. Szmidt ams@kemisten.nu
|
||||
Andi Kleen freitag@alancoxonachip.com
|
||||
Andre Novaes Cunha Andre.Cunha@br.global-one.net
|
||||
Andreas Frische andreasfrische@gmail.com
|
||||
Andreas Gruenbacher ag@bestbits.at
|
||||
Andreas Jaeger jaeger@gnu.org
|
||||
Andreas Luik luik@isa.de
|
||||
@@ -108,8 +110,10 @@ Dan Hagerty hag@gnu.ai.it.edu
|
||||
Dan Jacobson http://www.geocities.com/jidani
|
||||
Dan Pascu dan@services.iiruc.ro
|
||||
Daniel Bergstrom noa@melody.se
|
||||
Daniel P. Berrangé berrange@redhat.com
|
||||
Dániel Varga danielv@axelero.hu
|
||||
Danny Levinson danny.levinson@overture.com
|
||||
Darrel Francis d.francis@cheerful.com
|
||||
Darren Salt ds@youmustbejoking.demon.co.uk
|
||||
Dave Beckett dajobe@dajobe.org
|
||||
David Alan Gilbert gilbertd@treblig.org
|
||||
@@ -139,6 +143,7 @@ Duncan Roe duncanr@optimation.com.au
|
||||
Ed Avis ed@membled.com
|
||||
Edward Welbourne eddy@opera.com
|
||||
Edzer Pebesma Edzer.Pebesma@rivm.nl
|
||||
Egmont Koblinger egmont@uhulinux.hu
|
||||
Eirik Fuller eirik@hackrat.com
|
||||
Eivind eivindt@multinet.no
|
||||
Eli Zaretskii eliz@is.elta.co.il
|
||||
@@ -150,6 +155,7 @@ Eric Pemente pemente@northpark.edu
|
||||
Eric S. Raymond esr@snark.thyrsus.com
|
||||
Erik Bennett bennett@cvo.oneworld.com
|
||||
Erik Corry erik@kroete2.freinet.de
|
||||
Evan Hunt ethanol@armory.com
|
||||
Felix Lee flee@teleport.com
|
||||
Felix Rauch Valenti frauch@cse.unsw.edu.au
|
||||
Ferdinand fw@scenic.mine.nu
|
||||
@@ -173,6 +179,7 @@ Geoff Collyer geoff at collyer.net
|
||||
Geoff Kuenning geoff@cs.hmc.edu
|
||||
Geoff Odhner geoff@franklin.com
|
||||
Geoff Whale geoffw@cse.unsw.EDU.AU
|
||||
Gerald Pfeifer gerald@pfeifer.com
|
||||
Gerhard Poul gpoul@gnu.org
|
||||
Germano Leichsenring germano@jedi.cs.kobe-u.ac.jp
|
||||
Göran Uddeborg goeran@uddeborg.pp.se
|
||||
@@ -185,6 +192,7 @@ Greg Troxel gdt@bbn.com
|
||||
Greg Wooledge gawooledge@sherwin.com
|
||||
Gregory Leblanc gleblanc@cu-portland.edu
|
||||
Guido Leenders guido.leenders@invantive.com
|
||||
Guntram Blohm Extern.Guntram.Blohm@AUDI.DE
|
||||
H. J. Lu hjl@valinux.com
|
||||
Hans Ginzel hans@matfyz.cz
|
||||
Hans Lermen lermen@fgan.de
|
||||
@@ -192,6 +200,7 @@ Hans Verkuil hans@wyst.hobby.nl
|
||||
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
|
||||
Helen Faulkner helen_ml_faulkner@yahoo.co.uk
|
||||
Herbert Xu herbert@gondor.apana.org.au
|
||||
Holger Berger hberger@ess.nec.de
|
||||
@@ -208,6 +217,7 @@ 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 Sneeringer jvs@ocslink.com
|
||||
James Tanis jtt@soscorp.com
|
||||
James Youngman james+usenet@free-lunch.demon.co.uk
|
||||
@@ -222,6 +232,7 @@ Jeff Moore jbm@mordor.com
|
||||
Jeff Sheinberg jeff@bsrd.net
|
||||
Jens Elkner elkner@imsgroup.de
|
||||
Jens Schmidt jms@jsds.hamburg.com
|
||||
Jeremy Maitin-Shepard jbms@cmu.edu
|
||||
Jerome Abela abela@hsc.fr
|
||||
Jérôme Zago bug-coreutils-ml@agt-the-walker.net
|
||||
Jesse Kornblum kornblum@usna.edu
|
||||
@@ -233,6 +244,7 @@ Joakim Rosqvist dvljrt@cs.umu.se
|
||||
Jochen Hein jochen@jochen.org
|
||||
Joe Orton joe@manyfish.co.uk
|
||||
Joerg Sonnenberger joerg@britannica.bec.de
|
||||
Joey Hess joeyh@debian.org
|
||||
Johan Boule bohan@bohan.dyndns.org
|
||||
Johan Danielsson joda@pdc.kth.se
|
||||
John Bley jbb6@acpub.duke.edu
|
||||
@@ -271,6 +283,7 @@ Keith Owens kaos@audio.apana.org.au
|
||||
Keith Thompson kst@cts.com
|
||||
Ken Pizzini kenp@halcyon.com
|
||||
Kevin Mudrick kmudrick@healthmarketscience.com
|
||||
Kirk Kelsey kirk.kelsey@0x4b.net
|
||||
Kristin E Thomas kristint@us.ibm.com
|
||||
Kjetil Torgrim Homme kjetilho@ifi.uio.no
|
||||
Kristoffer Rose kris@diku.dk
|
||||
@@ -323,11 +336,13 @@ Matt Perry matt@primefactor.com
|
||||
Matt Schalit mschalit@pacbell.net
|
||||
Matt Swift swift@alum.mit.edu
|
||||
Matthew Arnison maffew@cat.org.au
|
||||
Matthew M. Boedicker matthewm@boedicker.org
|
||||
Matthew Braun matthew@ans.net
|
||||
Matthew Clarke Matthew_Clarke@mindlink.bc.ca
|
||||
Matthew S. Levine mslevine@theory.lcs.mit.edu
|
||||
Matthew Smith matts@bluesguitar.org
|
||||
Matthew Swift swift@alum.mit.edu
|
||||
Matthew Woehlke mw_triad@users.sourceforge.net
|
||||
Matthias Urlichs smurf@noris.de
|
||||
Matti Aarnio matti.aarnio@zmailer.org
|
||||
Mattias Wadenstein maswan@acc.umu.se
|
||||
@@ -342,6 +357,7 @@ Michael Hasselberg mikelh@zonta.ping.de
|
||||
Michael Hohn hohn@math.utah.edu
|
||||
Michael J. Croghan mcroghan@usatoday.com
|
||||
Michael McFarland sidlon@yahoo.com
|
||||
Michael McLagan mmclagan@invlogic.com
|
||||
Michael Piefel piefel@informatik.hu-berlin.de
|
||||
Michael Steffens michael.steffens@s.netic.de
|
||||
Michael Stone mstone@debian.org
|
||||
@@ -380,8 +396,10 @@ Ole Laursen olau@hardworking.dk
|
||||
Oliver Kiddle okiddle@yahoo.co.uk
|
||||
Ørn E. Hansen oehansen@daimi.aau.dk
|
||||
Oskar Liljeblad osk@hem.passagen.se
|
||||
Pádraig Brady P@draigBrady.com
|
||||
Patrick Mauritz oxygene@studentenbude.ath.cx
|
||||
Paul Eggert eggert@twinsun.com
|
||||
Paul Ghaleb paul.ghaleb@st.com
|
||||
Paul Jarc prj@po.cwru.edu
|
||||
Paul Nevai nevai@ops.mps.ohio-state.edu
|
||||
Paul Sauer paul@alexa.com
|
||||
@@ -391,7 +409,9 @@ Paul Worrall paul@basilisk.uklinux.net
|
||||
Pawel Prokop pablo@wizard.ae.krakow.pl
|
||||
Per Cederqvist ceder@lysator.liu.se
|
||||
Per Kristian Hove perhov@math.ntnu.no
|
||||
Per Starbäck starback@stp.lingfil.uu.se
|
||||
Peter Breitenlohner peb@mppmu.mpg.de
|
||||
Peter Dyballa peter_dyballa@web.de
|
||||
Peter Eriksson peter@ifm.liu.se
|
||||
Peter Fales psfales@lucent.com
|
||||
Peter Horst peter@ointment.org
|
||||
@@ -406,6 +426,7 @@ Philippe De Muyter phdm@macqel.be
|
||||
Philippe Schnoebelen Philippe.Schnoebelen@imag.fr
|
||||
Phillip Jones mouse@datastacks.com
|
||||
Piergiorgio Sartor sartor@sony.de
|
||||
Pieter Bowman bowman@math.utah.edu
|
||||
Piotr Kwapulinski kwap@univ.gda.pl
|
||||
Prashant TR tr@eth.net
|
||||
Rainer Orth ro@TechFak.Uni-Bielefeld.DE
|
||||
@@ -434,6 +455,7 @@ Ronald F. Guilmette rfg@netcom.com
|
||||
Ross Alexander r.alexander@auckland.ac.nz
|
||||
Ross Paterson rap@doc.ic.ac.uk
|
||||
Ross Ridge rridge@calum.csclub.uwaterloo.ca
|
||||
Rudolf Kastl rkastl@redhat.com
|
||||
Sami Farin sfarin@ratol.fi
|
||||
Samuel Tardieu sam@rfc1149.net
|
||||
Samuel Thibault samuel.thibault@ens-lyon.org
|
||||
@@ -455,6 +477,7 @@ Stephen Gildea gildea@stop.mail-abuse.org
|
||||
Stephen Smoogen smooge@mindspring.com
|
||||
Steve McConnel steve@acadcomp.sil.org
|
||||
Steve McIntyre steve@einval.com
|
||||
Steve Ward planet36@gmail.com
|
||||
Steven G. Johnson stevenj@alum.mit.edu
|
||||
Steven Mocking ufo@quicknet.nl
|
||||
Steven P Watson steven@magelico.net
|
||||
@@ -471,6 +494,7 @@ Thomas Hood jdthood@yahoo.co.uk
|
||||
Thomas Luzat thomas@luzat.com
|
||||
Thomas M.Ott thmo-13@gmx.de
|
||||
Thomas Quinot thomas@Cuivre.FR.EU.ORG
|
||||
Thomas Schwinge tschwinge@gnu.org
|
||||
Thomas Wolff mined@towo.net
|
||||
Tim J. Robbins tjr@FreeBSD.org
|
||||
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
|
||||
@@ -513,6 +537,7 @@ William Bader william@nscs.fast.net
|
||||
William Dowling will@franklin.com
|
||||
William Lewis wiml@omnigroup.com
|
||||
wiregauze wiregauze@yahoo.com
|
||||
Wis Macomson wis.macomson@intel.com
|
||||
Wojciech Purczynski cliph@isec.pl
|
||||
Wolfram Kleff kleff@cs.uni-bonn.de
|
||||
Won-kyu Park wkpark@chem.skku.ac.kr
|
||||
|
||||
70
TODO
70
TODO
@@ -1,4 +1,35 @@
|
||||
strip: add an option to specify the program used to strip binaries.
|
||||
If you're interested in helping, here are some tasks that we've considered
|
||||
over the years. Beware: some are quite old and no longer valid. To avoid
|
||||
wasting your time by duplicating work or by working on a task that is no
|
||||
longer pertinent, please search the mailing list and post your intent
|
||||
before embarking on a big project.
|
||||
|
||||
==================================================
|
||||
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.
|
||||
|
||||
printf:
|
||||
Now that gnulib supports *printf("%a"), import one of the
|
||||
*printf-posix modules so that printf(1) will support %a even on
|
||||
platforms where the native *printf(3) is deficient.
|
||||
Suggestion from Eric Blake.
|
||||
|
||||
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:
|
||||
@@ -20,6 +51,7 @@ See if we can be consistent about where --verbose sends its output:
|
||||
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.
|
||||
@@ -41,13 +73,9 @@ seq: give better diagnostics for invalid formats:
|
||||
e.g. no or too many % directives
|
||||
seq: consider allowing format string to contain no %-directives
|
||||
|
||||
resolve RH report on cp -a forwarded by Tim Waugh
|
||||
|
||||
tail: don't use xlseek; it *exits*.
|
||||
Instead, maybe use a macro and return nonzero.
|
||||
|
||||
add mktemp? Suggested by Nelson Beebe
|
||||
|
||||
tr: support nontrivial equivalence classes, e.g. [=e=] with LC_COLLATE=fr_FR
|
||||
|
||||
lib/strftime.c: Since %N is the only format that we need but that
|
||||
@@ -55,11 +83,6 @@ lib/strftime.c: Since %N is the only format that we need but that
|
||||
would expand /%(-_)?\d*N/ to the desired string and then pass the
|
||||
resulting string to glibc's strftime.
|
||||
|
||||
sort: Compress temporary files when doing large external sort/merges.
|
||||
This improves performance when you can compress/uncompress faster than
|
||||
you can read/write, which is common in these days of fast CPUs.
|
||||
suggestion from Charles Randall on 2001-08-10
|
||||
|
||||
unexpand: [http://www.opengroup.org/onlinepubs/007908799/xcu/unexpand.html]
|
||||
printf 'x\t \t y\n'|unexpand -t 8,9 should print its input, unmodified.
|
||||
printf 'x\t \t y\n'|unexpand -t 5,8 should print "x\ty\n"
|
||||
@@ -101,10 +124,6 @@ Changes expected to go in, someday.
|
||||
|
||||
dd patch from Olivier Delhomme
|
||||
|
||||
Andreas Gruenbacher's xattr changes
|
||||
|
||||
Apply Bruno Haible's hostname changes
|
||||
|
||||
test/mv/*: clean up $other_partition_tmpdir in all cases
|
||||
|
||||
ls: when both -l and --dereference-command-line-symlink-to-dir are
|
||||
@@ -131,9 +150,6 @@ Changes expected to go in, someday.
|
||||
|
||||
------------------------------
|
||||
|
||||
Have euidaccess.m4 check for eaccess as well as euidaccess
|
||||
If found, then do `#define euidaccess eaccess'.
|
||||
|
||||
Remove long-deprecated options. Search case-insensitive for
|
||||
`deprecated' and `remove in '. Automate this.
|
||||
|
||||
@@ -152,9 +168,13 @@ Implement Ulrich Drepper's suggestion to use getgrouplist rather
|
||||
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:
|
||||
remove `%s' notation (now that they're all gone, add a Makefile.maint 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
|
||||
for this, too.
|
||||
|
||||
remove or adjust chown's --changes option, since it
|
||||
can't always do what it currently says it does.
|
||||
|
||||
@@ -163,21 +183,18 @@ Adapt tools like wc, tr, fmt, etc. (most of the textutils) to be
|
||||
significant blocks of logic, yet I also want to incur only minimal
|
||||
(preferably `no') cost when operating in single-byte mode.
|
||||
|
||||
Remove all uses of the `register' keyword
|
||||
|
||||
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, 2003, 2004, 2005, 2006 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 2002-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -185,5 +202,4 @@ 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
435
announce-gen
435
announce-gen
@@ -1,435 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
# Generate an announcement message.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2004, 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 2, 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
use strict;
|
||||
|
||||
use Getopt::Long;
|
||||
use Digest::MD5;
|
||||
use Digest::SHA1;
|
||||
|
||||
(my $VERSION = '$Revision: 1.25 $ ') =~ tr/[0-9].//cd;
|
||||
(my $ME = $0) =~ s|.*/||;
|
||||
|
||||
my %valid_release_types = map {$_ => 1} qw (alpha beta major);
|
||||
|
||||
END
|
||||
{
|
||||
# Nobody ever checks the status of print()s. That's okay, because
|
||||
# if any do fail, we're guaranteed to get an indicator when we close()
|
||||
# the filehandle.
|
||||
#
|
||||
# Close stdout now, and if there were no errors, return happy status.
|
||||
# If stdout has already been closed by the script, though, do nothing.
|
||||
defined fileno STDOUT
|
||||
or return;
|
||||
close STDOUT
|
||||
and return;
|
||||
|
||||
# Errors closing stdout. Indicate that, and hope stderr is OK.
|
||||
warn "$ME: closing standard output: $!\n";
|
||||
|
||||
# Don't be so arrogant as to assume that we're the first END handler
|
||||
# defined, and thus the last one invoked. There may be others yet
|
||||
# to come. $? will be passed on to them, and to the final _exit().
|
||||
#
|
||||
# If it isn't already an error, make it one (and if it _is_ an error,
|
||||
# preserve the value: it might be important).
|
||||
$? ||= 1;
|
||||
}
|
||||
|
||||
sub usage ($)
|
||||
{
|
||||
my ($exit_code) = @_;
|
||||
my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
|
||||
if ($exit_code != 0)
|
||||
{
|
||||
print $STREAM "Try `$ME --help' for more information.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
my @types = sort keys %valid_release_types;
|
||||
print $STREAM <<EOF;
|
||||
Usage: $ME [OPTIONS]
|
||||
|
||||
OPTIONS:
|
||||
|
||||
Generate an announcement message.
|
||||
|
||||
FIXME: describe the following
|
||||
|
||||
--release-type=TYPE TYPE must be one of @types
|
||||
--package-name=PACKAGE_NAME
|
||||
--previous-version=VER
|
||||
--current-version=VER
|
||||
--gpg-key-id=ID The GnuPG ID of the key used to sign the tarballs
|
||||
--url-directory=URL_DIR
|
||||
--news=NEWS_FILE optional
|
||||
|
||||
--help display this help and exit
|
||||
--version output version information and exit
|
||||
|
||||
EOF
|
||||
}
|
||||
exit $exit_code;
|
||||
}
|
||||
|
||||
|
||||
=item C<%size> = C<sizes (@file)>
|
||||
|
||||
Compute the sizes of the C<@file> and return them as a hash. Return
|
||||
C<undef> if one of the computation failed.
|
||||
|
||||
=cut
|
||||
|
||||
sub sizes (@)
|
||||
{
|
||||
my (@file) = @_;
|
||||
|
||||
my $fail = 0;
|
||||
my %res;
|
||||
foreach my $f (@file)
|
||||
{
|
||||
my $cmd = "du --human $f";
|
||||
my $t = `$cmd`;
|
||||
# FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS
|
||||
$@
|
||||
and (warn "$ME: command failed: `$cmd'\n"), $fail = 1;
|
||||
chomp $t;
|
||||
$t =~ s/^([\d.]+[MkK]).*/${1}B/;
|
||||
$res{$f} = $t;
|
||||
}
|
||||
return $fail ? undef : %res;
|
||||
}
|
||||
|
||||
=item C<print_locations ($title, \@url, \%size, @file)
|
||||
|
||||
Print a section C<$title> dedicated to the list of <@file>, which
|
||||
sizes are stored in C<%size>, and which are available from the C<@url>.
|
||||
|
||||
=cut
|
||||
|
||||
sub print_locations ($\@\%@)
|
||||
{
|
||||
my ($title, $url, $size, @file) = @_;
|
||||
print "Here are the $title:\n";
|
||||
foreach my $url (@{$url})
|
||||
{
|
||||
for my $file (@file)
|
||||
{
|
||||
print " $url/$file";
|
||||
print " (", $$size{$file}, ")"
|
||||
if exists $$size{$file};
|
||||
print "\n";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
|
||||
=item C<print_checksums (@file)
|
||||
|
||||
Print the MD5 and SHA1 signature section for each C<@file>.
|
||||
|
||||
=cut
|
||||
|
||||
sub print_checksums (@)
|
||||
{
|
||||
my (@file) = @_;
|
||||
|
||||
print "Here are the MD5 and SHA1 checksums:\n";
|
||||
print "\n";
|
||||
|
||||
foreach my $meth (qw (md5 sha1))
|
||||
{
|
||||
foreach my $f (@file)
|
||||
{
|
||||
open IN, '<', $f
|
||||
or die "$ME: $f: cannot open for reading: $!\n";
|
||||
binmode IN;
|
||||
my $dig =
|
||||
($meth eq 'md5'
|
||||
? Digest::MD5->new->addfile(*IN)->hexdigest
|
||||
: Digest::SHA1->new->addfile(*IN)->hexdigest);
|
||||
close IN;
|
||||
print "$dig $f\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
=item C<print_news_deltas ($news_file, $prev_version, $curr_version)
|
||||
|
||||
Print the section of the NEWS file C<$news_file> addressing changes
|
||||
between versions C<$prev_version> and C<$curr_version>.
|
||||
|
||||
=cut
|
||||
|
||||
sub print_news_deltas ($$$)
|
||||
{
|
||||
my ($news_file, $prev_version, $curr_version) = @_;
|
||||
|
||||
print "\n$news_file\n\n";
|
||||
|
||||
# Print all lines from $news_file, starting with the first one
|
||||
# that mentions $curr_version up to but not including
|
||||
# the first occurrence of $prev_version.
|
||||
my $in_items;
|
||||
|
||||
my $re_prefix = qr/\* (:?Noteworthy|Major) change/;
|
||||
|
||||
open NEWS, '<', $news_file
|
||||
or die "$ME: $news_file: cannot open for reading: $!\n";
|
||||
while (defined (my $line = <NEWS>))
|
||||
{
|
||||
if ( ! $in_items)
|
||||
{
|
||||
# Match lines like these:
|
||||
# * Major changes in release 5.0.1:
|
||||
# * Noteworthy changes in release 6.6 (2006-11-22) [stable]
|
||||
$line =~ /^$re_prefix.*(:?[^\d.]|$)\Q$curr_version\E(:?[^\d.]|$)/o
|
||||
or next;
|
||||
$in_items = 1;
|
||||
print $line;
|
||||
}
|
||||
else
|
||||
{
|
||||
# This regexp must not match version numbers in NEWS items.
|
||||
# For example, they might well say `introduced in 4.5.5',
|
||||
# and we don't want that to match.
|
||||
$line =~ /^$re_prefix.*(:?[^\d.]|$)\Q$prev_version\E(:?[^\d.]|$)/o
|
||||
and last;
|
||||
print $line;
|
||||
}
|
||||
}
|
||||
close NEWS;
|
||||
|
||||
$in_items
|
||||
or die "$ME: $news_file: no matching lines for `$curr_version'\n";
|
||||
}
|
||||
|
||||
sub print_changelog_deltas ($$)
|
||||
{
|
||||
my ($package_name, $prev_version) = @_;
|
||||
|
||||
# Print new ChangeLog entries.
|
||||
|
||||
# First find all CVS-controlled ChangeLog files.
|
||||
use File::Find;
|
||||
my @changelog;
|
||||
find ({wanted => sub {$_ eq 'ChangeLog' && -d 'CVS'
|
||||
and push @changelog, $File::Find::name}},
|
||||
'.');
|
||||
|
||||
# If there are no ChangeLog files, we're done.
|
||||
@changelog
|
||||
or return;
|
||||
my %changelog = map {$_ => 1} @changelog;
|
||||
|
||||
# Reorder the list of files so that if there are ChangeLog
|
||||
# files in the specified directories, they're listed first,
|
||||
# in this order:
|
||||
my @dir = qw ( . src lib m4 config doc );
|
||||
|
||||
# A typical @changelog array might look like this:
|
||||
# ./ChangeLog
|
||||
# ./po/ChangeLog
|
||||
# ./m4/ChangeLog
|
||||
# ./lib/ChangeLog
|
||||
# ./doc/ChangeLog
|
||||
# ./config/ChangeLog
|
||||
my @reordered;
|
||||
foreach my $d (@dir)
|
||||
{
|
||||
my $dot_slash = $d eq '.' ? $d : "./$d";
|
||||
my $target = "$dot_slash/ChangeLog";
|
||||
delete $changelog{$target}
|
||||
and push @reordered, $target;
|
||||
}
|
||||
|
||||
# Append any remaining ChangeLog files.
|
||||
push @reordered, sort keys %changelog;
|
||||
|
||||
# Remove leading `./'.
|
||||
@reordered = map { s!^\./!!; $_ } @reordered;
|
||||
|
||||
print "\nChangeLog entries:\n\n";
|
||||
# print join ("\n", @reordered), "\n";
|
||||
|
||||
$prev_version =~ s/\./_/g;
|
||||
my $prev_cvs_tag = "\U$package_name\E-$prev_version";
|
||||
|
||||
my $cmd = "cvs -n diff -u -r$prev_cvs_tag -rHEAD @reordered";
|
||||
open DIFF, '-|', $cmd
|
||||
or die "$ME: cannot run `$cmd': $!\n";
|
||||
# Print two types of lines, making minor changes:
|
||||
# Lines starting with `+++ ', e.g.,
|
||||
# +++ ChangeLog 22 Feb 2003 16:52:51 -0000 1.247
|
||||
# and those starting with `+'.
|
||||
# Don't print the others.
|
||||
my $prev_printed_line_empty = 1;
|
||||
while (defined (my $line = <DIFF>))
|
||||
{
|
||||
if ($line =~ /^\+\+\+ /)
|
||||
{
|
||||
my $separator = "*"x70 ."\n";
|
||||
$line =~ s///;
|
||||
$line =~ s/\s.*//;
|
||||
$prev_printed_line_empty
|
||||
or print "\n";
|
||||
print $separator, $line, $separator;
|
||||
}
|
||||
elsif ($line =~ /^\+/)
|
||||
{
|
||||
$line =~ s///;
|
||||
print $line;
|
||||
$prev_printed_line_empty = ($line =~ /^$/);
|
||||
}
|
||||
}
|
||||
close DIFF;
|
||||
|
||||
# The exit code should be 1.
|
||||
# Allow in case there are no modified ChangeLog entries.
|
||||
$? == 256 || $? == 128
|
||||
or warn "$ME: warning: `cmd' had unexpected exit code or signal ($?)\n";
|
||||
}
|
||||
|
||||
{
|
||||
# Neutralize the locale, so that, for instance, "du" does not
|
||||
# issue "1,2" instead of "1.2", what confuses our regexps.
|
||||
$ENV{LC_ALL} = "C";
|
||||
|
||||
my $release_type;
|
||||
my $package_name;
|
||||
my $prev_version;
|
||||
my $curr_version;
|
||||
my $gpg_key_id;
|
||||
my @url_dir_list;
|
||||
my @news_file;
|
||||
|
||||
GetOptions
|
||||
(
|
||||
'release-type=s' => \$release_type,
|
||||
'package-name=s' => \$package_name,
|
||||
'previous-version=s' => \$prev_version,
|
||||
'current-version=s' => \$curr_version,
|
||||
'gpg-key-id=s' => \$gpg_key_id,
|
||||
'url-directory=s' => \@url_dir_list,
|
||||
'news=s' => \@news_file,
|
||||
|
||||
help => sub { usage 0 },
|
||||
version => sub { print "$ME version $VERSION\n"; exit },
|
||||
) or usage 1;
|
||||
|
||||
my $fail = 0;
|
||||
# Ensure that sure each required option is specified.
|
||||
$release_type
|
||||
or (warn "$ME: release type not specified\n"), $fail = 1;
|
||||
$package_name
|
||||
or (warn "$ME: package name not specified\n"), $fail = 1;
|
||||
$prev_version
|
||||
or (warn "$ME: previous version string not specified\n"), $fail = 1;
|
||||
$curr_version
|
||||
or (warn "$ME: current version string not specified\n"), $fail = 1;
|
||||
$gpg_key_id
|
||||
or (warn "$ME: GnuPG key ID not specified\n"), $fail = 1;
|
||||
@url_dir_list
|
||||
or (warn "$ME: URL directory name(s) not specified\n"), $fail = 1;
|
||||
|
||||
exists $valid_release_types{$release_type}
|
||||
or (warn "$ME: `$release_type': invalid release type\n"), $fail = 1;
|
||||
|
||||
@ARGV
|
||||
and (warn "$ME: too many arguments\n"), $fail = 1;
|
||||
$fail
|
||||
and usage 1;
|
||||
|
||||
my $my_distdir = "$package_name-$curr_version";
|
||||
my $tgz = "$my_distdir.tar.gz";
|
||||
my $tbz = "$my_distdir.tar.bz2";
|
||||
my $xd = "$package_name-$prev_version-$curr_version.xdelta";
|
||||
|
||||
my %size = sizes ($tgz, $tbz, $xd);
|
||||
%size
|
||||
or exit 1;
|
||||
|
||||
# The markup is escaped as <\# so that when this script is sent by
|
||||
# mail (or part of a diff), Gnus is not triggered.
|
||||
print <<EOF;
|
||||
|
||||
Subject: $my_distdir released
|
||||
|
||||
<\#secure method=pgpmime mode=sign>
|
||||
|
||||
FIXME: put comments here
|
||||
|
||||
EOF
|
||||
|
||||
print_locations ("compressed sources", @url_dir_list, %size,
|
||||
$tgz, $tbz);
|
||||
print_locations ("xdelta-style diffs", @url_dir_list, %size,
|
||||
$xd);
|
||||
print_locations ("GPG detached signatures[*]", @url_dir_list, %size,
|
||||
"$tgz.sig", "$tbz.sig");
|
||||
|
||||
print_checksums ($tgz, $tbz, $xd);
|
||||
|
||||
print <<EOF;
|
||||
|
||||
[*] You can use either of the above signature files to verify that
|
||||
the corresponding file (without the .sig suffix) is intact. First,
|
||||
be sure to download both the .sig file and the corresponding tarball.
|
||||
Then, run a command like this:
|
||||
|
||||
gpg --verify $tgz.sig
|
||||
|
||||
If that command fails because you don't have the required public key,
|
||||
then run this command to import it:
|
||||
|
||||
gpg --keyserver wwwkeys.pgp.net --recv-keys $gpg_key_id
|
||||
|
||||
and rerun the \`gpg --verify' command.
|
||||
EOF
|
||||
|
||||
print_news_deltas ($_, $prev_version, $curr_version)
|
||||
foreach @news_file;
|
||||
|
||||
$release_type eq 'major'
|
||||
or print_changelog_deltas ($package_name, $prev_version);
|
||||
|
||||
exit 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
### Setup "GNU" style for perl-mode and cperl-mode.
|
||||
## Local Variables:
|
||||
## perl-indent-level: 2
|
||||
## perl-continued-statement-offset: 2
|
||||
## perl-continued-brace-offset: 0
|
||||
## perl-brace-offset: 0
|
||||
## perl-brace-imaginary-offset: 0
|
||||
## perl-label-offset: -2
|
||||
## cperl-indent-level: 2
|
||||
## cperl-brace-offset: 0
|
||||
## cperl-continued-brace-offset: 0
|
||||
## cperl-label-offset: -2
|
||||
## cperl-extra-newline-before-brace: t
|
||||
## cperl-merge-trailing-else: nil
|
||||
## cperl-continued-statement-offset: 2
|
||||
## End:
|
||||
404
bootstrap
404
bootstrap
@@ -1,13 +1,13 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Bootstrap this package from CVS.
|
||||
# Bootstrap this package from checked-out sources.
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
# 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
|
||||
@@ -15,9 +15,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Written by Paul Eggert.
|
||||
|
||||
@@ -25,10 +23,16 @@ nl='
|
||||
'
|
||||
|
||||
# Ensure file names are sorted consistently across platforms.
|
||||
# Also, ensure diagnostics are in English, e.g., "wget --help" below.
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
|
||||
local_gl_dir=gl
|
||||
|
||||
# Temporary directory names.
|
||||
bt='._bootmp'
|
||||
bt_regex=`echo "$bt"| sed 's/\./[.]/g'`
|
||||
bt2=${bt}2
|
||||
|
||||
usage() {
|
||||
echo >&2 "\
|
||||
Usage: $0 [OPTION]...
|
||||
@@ -38,16 +42,14 @@ Options:
|
||||
--gnulib-srcdir=DIRNAME Specify the local directory where gnulib
|
||||
sources reside. Use this if you already
|
||||
have gnulib sources on your machine, and
|
||||
do not want to waste your bandwidth dowloading
|
||||
do not want to waste your bandwidth downloading
|
||||
them again.
|
||||
--copy Copy files instead of creating symbolic links.
|
||||
--force Attempt to bootstrap even if the sources seem
|
||||
not to have been checked out.
|
||||
--skip-po Do not download po files.
|
||||
--cvs-user=USERNAME Set the CVS username to be used when accessing
|
||||
the gnulib repository.
|
||||
|
||||
If the file .bootstrap.conf exists in the current working directory, its
|
||||
If the file bootstrap.conf exists in the current working directory, its
|
||||
contents are read as shell variables to configure the bootstrap.
|
||||
|
||||
Running without arguments will suffice in most cases.
|
||||
@@ -56,22 +58,29 @@ Running without arguments will suffice in most cases.
|
||||
|
||||
# Configuration.
|
||||
|
||||
# Name of the Makefile.am
|
||||
gnulib_mk=gnulib.mk
|
||||
|
||||
# List of gnulib modules needed.
|
||||
gnulib_modules=
|
||||
|
||||
# Any gnulib files needed that are not in modules.
|
||||
gnulib_files=
|
||||
|
||||
# Translation Project URL, for the registry of all projects
|
||||
# and for the translation-team master directory.
|
||||
TP_URL='http://www.iro.umontreal.ca/translation/registry.cgi?domain='
|
||||
TP_PO_URL='http://www.iro.umontreal.ca/translation/teams/PO/'
|
||||
# The command to download all .po files for a specified domain into
|
||||
# a specified directory. Fill in the first %s is the domain name, and
|
||||
# the second with the destination directory. Use rsync's -L and -r
|
||||
# options because the latest/%s directory and the .po files within are
|
||||
# all symlinks.
|
||||
po_download_command_format=\
|
||||
"rsync -Lrtvz 'translationproject.org::tp/latest/%s/' '%s'"
|
||||
|
||||
extract_package_name='
|
||||
/^AC_INIT(/{
|
||||
/.*,.*,.*,/{
|
||||
/.*,.*,.*, */{
|
||||
s///
|
||||
s/[][]//g
|
||||
s/)$//
|
||||
p
|
||||
q
|
||||
}
|
||||
@@ -84,18 +93,23 @@ extract_package_name='
|
||||
}
|
||||
'
|
||||
package=`sed -n "$extract_package_name" configure.ac` || exit
|
||||
gnulib_name=lib$package
|
||||
|
||||
build_aux=build-aux
|
||||
# Extra files from gnulib, which override files from other sources.
|
||||
gnulib_extra_files='
|
||||
build-aux/install-sh
|
||||
build-aux/missing
|
||||
build-aux/mdate-sh
|
||||
build-aux/texinfo.tex
|
||||
build-aux/depcomp
|
||||
build-aux/config.guess
|
||||
build-aux/config.sub
|
||||
gnulib_extra_files="
|
||||
$build_aux/install-sh
|
||||
$build_aux/missing
|
||||
$build_aux/mdate-sh
|
||||
$build_aux/texinfo.tex
|
||||
$build_aux/depcomp
|
||||
$build_aux/config.guess
|
||||
$build_aux/config.sub
|
||||
doc/INSTALL
|
||||
'
|
||||
"
|
||||
|
||||
# Additional gnulib-tool options to use. Use "\newline" to break lines.
|
||||
gnulib_tool_option_extras=
|
||||
|
||||
# Other locale categories that need message catalogs.
|
||||
EXTRA_LOCALE_CATEGORIES=
|
||||
@@ -112,14 +126,26 @@ excluded_files=
|
||||
|
||||
# File that should exist in the top directory of a checked out hierarchy,
|
||||
# but not in a distribution tarball.
|
||||
CVS_only_file=README-cvs
|
||||
checkout_only_file=README-hacking
|
||||
|
||||
# Whether to use copies instead of symlinks.
|
||||
copy=false
|
||||
|
||||
# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want
|
||||
# those files to be generated in directories like lib/, m4/, and po/.
|
||||
# Or set it to 'auto' to make this script select which to use based
|
||||
# on which version control system (if any) is used in the source directory.
|
||||
vc_ignore=auto
|
||||
|
||||
# Override the default configuration, if necessary.
|
||||
test -r bootstrap.conf && . ./bootstrap.conf
|
||||
|
||||
if test "$vc_ignore" = auto; then
|
||||
vc_ignore=
|
||||
test -d .git && vc_ignore=.gitignore
|
||||
test -d CVS && vc_ignore="$vc_ignore .cvsignore"
|
||||
fi
|
||||
|
||||
# Translate configuration into internal form.
|
||||
|
||||
# Parse options.
|
||||
@@ -132,12 +158,10 @@ do
|
||||
exit;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
|
||||
--cvs-user=*)
|
||||
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
CVS_only_file=;;
|
||||
checkout_only_file=;;
|
||||
--copy)
|
||||
copy=true;;
|
||||
*)
|
||||
@@ -146,12 +170,45 @@ do
|
||||
esac
|
||||
done
|
||||
|
||||
if test -n "$CVS_only_file" && test ! -r "$CVS_only_file"; then
|
||||
if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
|
||||
echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping CVS $package..."
|
||||
# If $STR is not already on a line by itself in $FILE, insert it,
|
||||
# sorting the new contents of the file and replacing $FILE with the result.
|
||||
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 -o $file \
|
||||
|| exit 1
|
||||
}
|
||||
|
||||
# Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
|
||||
found_aux_dir=no
|
||||
grep '^[ ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
grep '^[ ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
|
||||
>/dev/null && found_aux_dir=yes
|
||||
if test $found_aux_dir = no; then
|
||||
echo "$0: expected line not found in configure.ac. Add the following:" >&2
|
||||
echo " AC_CONFIG_AUX_DIR([$build_aux])" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If $build_aux doesn't exist, create it now, otherwise some bits
|
||||
# below will malfunction. If creating it, also mark it as ignored.
|
||||
if test ! -d $build_aux; then
|
||||
mkdir $build_aux
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
insert_sorted_if_absent $dot_ig $build_aux
|
||||
done
|
||||
fi
|
||||
|
||||
echo "$0: Bootstrapping from checked-out $package sources..."
|
||||
|
||||
cleanup_gnulib() {
|
||||
status=$?
|
||||
@@ -166,23 +223,9 @@ case ${GNULIB_SRCDIR--} in
|
||||
if [ ! -d gnulib ]; then
|
||||
echo "$0: getting gnulib files..."
|
||||
|
||||
case ${CVS_AUTH-pserver} in
|
||||
pserver)
|
||||
CVS_PREFIX=':pserver:anonymous@';;
|
||||
ssh)
|
||||
CVS_PREFIX="$CVS_USER${CVS_USER+@}";;
|
||||
*)
|
||||
echo "$0: $CVS_AUTH: Unknown CVS access method" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
case $CVS_RSH in
|
||||
'') CVS_RSH=ssh; export CVS_RSH;;
|
||||
esac
|
||||
|
||||
trap cleanup_gnulib 1 2 13 15
|
||||
|
||||
cvs -z3 -q -d ${CVS_PREFIX}cvs.savannah.gnu.org:/cvsroot/gnulib co gnulib ||
|
||||
git clone --depth 2 git://git.sv.gnu.org/gnulib ||
|
||||
cleanup_gnulib
|
||||
|
||||
trap - 1 2 13 15
|
||||
@@ -195,69 +238,81 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
|
||||
|
||||
# Get translations.
|
||||
|
||||
get_translations() {
|
||||
download_po_files() {
|
||||
subdir=$1
|
||||
domain=$2
|
||||
echo "$0: getting translations into $subdir for $domain..."
|
||||
cmd=`printf "$po_download_command_format" "$domain" "$subdir"`
|
||||
eval "$cmd"
|
||||
}
|
||||
|
||||
case $WGET_COMMAND in
|
||||
'')
|
||||
echo "$0: wget not available; skipping translations";;
|
||||
?*)
|
||||
echo "$0: getting translations into $subdir for $domain..." &&
|
||||
# Download .po files to $po_dir/.reference and copy only the new
|
||||
# or modified ones into $po_dir. Also update $po_dir/LINGUAS.
|
||||
update_po_files() {
|
||||
# Directory containing primary .po files.
|
||||
# Overwrite them only when we're sure a .po file is new.
|
||||
po_dir=$1
|
||||
domain=$2
|
||||
|
||||
(cd $subdir && rm -f dummy `ls | sed -n '/\.gmo$/p; /\.po/p'`) &&
|
||||
$WGET_COMMAND -O "$subdir/$domain.html" "$TP_URL$domain" &&
|
||||
# Download *.po files into this dir.
|
||||
# Usually contains *.s1 checksum files.
|
||||
ref_po_dir="$po_dir/.reference"
|
||||
|
||||
sed -n 's|.*"http://[^"]*/translation/teams/PO/\([^/"]*\)/'"$domain"'-\([^/"]*\)\.[^."]*\.po".*|\1.\2|p' <"$subdir/$domain.html" |
|
||||
sort -k 1,1 -k 2,2n -k2,2 -k3,3n -k3,3 -k4,4n -k4,4 -k5,5n -k5.5 |
|
||||
awk -F. '
|
||||
{ if (lang && $1 != lang) print lang, ver }
|
||||
{ lang = $1; ver = substr($0, index($0, ".") + 1) }
|
||||
END { if (lang) print lang, ver }
|
||||
' | awk -v domain="$domain" -v subdir="$subdir" '
|
||||
{
|
||||
lang = $1
|
||||
ver = $2
|
||||
urlfmt = ""
|
||||
printf "{ $WGET_COMMAND -O %s/%s.po '\'"$TP_PO_URL"'/%s/%s-%s.%s.po'\'' &&\n", subdir, lang, lang, domain, ver, lang
|
||||
printf " msgfmt -c -o /dev/null %s/%s.po || {\n", subdir, lang
|
||||
printf " echo >&2 '\'"$0"': omitting translation for %s'\''\n", lang
|
||||
printf " rm -f %s/%s.po; }; } &&\n", subdir, lang
|
||||
}
|
||||
END { print ":" }
|
||||
' | WGET_COMMAND="$WGET_COMMAND" sh;;
|
||||
esac &&
|
||||
ls "$subdir"/*.po 2>/dev/null |
|
||||
sed 's|.*/||; s|\.po$||' >"$subdir/LINGUAS" &&
|
||||
rm -f "$subdir/$domain.html"
|
||||
test -d $ref_po_dir || mkdir $ref_po_dir || return
|
||||
download_po_files $ref_po_dir $domain \
|
||||
&& ls "$ref_po_dir"/*.po 2>/dev/null |
|
||||
sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS"
|
||||
|
||||
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
|
||||
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
|
||||
echo "updated $po_dir/$po.po..."
|
||||
cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case $SKIP_PO in
|
||||
'')
|
||||
case `wget --help` in
|
||||
*'--no-cache'*)
|
||||
WGET_COMMAND='wget -nv --no-cache';;
|
||||
*'--cache=on/off'*)
|
||||
WGET_COMMAND='wget -nv --cache=off';;
|
||||
*'--non-verbose'*)
|
||||
WGET_COMMAND='wget -nv';;
|
||||
*)
|
||||
WGET_COMMAND='';;
|
||||
esac
|
||||
|
||||
get_translations po $package || exit
|
||||
if test -d po; then
|
||||
update_po_files po $package || exit
|
||||
fi
|
||||
|
||||
if test -d runtime-po; then
|
||||
get_translations runtime-po $package-runtime || exit
|
||||
update_po_files runtime-po $package-runtime || exit
|
||||
fi;;
|
||||
esac
|
||||
|
||||
symlink_to_gnulib()
|
||||
symlink_to_dir()
|
||||
{
|
||||
src=$GNULIB_SRCDIR/$1
|
||||
dst=${2-$1}
|
||||
src=$1/$2
|
||||
dst=${3-$2}
|
||||
|
||||
test -f "$src" && {
|
||||
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$dst"`
|
||||
if ! test -d "$dst_dir"; then
|
||||
mkdir -p "$dst_dir"
|
||||
|
||||
# If we've just created a directory like lib/uniwidth,
|
||||
# tell version control system(s) it's ignorable.
|
||||
# FIXME: for now, this does only one level
|
||||
parent=`dirname "$dst_dir"`
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$parent/$dot_ig
|
||||
insert_sorted_if_absent $ig `echo "$dst_dir"|sed 's,.*/,,'`
|
||||
done
|
||||
fi
|
||||
|
||||
if $copy; then
|
||||
{
|
||||
test ! -h "$dst" || {
|
||||
@@ -302,7 +357,9 @@ cp_mark_as_generated()
|
||||
cp_dst=$2
|
||||
|
||||
if cmp -s "$cp_src" "$GNULIB_SRCDIR/$cp_dst"; then
|
||||
symlink_to_gnulib "$cp_dst"
|
||||
symlink_to_dir "$GNULIB_SRCDIR" "$cp_dst"
|
||||
elif cmp -s "$cp_src" "$local_gl_dir/$cp_dst"; then
|
||||
symlink_to_dir $local_gl_dir "$cp_dst"
|
||||
else
|
||||
case $cp_dst in
|
||||
*.[ch]) c1='/* '; c2=' */';;
|
||||
@@ -311,10 +368,16 @@ cp_mark_as_generated()
|
||||
*) c1= ; c2= ;;
|
||||
esac
|
||||
|
||||
# If the destination directory doesn't exist, create it.
|
||||
# This is required at least for "lib/uniwidth/cjk.h".
|
||||
dst_dir=`dirname "$cp_dst"`
|
||||
test -d "$dst_dir" || mkdir -p "$dst_dir"
|
||||
|
||||
if test -z "$c1"; then
|
||||
cmp -s "$cp_src" "$cp_dst" || {
|
||||
echo "$0: cp -f $cp_src $cp_dst" &&
|
||||
cp -f "$cp_src" "$cp_dst"
|
||||
rm -f "$cp_dst" &&
|
||||
sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst"
|
||||
}
|
||||
else
|
||||
# Copy the file first to get proper permissions if it
|
||||
@@ -323,7 +386,7 @@ cp_mark_as_generated()
|
||||
(
|
||||
echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" &&
|
||||
echo "${c1}DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" &&
|
||||
cat "$cp_src"
|
||||
sed "s!$bt_regex/!!g" "$cp_src"
|
||||
) > $cp_dst-t &&
|
||||
if cmp -s "$cp_dst-t" "$cp_dst"; then
|
||||
rm -f "$cp_dst-t"
|
||||
@@ -354,18 +417,22 @@ slurp() {
|
||||
for dir in . `(cd $1 && find * -type d -print)`; do
|
||||
copied=
|
||||
sep=
|
||||
for file in `ls $1/$dir`; do
|
||||
for file in `ls -a $1/$dir`; do
|
||||
case $file in
|
||||
.|..) continue;;
|
||||
.*) continue;; # FIXME: should all file names starting with "." be ignored?
|
||||
esac
|
||||
test -d $1/$dir/$file && continue
|
||||
for excluded_file in $excluded_files; do
|
||||
test "$dir/$file" = "$excluded_file" && continue 2
|
||||
done
|
||||
if test $file = Makefile.am; then
|
||||
copied=$copied${sep}gnulib.mk; sep=$nl
|
||||
remove_intl='/^[^#].*\/intl/s/^/#/'
|
||||
sed "$remove_intl" $1/$dir/$file | cmp -s - $dir/gnulib.mk || {
|
||||
echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." &&
|
||||
rm -f $dir/gnulib.mk &&
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/gnulib.mk
|
||||
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 || {
|
||||
echo "$0: Copying $1/$dir/$file to $dir/$gnulib_mk ..." &&
|
||||
rm -f $dir/$gnulib_mk &&
|
||||
sed "$remove_intl" $1/$dir/$file >$dir/$gnulib_mk
|
||||
}
|
||||
elif { test "${2+set}" = set && test -r $2/$dir/$file; } ||
|
||||
version_controlled_file $dir $file; then
|
||||
@@ -389,11 +456,22 @@ slurp() {
|
||||
fi || exit
|
||||
done
|
||||
|
||||
for dot_ig in .cvsignore .gitignore; do
|
||||
for dot_ig in x $vc_ignore; do
|
||||
test $dot_ig = x && continue
|
||||
ig=$dir/$dot_ig
|
||||
if test -n "$copied" && test -f $ig; then
|
||||
echo "$copied" | sort -u - $ig | cmp -s - $ig ||
|
||||
echo "$copied" | sort -u - $ig -o $ig || exit
|
||||
if test -n "$copied"; then
|
||||
insert_sorted_if_absent $ig "$copied"
|
||||
# If an ignored file name ends with .in.h, then also add
|
||||
# the name with just ".h". Many gnulib headers are generated,
|
||||
# e.g., stdint.in.h -> stdint.h, dirent.in.h ->..., etc.
|
||||
# Likewise for .gperf -> .h, .y -> .c, and .sin -> .sed
|
||||
f=`echo "$copied"|sed 's/\.in\.h$/.h/;s/\.sin$/.sed/;s/\.y$/.c/;s/\.gperf$/.h/'`
|
||||
insert_sorted_if_absent $ig "$f"
|
||||
|
||||
# For files like sys_stat.in.h and sys_time.in.h, record as
|
||||
# ignorable the directory we might eventually create: sys/.
|
||||
f=`echo "$copied"|sed 's/sys_.*\.in\.h$/sys/'`
|
||||
insert_sorted_if_absent $ig "$f"
|
||||
fi
|
||||
done
|
||||
done
|
||||
@@ -401,9 +479,6 @@ slurp() {
|
||||
|
||||
|
||||
# Create boot temporary directories to import from gnulib and gettext.
|
||||
|
||||
bt='.#bootmp'
|
||||
bt2=${bt}2
|
||||
rm -fr $bt $bt2 &&
|
||||
mkdir $bt $bt2 || exit
|
||||
|
||||
@@ -412,86 +487,125 @@ mkdir $bt $bt2 || exit
|
||||
gnulib_tool_options="\
|
||||
--import\
|
||||
--no-changelog\
|
||||
--aux-dir $bt/build-aux\
|
||||
--aux-dir $bt/$build_aux\
|
||||
--doc-base $bt/doc\
|
||||
--lib lib$package\
|
||||
--lib $gnulib_name\
|
||||
--m4-base $bt/m4/\
|
||||
--source-base $bt/lib/\
|
||||
--tests-base $bt/tests\
|
||||
--local-dir gl\
|
||||
--local-dir $local_gl_dir\
|
||||
$gnulib_tool_option_extras\
|
||||
"
|
||||
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
|
||||
$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
|
||||
slurp $bt || exit
|
||||
|
||||
for file in $gnulib_files; do
|
||||
symlink_to_gnulib $file || exit
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file || exit
|
||||
done
|
||||
|
||||
|
||||
# Import from gettext.
|
||||
with_gettext=yes
|
||||
grep '^[ ]*AM_GNU_GETTEXT_VERSION(' configure.ac >/dev/null || \
|
||||
with_gettext=no
|
||||
|
||||
echo "$0: (cd $bt2; autopoint) ..."
|
||||
cp configure.ac $bt2 &&
|
||||
(cd $bt2 && autopoint && rm configure.ac) &&
|
||||
slurp $bt2 $bt || exit
|
||||
if test $with_gettext = yes; then
|
||||
echo "$0: (cd $bt2; autopoint) ..."
|
||||
cp configure.ac $bt2 &&
|
||||
(cd $bt2 && autopoint && rm configure.ac) &&
|
||||
slurp $bt2 $bt || exit
|
||||
|
||||
rm -fr $bt $bt2 || exit
|
||||
rm -fr $bt $bt2 || exit
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
# Reconfigure, getting other files.
|
||||
|
||||
for command in \
|
||||
libtool \
|
||||
'aclocal --force -I m4' \
|
||||
'autoconf --force' \
|
||||
'autoheader --force' \
|
||||
'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'
|
||||
fi
|
||||
echo "$0: $command ..."
|
||||
$command || exit
|
||||
done
|
||||
|
||||
|
||||
# Get some extra files from gnulib, overriding existing files.
|
||||
|
||||
for file in $gnulib_extra_files; do
|
||||
case $file in
|
||||
*/INSTALL) dst=INSTALL;;
|
||||
build-aux/*) dst=$build_aux/`expr "$file" : 'build-aux/\(.*\)'`;;
|
||||
*) dst=$file;;
|
||||
esac
|
||||
symlink_to_gnulib $file $dst || exit
|
||||
symlink_to_dir "$GNULIB_SRCDIR" $file $dst || exit
|
||||
done
|
||||
|
||||
|
||||
# Create gettext configuration.
|
||||
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||
rm -f po/Makevars
|
||||
sed '
|
||||
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' po/Makevars.template >po/Makevars
|
||||
|
||||
if test -d runtime-po; then
|
||||
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||
rm -f runtime-po/Makevars
|
||||
if test $with_gettext = yes; then
|
||||
# Create gettext configuration.
|
||||
echo "$0: Creating po/Makevars from po/Makevars.template ..."
|
||||
rm -f po/Makevars
|
||||
sed '
|
||||
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
|
||||
/^subdir *=.*/s/=.*/= runtime-po/
|
||||
/^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||
'"$XGETTEXT_OPTIONS"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' <po/Makevars.template >runtime-po/Makevars
|
||||
' po/Makevars.template >po/Makevars
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
if test -d runtime-po; then
|
||||
# Similarly for runtime-po/Makevars, but not quite the same.
|
||||
rm -f runtime-po/Makevars
|
||||
sed '
|
||||
/^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/
|
||||
/^subdir *=.*/s/=.*/= runtime-po/
|
||||
/^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/
|
||||
/^XGETTEXT_OPTIONS *=/{
|
||||
s/$/ \\/
|
||||
a\
|
||||
'"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+}
|
||||
}
|
||||
' <po/Makevars.template >runtime-po/Makevars
|
||||
|
||||
# Copy identical files from po to runtime-po.
|
||||
(cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Horrible, coreutils-specific kludges.
|
||||
# Change paths in gnulib-tests/gnulib.mk from "../.." to "..".
|
||||
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'."
|
||||
|
||||
131
bootstrap.conf
131
bootstrap.conf
@@ -1,11 +1,11 @@
|
||||
# Bootstrap configuration.
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
# 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
|
||||
@@ -13,17 +13,14 @@
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# 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 dependencies.
|
||||
# includes them because of gettext and fchdir dependencies.
|
||||
avoided_gnulib_modules='
|
||||
--avoid=lock
|
||||
--avoid=size_max
|
||||
--avoid=xsize
|
||||
--avoid=canonicalize-lgpl
|
||||
'
|
||||
|
||||
# These modules are obsolete and can probably be removed soon,
|
||||
@@ -37,34 +34,63 @@ obsolete_gnulib_modules='
|
||||
gnulib_modules="
|
||||
$avoided_gnulib_modules
|
||||
$obsolete_gnulib_modules
|
||||
acl alloca argmatch assert backupfile base64 c-strtod
|
||||
acl alloca announce-gen argmatch assert
|
||||
autobuild
|
||||
backupfile base64
|
||||
c-strcase c-strtod
|
||||
c-strtold calloc canon-host canonicalize chown cloexec
|
||||
config-h configmake
|
||||
closeout cycle-check d-ino d-type diacrit dirfd dirname dup2
|
||||
error euidaccess exclude exitfail fcntl fcntl-safer fdl file-type
|
||||
fileblocks filemode filenamecat fnmatch-gnu fopen-safer
|
||||
fprintftime fsusage ftruncate fts getdate getgroups gethrxtime
|
||||
closein closeout
|
||||
crypto/md5 crypto/sha1
|
||||
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
|
||||
fopen-safer
|
||||
fprintftime
|
||||
fseeko
|
||||
fsusage ftruncate
|
||||
ftello
|
||||
fts getdate getgroups gethrxtime
|
||||
getline getloadavg getndelim2 getopt getpagesize getpass-gnu
|
||||
gettext gettime gettimeofday getugroups getusershell gnupload
|
||||
gettext gettime gettimeofday getugroups getusershell
|
||||
git-version-gen
|
||||
gnu-make gnupload
|
||||
group-member hard-locale hash hash-pjw host-os human idcache
|
||||
inttostr inttypes isapipe
|
||||
lchmod lchown lib-ignore linebuffer link-follow
|
||||
long-options lstat malloc mbswidth md5 memcasecmp mempcpy
|
||||
memrchr mkancesdirs mkdir mkdir-p mkstemp mktime modechange
|
||||
mountlist obstack pathmax perl physmem posixtm posixver putenv
|
||||
quote quotearg raise readlink readtokens readtokens0 readutmp
|
||||
long-options lstat malloc mbswidth memcasecmp mempcpy
|
||||
memrchr mgetgroups
|
||||
mkancesdirs mkdir mkdir-p mkstemp mktime modechange
|
||||
mountlist mpsort obstack pathmax perl physmem
|
||||
posix-shell posixtm posixver putenv
|
||||
quote quotearg raise readlink areadlink-with-size
|
||||
randint
|
||||
randperm
|
||||
readtokens
|
||||
readtokens0 readutmp
|
||||
realloc regex rename-dest-slash rmdir rmdir-errno
|
||||
root-dev-ino
|
||||
rpmatch
|
||||
safe-read same
|
||||
save-cwd savedir savewd settime sha1 sig2str ssize_t stat-macros
|
||||
stat-time stdbool stdlib-safer stpcpy strcase strftime
|
||||
save-cwd savedir savewd
|
||||
selinux-at
|
||||
settime sig2str ssize_t stat-macros
|
||||
stat-time stdbool stdlib-safer stpcpy
|
||||
stpncpy
|
||||
strftime
|
||||
strpbrk strtoimax strtoumax strverscmp sys_stat timespec tzset
|
||||
unicodeio unistd-safer unlink-busy unlinkdir unlocked-io
|
||||
uptime userspec utimecmp utimens vasprintf verify version-etc-fsf
|
||||
wcwidth winsz-ioctl winsz-termios xalloc xgetcwd xgethostname
|
||||
xmemcoll xnanosleep xreadlink xstrtod xstrtoimax xstrtol
|
||||
xstrtold xstrtoumax yesno
|
||||
uptime userspec utimecmp utimens
|
||||
vasprintf-posix
|
||||
verify version-etc-fsf
|
||||
wcwidth winsz-ioctl winsz-termios write-any-file
|
||||
xalloc xgetcwd xgethostname
|
||||
xmemcoll xnanosleep
|
||||
xprintf
|
||||
xprintf-posix
|
||||
xstrtod xstrtoimax
|
||||
xstrtol xstrtold xstrtoumax yesno
|
||||
"
|
||||
|
||||
# Other locale categories that need message catalogs.
|
||||
@@ -73,22 +99,43 @@ EXTRA_LOCALE_CATEGORIES=LC_TIME
|
||||
# Additional xgettext options to use. Use "\\\newline" to break lines.
|
||||
XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\
|
||||
--from-code=UTF-8\\\
|
||||
--flag=asprintf:2:c-format --flag=vasprintf:2:c-format\\\
|
||||
--flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\
|
||||
--flag=asprintf:2:c-format\\\
|
||||
--flag=asnprintf:3:c-format\\\
|
||||
--flag=error:3:c-format\\\
|
||||
--flag=error_at_line:5:c-format\\\
|
||||
--flag=vasprintf:2:c-format\\\
|
||||
--flag=vasnprintf:3:c-format\\\
|
||||
--flag=wrapf:1:c-format\\\
|
||||
--flag=xasprintf:1:c-format\\\
|
||||
--flag=xfprintf:2:c-format\\\
|
||||
--flag=xprintf:1:c-format\\\
|
||||
'
|
||||
|
||||
# Gettext supplies these files, but we don't need them since
|
||||
# we don't have an intl subdirectory.
|
||||
excluded_files='
|
||||
m4/glibc2.m4
|
||||
m4/intdiv0.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/printf-posix.m4
|
||||
m4/size_max.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
m4/xsize.m4
|
||||
'
|
||||
# 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),
|
||||
# the following test is ugly. Also, this depends on the existence
|
||||
# of configure.ac, not the obsolescent-named configure.in. But if
|
||||
# you're using this infrastructure, you should care about such things.
|
||||
|
||||
gettext_external=0
|
||||
grep '^[ ]*AM_GNU_GETTEXT(external\>' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
grep '^[ ]*AM_GNU_GETTEXT(\[external\]' configure.ac > /dev/null &&
|
||||
gettext_external=1
|
||||
|
||||
if test $gettext_external = 1; then
|
||||
# Gettext supplies these files, but we don't need them since
|
||||
# we don't have an intl subdirectory.
|
||||
excluded_files='
|
||||
m4/glibc2.m4
|
||||
m4/intdiv0.m4
|
||||
m4/lcmessage.m4
|
||||
m4/lock.m4
|
||||
m4/uintmax_t.m4
|
||||
m4/ulonglong.m4
|
||||
m4/visibility.m4
|
||||
'
|
||||
fi
|
||||
|
||||
gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
gnupload
|
||||
install-sh
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
3
build-aux/.gitignore
vendored
3
build-aux/.gitignore
vendored
@@ -1,10 +1,13 @@
|
||||
announce-gen
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
git-version-gen
|
||||
gnupload
|
||||
install-sh
|
||||
link-warning.h
|
||||
mdate-sh
|
||||
missing
|
||||
texinfo.tex
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
2007-09-29 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* check.mk (%.log): Also allow suffix-less tests, on platforms
|
||||
where $(EXEEXT) is not empty.
|
||||
|
||||
2007-09-15 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vc-list-files: Remove mercurial support.
|
||||
Check for CVS first. Adjust comments.
|
||||
|
||||
2007-01-30 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vc-list-files: Select column 2, not 3 (hg-0.9.3's manifest format
|
||||
now has only two columns).
|
||||
|
||||
2006-10-14 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vc-list-files: Don't filter git-ls-files output through cut.
|
||||
|
||||
268
build-aux/check.mk
Normal file
268
build-aux/check.mk
Normal file
@@ -0,0 +1,268 @@
|
||||
## Vaucanson, a generic library for finite state machines.
|
||||
## Copyright (C) 2006, 2007 The Vaucanson Group.
|
||||
##
|
||||
## 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 2
|
||||
## of the License, or (at your option) any later version.
|
||||
##
|
||||
## The complete GNU General Public Licence Notice can be found as the
|
||||
## `COPYING' file in the root directory.
|
||||
|
||||
## Override the definition from Automake to generate a log file with
|
||||
## failed tests. It also supports parallel make checks.
|
||||
##
|
||||
## This file provides special support for "unit tests", that is to
|
||||
## say, tests that (once run) no longer need to be re-compiled and
|
||||
## re-run at each "make check", unless their sources changed. To
|
||||
## enable unit-test supports, define LAZY_TEST_SUITE. In such a
|
||||
## setting, that heavily relies on correct dependencies, its users may
|
||||
## prefer to define EXTRA_PROGRAMS instead of check_PROGRAMS, because
|
||||
## it allows intertwined compilation and execution of the tests.
|
||||
## Sometimes this helps catching errors earlier (you don't have to
|
||||
## wait for all the tests to be compiled).
|
||||
##
|
||||
## Define TEST_SUITE_LOG to be the name of the global log to create.
|
||||
## Define TEST_LOGS to the set of logs to include in it. One possibility
|
||||
## is $(TESTS:.test=.log).
|
||||
##
|
||||
## In addition to the magic "exit 77 means SKIP" feature (which was
|
||||
## imported from automake), there is a magic "exit 177 means FAIL" feature
|
||||
## which is useful if you need to issue a hard error no matter whether the
|
||||
## test is XFAIL or not.
|
||||
|
||||
# Use a POSIX-compatible shell if available, as this file uses
|
||||
# features of the POSIX shell that are not supported by some standard
|
||||
# shell implementations (e.g., Solaris 10 /bin/sh).
|
||||
SHELL = $(PREFERABLY_POSIX_SHELL)
|
||||
|
||||
# Set this to `false' to disable hard errors.
|
||||
ENABLE_HARD_ERRORS = :
|
||||
|
||||
## We use GNU Make extensions (%-rules) inside GNU_MAKE checks,
|
||||
## and we override check-TESTS.
|
||||
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/.*//'
|
||||
am__rst_section = sed 'p;s/./=/g;p;g'
|
||||
|
||||
# Put stdin (possibly several lines separated by ". ") in a box.
|
||||
am__text_box = $(AWK) '{gsub ("\\. ", "\n"); print $$0; }' | \
|
||||
$(AWK) ' \
|
||||
max < length($$0) { \
|
||||
final= final (final ? "\n" : "") " " $$0; \
|
||||
max = length($$0); \
|
||||
} \
|
||||
END { \
|
||||
for (i = 0; i < max + 2 ; ++i) \
|
||||
line = line "="; \
|
||||
print line; \
|
||||
print final; \
|
||||
print line; \
|
||||
}'
|
||||
|
||||
# If stdout is a tty and TERM is smart then use colors. If test -t or
|
||||
# tput are not supported then this fails; a conservative approach. Of
|
||||
# course do not redirect stdout here, just stderr...
|
||||
am__tty_colors = \
|
||||
red=; \
|
||||
grn=; \
|
||||
lgn=; \
|
||||
blu=; \
|
||||
std=; \
|
||||
test "X$$TERM" != Xdumb && \
|
||||
test -t 1 2>/dev/null && \
|
||||
tput bold 1 >/dev/null 2>&1 && \
|
||||
tput setaf 1 >/dev/null 2>&1 && \
|
||||
tput sgr0 >/dev/null 2>&1 && \
|
||||
{ \
|
||||
red=$$(tput setaf 1); \
|
||||
grn=$$(tput setaf 2); \
|
||||
lgn=$$(tput bold)$$(tput setaf 2); \
|
||||
blu=$$(tput setaf 4); \
|
||||
std=$$(tput sgr0); \
|
||||
}
|
||||
|
||||
# Solaris 10 'make', and several other traditional 'make' implementations,
|
||||
# pass "-e" to $(SHELL). This contradicts POSIX. Work around the problem
|
||||
# by disabling -e (using the XSI extension "set +e") if it's set.
|
||||
SH_E_WORKAROUND = case $$- in *e*) set +e;; esac
|
||||
|
||||
# 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.
|
||||
am__check_pre = \
|
||||
$(SH_E_WORKAROUND); \
|
||||
tst=`echo "$$src" | sed 's|^.*/||'`; \
|
||||
rm -f $@-t; \
|
||||
$(mkdir_p) "$$(dirname $@)" || exit; \
|
||||
if test -f "./$$src"; then dir=./; \
|
||||
elif test -f "$$src"; then dir=; \
|
||||
else dir="$(srcdir)/"; fi; \
|
||||
$(TESTS_ENVIRONMENT) $(SHELL)
|
||||
|
||||
# To be appended to the command running the test. Handles the stdout
|
||||
# and stderr redirection, and catch the exit status.
|
||||
am__check_post = \
|
||||
>$@-t 2>&1; \
|
||||
estatus=$$?; \
|
||||
if test $$estatus -eq 177; then \
|
||||
$(ENABLE_HARD_ERRORS) || estatus=1; \
|
||||
fi; \
|
||||
$(am__tty_colors); \
|
||||
xfailed=PASS; \
|
||||
for xfail in : $(XFAIL_TESTS); do \
|
||||
case $$src in \
|
||||
$$xfail | */$$xfail) xfailed=XFAIL; break; \
|
||||
esac; \
|
||||
done; \
|
||||
case $$estatus:$$xfailed in \
|
||||
0:XFAIL) col=$$red; res=XPASS;; \
|
||||
0:*) col=$$grn; res=PASS ;; \
|
||||
77:*) col=$$blu; res=SKIP ;; \
|
||||
177:*) col=$$red; res=FAIL ;; \
|
||||
*:XFAIL) col=$$lgn; res=XFAIL;; \
|
||||
*:*) col=$$red; res=FAIL ;; \
|
||||
esac; \
|
||||
echo "$${col}$$res$${std}: $@"; \
|
||||
echo "$$res: $@ (exit: $$estatus)" | \
|
||||
$(am__rst_section) >$@; \
|
||||
cat $@-t >>$@; \
|
||||
rm $@-t
|
||||
|
||||
SUFFIXES = .html .log
|
||||
|
||||
# From a test (with no extension) to a log file.
|
||||
if GNU_MAKE
|
||||
%.log: %
|
||||
@src='$<'; $(am__check_pre) "$$dir$$src" $(am__check_post)
|
||||
else
|
||||
# With POSIX 'make', inference rules cannot have FOO.log depend on FOO.
|
||||
# Work around the problem by calculating the dependency dynamically, and
|
||||
# then invoking a submake with the calculated dependency.
|
||||
CHECK-FORCE:
|
||||
DEPENDENCY = CHECK-FORCE
|
||||
$(TEST_LOGS): $(DEPENDENCY)
|
||||
@if test '$(DEPENDENCY)' = CHECK-FORCE; then \
|
||||
dst=$@; \
|
||||
exec $(MAKE) $(AM_MAKEFLAGS) DEPENDENCY='$(srcdir)'/$${dst%.log} $@;\
|
||||
else \
|
||||
src='$(DEPENDENCY)'; \
|
||||
$(am__check_pre) "$$dir$$src" $(am__check_post); \
|
||||
fi
|
||||
endif
|
||||
|
||||
#TEST_LOGS = $(TESTS:.test=.log)
|
||||
TEST_SUITE_LOG = test-suite.log
|
||||
|
||||
$(TEST_SUITE_LOG): $(TEST_LOGS)
|
||||
@$(SH_E_WORKAROUND); \
|
||||
results=$$(for f in $(TEST_LOGS); do sed 1q $$f; done); \
|
||||
all=$$(echo "$$results" | wc -l | sed -e 's/^[ \t]*//'); \
|
||||
fail=$$(echo "$$results" | grep -c '^FAIL'); \
|
||||
pass=$$(echo "$$results" | grep -c '^PASS'); \
|
||||
skip=$$(echo "$$results" | grep -c '^SKIP'); \
|
||||
xfail=$$(echo "$$results" | grep -c '^XFAIL'); \
|
||||
xpass=$$(echo "$$results" | grep -c '^XPASS'); \
|
||||
failures=$$(expr $$fail + $$xpass); \
|
||||
case fail=$$fail:xpass=$$xpass:xfail=$$xfail in \
|
||||
fail=0:xpass=0:xfail=0) \
|
||||
msg="All $$all tests passed. "; \
|
||||
exit=true;; \
|
||||
fail=0:xpass=0:xfail=*) \
|
||||
msg="All $$all tests behaved as expected"; \
|
||||
msg="$$msg ($$xfail expected failures). "; \
|
||||
exit=true;; \
|
||||
fail=*:xpass=0:xfail=*) \
|
||||
msg="$$fail of $$all tests failed. "; \
|
||||
exit=false;; \
|
||||
fail=*:xpass=*:xfail=*) \
|
||||
msg="$$failures of $$all tests did not behave as expected"; \
|
||||
msg="$$msg ($$xpass unexpected passes). "; \
|
||||
exit=false;; \
|
||||
*) \
|
||||
echo >&2 "incorrect case"; exit 4;; \
|
||||
esac; \
|
||||
if test "$$skip" -ne 0; then \
|
||||
msg="$$msg($$skip tests were not run). "; \
|
||||
fi; \
|
||||
if test "$$failures" -ne 0; then \
|
||||
{ \
|
||||
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
|
||||
$(am__rst_title); \
|
||||
echo "$$msg"; \
|
||||
echo; \
|
||||
echo ".. contents:: :depth: 2"; \
|
||||
echo; \
|
||||
for f in $(TEST_LOGS); \
|
||||
do \
|
||||
case $$(sed 1q $$f) in \
|
||||
SKIP:*|PASS:*|XFAIL:*);; \
|
||||
*) echo; cat $$f;; \
|
||||
esac; \
|
||||
done; \
|
||||
} >$(TEST_SUITE_LOG).tmp; \
|
||||
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
|
||||
msg="$${msg}See $(subdir)/$(TEST_SUITE_LOG). "; \
|
||||
if test -n "$(PACKAGE_BUGREPORT)"; then \
|
||||
msg="$${msg}Please report it to $(PACKAGE_BUGREPORT). "; \
|
||||
fi; \
|
||||
fi; \
|
||||
$(am__tty_colors); \
|
||||
if $$exit; then echo $$grn; else echo $$red; fi; \
|
||||
echo "$$msg" | $(am__text_box); \
|
||||
echo $$std; \
|
||||
test x"$$VERBOSE" = x || $$exit || cat $(TEST_SUITE_LOG); \
|
||||
$$exit
|
||||
|
||||
# if test x"$$VERBOSE" != x && ! $exit; then
|
||||
|
||||
# Run all the tests.
|
||||
check-TESTS:
|
||||
@if test -z '$(LAZY_TEST_SUITE)'; then \
|
||||
rm -f $(TEST_SUITE_LOG) $(TEST_LOGS); \
|
||||
fi
|
||||
@$(MAKE) $(TEST_SUITE_LOG)
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Produce HTML. ##
|
||||
## -------------- ##
|
||||
|
||||
TEST_SUITE_HTML = $(TEST_SUITE_LOG:.log=.html)
|
||||
|
||||
.log.html:
|
||||
@for r2h in $(RST2HTML) $$RST2HTML rst2html rst2html.py; \
|
||||
do \
|
||||
if ($$r2h --version) >/dev/null 2>&1; then \
|
||||
R2H=$$r2h; \
|
||||
fi; \
|
||||
done; \
|
||||
if test -z "$$R2H"; then \
|
||||
echo >&2 "cannot find rst2html, cannot create $@"; \
|
||||
exit 2; \
|
||||
fi; \
|
||||
$$R2H $< >$@.tmp
|
||||
@mv $@.tmp $@
|
||||
|
||||
# Be sure to run check-TESTS first, and then to convert the result.
|
||||
# Beware of concurrent executions. And expect check-TESTS to fail.
|
||||
check-html:
|
||||
@if $(MAKE) $(AM_MAKEFLAGS) check-TESTS; then :; else \
|
||||
rv=$$?; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_HTML); \
|
||||
exit $$rv; \
|
||||
fi
|
||||
|
||||
.PHONY: check-html
|
||||
|
||||
|
||||
## ------- ##
|
||||
## Clean. ##
|
||||
## ------- ##
|
||||
|
||||
check-clean:
|
||||
rm -f $(CHECK_CLEANFILES) $(TEST_SUITE_LOG) $(TEST_SUITE_HTML) $(TEST_LOGS)
|
||||
.PHONY: check-clean
|
||||
clean-local: check-clean
|
||||
@@ -6,20 +6,18 @@
|
||||
# Initially written by Tom Tromey <tromey@cygnus.com>
|
||||
# Completely rewritten by Pavel Roskin <proski@gnu.org>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# 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, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
# 02111-1307, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
require 5.004;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
# List the specified version-controlled files.
|
||||
|
||||
# Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
# 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
|
||||
@@ -14,47 +14,37 @@
|
||||
# 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# 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,
|
||||
# with no trailing slashes. In mercurial mode, it's used as part of a
|
||||
# "grep" pattern (prepend "^", append "/"), and in cvs mode, it's simply
|
||||
# used as an argument to the cvsu script.
|
||||
# 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/
|
||||
|
||||
include_prefix=
|
||||
dir=
|
||||
case $# in
|
||||
0) ;;
|
||||
1) include_prefix=$1 ;;
|
||||
1) dir=$1 ;;
|
||||
*) echo "$0: too many arguments" 1>&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
if test -d .git; then
|
||||
if test "x$include_prefix" = x; then
|
||||
git-ls-files
|
||||
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
|
||||
git-ls-files | grep "^$include_prefix/"
|
||||
awk -F/ '{ \
|
||||
if (!$1 && $3 !~ /^-/) { \
|
||||
f=FILENAME; \
|
||||
sub(/CVS\/Entries/, "", f); \
|
||||
print f $2; \
|
||||
}}' \
|
||||
$(find ${*-*} -name Entries -print) /dev/null;
|
||||
fi
|
||||
elif test -d .hg; then
|
||||
if test "x$include_prefix" = x; then
|
||||
hg manifest | cut -d ' ' -f 3
|
||||
else
|
||||
hg manifest | cut -d ' ' -f 3 | grep "^$include_prefix/"
|
||||
fi
|
||||
elif test -x build-aux/cvsu; then
|
||||
build-aux/cvsu --find --types=AFGM $include_prefix
|
||||
else
|
||||
awk -F/ '{ \
|
||||
if (!$1 && $3 !~ /^-/) { \
|
||||
f=FILENAME; \
|
||||
sub(/CVS\/Entries/, "", f); \
|
||||
print f $2; \
|
||||
}}' \
|
||||
$(find ${*-*} -name Entries -print) /dev/null;
|
||||
git-ls-files "$dir"
|
||||
fi
|
||||
|
||||
158
configure.ac
158
configure.ac
@@ -1,12 +1,12 @@
|
||||
# -*- autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# Copyright (C) 1991, 1993-2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1993-2008 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2, or (at your option)
|
||||
# any later version.
|
||||
# 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
|
||||
@@ -14,20 +14,25 @@
|
||||
# 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, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
dnl Written by Jim Meyering.
|
||||
|
||||
AC_PREREQ(2.60)
|
||||
AC_INIT([GNU coreutils],[6.6],[bug-coreutils@gnu.org])
|
||||
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]),
|
||||
[bug-coreutils@gnu.org])
|
||||
|
||||
AC_CONFIG_SRCDIR(src/ls.c)
|
||||
|
||||
AC_CONFIG_AUX_DIR(build-aux)
|
||||
AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
|
||||
|
||||
AB_INIT()
|
||||
AM_INIT_AUTOMAKE([1.9.6 gnits dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([1.10 dist-lzma])
|
||||
|
||||
AC_PROG_CC_STDC
|
||||
AM_PROG_CC_C_O
|
||||
@@ -39,15 +44,15 @@ gl_EARLY
|
||||
gl_INIT
|
||||
coreutils_MACROS
|
||||
|
||||
AC_FUNC_FORK
|
||||
|
||||
optional_bin_progs=
|
||||
AC_CHECK_FUNCS(uname,
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uname\$(EXEEXT)"
|
||||
MAN="$MAN uname.1")
|
||||
gl_ADD_PROG([optional_bin_progs], [uname]))
|
||||
AC_CHECK_FUNCS(chroot,
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS chroot\$(EXEEXT)"
|
||||
MAN="$MAN chroot.1")
|
||||
gl_ADD_PROG([optional_bin_progs], [chroot]))
|
||||
AC_CHECK_FUNCS(gethostid,
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS hostid\$(EXEEXT)"
|
||||
MAN="$MAN hostid.1")
|
||||
gl_ADD_PROG([optional_bin_progs], [hostid]))
|
||||
|
||||
gl_WINSIZE_IN_PTEM
|
||||
|
||||
@@ -128,18 +133,16 @@ if test $utils_cv_func_setpriority = no; then
|
||||
fi
|
||||
case $utils_cv_func_setpriority,$ac_cv_func_nice in
|
||||
*yes*)
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
|
||||
MAN="$MAN nice.1";;
|
||||
gl_ADD_PROG([optional_bin_progs], [nice])
|
||||
esac
|
||||
|
||||
AC_DEFUN([coreutils_DUMMY_1],
|
||||
[
|
||||
AC_REQUIRE([gl_READUTMP])
|
||||
if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS pinky\$(EXEEXT)"
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS users\$(EXEEXT)"
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS who\$(EXEEXT)"
|
||||
MAN="$MAN pinky.1 users.1 who.1"
|
||||
gl_ADD_PROG([optional_bin_progs], [who])
|
||||
gl_ADD_PROG([optional_bin_progs], [users])
|
||||
gl_ADD_PROG([optional_bin_progs], [pinky])
|
||||
fi
|
||||
])
|
||||
coreutils_DUMMY_1
|
||||
@@ -170,15 +173,13 @@ if test -z "$have_ut_host"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
GNULIB_BOOT_TIME(
|
||||
[OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS uptime\$(EXEEXT)"
|
||||
MAN="$MAN uptime.1"])
|
||||
GNULIB_BOOT_TIME([gl_ADD_PROG([optional_bin_progs], [uptime])])
|
||||
|
||||
AC_SYS_POSIX_TERMIOS()
|
||||
gl_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL
|
||||
|
||||
if test $ac_cv_sys_posix_termios = yes; then
|
||||
OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS stty\$(EXEEXT)" MAN="$MAN stty.1"
|
||||
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,
|
||||
@@ -216,8 +217,8 @@ gl_WINSIZE_IN_PTEM
|
||||
|
||||
gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H
|
||||
|
||||
if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no && \
|
||||
test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = no; then
|
||||
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_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
@@ -242,11 +243,92 @@ AC_CHECK_DECLS([strsignal, sys_siglist, _sys_siglist, __sys_siglist], , ,
|
||||
[AC_INCLUDES_DEFAULT
|
||||
#include <signal.h>])
|
||||
|
||||
# For src/kill.c and src/printf.c.
|
||||
AC_CHECK_DECLS([strtoimax, strtoumax])
|
||||
|
||||
cu_LIB_CHECK
|
||||
|
||||
# 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
|
||||
gl_ADD_PROG([optional_bin_progs], [df])
|
||||
fi
|
||||
|
||||
############################################################################
|
||||
mk="$srcdir/src/Makefile.am"
|
||||
# Extract all literal names from the definition of $(EXTRA_PROGRAMS)
|
||||
# in $mk but don't expand the variable references.
|
||||
# Append each literal name to $optional_bin_progs.
|
||||
v=EXTRA_PROGRAMS
|
||||
for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
||||
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
||||
| tr -s '\\012\\\\' ' '`; do
|
||||
gl_ADD_PROG([optional_bin_progs], $gl_i)
|
||||
done
|
||||
|
||||
# As above, extract literal names from the definition of $(no_install__progs)
|
||||
# in $mk but don't expand the variable references.
|
||||
v=no_install__progs
|
||||
t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
|
||||
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
|
||||
| tr -s '\\012\\\\' ' '`
|
||||
# Remove any trailing space.
|
||||
no_install_progs_default=`echo "$t"|sed 's/ $//'`
|
||||
|
||||
# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the list
|
||||
# of default-not-installed programs, "arch hostname su", must appear in two
|
||||
# places: in this file below, and in $mk. Using "$no_install_progs_default"
|
||||
# below cannot work. And we can't substitute the names into $mk because
|
||||
# automake needs the literals, too.
|
||||
# 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
|
||||
}' $c`
|
||||
case $t in
|
||||
$no_install_progs_default) ;;
|
||||
*) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t,
|
||||
does not match the list of default-not-installed programs
|
||||
($no_install_progs_default) also recorded in $mk]],
|
||||
1) ;;
|
||||
esac
|
||||
|
||||
# Given the name of a variable containing a space-separated list of
|
||||
# install-by-default programs and the actual list do-not-install-by-default
|
||||
# programs, modify the former variable to reflect any "do-install" and
|
||||
# "don't-install" requests.
|
||||
# I.e., add any program name specified via --enable-install-program=..., and
|
||||
# remove any program name specified via --enable-no-install-program=...
|
||||
# Note how the second argument below is a literal, with "," separators.
|
||||
# That is required due to the way the macro works, and since the
|
||||
# corresponding ./configure option argument is comma-separated on input.
|
||||
gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,hostname,su])
|
||||
|
||||
# Set INSTALL_SU if su installation has been requested via
|
||||
# --enable-install-program=su.
|
||||
AC_SUBST([INSTALL_SU])
|
||||
case " $optional_bin_progs " in
|
||||
*' su '*) INSTALL_SU=yes ;;
|
||||
*) INSTALL_SU=no ;;
|
||||
esac
|
||||
|
||||
MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'`
|
||||
|
||||
# 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`
|
||||
|
||||
# Remove [.1, since writing a portable rule for it in man/Makefile.am
|
||||
# is not practical. The sed LHS below uses the autoconf quadrigraph
|
||||
# representing '['.
|
||||
MAN=`echo "$MAN"|sed 's/\@<:@\.1//'`
|
||||
|
||||
OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'`
|
||||
AC_SUBST([OPTIONAL_BIN_PROGS])
|
||||
NO_INSTALL_PROGS_DEFAULT=$no_install_progs_default
|
||||
AC_SUBST([NO_INSTALL_PROGS_DEFAULT])
|
||||
|
||||
# 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'
|
||||
AC_SUBST([CONFIG_STATUS_DEPENDENCIES])
|
||||
############################################################################
|
||||
|
||||
AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
||||
AM_GNU_GETTEXT_VERSION([0.15])
|
||||
|
||||
@@ -258,47 +340,33 @@ AC_CONFIG_FILES(
|
||||
po/Makefile.in
|
||||
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/dircolors/Makefile
|
||||
tests/du/Makefile
|
||||
tests/expr/Makefile
|
||||
tests/factor/Makefile
|
||||
tests/fmt/Makefile
|
||||
tests/head/Makefile
|
||||
tests/install/Makefile
|
||||
tests/join/Makefile
|
||||
tests/ln/Makefile
|
||||
tests/ls-2/Makefile
|
||||
tests/ls/Makefile
|
||||
tests/md5sum/Makefile
|
||||
tests/misc/Makefile
|
||||
tests/mkdir/Makefile
|
||||
tests/mv/Makefile
|
||||
tests/od/Makefile
|
||||
tests/pr/Makefile
|
||||
tests/readlink/Makefile
|
||||
tests/rm/Makefile
|
||||
tests/rmdir/Makefile
|
||||
tests/seq/Makefile
|
||||
tests/sha1sum/Makefile
|
||||
tests/shred/Makefile
|
||||
tests/sort/Makefile
|
||||
tests/stty/Makefile
|
||||
tests/sum/Makefile
|
||||
tests/tac/Makefile
|
||||
tests/tail-2/Makefile
|
||||
tests/tail/Makefile
|
||||
tests/tee/Makefile
|
||||
tests/test/Makefile
|
||||
tests/touch/Makefile
|
||||
tests/tr/Makefile
|
||||
tests/tsort/Makefile
|
||||
tests/unexpand/Makefile
|
||||
tests/uniq/Makefile
|
||||
tests/wc/Makefile
|
||||
)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
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.ps
|
||||
coreutils.tmp
|
||||
coreutils.toc
|
||||
coreutils.tp
|
||||
coreutils.tps
|
||||
coreutils.vr
|
||||
fdl.texi
|
||||
getdate.texi
|
||||
stamp-vti
|
||||
version.texi
|
||||
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
constants.texi
|
||||
coreutils.info
|
||||
fdl.texi
|
||||
getdate.texi
|
||||
|
||||
119
doc/ChangeLog
119
doc/ChangeLog
@@ -1,3 +1,122 @@
|
||||
2007-10-05 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (chroot invocation): List two systems on which
|
||||
chroot works when run by non-root.
|
||||
|
||||
2007-09-19 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (expr invocation): Correct description of relative
|
||||
operator precedence. Reported by hanpingtian@gmail.com.
|
||||
|
||||
2007-08-25 Eric Blake <ebb9@byu.net>
|
||||
|
||||
Avoid case-insensitive clash in one-page-per-node html docs.
|
||||
* coreutils.texi (Concept index): Rename from Index.
|
||||
|
||||
2007-07-15 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi: Revise node structure per new fdl.texi.
|
||||
|
||||
2007-06-06 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (rmdir invocation): Fix a tiny typo.
|
||||
|
||||
2007-06-03 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* constants.texi: Remove from version control.
|
||||
This file has always been generated.
|
||||
* .gitignore: Add constants.texi.
|
||||
|
||||
2007-04-28 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* coreutils.texi (nohup invocation): Add advice about saving
|
||||
output to a file.
|
||||
|
||||
2007-04-16 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (cut invocation): Adjust synopsis to show that an
|
||||
OPTION is required. Reported by Rudolf Kastl.
|
||||
|
||||
2007-03-21 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* coreutils.texi (md5sum invocation): Document escapes in output
|
||||
format. Reported by Armijn Hemel.
|
||||
|
||||
2007-03-15 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Fix manual in response to bug reports by Dan Jacobson.
|
||||
* coreutils.texi (sort invocation): Explain numeric sorts better.
|
||||
Compress self-congratulation into a simple "comparison is exact"
|
||||
notice; the --general-numeric-sort option already explains the
|
||||
tradeoffs.
|
||||
(seq invocation): Add example of -f.
|
||||
|
||||
2007-03-12 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (cp invocation): Mention that --preserve=timestamps
|
||||
doesn't preserve time stamps on symbolic links.
|
||||
Reported by Polo Talnir in <https://bugzilla.redhat.com/230866>.
|
||||
|
||||
2007-02-27 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* coreutils.texi (df invocation): With -P, the default block size
|
||||
and output format is not affected by DF_BLOCK_SIZE, BLOCK_SIZE, or
|
||||
BLOCKSIZE.
|
||||
|
||||
2007-01-30 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* coreutils.texi
|
||||
(Input processing in ptx, mkdir invocation, rmdir invocation):
|
||||
@item -> @itemx to fix some typos.
|
||||
|
||||
2007-01-30 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* coreutils.texi (mkdir invocation): Say how to set the file
|
||||
permission bits of a parent directory with mkdir -p.
|
||||
|
||||
2007-01-29 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Document new syntax: "chown +0:+287 file", "chgrp +99 file"
|
||||
* coreutils.texi (Disambiguating names and IDs): New section.
|
||||
(chown invocation, chgrp invocation): Mention the new syntax
|
||||
with an xref to the new section.
|
||||
|
||||
2007-01-19 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (ls: General output formatting): Mention the
|
||||
workarounds to accommodate the Apple Terminal bug.
|
||||
|
||||
2007-01-04 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (base64 invocation): When decoding, newlines
|
||||
are always accepted.
|
||||
|
||||
2007-01-03 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Document what the ".0" in e.g., "-k 2,3.0" means, and...
|
||||
* coreutils.texi (sort invocation): ... that it can be applied to the
|
||||
field-end spec, but not the field-start one. Patch from Evan Hunt.
|
||||
|
||||
2006-12-21 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (dd invocation): Improve the documentation
|
||||
for bs, ibs, obs, and cbs. Suggestion from Dan Jacobson.
|
||||
Patch by Olivier Delhomme.
|
||||
(dd invocation): Add to the description of cbs.
|
||||
(dd invocation): Specify that bs=N overrides only any
|
||||
_preceding_ ibs and obs settings. Spotted by Andreas Schwab.
|
||||
|
||||
2006-12-14 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi: Remove two doubled words.
|
||||
(Treating / specially): With --preserve-root, chgrp and chown
|
||||
will not modify "/", even through a symlink.
|
||||
|
||||
2006-11-28 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* perm.texi (Mode Structure): Fix typo: s/setgid/setuid/.
|
||||
Reported by Georg Neis as Debian bug 400778.
|
||||
|
||||
2006-10-27 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* coreutils.texi (wc invocation): When giving the order in which
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# Make coreutils documentation. -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005,
|
||||
# 2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-1998, 2001-2007 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,9 +13,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
info_TEXINFOS = coreutils.texi
|
||||
|
||||
@@ -47,28 +44,56 @@ $(INFO_DEPS): $(EXTRA_DIST)
|
||||
_W = (^|[^A-Za-z0-9_])
|
||||
W_ = ([^A-Za-z0-9_]|$$)
|
||||
|
||||
syntax_checks = \
|
||||
sc-avoid-io \
|
||||
sc-avoid-non-zero \
|
||||
sc-avoid-timezone \
|
||||
sc-avoid-zeroes \
|
||||
sc-exponent-grouping \
|
||||
sc-use-small-caps-NUL
|
||||
|
||||
.PHONY: $(syntax_checks) check-texinfo
|
||||
|
||||
# List words/regexps here that should not appear in the texinfo documentation.
|
||||
# E.g., use @sc{nul}, not `NUL'
|
||||
# Use `time zone', not `timezone'.
|
||||
# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
|
||||
check-texinfo:
|
||||
check-texinfo: $(syntax_checks)
|
||||
fail=0; \
|
||||
grep timezone $(srcdir)/*.texi && fail=1; \
|
||||
$(EGREP) '$(_W)IO$(W_)' $(srcdir)/*.texi && fail=1; \
|
||||
grep non-zero $(srcdir)/*.texi && fail=1; \
|
||||
grep '@url{' $(srcdir)/*.texi && fail=1; \
|
||||
$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && fail=1; \
|
||||
grep '\$$@"' $(srcdir)/*.texi && fail=1; \
|
||||
grep -n '[^[:punct:]]@footnote' $(srcdir)/*.texi && fail=1; \
|
||||
grep -n filename $(srcdir)/*.texi|$(EGREP) -v 'setfilename|[{]filename[}]' \
|
||||
grep -n filename $(srcdir)/*.texi \
|
||||
| $(EGREP) -v 'setfilename|[{]filename[}]' \
|
||||
&& fail=1; \
|
||||
$(PERL) -e 1 2> /dev/null && { $(PERL) -ne \
|
||||
'/\bPOSIX\b/ && !/\@acronym{POSIX}/ && !/^\* / || /{posix}/ and print,exit 1' \
|
||||
$(srcdir)/*.texi 2> /dev/null || fail=1; }; \
|
||||
$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && 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; \
|
||||
exit $$fail
|
||||
|
||||
# Use `time zone', not `timezone'.
|
||||
sc-avoid-timezone:
|
||||
$(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 || :
|
||||
|
||||
# E.g., use @sc{nul}, not NUL.
|
||||
sc-use-small-caps-NUL:
|
||||
$(EGREP) '$(_W)NUL$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
# Say I/O, not IO.
|
||||
sc-avoid-io:
|
||||
$(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 || :
|
||||
|
||||
# Use `zeros', not `zeroes' (nothing wrong with `zeroes'. just be consistent).
|
||||
sc-avoid-zeroes:
|
||||
$(EGREP) -i '$(_W)zeroes$(W_)' $(srcdir)/*.texi && exit 1 || :
|
||||
|
||||
check: check-texinfo
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
@set DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS 5
|
||||
File diff suppressed because it is too large
Load Diff
@@ -75,7 +75,7 @@ executable files (programs) and, on most systems, directories:
|
||||
@cindex set-user-ID
|
||||
@cindex setuid
|
||||
Set the process's effective user ID to that of the file upon execution
|
||||
(called the @dfn{set-user-ID bit}, or sometimes the @dfn{setgid bit}).
|
||||
(called the @dfn{set-user-ID bit}, or sometimes the @dfn{setuid bit}).
|
||||
For directories on a few systems, give files created in the directory
|
||||
the same owner as the directory, no matter who creates them, and set
|
||||
the set-user-ID bit of newly-created subdirectories.
|
||||
|
||||
558
gl/lib/base64.c
Normal file
558
gl/lib/base64.c
Normal file
@@ -0,0 +1,558 @@
|
||||
/* 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;
|
||||
}
|
||||
53
gl/lib/base64.h
Normal file
53
gl/lib/base64.h
Normal file
@@ -0,0 +1,53 @@
|
||||
/* 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 */
|
||||
79
gl/lib/mgetgroups.c
Normal file
79
gl/lib/mgetgroups.c
Normal file
@@ -0,0 +1,79 @@
|
||||
/* mgetgroups.c -- return a list of the groups a user is in
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation.
|
||||
|
||||
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/>. */
|
||||
|
||||
/* Extracted from coreutils' src/id.c. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "mgetgroups.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "getugroups.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
/* 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
|
||||
group ID (pw_gid) obtained from getpwuid, in case USERNAME is not
|
||||
listed in the groups database (e.g., /etc/groups). Upon failure,
|
||||
don't modify *GROUPS, set errno, and return -1. Otherwise, return
|
||||
the number of groups. */
|
||||
|
||||
int
|
||||
mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups)
|
||||
{
|
||||
int max_n_groups;
|
||||
int ng;
|
||||
GETGROUPS_T *g;
|
||||
|
||||
max_n_groups = (username
|
||||
? getugroups (0, NULL, username, gid)
|
||||
: getgroups (0, NULL));
|
||||
|
||||
/* If we failed to count groups with NULL for a buffer,
|
||||
try again with a non-NULL one, just in case. */
|
||||
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);
|
||||
if (g == NULL)
|
||||
return -1;
|
||||
|
||||
ng = (username
|
||||
? getugroups (max_n_groups, g, username, gid)
|
||||
: getgroups (max_n_groups, g));
|
||||
|
||||
if (ng < 0)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
free (g);
|
||||
errno = saved_errno;
|
||||
return -1;
|
||||
}
|
||||
|
||||
*groups = g;
|
||||
return ng;
|
||||
}
|
||||
19
gl/lib/mgetgroups.h
Normal file
19
gl/lib/mgetgroups.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* Get a list of all group IDs associated with a specified user ID.
|
||||
Copyright (C) 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/>. */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
int mgetgroups (const char *username, gid_t gid, GETGROUPS_T **groups);
|
||||
@@ -3,10 +3,10 @@
|
||||
Copyright (C) 1999-2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Colin Plumb.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -14,8 +14,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Colin Plumb. */
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
Copyright (C) 1999-2005 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999 Colin Plumb.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -14,8 +14,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Colin Plumb. */
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/* Generate random permutations.
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@@ -58,9 +57,9 @@ randperm_bound (size_t h, size_t n)
|
||||
return bound;
|
||||
}
|
||||
|
||||
/* From R, allocate and return the first H elements of a random
|
||||
permutation of N elements. H must not exceed N. Return NULL if H
|
||||
is zero. */
|
||||
/* From R, allocate and return a malloc'd array of the first H elements
|
||||
of a random permutation of N elements. H must not exceed N.
|
||||
Return NULL if H is zero. */
|
||||
|
||||
size_t *
|
||||
randperm_new (struct randint_source *r, size_t h, size_t n)
|
||||
@@ -1,11 +1,11 @@
|
||||
/* Generate buffers of random data.
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@@ -44,8 +43,10 @@
|
||||
# define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
|
||||
# define __attribute__(x)
|
||||
#ifndef __attribute__
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
||||
# define __attribute__(x)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/* root-dev-ino.c -- get the device and inode numbers for `/'.
|
||||
Copyright (C) 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -12,8 +12,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2003, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef ROOT_DEV_INO_H
|
||||
# define ROOT_DEV_INO_H 1
|
||||
|
||||
31
gl/lib/se-context.in.h
Normal file
31
gl/lib/se-context.in.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
57
gl/lib/se-selinux.in.h
Normal file
57
gl/lib/se-selinux.in.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#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
|
||||
91
gl/lib/selinux-at.c
Normal file
91
gl/lib/selinux-at.c
Normal file
@@ -0,0 +1,91 @@
|
||||
/* openat-style fd-relative functions for SE Linux
|
||||
Copyright (C) 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 Jim Meyering */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "selinux-at.h"
|
||||
#include "openat.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "dirname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
|
||||
#include "save-cwd.h"
|
||||
|
||||
#include "gettext.h"
|
||||
#define _(msgid) gettext (msgid)
|
||||
|
||||
#include "openat-priv.h"
|
||||
|
||||
#define AT_FUNC_NAME getfileconat
|
||||
#define AT_FUNC_F1 getfilecon
|
||||
#define AT_FUNC_F2 getfilecon
|
||||
#define AT_FUNC_USE_F1_COND 1
|
||||
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
|
||||
#define AT_FUNC_POST_FILE_ARGS , con
|
||||
#include "at-func.c"
|
||||
#undef AT_FUNC_NAME
|
||||
#undef AT_FUNC_F1
|
||||
#undef AT_FUNC_F2
|
||||
#undef AT_FUNC_USE_F1_COND
|
||||
#undef AT_FUNC_POST_FILE_PARAM_DECLS
|
||||
#undef AT_FUNC_POST_FILE_ARGS
|
||||
|
||||
#define AT_FUNC_NAME lgetfileconat
|
||||
#define AT_FUNC_F1 lgetfilecon
|
||||
#define AT_FUNC_F2 lgetfilecon
|
||||
#define AT_FUNC_USE_F1_COND 1
|
||||
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t *con
|
||||
#define AT_FUNC_POST_FILE_ARGS , con
|
||||
#include "at-func.c"
|
||||
#undef AT_FUNC_NAME
|
||||
#undef AT_FUNC_F1
|
||||
#undef AT_FUNC_F2
|
||||
#undef AT_FUNC_USE_F1_COND
|
||||
#undef AT_FUNC_POST_FILE_PARAM_DECLS
|
||||
#undef AT_FUNC_POST_FILE_ARGS
|
||||
|
||||
#define AT_FUNC_NAME setfileconat
|
||||
#define AT_FUNC_F1 setfilecon
|
||||
#define AT_FUNC_F2 setfilecon
|
||||
#define AT_FUNC_USE_F1_COND 1
|
||||
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
|
||||
#define AT_FUNC_POST_FILE_ARGS , con
|
||||
#include "at-func.c"
|
||||
#undef AT_FUNC_NAME
|
||||
#undef AT_FUNC_F1
|
||||
#undef AT_FUNC_F2
|
||||
#undef AT_FUNC_USE_F1_COND
|
||||
#undef AT_FUNC_POST_FILE_PARAM_DECLS
|
||||
#undef AT_FUNC_POST_FILE_ARGS
|
||||
|
||||
#define AT_FUNC_NAME lsetfileconat
|
||||
#define AT_FUNC_F1 lsetfilecon
|
||||
#define AT_FUNC_F2 lsetfilecon
|
||||
#define AT_FUNC_USE_F1_COND 1
|
||||
#define AT_FUNC_POST_FILE_PARAM_DECLS , security_context_t con
|
||||
#define AT_FUNC_POST_FILE_ARGS , con
|
||||
#include "at-func.c"
|
||||
#undef AT_FUNC_NAME
|
||||
#undef AT_FUNC_F1
|
||||
#undef AT_FUNC_F2
|
||||
#undef AT_FUNC_USE_F1_COND
|
||||
#undef AT_FUNC_POST_FILE_PARAM_DECLS
|
||||
#undef AT_FUNC_POST_FILE_ARGS
|
||||
23
gl/lib/selinux-at.h
Normal file
23
gl/lib/selinux-at.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Prototypes for openat-style fd-relative SELinux functions
|
||||
Copyright (C) 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/>. */
|
||||
|
||||
#include <selinux/selinux.h>
|
||||
#include <selinux/context.h>
|
||||
|
||||
int getfileconat (int fd, char const *file, security_context_t *con);
|
||||
int lgetfileconat (int fd, char const *file, security_context_t *con);
|
||||
int setfileconat (int fd, char const *file, security_context_t con);
|
||||
int lsetfileconat (int fd, char const *file, security_context_t con);
|
||||
301
gl/lib/tempname.c
Normal file
301
gl/lib/tempname.c
Normal file
@@ -0,0 +1,301 @@
|
||||
/* tempname.c - generate the name of a temporary file.
|
||||
|
||||
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
2000, 2001, 2002, 2003, 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/>. */
|
||||
|
||||
/* Extracted from glibc sysdeps/posix/tempname.c. See also tmpdir.c. */
|
||||
|
||||
#if !_LIBC
|
||||
# include <config.h>
|
||||
# include "tempname.h"
|
||||
# include "randint.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef __set_errno
|
||||
# define __set_errno(Val) errno = (Val)
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef P_tmpdir
|
||||
# define P_tmpdir "/tmp"
|
||||
#endif
|
||||
#ifndef TMP_MAX
|
||||
# define TMP_MAX 238328
|
||||
#endif
|
||||
#ifndef __GT_FILE
|
||||
# define __GT_FILE 0
|
||||
# define __GT_BIGFILE 1
|
||||
# define __GT_DIR 2
|
||||
# define __GT_NOCREATE 3
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if _LIBC
|
||||
# define struct_stat64 struct stat64
|
||||
# define small_open __open
|
||||
# define large_open __open64
|
||||
#else
|
||||
# define struct_stat64 struct stat
|
||||
# define small_open open
|
||||
# define large_open open
|
||||
# define __gen_tempname gen_tempname
|
||||
# define __getpid getpid
|
||||
# define __gettimeofday gettimeofday
|
||||
# define __mkdir mkdir
|
||||
# define __lxstat64(version, file, buf) lstat (file, buf)
|
||||
# define __xstat64(version, file, buf) stat (file, buf)
|
||||
#endif
|
||||
|
||||
#if ! (HAVE___SECURE_GETENV || _LIBC)
|
||||
# define __secure_getenv getenv
|
||||
#endif
|
||||
|
||||
#if _LIBC
|
||||
/* Return nonzero if DIR is an existent directory. */
|
||||
static int
|
||||
direxists (const char *dir)
|
||||
{
|
||||
struct_stat64 buf;
|
||||
return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
|
||||
}
|
||||
|
||||
/* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is
|
||||
non-null and exists, uses it; otherwise uses the first of $TMPDIR,
|
||||
P_tmpdir, /tmp that exists. Copies into TMPL a template suitable
|
||||
for use with mk[s]temp. Will fail (-1) if DIR is non-null and
|
||||
doesn't exist, none of the searched dirs exists, or there's not
|
||||
enough space in TMPL. */
|
||||
int
|
||||
__path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
|
||||
int try_tmpdir)
|
||||
{
|
||||
const char *d;
|
||||
size_t dlen, plen;
|
||||
|
||||
if (!pfx || !pfx[0])
|
||||
{
|
||||
pfx = "file";
|
||||
plen = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
plen = strlen (pfx);
|
||||
if (plen > 5)
|
||||
plen = 5;
|
||||
}
|
||||
|
||||
if (try_tmpdir)
|
||||
{
|
||||
d = __secure_getenv ("TMPDIR");
|
||||
if (d != NULL && direxists (d))
|
||||
dir = d;
|
||||
else if (dir != NULL && direxists (dir))
|
||||
/* nothing */ ;
|
||||
else
|
||||
dir = NULL;
|
||||
}
|
||||
if (dir == NULL)
|
||||
{
|
||||
if (direxists (P_tmpdir))
|
||||
dir = P_tmpdir;
|
||||
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
|
||||
dir = "/tmp";
|
||||
else
|
||||
{
|
||||
__set_errno (ENOENT);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
dlen = strlen (dir);
|
||||
while (dlen > 1 && dir[dlen - 1] == '/')
|
||||
dlen--; /* remove trailing slashes */
|
||||
|
||||
/* check we have room for "${dir}/${pfx}XXXXXX\0" */
|
||||
if (tmpl_len < dlen + 1 + plen + 6 + 1)
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
sprintf (tmpl, "%.*s/%.*sXXXXXX", (int) dlen, dir, (int) plen, pfx);
|
||||
return 0;
|
||||
}
|
||||
#endif /* _LIBC */
|
||||
|
||||
static inline bool
|
||||
check_x_suffix (char const *s, size_t len)
|
||||
{
|
||||
return strspn (s, "X") == len;
|
||||
}
|
||||
|
||||
/* These are the characters used in temporary file names. */
|
||||
static const char letters[] =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
/* Generate a temporary file name based on TMPL. TMPL must end in a
|
||||
a sequence of at least X_SUFFIX_LEN "X"s. The name constructed
|
||||
does not exist at the time of the call to __gen_tempname. TMPL is
|
||||
overwritten with the result.
|
||||
|
||||
KIND may be one of:
|
||||
__GT_NOCREATE: simply verify that the name does not exist
|
||||
at the time of the call.
|
||||
__GT_FILE: create the file using open(O_CREAT|O_EXCL)
|
||||
and return a read-write fd. The file is mode 0600.
|
||||
__GT_BIGFILE: same as __GT_FILE but use open64().
|
||||
__GT_DIR: create a directory, which will be mode 0700.
|
||||
|
||||
We use a clever algorithm to get hard-to-predict names. */
|
||||
int
|
||||
gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len)
|
||||
{
|
||||
size_t len;
|
||||
char *XXXXXX;
|
||||
unsigned int count;
|
||||
int fd = -1;
|
||||
int save_errno = errno;
|
||||
struct_stat64 st;
|
||||
struct randint_source *rand_src;
|
||||
|
||||
/* A lower bound on the number of temporary files to attempt to
|
||||
generate. The maximum total number of temporary file names that
|
||||
can exist for a given template is 62**6. It should never be
|
||||
necessary to try all these combinations. Instead if a reasonable
|
||||
number of names is tried (we define reasonable as 62**3) fail to
|
||||
give the system administrator the chance to remove the problems. */
|
||||
#define ATTEMPTS_MIN (62 * 62 * 62)
|
||||
|
||||
/* The number of times to attempt to generate a temporary file. To
|
||||
conform to POSIX, this must be no smaller than TMP_MAX. */
|
||||
#if ATTEMPTS_MIN < TMP_MAX
|
||||
unsigned int attempts = TMP_MAX;
|
||||
#else
|
||||
unsigned int attempts = ATTEMPTS_MIN;
|
||||
#endif
|
||||
|
||||
len = strlen (tmpl);
|
||||
if (len < x_suffix_len || ! check_x_suffix (&tmpl[len - x_suffix_len],
|
||||
x_suffix_len))
|
||||
{
|
||||
__set_errno (EINVAL);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rand_src = randint_all_new (NULL, 8);
|
||||
if (! rand_src)
|
||||
return -1;
|
||||
|
||||
/* This is where the Xs start. */
|
||||
XXXXXX = &tmpl[len - x_suffix_len];
|
||||
|
||||
for (count = 0; count < attempts; ++count)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < x_suffix_len; i++)
|
||||
{
|
||||
XXXXXX[i] = letters[randint_genmax (rand_src, sizeof letters - 2)];
|
||||
}
|
||||
|
||||
switch (kind)
|
||||
{
|
||||
case __GT_FILE:
|
||||
fd = small_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
break;
|
||||
|
||||
case __GT_BIGFILE:
|
||||
fd = large_open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
break;
|
||||
|
||||
case __GT_DIR:
|
||||
fd = __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
|
||||
break;
|
||||
|
||||
case __GT_NOCREATE:
|
||||
/* This case is backward from the other three. This function
|
||||
succeeds if __xstat fails because the name does not exist.
|
||||
Note the continue to bypass the common logic at the bottom
|
||||
of the loop. */
|
||||
if (__lxstat64 (_STAT_VER, tmpl, &st) < 0)
|
||||
{
|
||||
if (errno == ENOENT)
|
||||
{
|
||||
__set_errno (save_errno);
|
||||
fd = 0;
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Give up now. */
|
||||
fd = -1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
||||
default:
|
||||
assert (! "invalid KIND in __gen_tempname");
|
||||
}
|
||||
|
||||
if (fd >= 0)
|
||||
{
|
||||
__set_errno (save_errno);
|
||||
goto done;
|
||||
}
|
||||
else if (errno != EEXIST)
|
||||
{
|
||||
fd = -1;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
randint_all_free (rand_src);
|
||||
|
||||
/* We got out of the loop because we ran out of combinations to try. */
|
||||
__set_errno (EEXIST);
|
||||
return -1;
|
||||
|
||||
done:
|
||||
{
|
||||
int saved_errno = errno;
|
||||
randint_all_free (rand_src);
|
||||
__set_errno (saved_errno);
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
int
|
||||
__gen_tempname (char *tmpl, int kind)
|
||||
{
|
||||
return gen_tempname_len (tmpl, kind, 6);
|
||||
}
|
||||
41
gl/lib/tempname.h
Normal file
41
gl/lib/tempname.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/* Create a temporary file or directory.
|
||||
|
||||
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/>. */
|
||||
|
||||
/* header written by Eric Blake */
|
||||
|
||||
/* In gnulib, always prefer large files. GT_FILE maps to
|
||||
__GT_BIGFILE, not __GT_FILE, for a reason. */
|
||||
#define GT_FILE 1
|
||||
#define GT_DIR 2
|
||||
#define GT_NOCREATE 3
|
||||
|
||||
/* Generate a temporary file name based on TMPL. TMPL must match the
|
||||
rules for mk[s]temp (i.e. end in "XXXXXX"). The name constructed
|
||||
does not exist at the time of the call to gen_tempname. TMPL is
|
||||
overwritten with the result.
|
||||
|
||||
KIND may be one of:
|
||||
GT_NOCREATE: simply verify that the name does not exist
|
||||
at the time of the call.
|
||||
GT_FILE: create a large file using open(O_CREAT|O_EXCL)
|
||||
and return a read-write fd. The file is mode 0600.
|
||||
GT_DIR: create a directory, which will be mode 0700.
|
||||
|
||||
We use a clever algorithm to get hard-to-predict names. */
|
||||
#include <stddef.h>
|
||||
extern int gen_tempname (char *tmpl, int kind);
|
||||
extern int gen_tempname_len (char *tmpl, int kind, size_t x_suffix_len);
|
||||
@@ -1,10 +1,10 @@
|
||||
dnl Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
#serial 1
|
||||
dnl Copyright (C) 2007 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_RANDPERM],
|
||||
AC_DEFUN([gl_MGETGROUPS],
|
||||
[
|
||||
AC_LIBSOURCES([randperm.c, randperm.h])
|
||||
AC_LIBOBJ([randperm])
|
||||
AC_LIBOBJ([mgetgroups])
|
||||
])
|
||||
17
gl/m4/selinux-context-h.m4
Normal file
17
gl/m4/selinux-context-h.m4
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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])
|
||||
])
|
||||
17
gl/m4/selinux-selinux-h.m4
Normal file
17
gl/m4/selinux-selinux-h.m4
Normal file
@@ -0,0 +1,17 @@
|
||||
# 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])
|
||||
])
|
||||
25
gl/modules/mgetgroups
Normal file
25
gl/modules/mgetgroups
Normal file
@@ -0,0 +1,25 @@
|
||||
Description:
|
||||
Return the group IDs of a user in malloc'd storage.
|
||||
|
||||
Files:
|
||||
lib/mgetgroups.c
|
||||
lib/mgetgroups.h
|
||||
m4/mgetgroups.m4
|
||||
|
||||
Depends-on:
|
||||
free
|
||||
getugroups
|
||||
xalloc
|
||||
|
||||
configure.ac:
|
||||
gl_MGETGROUPS
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
|
||||
License:
|
||||
LGPL
|
||||
|
||||
Maintainer:
|
||||
Jim Meyering
|
||||
24
gl/modules/randint
Normal file
24
gl/modules/randint
Normal file
@@ -0,0 +1,24 @@
|
||||
Description:
|
||||
Generate random integers.
|
||||
|
||||
Files:
|
||||
lib/randint.c
|
||||
lib/randint.h
|
||||
|
||||
Depends-on:
|
||||
inline
|
||||
randread
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += randint.c randint.h
|
||||
|
||||
Include:
|
||||
"randint.h"
|
||||
|
||||
License
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
Paul Eggert
|
||||
24
gl/modules/randperm
Normal file
24
gl/modules/randperm
Normal file
@@ -0,0 +1,24 @@
|
||||
Description:
|
||||
Generate random permutations.
|
||||
|
||||
Files:
|
||||
lib/randperm.c
|
||||
lib/randperm.h
|
||||
|
||||
Depends-on:
|
||||
randint
|
||||
xalloc
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += randperm.c randperm.h
|
||||
|
||||
Include:
|
||||
"randperm.h"
|
||||
|
||||
License
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
Paul Eggert
|
||||
33
gl/modules/randread
Normal file
33
gl/modules/randread
Normal file
@@ -0,0 +1,33 @@
|
||||
Description:
|
||||
Generate buffers of random data.
|
||||
|
||||
Files:
|
||||
lib/rand-isaac.c
|
||||
lib/rand-isaac.h
|
||||
lib/randread.c
|
||||
lib/randread.h
|
||||
|
||||
Depends-on:
|
||||
error
|
||||
exitfail
|
||||
fopen-safer
|
||||
gethrxtime
|
||||
quotearg
|
||||
stdbool
|
||||
stdint
|
||||
unlocked-io
|
||||
xalloc
|
||||
|
||||
configure.ac:
|
||||
|
||||
Makefile.am:
|
||||
lib_SOURCES += randread.c randread.h rand-isaac.c rand-isaac.h
|
||||
|
||||
Include:
|
||||
"randread.h"
|
||||
|
||||
License
|
||||
GPL
|
||||
|
||||
Maintainer:
|
||||
Paul Eggert
|
||||
32
gl/modules/selinux-at
Normal file
32
gl/modules/selinux-at
Normal file
@@ -0,0 +1,32 @@
|
||||
Description:
|
||||
openat-style fd-relative functions for SE Linux
|
||||
|
||||
Files:
|
||||
lib/selinux-at.c
|
||||
lib/selinux-at.h
|
||||
|
||||
Depends-on:
|
||||
selinux-h
|
||||
|
||||
configure.ac:
|
||||
# FIXME: put this in an .m4 file?
|
||||
# For runcon.
|
||||
AC_CHECK_HEADERS([selinux/flask.h])
|
||||
AC_LIBOBJ([selinux-at])
|
||||
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"
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
selinux-at.h
|
||||
|
||||
License:
|
||||
LGPL
|
||||
|
||||
Maintainer:
|
||||
Jim Meyering
|
||||
56
gl/modules/selinux-h
Normal file
56
gl/modules/selinux-h
Normal file
@@ -0,0 +1,56 @@
|
||||
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"
|
||||
30
gl/modules/tempname
Normal file
30
gl/modules/tempname
Normal file
@@ -0,0 +1,30 @@
|
||||
Description:
|
||||
gen_tempname, gen_tempname_len: create a private temporary file or directory.
|
||||
|
||||
Files:
|
||||
lib/tempname.c
|
||||
lib/tempname.h
|
||||
m4/tempname.m4
|
||||
|
||||
Depends-on:
|
||||
extensions
|
||||
gettimeofday
|
||||
randint
|
||||
stdbool
|
||||
stdint
|
||||
sys_stat
|
||||
sys_time
|
||||
|
||||
configure.ac:
|
||||
gl_FUNC_GEN_TEMPNAME
|
||||
|
||||
Makefile.am:
|
||||
|
||||
Include:
|
||||
"tempname.h"
|
||||
|
||||
License:
|
||||
LGPL
|
||||
|
||||
Maintainer:
|
||||
Eric Blake and Jim Meyering
|
||||
1
gnulib-tests/Makefile.am
Normal file
1
gnulib-tests/Makefile.am
Normal file
@@ -0,0 +1 @@
|
||||
include gnulib.mk
|
||||
379
lib/.cvsignore
379
lib/.cvsignore
@@ -1,379 +0,0 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl.c
|
||||
acl.h
|
||||
alloca.c
|
||||
alloca.h
|
||||
alloca_.h
|
||||
allocsa.c
|
||||
allocsa.h
|
||||
allocsa.valgrind
|
||||
argmatch.c
|
||||
argmatch.h
|
||||
asnprintf.c
|
||||
asprintf.c
|
||||
at-func.c
|
||||
atexit.c
|
||||
backupfile.c
|
||||
backupfile.h
|
||||
base64.c
|
||||
base64.h
|
||||
basename.c
|
||||
c-strtod.c
|
||||
c-strtod.h
|
||||
c-strtold.c
|
||||
calloc.c
|
||||
canon-host.c
|
||||
canon-host.h
|
||||
canonicalize.c
|
||||
canonicalize.h
|
||||
charset.alias
|
||||
chdir-long.c
|
||||
chdir-long.h
|
||||
chown.c
|
||||
cloexec.c
|
||||
cloexec.h
|
||||
close-stream.c
|
||||
close-stream.h
|
||||
closeout.c
|
||||
closeout.h
|
||||
config.charset
|
||||
config.h
|
||||
config.hin
|
||||
configmake.h
|
||||
creat-safer.c
|
||||
cycle-check.c
|
||||
cycle-check.h
|
||||
dev-ino.h
|
||||
diacrit.c
|
||||
diacrit.h
|
||||
dirchownmod.c
|
||||
dirchownmod.h
|
||||
dirfd.c
|
||||
dirfd.h
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
dup2.c
|
||||
error.c
|
||||
error.h
|
||||
euidaccess.c
|
||||
euidaccess.h
|
||||
exclude.c
|
||||
exclude.h
|
||||
exit.h
|
||||
exitfail.c
|
||||
exitfail.h
|
||||
fchmodat.c
|
||||
fchown-stub.c
|
||||
fcntl--.h
|
||||
fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
filemode.c
|
||||
filemode.h
|
||||
filenamecat.c
|
||||
filenamecat.h
|
||||
fnmatch.c
|
||||
fnmatch.h
|
||||
fnmatch_.h
|
||||
fnmatch_loop.c
|
||||
fopen-safer.c
|
||||
fprintftime.c
|
||||
fprintftime.h
|
||||
free.c
|
||||
fstatat.c
|
||||
fsusage.c
|
||||
fsusage.h
|
||||
ftruncate.c
|
||||
fts-cycle.c
|
||||
fts.c
|
||||
fts.h
|
||||
fts_.h
|
||||
full-read.c
|
||||
full-read.h
|
||||
full-write.c
|
||||
full-write.h
|
||||
gai_strerror.c
|
||||
getaddrinfo.c
|
||||
getaddrinfo.h
|
||||
getcwd.c
|
||||
getcwd.h
|
||||
getdate.c
|
||||
getdate.h
|
||||
getdate.tab.c
|
||||
getdate.tab.h
|
||||
getdate.y
|
||||
getdelim.c
|
||||
getdelim.h
|
||||
getgroups.c
|
||||
gethostname.c
|
||||
gethrxtime.c
|
||||
gethrxtime.h
|
||||
getline.c
|
||||
getline.h
|
||||
getloadavg.c
|
||||
getndelim2.c
|
||||
getndelim2.h
|
||||
getopt.c
|
||||
getopt.h
|
||||
getopt1.c
|
||||
getopt_.h
|
||||
getopt_int.h
|
||||
getpagesize.h
|
||||
getpass.c
|
||||
getpass.h
|
||||
gettext.h
|
||||
gettime.c
|
||||
gettimeofday.c
|
||||
getugroups.c
|
||||
getusershell.c
|
||||
gnulib.mk
|
||||
group-member.c
|
||||
group-member.h
|
||||
hard-locale.c
|
||||
hard-locale.h
|
||||
hash-pjw.c
|
||||
hash-pjw.h
|
||||
hash.c
|
||||
hash.h
|
||||
human.c
|
||||
human.h
|
||||
i-ring.c
|
||||
i-ring.h
|
||||
idcache.c
|
||||
imaxtostr.c
|
||||
inet_ntop.c
|
||||
inet_ntop.h
|
||||
intprops.h
|
||||
inttostr.c
|
||||
inttostr.h
|
||||
inttypes.h
|
||||
inttypes_.h
|
||||
isapipe.c
|
||||
isapipe.h
|
||||
lchmod.h
|
||||
lchown.c
|
||||
lchown.h
|
||||
linebuffer.c
|
||||
linebuffer.h
|
||||
localcharset.c
|
||||
localcharset.h
|
||||
long-options.c
|
||||
long-options.h
|
||||
lstat.c
|
||||
lstat.h
|
||||
malloc.c
|
||||
mbchar.c
|
||||
mbchar.h
|
||||
mbswidth.c
|
||||
mbswidth.h
|
||||
mbuiter.h
|
||||
md5.c
|
||||
md5.h
|
||||
memcasecmp.c
|
||||
memcasecmp.h
|
||||
memchr.c
|
||||
memcmp.c
|
||||
memcoll.c
|
||||
memcoll.h
|
||||
memcpy.c
|
||||
memmove.c
|
||||
mempcpy.c
|
||||
mempcpy.h
|
||||
memrchr.c
|
||||
memrchr.h
|
||||
memset.c
|
||||
mkancesdirs.c
|
||||
mkancesdirs.h
|
||||
mkdir-p.c
|
||||
mkdir-p.h
|
||||
mkdir.c
|
||||
mkdirat.c
|
||||
mkstemp-safer.c
|
||||
mkstemp.c
|
||||
mkstemp.h
|
||||
mktime.c
|
||||
modechange.c
|
||||
modechange.h
|
||||
mountlist.c
|
||||
mountlist.h
|
||||
nanosleep.c
|
||||
obstack.c
|
||||
obstack.h
|
||||
offtostr.c
|
||||
open-safer.c
|
||||
openat-die.c
|
||||
openat-priv.h
|
||||
openat-proc.c
|
||||
openat.c
|
||||
openat.h
|
||||
pathmax.h
|
||||
physmem.c
|
||||
physmem.h
|
||||
pipe-safer.c
|
||||
poll.h
|
||||
posixtm.c
|
||||
posixtm.h
|
||||
posixver.c
|
||||
posixver.h
|
||||
printf-args.c
|
||||
printf-args.h
|
||||
printf-parse.h
|
||||
putenv.c
|
||||
quote.c
|
||||
quote.h
|
||||
quotearg.c
|
||||
quotearg.h
|
||||
raise.c
|
||||
readlink.c
|
||||
readtokens.c
|
||||
readtokens.h
|
||||
readtokens0.c
|
||||
readtokens0.h
|
||||
readutmp.c
|
||||
readutmp.h
|
||||
realloc.c
|
||||
ref-add.sed
|
||||
ref-add.sin
|
||||
ref-del.sed
|
||||
ref-del.sin
|
||||
regcomp.c
|
||||
regex.c
|
||||
regex.h
|
||||
regex_internal.c
|
||||
regex_internal.h
|
||||
regexec.c
|
||||
rename-dest-slash.c
|
||||
rename.c
|
||||
rmdir.c
|
||||
root-dev-ino.c
|
||||
root-dev-ino.h
|
||||
rpmatch.c
|
||||
safe-read.c
|
||||
safe-read.h
|
||||
safe-write.c
|
||||
safe-write.h
|
||||
same-inode.h
|
||||
same.c
|
||||
same.h
|
||||
save-cwd.c
|
||||
save-cwd.h
|
||||
savedir.c
|
||||
savedir.h
|
||||
savewd.c
|
||||
savewd.h
|
||||
search.h
|
||||
setenv.c
|
||||
setenv.h
|
||||
settime.c
|
||||
sha1.c
|
||||
sha1.h
|
||||
sig2str.c
|
||||
sig2str.h
|
||||
snprintf.c
|
||||
snprintf.h
|
||||
socket_.h
|
||||
stamp-h1
|
||||
stat-macros.h
|
||||
stat-time.h
|
||||
stat_.h
|
||||
stdbool.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdlib--.h
|
||||
stdlib-safer.h
|
||||
stpcpy.c
|
||||
stpcpy.h
|
||||
strcase.h
|
||||
strcasecmp.c
|
||||
strcspn.c
|
||||
strdup.c
|
||||
strdup.h
|
||||
strftime.c
|
||||
strftime.h
|
||||
stripslash.c
|
||||
strncasecmp.c
|
||||
strndup.c
|
||||
strndup.h
|
||||
strnlen.c
|
||||
strnlen.h
|
||||
strnlen1.c
|
||||
strnlen1.h
|
||||
strpbrk.c
|
||||
strpbrk.h
|
||||
strtod.c
|
||||
strtoimax.c
|
||||
strtol.c
|
||||
strtoll.c
|
||||
strtoul.c
|
||||
strtoull.c
|
||||
strtoumax.c
|
||||
strverscmp.c
|
||||
strverscmp.h
|
||||
t-fpending
|
||||
tempname.c
|
||||
tempname.h
|
||||
time_r.c
|
||||
time_r.h
|
||||
timespec.h
|
||||
uinttostr.c
|
||||
umaxtostr.c
|
||||
unicodeio.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unlinkdir.c
|
||||
unlinkdir.h
|
||||
unlocked-io.h
|
||||
unsetenv.c
|
||||
userspec.c
|
||||
userspec.h
|
||||
utime.c
|
||||
utimecmp.c
|
||||
utimecmp.h
|
||||
utimens.c
|
||||
utimens.h
|
||||
vasnprintf.h
|
||||
vasprintf.c
|
||||
vasprintf.h
|
||||
verify.h
|
||||
version-etc-fsf.c
|
||||
version-etc.c
|
||||
version-etc.h
|
||||
wcwidth.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xgetcwd.c
|
||||
xgetcwd.h
|
||||
xgethostname.c
|
||||
xgethostname.h
|
||||
xmalloc.c
|
||||
xmemcoll.c
|
||||
xmemcoll.h
|
||||
xnanosleep.c
|
||||
xnanosleep.h
|
||||
xreadlink.c
|
||||
xreadlink.h
|
||||
xstrndup.c
|
||||
xstrndup.h
|
||||
xstrtod.c
|
||||
xstrtod.h
|
||||
xstrtoimax.c
|
||||
xstrtol.c
|
||||
xstrtol.h
|
||||
xstrtold.c
|
||||
xstrtoul.c
|
||||
xstrtoumax.c
|
||||
xtime.h
|
||||
yesno.c
|
||||
yesno.h
|
||||
340
lib/.gdb-history
340
lib/.gdb-history
@@ -1,340 +0,0 @@
|
||||
# GDB history for debugging coreutils.
|
||||
#
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003 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 2, 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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
#
|
||||
r 206.65.212.10
|
||||
b main
|
||||
r
|
||||
n
|
||||
s
|
||||
n
|
||||
p addr
|
||||
p addr
|
||||
p he->h_name
|
||||
n
|
||||
q
|
||||
b canon_host
|
||||
r 206.65.212.10
|
||||
n
|
||||
p he
|
||||
p *he
|
||||
n
|
||||
n
|
||||
p (he->h_addrtype)
|
||||
n
|
||||
q
|
||||
r a:b
|
||||
b main
|
||||
r a:b
|
||||
n
|
||||
s
|
||||
n
|
||||
p separator
|
||||
n
|
||||
l 128
|
||||
c
|
||||
q
|
||||
r meyering:store
|
||||
p *username
|
||||
p *username[separator - name]
|
||||
p separator - name
|
||||
p username[separator - name]
|
||||
r ''
|
||||
l
|
||||
q
|
||||
r ''
|
||||
l
|
||||
q
|
||||
r meyering
|
||||
b main
|
||||
r meyering
|
||||
n
|
||||
r
|
||||
n
|
||||
s
|
||||
n
|
||||
p u
|
||||
n
|
||||
n
|
||||
q
|
||||
r ''
|
||||
r meyering
|
||||
up
|
||||
l
|
||||
q
|
||||
b main
|
||||
b a.out 1
|
||||
r a.out 1
|
||||
n
|
||||
s
|
||||
fin
|
||||
s
|
||||
n
|
||||
p uid
|
||||
p gid
|
||||
p euid
|
||||
p egid
|
||||
n
|
||||
p mode
|
||||
p path
|
||||
fin
|
||||
r -v -c 10 -n 20 -x 80 < in-2
|
||||
up
|
||||
up
|
||||
p &dummy
|
||||
p *ovp
|
||||
p *(int*)*ovp
|
||||
p ((struct item*)*ovp)->key
|
||||
p old_vec@10
|
||||
r -v -c 10 -n 20 -x 80 < in-3
|
||||
p *(int*)*ovp
|
||||
up
|
||||
dow
|
||||
p *(int*)*ovp
|
||||
up
|
||||
p *(int*)*ovp
|
||||
i loca
|
||||
dow
|
||||
p key
|
||||
p dummy
|
||||
p &dummy
|
||||
up
|
||||
p old_vec
|
||||
p *ovp
|
||||
p ovp
|
||||
p ovp - old_vec
|
||||
p *old_vec@10
|
||||
p *old_vec@13
|
||||
b hash_insert_item
|
||||
r
|
||||
b hash_insert_item_at
|
||||
r
|
||||
n
|
||||
p fail
|
||||
p *(ht->vec)@13
|
||||
p *(ht->ht_vec)@13
|
||||
p ((struct item*)(ht->ht_vec)[10])->key
|
||||
b hash_delete_item
|
||||
b hash_delete_item_at
|
||||
c
|
||||
n
|
||||
p slot
|
||||
p item
|
||||
n
|
||||
n
|
||||
p *(ht->ht_vec)@13
|
||||
p &dummy
|
||||
p dummy
|
||||
n
|
||||
s
|
||||
n
|
||||
n
|
||||
p *(ht->ht_vec)@13
|
||||
n
|
||||
p new_size
|
||||
n
|
||||
p *old_vec@13
|
||||
p old_vec@13
|
||||
n
|
||||
p *old_vec@13
|
||||
n
|
||||
p *old_vec@13
|
||||
n
|
||||
l
|
||||
n
|
||||
p ovp - old_vec
|
||||
n
|
||||
p ovp - old_vec
|
||||
n
|
||||
p ovp - old_vec
|
||||
p *old_vec@13
|
||||
p &dummy
|
||||
q
|
||||
r 444444444444 44444444444
|
||||
b human_readable
|
||||
r
|
||||
n
|
||||
q
|
||||
b main
|
||||
r 444444444444 44444444444
|
||||
n
|
||||
p a
|
||||
p b
|
||||
r 34343434 3434343434
|
||||
c
|
||||
r
|
||||
n
|
||||
n
|
||||
p a
|
||||
p b
|
||||
r 343434343 343434343
|
||||
c
|
||||
q
|
||||
b posixtime
|
||||
r
|
||||
n
|
||||
s
|
||||
n
|
||||
p len
|
||||
n
|
||||
p pair
|
||||
p len
|
||||
n
|
||||
b year
|
||||
y
|
||||
c
|
||||
c
|
||||
p n
|
||||
up
|
||||
p len
|
||||
q
|
||||
complete b user
|
||||
complete b user
|
||||
complete b pars
|
||||
b parse_user_spec
|
||||
r a.b
|
||||
n
|
||||
n
|
||||
p u
|
||||
n
|
||||
p u
|
||||
n
|
||||
r -r .aa > k
|
||||
pwd
|
||||
q
|
||||
b main
|
||||
r
|
||||
b get_date
|
||||
c
|
||||
n
|
||||
p tm
|
||||
n
|
||||
p tm
|
||||
n
|
||||
p pc
|
||||
n
|
||||
p tm
|
||||
n
|
||||
p tm
|
||||
n
|
||||
p delta
|
||||
n
|
||||
p Start
|
||||
q
|
||||
b dir_name
|
||||
r
|
||||
n
|
||||
p slash
|
||||
n
|
||||
n
|
||||
n
|
||||
p slash
|
||||
p slash - path + 1
|
||||
q
|
||||
q
|
||||
r
|
||||
b asprintf
|
||||
q
|
||||
b main
|
||||
r
|
||||
n
|
||||
s
|
||||
q
|
||||
r
|
||||
q
|
||||
b asprintf
|
||||
r
|
||||
n
|
||||
s
|
||||
s
|
||||
s
|
||||
b 515
|
||||
fin
|
||||
b 515
|
||||
c
|
||||
p length
|
||||
c
|
||||
p length
|
||||
c
|
||||
p length
|
||||
n
|
||||
p maxlen
|
||||
p allocated
|
||||
n
|
||||
n
|
||||
p arg
|
||||
p maxlen
|
||||
n
|
||||
p count
|
||||
p result
|
||||
b 153
|
||||
r
|
||||
c
|
||||
c
|
||||
c
|
||||
p length
|
||||
b 147
|
||||
r
|
||||
c
|
||||
p cp
|
||||
cp dp->dir_start
|
||||
p dp->dir_start
|
||||
p cp
|
||||
p length
|
||||
n
|
||||
n
|
||||
q
|
||||
r
|
||||
q
|
||||
b vasnprintf
|
||||
n 20
|
||||
r
|
||||
n 29
|
||||
n
|
||||
p allocated
|
||||
n 20
|
||||
n
|
||||
complete p alloca
|
||||
p allocated
|
||||
p length
|
||||
n
|
||||
p maxlen
|
||||
n
|
||||
p maxlen
|
||||
n
|
||||
p arg
|
||||
n
|
||||
p result
|
||||
q
|
||||
complete b vasnp
|
||||
b vasnprintf
|
||||
r
|
||||
n 30
|
||||
n
|
||||
p buf
|
||||
p result
|
||||
complete p alloc
|
||||
p allocated
|
||||
n
|
||||
n
|
||||
n
|
||||
n
|
||||
p count
|
||||
p maxlen
|
||||
n
|
||||
n
|
||||
366
lib/.gitignore
vendored
366
lib/.gitignore
vendored
@@ -1,366 +0,0 @@
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl.c
|
||||
acl.h
|
||||
alloca.c
|
||||
alloca.h
|
||||
alloca_.h
|
||||
allocsa.c
|
||||
allocsa.h
|
||||
allocsa.valgrind
|
||||
argmatch.c
|
||||
argmatch.h
|
||||
asnprintf.c
|
||||
asprintf.c
|
||||
at-func.c
|
||||
atexit.c
|
||||
backupfile.c
|
||||
backupfile.h
|
||||
base64.c
|
||||
base64.h
|
||||
basename.c
|
||||
c-strtod.c
|
||||
c-strtod.h
|
||||
c-strtold.c
|
||||
calloc.c
|
||||
canon-host.c
|
||||
canon-host.h
|
||||
canonicalize.c
|
||||
canonicalize.h
|
||||
charset.alias
|
||||
chdir-long.c
|
||||
chdir-long.h
|
||||
chown.c
|
||||
cloexec.c
|
||||
cloexec.h
|
||||
close-stream.c
|
||||
close-stream.h
|
||||
closeout.c
|
||||
closeout.h
|
||||
config.charset
|
||||
configmake.h
|
||||
creat-safer.c
|
||||
cycle-check.c
|
||||
cycle-check.h
|
||||
dev-ino.h
|
||||
diacrit.c
|
||||
diacrit.h
|
||||
dirchownmod.c
|
||||
dirchownmod.h
|
||||
dirfd.c
|
||||
dirfd.h
|
||||
dirname.c
|
||||
dirname.h
|
||||
dup-safer.c
|
||||
dup2.c
|
||||
error.c
|
||||
error.h
|
||||
euidaccess.c
|
||||
euidaccess.h
|
||||
exclude.c
|
||||
exclude.h
|
||||
exit.h
|
||||
exitfail.c
|
||||
exitfail.h
|
||||
fchmodat.c
|
||||
fchown-stub.c
|
||||
fcntl--.h
|
||||
fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
filemode.c
|
||||
filemode.h
|
||||
filenamecat.c
|
||||
filenamecat.h
|
||||
fnmatch.c
|
||||
fnmatch_.h
|
||||
fnmatch_loop.c
|
||||
fopen-safer.c
|
||||
fprintftime.c
|
||||
fprintftime.h
|
||||
free.c
|
||||
fstatat.c
|
||||
fsusage.c
|
||||
fsusage.h
|
||||
ftruncate.c
|
||||
fts-cycle.c
|
||||
fts.c
|
||||
fts_.h
|
||||
full-read.c
|
||||
full-read.h
|
||||
full-write.c
|
||||
full-write.h
|
||||
gai_strerror.c
|
||||
getaddrinfo.c
|
||||
getaddrinfo.h
|
||||
getcwd.c
|
||||
getcwd.h
|
||||
getdate.c
|
||||
getdate.h
|
||||
getdate.y
|
||||
getdelim.c
|
||||
getdelim.h
|
||||
getgroups.c
|
||||
gethostname.c
|
||||
gethrxtime.c
|
||||
gethrxtime.h
|
||||
getline.c
|
||||
getline.h
|
||||
getloadavg.c
|
||||
getndelim2.c
|
||||
getndelim2.h
|
||||
getopt.c
|
||||
getopt1.c
|
||||
getopt_.h
|
||||
getopt_int.h
|
||||
getpagesize.h
|
||||
getpass.c
|
||||
getpass.h
|
||||
gettext.h
|
||||
gettime.c
|
||||
gettimeofday.c
|
||||
getugroups.c
|
||||
getusershell.c
|
||||
gnulib.mk
|
||||
group-member.c
|
||||
group-member.h
|
||||
hard-locale.c
|
||||
hard-locale.h
|
||||
hash-pjw.c
|
||||
hash-pjw.h
|
||||
hash.c
|
||||
hash.h
|
||||
human.c
|
||||
human.h
|
||||
i-ring.c
|
||||
i-ring.h
|
||||
idcache.c
|
||||
imaxtostr.c
|
||||
inet_ntop.c
|
||||
inet_ntop.h
|
||||
intprops.h
|
||||
inttostr.c
|
||||
inttostr.h
|
||||
inttypes.h
|
||||
inttypes_.h
|
||||
isapipe.c
|
||||
isapipe.h
|
||||
lchmod.h
|
||||
lchown.c
|
||||
lchown.h
|
||||
libcoreutils.a
|
||||
linebuffer.c
|
||||
linebuffer.h
|
||||
localcharset.c
|
||||
localcharset.h
|
||||
long-options.c
|
||||
long-options.h
|
||||
lstat.c
|
||||
lstat.h
|
||||
malloc.c
|
||||
mbchar.c
|
||||
mbchar.h
|
||||
mbswidth.c
|
||||
mbswidth.h
|
||||
mbuiter.h
|
||||
md5.c
|
||||
md5.h
|
||||
memcasecmp.c
|
||||
memcasecmp.h
|
||||
memchr.c
|
||||
memcmp.c
|
||||
memcoll.c
|
||||
memcoll.h
|
||||
memcpy.c
|
||||
memmove.c
|
||||
mempcpy.c
|
||||
mempcpy.h
|
||||
memrchr.c
|
||||
memrchr.h
|
||||
memset.c
|
||||
mkancesdirs.c
|
||||
mkancesdirs.h
|
||||
mkdir-p.c
|
||||
mkdir-p.h
|
||||
mkdir.c
|
||||
mkdirat.c
|
||||
mkstemp-safer.c
|
||||
mkstemp.c
|
||||
mkstemp.h
|
||||
mktime.c
|
||||
modechange.c
|
||||
modechange.h
|
||||
mountlist.c
|
||||
mountlist.h
|
||||
nanosleep.c
|
||||
obstack.c
|
||||
obstack.h
|
||||
offtostr.c
|
||||
open-safer.c
|
||||
openat-die.c
|
||||
openat-priv.h
|
||||
openat-proc.c
|
||||
openat.c
|
||||
openat.h
|
||||
pathmax.h
|
||||
physmem.c
|
||||
physmem.h
|
||||
pipe-safer.c
|
||||
posixtm.c
|
||||
posixtm.h
|
||||
posixver.c
|
||||
posixver.h
|
||||
printf-args.c
|
||||
printf-args.h
|
||||
printf-parse.h
|
||||
putenv.c
|
||||
quote.c
|
||||
quote.h
|
||||
quotearg.c
|
||||
quotearg.h
|
||||
raise.c
|
||||
readlink.c
|
||||
readtokens.c
|
||||
readtokens.h
|
||||
readtokens0.c
|
||||
readtokens0.h
|
||||
readutmp.c
|
||||
readutmp.h
|
||||
realloc.c
|
||||
ref-add.sed
|
||||
ref-add.sin
|
||||
ref-del.sed
|
||||
ref-del.sin
|
||||
regcomp.c
|
||||
regex.c
|
||||
regex.h
|
||||
regex_internal.c
|
||||
regex_internal.h
|
||||
regexec.c
|
||||
rename-dest-slash.c
|
||||
rename.c
|
||||
rmdir.c
|
||||
root-dev-ino.c
|
||||
root-dev-ino.h
|
||||
rpmatch.c
|
||||
safe-read.c
|
||||
safe-read.h
|
||||
safe-write.c
|
||||
safe-write.h
|
||||
same-inode.h
|
||||
same.c
|
||||
same.h
|
||||
save-cwd.c
|
||||
save-cwd.h
|
||||
savedir.c
|
||||
savedir.h
|
||||
savewd.c
|
||||
savewd.h
|
||||
setenv.c
|
||||
setenv.h
|
||||
settime.c
|
||||
sha1.c
|
||||
sha1.h
|
||||
sig2str.c
|
||||
sig2str.h
|
||||
snprintf.c
|
||||
snprintf.h
|
||||
socket_.h
|
||||
stat-macros.h
|
||||
stat-time.h
|
||||
stat_.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdlib--.h
|
||||
stdlib-safer.h
|
||||
stpcpy.c
|
||||
stpcpy.h
|
||||
strcase.h
|
||||
strcasecmp.c
|
||||
strcspn.c
|
||||
strdup.c
|
||||
strdup.h
|
||||
strftime.c
|
||||
strftime.h
|
||||
stripslash.c
|
||||
strncasecmp.c
|
||||
strndup.c
|
||||
strndup.h
|
||||
strnlen.c
|
||||
strnlen.h
|
||||
strnlen1.c
|
||||
strnlen1.h
|
||||
strpbrk.c
|
||||
strpbrk.h
|
||||
strtod.c
|
||||
strtoimax.c
|
||||
strtol.c
|
||||
strtoll.c
|
||||
strtoul.c
|
||||
strtoull.c
|
||||
strtoumax.c
|
||||
strverscmp.c
|
||||
strverscmp.h
|
||||
t-fpending
|
||||
tempname.c
|
||||
tempname.h
|
||||
time_r.c
|
||||
time_r.h
|
||||
timespec.h
|
||||
uinttostr.c
|
||||
umaxtostr.c
|
||||
unicodeio.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unlinkdir.c
|
||||
unlinkdir.h
|
||||
unlocked-io.h
|
||||
unsetenv.c
|
||||
userspec.c
|
||||
userspec.h
|
||||
utime.c
|
||||
utimecmp.c
|
||||
utimecmp.h
|
||||
utimens.c
|
||||
utimens.h
|
||||
vasnprintf.h
|
||||
vasprintf.c
|
||||
vasprintf.h
|
||||
verify.h
|
||||
version-etc-fsf.c
|
||||
version-etc.c
|
||||
version-etc.h
|
||||
wcwidth.h
|
||||
xalloc-die.c
|
||||
xalloc.h
|
||||
xgetcwd.c
|
||||
xgetcwd.h
|
||||
xgethostname.c
|
||||
xgethostname.h
|
||||
xmalloc.c
|
||||
xmemcoll.c
|
||||
xmemcoll.h
|
||||
xnanosleep.c
|
||||
xnanosleep.h
|
||||
xreadlink.c
|
||||
xreadlink.h
|
||||
xstrndup.c
|
||||
xstrndup.h
|
||||
xstrtod.c
|
||||
xstrtod.h
|
||||
xstrtoimax.c
|
||||
xstrtol.c
|
||||
xstrtol.h
|
||||
xstrtold.c
|
||||
xstrtoul.c
|
||||
xstrtoumax.c
|
||||
xtime.h
|
||||
yesno.c
|
||||
yesno.h
|
||||
@@ -1,3 +1,69 @@
|
||||
2007-05-31 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* printf-parse.c, vasnprintf.c, unicodeio.c: Remove local
|
||||
copies, so we now get these files from gnulib.
|
||||
|
||||
2007-03-20 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Fix a typo in the handling of %x and %X.
|
||||
* vasnprintf.c (VASNPRINTF): When adding 2 to buffer length,
|
||||
don't double it.
|
||||
|
||||
2007-03-04 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vasnprintf.c (VASNPRINTF): Add missing semicolon.
|
||||
|
||||
2007-03-02 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* vasnprintf.c (VASNPRINTF): Remove cast of alloca return value.
|
||||
|
||||
2007-03-01 Jim Meyering <jim@meyering.net>
|
||||
|
||||
Merge in changes from gnulib:
|
||||
* vasnprintf.c: Add a comment explaining why coreutils has its own
|
||||
version of this file.
|
||||
Include <stdint.h>.
|
||||
(SIZE_MAX): Remove definition (now, stdint.h covers that).
|
||||
(EOVERFLOW): Remove definition (now done via the eoverflow module).
|
||||
Update some #ifdef to #if.
|
||||
Use HAVE_LONG_LONG_INT, not HAVE_LONG_LONG.
|
||||
* printf-parse.c: Likewise.
|
||||
|
||||
2007-02-28 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* tsearch.c: Remove unused file.
|
||||
|
||||
2007-02-23 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* randperm.c (randperm_new): Comment: say that this function
|
||||
returns a pointer to malloc'd storage.
|
||||
|
||||
2007-02-18 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h
|
||||
is guaranteed to provide a valid definition of EXIT_FAILURE.
|
||||
|
||||
2007-01-19 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* .cvsignore, .gitignore: Add sys, as well as more
|
||||
bootstrap-inserted file names.
|
||||
|
||||
2007-01-14 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* fchdir-stub.c: Remove file. No longer needed.
|
||||
|
||||
2006-12-03 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* Makefile.am (libcoreutils_a_SOURCES): Remove xmemcoll.c and
|
||||
xmemcoll.h. Now, they're handled by the gnulib xmemcoll module.
|
||||
|
||||
2006-11-22 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* randread.c (__attribute__): Don't define if __attribute__ is
|
||||
already defined. Otherwise, the code won't conform to C99, since
|
||||
the macro arg is spelled differently by some include file, and the
|
||||
compilation fails with pedantic GCC.
|
||||
|
||||
2006-11-22 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* .cvsignore, .gitignore: Add fstat.c.
|
||||
|
||||
@@ -1,39 +1,27 @@
|
||||
## Makefile for gnulib/lib -*-Makefile-*-
|
||||
|
||||
# Copyright (C) 1995-2006 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2007 Free Software Foundation, Inc.
|
||||
|
||||
## This program is free software; you can redistribute it and/or modify
|
||||
## 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 2, or (at your option)
|
||||
## any later version.
|
||||
|
||||
## 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, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
## 02110-1301, USA.
|
||||
## along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include gnulib.mk
|
||||
|
||||
AM_CFLAGS = $(WARNING_CFLAGS) $(WERROR_CFLAGS)
|
||||
|
||||
noinst_PROGRAMS = t-fpending
|
||||
LDADD = $(noinst_LIBRARIES)
|
||||
|
||||
libcoreutils_a_SOURCES += \
|
||||
buffer-lcm.c buffer-lcm.h \
|
||||
xmemcoll.c xmemcoll.h \
|
||||
xmemxfrm.c xmemxfrm.h
|
||||
|
||||
libcoreutils_a_LIBADD += $(LIBOBJS)
|
||||
libcoreutils_a_DEPENDENCIES += $(LIBOBJS)
|
||||
|
||||
check: unit-test
|
||||
|
||||
.PHONY: unit-test
|
||||
unit-test: t-fpending
|
||||
./t-fpending > /dev/null
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2002, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@@ -4,19 +4,18 @@
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Adapted for use in GNU remove.c by Jim Meyering. */
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#include <config.h>
|
||||
#include <sys/types.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* A trivial substitute for `fchdir'.
|
||||
|
||||
DJGPP 2.03 and earlier don't have `fchdir'. */
|
||||
|
||||
int
|
||||
fchdir (int fd)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@@ -2,19 +2,18 @@
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
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>
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert <eggert@cs.ucla.edu>. */
|
||||
|
||||
|
||||
@@ -1,535 +0,0 @@
|
||||
/* Formatted output to strings.
|
||||
Copyright (C) 1999-2000, 2002-2004, 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 2, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#if WIDE_CHAR_VERSION
|
||||
# include "wprintf-parse.h"
|
||||
#else
|
||||
# include "printf-parse.h"
|
||||
#endif
|
||||
|
||||
/* Get size_t, NULL. */
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get intmax_t. */
|
||||
#if HAVE_STDINT_H_WITH_UINTMAX
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
#if HAVE_INTTYPES_H_WITH_UINTMAX
|
||||
# include <inttypes.h>
|
||||
#endif
|
||||
|
||||
/* malloc(), realloc(), free(). */
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef SIZE_MAX
|
||||
# define SIZE_MAX ((size_t) -1)
|
||||
#endif
|
||||
|
||||
#if WIDE_CHAR_VERSION
|
||||
# define PRINTF_PARSE wprintf_parse
|
||||
# define CHAR_T wchar_t
|
||||
# define DIRECTIVE wchar_t_directive
|
||||
# define DIRECTIVES wchar_t_directives
|
||||
#else
|
||||
# define PRINTF_PARSE printf_parse
|
||||
# define CHAR_T char
|
||||
# define DIRECTIVE char_directive
|
||||
# define DIRECTIVES char_directives
|
||||
#endif
|
||||
|
||||
#ifdef STATIC
|
||||
STATIC
|
||||
#endif
|
||||
int
|
||||
PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
|
||||
{
|
||||
const CHAR_T *cp = format; /* pointer into format */
|
||||
size_t arg_posn = 0; /* number of regular arguments consumed */
|
||||
size_t d_allocated; /* allocated elements of d->dir */
|
||||
size_t a_allocated; /* allocated elements of a->arg */
|
||||
size_t max_width_length = 0;
|
||||
size_t max_precision_length = 0;
|
||||
|
||||
d->count = 0;
|
||||
d_allocated = 1;
|
||||
d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
|
||||
if (d->dir == NULL)
|
||||
/* Out of memory. */
|
||||
return -1;
|
||||
|
||||
a->count = 0;
|
||||
a_allocated = 0;
|
||||
a->arg = NULL;
|
||||
|
||||
#define REGISTER_ARG(_index_,_type_) \
|
||||
{ \
|
||||
size_t n = (_index_); \
|
||||
if (n >= a_allocated) \
|
||||
{ \
|
||||
size_t memory_size; \
|
||||
argument *memory; \
|
||||
\
|
||||
a_allocated *= 2; \
|
||||
if (a_allocated <= n) \
|
||||
a_allocated = n + 1; \
|
||||
if (SIZE_MAX / sizeof (argument) < a_allocated) \
|
||||
/* Overflow, would lead to out of memory. */ \
|
||||
goto error; \
|
||||
memory_size = a_allocated * sizeof (argument); \
|
||||
memory = (a->arg \
|
||||
? realloc (a->arg, memory_size) \
|
||||
: malloc (memory_size)); \
|
||||
if (memory == NULL) \
|
||||
/* Out of memory. */ \
|
||||
goto error; \
|
||||
a->arg = memory; \
|
||||
} \
|
||||
while (a->count <= n) \
|
||||
a->arg[a->count++].type = TYPE_NONE; \
|
||||
if (a->arg[n].type == TYPE_NONE) \
|
||||
a->arg[n].type = (_type_); \
|
||||
else if (a->arg[n].type != (_type_)) \
|
||||
/* Ambiguous type for positional argument. */ \
|
||||
goto error; \
|
||||
}
|
||||
|
||||
while (*cp != '\0')
|
||||
{
|
||||
CHAR_T c = *cp++;
|
||||
if (c == '%')
|
||||
{
|
||||
size_t arg_index = ARG_NONE;
|
||||
DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
|
||||
|
||||
/* Initialize the next directive. */
|
||||
dp->dir_start = cp - 1;
|
||||
dp->flags = 0;
|
||||
dp->width_start = NULL;
|
||||
dp->width_end = NULL;
|
||||
dp->width_arg_index = ARG_NONE;
|
||||
dp->precision_start = NULL;
|
||||
dp->precision_end = NULL;
|
||||
dp->precision_arg_index = ARG_NONE;
|
||||
dp->arg_index = ARG_NONE;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
if (n < SIZE_MAX / 10)
|
||||
n = 10 * n + (*np - '0');
|
||||
else
|
||||
/* n too large for memory. */
|
||||
goto error;
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the flags. */
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == '\'')
|
||||
{
|
||||
dp->flags |= FLAG_GROUP;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '-')
|
||||
{
|
||||
dp->flags |= FLAG_LEFT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '+')
|
||||
{
|
||||
dp->flags |= FLAG_SHOWSIGN;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == ' ')
|
||||
{
|
||||
dp->flags |= FLAG_SPACE;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '#')
|
||||
{
|
||||
dp->flags |= FLAG_ALT;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == '0')
|
||||
{
|
||||
dp->flags |= FLAG_ZERO;
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Parse the field width. */
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->width_start = cp;
|
||||
cp++;
|
||||
dp->width_end = cp;
|
||||
if (max_width_length < 1)
|
||||
max_width_length = 1;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
if (n < SIZE_MAX / 10)
|
||||
n = 10 * n + (*np - '0');
|
||||
else
|
||||
/* n too large for memory. */
|
||||
goto error;
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
dp->width_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->width_arg_index = arg_posn++;
|
||||
if (dp->width_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->width_arg_index, TYPE_INT);
|
||||
}
|
||||
else if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
size_t width_length;
|
||||
|
||||
dp->width_start = cp;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->width_end = cp;
|
||||
width_length = dp->width_end - dp->width_start;
|
||||
if (max_width_length < width_length)
|
||||
max_width_length = width_length;
|
||||
}
|
||||
|
||||
/* Parse the precision. */
|
||||
if (*cp == '.')
|
||||
{
|
||||
cp++;
|
||||
if (*cp == '*')
|
||||
{
|
||||
dp->precision_start = cp - 1;
|
||||
cp++;
|
||||
dp->precision_end = cp;
|
||||
if (max_precision_length < 2)
|
||||
max_precision_length = 2;
|
||||
|
||||
/* Test for positional argument. */
|
||||
if (*cp >= '0' && *cp <= '9')
|
||||
{
|
||||
const CHAR_T *np;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
;
|
||||
if (*np == '$')
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
for (np = cp; *np >= '0' && *np <= '9'; np++)
|
||||
if (n < SIZE_MAX / 10)
|
||||
n = 10 * n + (*np - '0');
|
||||
else
|
||||
/* n too large for memory. */
|
||||
goto error;
|
||||
if (n == 0)
|
||||
/* Positional argument 0. */
|
||||
goto error;
|
||||
dp->precision_arg_index = n - 1;
|
||||
cp = np + 1;
|
||||
}
|
||||
}
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
{
|
||||
dp->precision_arg_index = arg_posn++;
|
||||
if (dp->precision_arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t precision_length;
|
||||
|
||||
dp->precision_start = cp - 1;
|
||||
for (; *cp >= '0' && *cp <= '9'; cp++)
|
||||
;
|
||||
dp->precision_end = cp;
|
||||
precision_length = dp->precision_end - dp->precision_start;
|
||||
if (max_precision_length < precision_length)
|
||||
max_precision_length = precision_length;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
arg_type type;
|
||||
|
||||
/* Parse argument type/size specifiers. */
|
||||
{
|
||||
int flags = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (*cp == 'h')
|
||||
{
|
||||
flags |= (1 << (flags & 1));
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'L')
|
||||
{
|
||||
flags |= 4;
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 'l')
|
||||
{
|
||||
flags += 8;
|
||||
cp++;
|
||||
}
|
||||
#ifdef HAVE_INTMAX_T
|
||||
else if (*cp == 'j')
|
||||
{
|
||||
if (sizeof (intmax_t) > sizeof (long))
|
||||
{
|
||||
/* intmax_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (intmax_t) > sizeof (int))
|
||||
{
|
||||
/* intmax_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
#endif
|
||||
else if (*cp == 'z' || *cp == 'Z')
|
||||
{
|
||||
/* 'z' is standardized in ISO C 99, but glibc uses 'Z'
|
||||
because the warning facility in gcc-2.95.2 understands
|
||||
only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
|
||||
if (sizeof (size_t) > sizeof (long))
|
||||
{
|
||||
/* size_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (size_t) > sizeof (int))
|
||||
{
|
||||
/* size_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else if (*cp == 't')
|
||||
{
|
||||
if (sizeof (ptrdiff_t) > sizeof (long))
|
||||
{
|
||||
/* ptrdiff_t = long long */
|
||||
flags += 16;
|
||||
}
|
||||
else if (sizeof (ptrdiff_t) > sizeof (int))
|
||||
{
|
||||
/* ptrdiff_t = long */
|
||||
flags += 8;
|
||||
}
|
||||
cp++;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read the conversion character. */
|
||||
c = *cp++;
|
||||
switch (c)
|
||||
{
|
||||
case 'd': case 'i':
|
||||
#ifdef HAVE_LONG_LONG
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
if (flags >= 8)
|
||||
type = TYPE_LONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_SCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_SHORT;
|
||||
else
|
||||
type = TYPE_INT;
|
||||
break;
|
||||
case 'o': case 'u': case 'x': case 'X':
|
||||
#ifdef HAVE_LONG_LONG
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_ULONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
if (flags >= 8)
|
||||
type = TYPE_ULONGINT;
|
||||
else if (flags & 2)
|
||||
type = TYPE_UCHAR;
|
||||
else if (flags & 1)
|
||||
type = TYPE_USHORT;
|
||||
else
|
||||
type = TYPE_UINT;
|
||||
break;
|
||||
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
|
||||
case 'a': case 'A':
|
||||
#ifdef HAVE_LONG_DOUBLE
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGDOUBLE;
|
||||
else
|
||||
#endif
|
||||
type = TYPE_DOUBLE;
|
||||
break;
|
||||
case 'c':
|
||||
if (flags >= 8)
|
||||
#ifdef HAVE_WINT_T
|
||||
type = TYPE_WIDE_CHAR;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_CHAR;
|
||||
break;
|
||||
#ifdef HAVE_WINT_T
|
||||
case 'C':
|
||||
type = TYPE_WIDE_CHAR;
|
||||
c = 'c';
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
if (flags >= 8)
|
||||
#ifdef HAVE_WCHAR_T
|
||||
type = TYPE_WIDE_STRING;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_STRING;
|
||||
break;
|
||||
#ifdef HAVE_WCHAR_T
|
||||
case 'S':
|
||||
type = TYPE_WIDE_STRING;
|
||||
c = 's';
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
type = TYPE_POINTER;
|
||||
break;
|
||||
case 'n':
|
||||
#ifdef HAVE_LONG_LONG
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
else
|
||||
#endif
|
||||
if (flags >= 8)
|
||||
type = TYPE_COUNT_LONGINT_POINTER;
|
||||
else if (flags & 2)
|
||||
type = TYPE_COUNT_SCHAR_POINTER;
|
||||
else if (flags & 1)
|
||||
type = TYPE_COUNT_SHORT_POINTER;
|
||||
else
|
||||
type = TYPE_COUNT_INT_POINTER;
|
||||
break;
|
||||
case '%':
|
||||
type = TYPE_NONE;
|
||||
break;
|
||||
default:
|
||||
/* Unknown conversion character. */
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != TYPE_NONE)
|
||||
{
|
||||
dp->arg_index = arg_index;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
{
|
||||
dp->arg_index = arg_posn++;
|
||||
if (dp->arg_index == ARG_NONE)
|
||||
/* arg_posn wrapped around. */
|
||||
goto error;
|
||||
}
|
||||
REGISTER_ARG (dp->arg_index, type);
|
||||
}
|
||||
dp->conversion = c;
|
||||
dp->dir_end = cp;
|
||||
}
|
||||
|
||||
d->count++;
|
||||
if (d->count >= d_allocated)
|
||||
{
|
||||
DIRECTIVE *memory;
|
||||
|
||||
if (SIZE_MAX / (2 * sizeof (DIRECTIVE)) < d_allocated)
|
||||
/* Overflow, would lead to out of memory. */
|
||||
goto error;
|
||||
d_allocated *= 2;
|
||||
memory = realloc (d->dir, d_allocated * sizeof (DIRECTIVE));
|
||||
if (memory == NULL)
|
||||
/* Out of memory. */
|
||||
goto error;
|
||||
d->dir = memory;
|
||||
}
|
||||
}
|
||||
}
|
||||
d->dir[d->count].dir_start = cp;
|
||||
|
||||
d->max_width_length = max_width_length;
|
||||
d->max_precision_length = max_precision_length;
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (a->arg)
|
||||
free (a->arg);
|
||||
if (d->dir)
|
||||
free (d->dir);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#undef DIRECTIVES
|
||||
#undef DIRECTIVE
|
||||
#undef CHAR_T
|
||||
#undef PRINTF_PARSE
|
||||
@@ -1,88 +0,0 @@
|
||||
/* Tree search.
|
||||
|
||||
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003 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 2, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
/* For use with hsearch(3). */
|
||||
#ifndef __COMPAR_FN_T
|
||||
# define __COMPAR_FN_T
|
||||
typedef int (*__compar_fn_t) (const void *, const void *);
|
||||
|
||||
# ifdef __USE_GNU
|
||||
typedef __compar_fn_t comparison_fn_t;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The tsearch routines are very interesting. They make many
|
||||
assumptions about the compiler. It assumes that the first field
|
||||
in node must be the "key" field, which points to the datum.
|
||||
Everything depends on that. */
|
||||
/* For tsearch */
|
||||
typedef enum
|
||||
{
|
||||
preorder,
|
||||
postorder,
|
||||
endorder,
|
||||
leaf
|
||||
}
|
||||
VISIT;
|
||||
|
||||
/* GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
"restrict", and "configure" may have defined "restrict". */
|
||||
#ifndef __restrict
|
||||
# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
|
||||
# if defined restrict || 199901L <= __STDC_VERSION__
|
||||
# define __restrict restrict
|
||||
# else
|
||||
# define __restrict
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Search for an entry matching the given KEY in the tree pointed to
|
||||
by *ROOTP and insert a new element if not found. */
|
||||
extern void *tsearch (const void *__key, void **__rootp,
|
||||
__compar_fn_t __compar);
|
||||
|
||||
/* Search for an entry matching the given KEY in the tree pointed to
|
||||
by *ROOTP. If no matching entry is available return NULL. */
|
||||
extern void *tfind (const void *__key, void *const *__rootp,
|
||||
__compar_fn_t __compar);
|
||||
|
||||
/* Remove the element matching KEY from the tree pointed to by *ROOTP. */
|
||||
extern void *tdelete (const void *__restrict __key,
|
||||
void **__restrict __rootp,
|
||||
__compar_fn_t __compar);
|
||||
|
||||
#ifndef __ACTION_FN_T
|
||||
# define __ACTION_FN_T
|
||||
typedef void (*__action_fn_t) (const void *__nodep, VISIT __value,
|
||||
int __level);
|
||||
#endif
|
||||
|
||||
/* Walk through the whole tree and call the ACTION callback for every node
|
||||
or leaf. */
|
||||
extern void twalk (const void *__root, __action_fn_t __action);
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Callback type for function to free a tree node. If the keys are atomic
|
||||
data this function should do nothing. */
|
||||
typedef void (*__free_fn_t) (void *__nodep);
|
||||
|
||||
/* Destroy the whole tree, call FREEFCT for each node or leaf. */
|
||||
extern void tdestroy (void *__root, __free_fn_t __freefct);
|
||||
#endif
|
||||
11
lib/sha256.c
11
lib/sha256.c
@@ -3,10 +3,10 @@
|
||||
|
||||
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 2, or (at your option) any
|
||||
later version.
|
||||
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
|
||||
@@ -14,8 +14,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
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
|
||||
|
||||
11
lib/sha256.h
11
lib/sha256.h
@@ -2,10 +2,10 @@
|
||||
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 2, or (at your option) any
|
||||
later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SHA256_H
|
||||
# define SHA256_H 1
|
||||
|
||||
11
lib/sha512.c
11
lib/sha512.c
@@ -3,10 +3,10 @@
|
||||
|
||||
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 2, or (at your option) any
|
||||
later version.
|
||||
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
|
||||
@@ -14,8 +14,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
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
|
||||
|
||||
11
lib/sha512.h
11
lib/sha512.h
@@ -2,10 +2,10 @@
|
||||
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 2, or (at your option) any
|
||||
later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef SHA512_H
|
||||
# define SHA512_H 1
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert and Jim Meyering. */
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
Copyright (C) 1988, 1991, 1992, 1993, 1995, 1996, 1998, 1999, 2000,
|
||||
2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -14,8 +14,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Mike Haertel. */
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
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 2, or (at your option)
|
||||
any later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# 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 2 of the License, or
|
||||
# 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,
|
||||
@@ -14,9 +14,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, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# FIXME: add traps and choose top level names so that
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/* Ensure that __fpending works.
|
||||
|
||||
Copyright (C) 2004 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 2, 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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Written by Jim Meyering. */
|
||||
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "__fpending.h"
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
if (__fpending (stdout) != 0)
|
||||
abort ();
|
||||
|
||||
fputs ("foo", stdout);
|
||||
if (__fpending (stdout) != 3)
|
||||
abort ();
|
||||
|
||||
fflush (stdout);
|
||||
if (__fpending (stdout) != 0)
|
||||
abort ();
|
||||
|
||||
exit (0);
|
||||
}
|
||||
698
lib/tsearch.c
698
lib/tsearch.c
@@ -1,698 +0,0 @@
|
||||
/* Copyright (C) 1995, 1996, 1997, 2000, 2005, 2006 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>, 1997.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301 USA. */
|
||||
|
||||
/* Tree search for red/black trees.
|
||||
The algorithm for adding nodes is taken from one of the many "Algorithms"
|
||||
books by Robert Sedgewick, although the implementation differs.
|
||||
The algorithm for deleting nodes can probably be found in a book named
|
||||
"Introduction to Algorithms" by Cormen/Leiserson/Rivest. At least that's
|
||||
the book that my professor took most algorithms from during the "Data
|
||||
Structures" course...
|
||||
|
||||
Totally public domain. */
|
||||
|
||||
/* Red/black trees are binary trees in which the edges are colored either red
|
||||
or black. They have the following properties:
|
||||
1. The number of black edges on every path from the root to a leaf is
|
||||
constant.
|
||||
2. No two red edges are adjacent.
|
||||
Therefore there is an upper bound on the length of every path, it's
|
||||
O(log n) where n is the number of nodes in the tree. No path can be longer
|
||||
than 1+2*P where P is the length of the shortest path in the tree.
|
||||
Useful for the implementation:
|
||||
3. If one of the children of a node is NULL, then the other one is red
|
||||
(if it exists).
|
||||
|
||||
In the implementation, not the edges are colored, but the nodes. The color
|
||||
interpreted as the color of the edge leading to this node. The color is
|
||||
meaningless for the root node, but we color the root node black for
|
||||
convenience. All added nodes are red initially.
|
||||
|
||||
Adding to a red/black tree is rather easy. The right place is searched
|
||||
with a usual binary tree search. Additionally, whenever a node N is
|
||||
reached that has two red successors, the successors are colored black and
|
||||
the node itself colored red. This moves red edges up the tree where they
|
||||
pose less of a problem once we get to really insert the new node. Changing
|
||||
N's color to red may violate rule 2, however, so rotations may become
|
||||
necessary to restore the invariants. Adding a new red leaf may violate
|
||||
the same rule, so afterwards an additional check is run and the tree
|
||||
possibly rotated.
|
||||
|
||||
Deleting is hairy. There are mainly two nodes involved: the node to be
|
||||
deleted (n1), and another node that is to be unchained from the tree (n2).
|
||||
If n1 has a successor (the node with a smallest key that is larger than
|
||||
n1), then the successor becomes n2 and its contents are copied into n1,
|
||||
otherwise n1 becomes n2.
|
||||
Unchaining a node may violate rule 1: if n2 is black, one subtree is
|
||||
missing one black edge afterwards. The algorithm must try to move this
|
||||
error upwards towards the root, so that the subtree that does not have
|
||||
enough black edges becomes the whole tree. Once that happens, the error
|
||||
has disappeared. It may not be necessary to go all the way up, since it
|
||||
is possible that rotations and recoloring can fix the error before that.
|
||||
|
||||
Although the deletion algorithm must walk upwards through the tree, we
|
||||
do not store parent pointers in the nodes. Instead, delete allocates a
|
||||
small array of parent pointers and fills it while descending the tree.
|
||||
Since we know that the length of a path is O(log n), where n is the number
|
||||
of nodes, this is likely to use less memory. */
|
||||
|
||||
/* Tree rotations look like this:
|
||||
A C
|
||||
/ \ / \
|
||||
B C A G
|
||||
/ \ / \ --> / \
|
||||
D E F G B F
|
||||
/ \
|
||||
D E
|
||||
|
||||
In this case, A has been rotated left. This preserves the ordering of the
|
||||
binary tree. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if __GNUC__
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifdef _AIX
|
||||
# pragma alloca
|
||||
# else
|
||||
char *alloca ();
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <search.h>
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __tsearch tsearch
|
||||
# define __tfind tfind
|
||||
# define __tdelete tdelete
|
||||
# define __twalk twalk
|
||||
# define __tdestroy tdestroy
|
||||
#endif
|
||||
|
||||
#ifndef _LIBC
|
||||
# define weak_alias(f,g)
|
||||
# define internal_function
|
||||
#endif
|
||||
|
||||
typedef struct node_t
|
||||
{
|
||||
/* Callers expect this to be the first element in the structure - do not
|
||||
move! */
|
||||
const void *key;
|
||||
struct node_t *left;
|
||||
struct node_t *right;
|
||||
unsigned int red:1;
|
||||
} *node;
|
||||
typedef const struct node_t *const_node;
|
||||
|
||||
#undef DEBUGGING
|
||||
|
||||
#ifdef DEBUGGING
|
||||
|
||||
/* Routines to check tree invariants. */
|
||||
|
||||
# include <assert.h>
|
||||
|
||||
# define CHECK_TREE(a) check_tree(a)
|
||||
|
||||
static void
|
||||
check_tree_recurse (node p, int d_sofar, int d_total)
|
||||
{
|
||||
if (p == NULL)
|
||||
{
|
||||
assert (d_sofar == d_total);
|
||||
return;
|
||||
}
|
||||
|
||||
check_tree_recurse (p->left, d_sofar + (p->left && !p->left->red), d_total);
|
||||
check_tree_recurse (p->right, d_sofar + (p->right && !p->right->red), d_total);
|
||||
if (p->left)
|
||||
assert (!(p->left->red && p->red));
|
||||
if (p->right)
|
||||
assert (!(p->right->red && p->red));
|
||||
}
|
||||
|
||||
static void
|
||||
check_tree (node root)
|
||||
{
|
||||
int cnt = 0;
|
||||
node p;
|
||||
if (root == NULL)
|
||||
return;
|
||||
root->red = 0;
|
||||
for(p = root->left; p; p = p->left)
|
||||
cnt += !p->red;
|
||||
check_tree_recurse (root, 0, cnt);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
# define CHECK_TREE(a)
|
||||
|
||||
#endif
|
||||
|
||||
/* Possibly "split" a node with two red successors, and/or fix up two red
|
||||
edges in a row. ROOTP is a pointer to the lowest node we visited, PARENTP
|
||||
and GPARENTP pointers to its parent/grandparent. P_R and GP_R contain the
|
||||
comparison values that determined which way was taken in the tree to reach
|
||||
ROOTP. MODE is 1 if we need not do the split, but must check for two red
|
||||
edges between GPARENTP and ROOTP. */
|
||||
static void
|
||||
maybe_split_for_insert (node *rootp, node *parentp, node *gparentp,
|
||||
int p_r, int gp_r, int mode)
|
||||
{
|
||||
node root = *rootp;
|
||||
node *rp, *lp;
|
||||
rp = &(*rootp)->right;
|
||||
lp = &(*rootp)->left;
|
||||
|
||||
/* See if we have to split this node (both successors red). */
|
||||
if (mode == 1
|
||||
|| ((*rp) != NULL && (*lp) != NULL && (*rp)->red && (*lp)->red))
|
||||
{
|
||||
/* This node becomes red, its successors black. */
|
||||
root->red = 1;
|
||||
if (*rp)
|
||||
(*rp)->red = 0;
|
||||
if (*lp)
|
||||
(*lp)->red = 0;
|
||||
|
||||
/* If the parent of this node is also red, we have to do
|
||||
rotations. */
|
||||
if (parentp != NULL && (*parentp)->red)
|
||||
{
|
||||
node gp = *gparentp;
|
||||
node p = *parentp;
|
||||
/* There are two main cases:
|
||||
1. The edge types (left or right) of the two red edges differ.
|
||||
2. Both red edges are of the same type.
|
||||
There exist two symmetries of each case, so there is a total of
|
||||
4 cases. */
|
||||
if ((p_r > 0) != (gp_r > 0))
|
||||
{
|
||||
/* Put the child at the top of the tree, with its parent
|
||||
and grandparent as successors. */
|
||||
p->red = 1;
|
||||
gp->red = 1;
|
||||
root->red = 0;
|
||||
if (p_r < 0)
|
||||
{
|
||||
/* Child is left of parent. */
|
||||
p->left = *rp;
|
||||
*rp = p;
|
||||
gp->right = *lp;
|
||||
*lp = gp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Child is right of parent. */
|
||||
p->right = *lp;
|
||||
*lp = p;
|
||||
gp->left = *rp;
|
||||
*rp = gp;
|
||||
}
|
||||
*gparentp = root;
|
||||
}
|
||||
else
|
||||
{
|
||||
*gparentp = *parentp;
|
||||
/* Parent becomes the top of the tree, grandparent and
|
||||
child are its successors. */
|
||||
p->red = 0;
|
||||
gp->red = 1;
|
||||
if (p_r < 0)
|
||||
{
|
||||
/* Left edges. */
|
||||
gp->left = p->right;
|
||||
p->right = gp;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Right edges. */
|
||||
gp->right = p->left;
|
||||
p->left = gp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Find or insert datum into search tree.
|
||||
KEY is the key to be located, ROOTP is the address of tree root,
|
||||
COMPAR the ordering function. */
|
||||
void *
|
||||
__tsearch (const void *key, void **vrootp, __compar_fn_t compar)
|
||||
{
|
||||
node q;
|
||||
node *parentp = NULL, *gparentp = NULL;
|
||||
node *rootp = (node *) vrootp;
|
||||
node *nextp;
|
||||
int r = 0, p_r = 0, gp_r = 0; /* No they might not, Mr Compiler. */
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
/* This saves some additional tests below. */
|
||||
if (*rootp != NULL)
|
||||
(*rootp)->red = 0;
|
||||
|
||||
CHECK_TREE (*rootp);
|
||||
|
||||
nextp = rootp;
|
||||
while (*nextp != NULL)
|
||||
{
|
||||
node root = *rootp;
|
||||
r = (*compar) (key, root->key);
|
||||
if (r == 0)
|
||||
return root;
|
||||
|
||||
maybe_split_for_insert (rootp, parentp, gparentp, p_r, gp_r, 0);
|
||||
/* If that did any rotations, parentp and gparentp are now garbage.
|
||||
That doesn't matter, because the values they contain are never
|
||||
used again in that case. */
|
||||
|
||||
nextp = r < 0 ? &root->left : &root->right;
|
||||
if (*nextp == NULL)
|
||||
break;
|
||||
|
||||
gparentp = parentp;
|
||||
parentp = rootp;
|
||||
rootp = nextp;
|
||||
|
||||
gp_r = p_r;
|
||||
p_r = r;
|
||||
}
|
||||
|
||||
q = (struct node_t *) malloc (sizeof (struct node_t));
|
||||
if (q != NULL)
|
||||
{
|
||||
*nextp = q; /* link new node to old */
|
||||
q->key = key; /* initialize new node */
|
||||
q->red = 1;
|
||||
q->left = q->right = NULL;
|
||||
}
|
||||
if (nextp != rootp)
|
||||
/* There may be two red edges in a row now, which we must avoid by
|
||||
rotating the tree. */
|
||||
maybe_split_for_insert (nextp, rootp, parentp, r, p_r, 1);
|
||||
|
||||
return q;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tsearch, tsearch)
|
||||
#endif
|
||||
|
||||
|
||||
/* Find datum in search tree.
|
||||
KEY is the key to be located, ROOTP is the address of tree root,
|
||||
COMPAR the ordering function. */
|
||||
void *
|
||||
__tfind (key, vrootp, compar)
|
||||
const void *key;
|
||||
void *const *vrootp;
|
||||
__compar_fn_t compar;
|
||||
{
|
||||
node *rootp = (node *) vrootp;
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
|
||||
CHECK_TREE (*rootp);
|
||||
|
||||
while (*rootp != NULL)
|
||||
{
|
||||
node root = *rootp;
|
||||
int r;
|
||||
|
||||
r = (*compar) (key, root->key);
|
||||
if (r == 0)
|
||||
return root;
|
||||
|
||||
rootp = r < 0 ? &root->left : &root->right;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tfind, tfind)
|
||||
#endif
|
||||
|
||||
|
||||
/* Delete node with given key.
|
||||
KEY is the key to be deleted, ROOTP is the address of the root of tree,
|
||||
COMPAR the comparison function. */
|
||||
void *
|
||||
__tdelete (const void *key, void **vrootp, __compar_fn_t compar)
|
||||
{
|
||||
node p, q, r, retval;
|
||||
int cmp;
|
||||
node *rootp = (node *) vrootp;
|
||||
node root, unchained;
|
||||
/* Stack of nodes so we remember the parents without recursion. It's
|
||||
_very_ unlikely that there are paths longer than 40 nodes. The tree
|
||||
would need to have around 250.000 nodes. */
|
||||
int stacksize = 40;
|
||||
int sp = 0;
|
||||
node **nodestack = (node **) alloca (sizeof (node *) * stacksize);
|
||||
|
||||
if (rootp == NULL)
|
||||
return NULL;
|
||||
p = *rootp;
|
||||
if (p == NULL)
|
||||
return NULL;
|
||||
|
||||
CHECK_TREE (p);
|
||||
|
||||
while ((cmp = (*compar) (key, (*rootp)->key)) != 0)
|
||||
{
|
||||
if (sp == stacksize)
|
||||
{
|
||||
node **newstack;
|
||||
stacksize += 20;
|
||||
newstack = (node **) alloca (sizeof (node *) * stacksize);
|
||||
nodestack = memcpy (newstack, nodestack, sp * sizeof (node *));
|
||||
}
|
||||
|
||||
nodestack[sp++] = rootp;
|
||||
p = *rootp;
|
||||
rootp = ((cmp < 0)
|
||||
? &(*rootp)->left
|
||||
: &(*rootp)->right);
|
||||
if (*rootp == NULL)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This is bogus if the node to be deleted is the root... this routine
|
||||
really should return an integer with 0 for success, -1 for failure
|
||||
and errno = ESRCH or something. */
|
||||
retval = p;
|
||||
|
||||
/* We don't unchain the node we want to delete. Instead, we overwrite
|
||||
it with its successor and unchain the successor. If there is no
|
||||
successor, we really unchain the node to be deleted. */
|
||||
|
||||
root = *rootp;
|
||||
|
||||
r = root->right;
|
||||
q = root->left;
|
||||
|
||||
if (q == NULL || r == NULL)
|
||||
unchained = root;
|
||||
else
|
||||
{
|
||||
node *parent = rootp, *up = &root->right;
|
||||
for (;;)
|
||||
{
|
||||
if (sp == stacksize)
|
||||
{
|
||||
node **newstack;
|
||||
stacksize += 20;
|
||||
newstack = (node **) alloca (sizeof (node *) * stacksize);
|
||||
nodestack = memcpy (newstack, nodestack, sp * sizeof (node *));
|
||||
}
|
||||
nodestack[sp++] = parent;
|
||||
parent = up;
|
||||
if ((*up)->left == NULL)
|
||||
break;
|
||||
up = &(*up)->left;
|
||||
}
|
||||
unchained = *up;
|
||||
}
|
||||
|
||||
/* We know that either the left or right successor of UNCHAINED is NULL.
|
||||
R becomes the other one, it is chained into the parent of UNCHAINED. */
|
||||
r = unchained->left;
|
||||
if (r == NULL)
|
||||
r = unchained->right;
|
||||
if (sp == 0)
|
||||
*rootp = r;
|
||||
else
|
||||
{
|
||||
q = *nodestack[sp-1];
|
||||
if (unchained == q->right)
|
||||
q->right = r;
|
||||
else
|
||||
q->left = r;
|
||||
}
|
||||
|
||||
if (unchained != root)
|
||||
root->key = unchained->key;
|
||||
if (!unchained->red)
|
||||
{
|
||||
/* Now we lost a black edge, which means that the number of black
|
||||
edges on every path is no longer constant. We must balance the
|
||||
tree. */
|
||||
/* NODESTACK now contains all parents of R. R is likely to be NULL
|
||||
in the first iteration. */
|
||||
/* NULL nodes are considered black throughout - this is necessary for
|
||||
correctness. */
|
||||
while (sp > 0 && (r == NULL || !r->red))
|
||||
{
|
||||
node *pp = nodestack[sp - 1];
|
||||
p = *pp;
|
||||
/* Two symmetric cases. */
|
||||
if (r == p->left)
|
||||
{
|
||||
/* Q is R's brother, P is R's parent. The subtree with root
|
||||
R has one black edge less than the subtree with root Q. */
|
||||
q = p->right;
|
||||
if (q != NULL && q->red)
|
||||
{
|
||||
/* If Q is red, we know that P is black. We rotate P left
|
||||
so that Q becomes the top node in the tree, with P below
|
||||
it. P is colored red, Q is colored black.
|
||||
This action does not change the black edge count for any
|
||||
leaf in the tree, but we will be able to recognize one
|
||||
of the following situations, which all require that Q
|
||||
is black. */
|
||||
q->red = 0;
|
||||
p->red = 1;
|
||||
/* Left rotate p. */
|
||||
p->right = q->left;
|
||||
q->left = p;
|
||||
*pp = q;
|
||||
/* Make sure pp is right if the case below tries to use
|
||||
it. */
|
||||
nodestack[sp++] = pp = &q->left;
|
||||
q = p->right;
|
||||
}
|
||||
/* We know that Q can't be NULL here. We also know that Q is
|
||||
black. */
|
||||
if ((q->left == NULL || !q->left->red)
|
||||
&& (q->right == NULL || !q->right->red))
|
||||
{
|
||||
/* Q has two black successors. We can simply color Q red.
|
||||
The whole subtree with root P is now missing one black
|
||||
edge. Note that this action can temporarily make the
|
||||
tree invalid (if P is red). But we will exit the loop
|
||||
in that case and set P black, which both makes the tree
|
||||
valid and also makes the black edge count come out
|
||||
right. If P is black, we are at least one step closer
|
||||
to the root and we'll try again the next iteration. */
|
||||
q->red = 1;
|
||||
r = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Q is black, one of Q's successors is red. We can
|
||||
repair the tree with one operation and will exit the
|
||||
loop afterwards. */
|
||||
if (q->right == NULL || !q->right->red)
|
||||
{
|
||||
/* The left one is red. We perform the same action as
|
||||
in maybe_split_for_insert where two red edges are
|
||||
adjacent but point in different directions:
|
||||
Q's left successor (let's call it Q2) becomes the
|
||||
top of the subtree we are looking at, its parent (Q)
|
||||
and grandparent (P) become its successors. The former
|
||||
successors of Q2 are placed below P and Q.
|
||||
P becomes black, and Q2 gets the color that P had.
|
||||
This changes the black edge count only for node R and
|
||||
its successors. */
|
||||
node q2 = q->left;
|
||||
q2->red = p->red;
|
||||
p->right = q2->left;
|
||||
q->left = q2->right;
|
||||
q2->right = q;
|
||||
q2->left = p;
|
||||
*pp = q2;
|
||||
p->red = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's the right one. Rotate P left. P becomes black,
|
||||
and Q gets the color that P had. Q's right successor
|
||||
also becomes black. This changes the black edge
|
||||
count only for node R and its successors. */
|
||||
q->red = p->red;
|
||||
p->red = 0;
|
||||
|
||||
q->right->red = 0;
|
||||
|
||||
/* left rotate p */
|
||||
p->right = q->left;
|
||||
q->left = p;
|
||||
*pp = q;
|
||||
}
|
||||
|
||||
/* We're done. */
|
||||
sp = 1;
|
||||
r = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Comments: see above. */
|
||||
q = p->left;
|
||||
if (q != NULL && q->red)
|
||||
{
|
||||
q->red = 0;
|
||||
p->red = 1;
|
||||
p->left = q->right;
|
||||
q->right = p;
|
||||
*pp = q;
|
||||
nodestack[sp++] = pp = &q->right;
|
||||
q = p->left;
|
||||
}
|
||||
if ((q->right == NULL || !q->right->red)
|
||||
&& (q->left == NULL || !q->left->red))
|
||||
{
|
||||
q->red = 1;
|
||||
r = p;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (q->left == NULL || !q->left->red)
|
||||
{
|
||||
node q2 = q->right;
|
||||
q2->red = p->red;
|
||||
p->left = q2->right;
|
||||
q->right = q2->left;
|
||||
q2->left = q;
|
||||
q2->right = p;
|
||||
*pp = q2;
|
||||
p->red = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
q->red = p->red;
|
||||
p->red = 0;
|
||||
q->left->red = 0;
|
||||
p->left = q->right;
|
||||
q->right = p;
|
||||
*pp = q;
|
||||
}
|
||||
sp = 1;
|
||||
r = NULL;
|
||||
}
|
||||
}
|
||||
--sp;
|
||||
}
|
||||
if (r != NULL)
|
||||
r->red = 0;
|
||||
}
|
||||
|
||||
free (unchained);
|
||||
return retval;
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tdelete, tdelete)
|
||||
#endif
|
||||
|
||||
|
||||
/* Walk the nodes of a tree.
|
||||
ROOT is the root of the tree to be walked, ACTION the function to be
|
||||
called at each node. LEVEL is the level of ROOT in the whole tree. */
|
||||
static void
|
||||
internal_function
|
||||
trecurse (const void *vroot, __action_fn_t action, int level)
|
||||
{
|
||||
const_node root = (const_node) vroot;
|
||||
|
||||
if (root->left == NULL && root->right == NULL)
|
||||
(*action) (root, leaf, level);
|
||||
else
|
||||
{
|
||||
(*action) (root, preorder, level);
|
||||
if (root->left != NULL)
|
||||
trecurse (root->left, action, level + 1);
|
||||
(*action) (root, postorder, level);
|
||||
if (root->right != NULL)
|
||||
trecurse (root->right, action, level + 1);
|
||||
(*action) (root, endorder, level);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Walk the nodes of a tree.
|
||||
ROOT is the root of the tree to be walked, ACTION the function to be
|
||||
called at each node. */
|
||||
void
|
||||
__twalk (const void *vroot, __action_fn_t action)
|
||||
{
|
||||
const_node root = (const_node) vroot;
|
||||
|
||||
CHECK_TREE (root);
|
||||
|
||||
if (root != NULL && action != NULL)
|
||||
trecurse (root, action, 0);
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__twalk, twalk)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* The standardized functions miss an important functionality: the
|
||||
tree cannot be removed easily. We provide a function to do this. */
|
||||
static void
|
||||
internal_function
|
||||
tdestroy_recurse (node root, void (*freefct)(void *))
|
||||
{
|
||||
if (root->left != NULL)
|
||||
tdestroy_recurse (root->left, freefct);
|
||||
if (root->right != NULL)
|
||||
tdestroy_recurse (root->right, freefct);
|
||||
(*freefct) ((void *) root->key);
|
||||
/* Free the node itself. */
|
||||
free (root);
|
||||
}
|
||||
|
||||
void
|
||||
__tdestroy (void *vroot, void (*freefct)(void *))
|
||||
{
|
||||
node root = (node) vroot;
|
||||
|
||||
CHECK_TREE (root);
|
||||
|
||||
if (root != NULL)
|
||||
tdestroy_recurse (root, freefct);
|
||||
}
|
||||
#ifdef weak_alias
|
||||
weak_alias (__tdestroy, tdestroy)
|
||||
#endif
|
||||
11
lib/u64.h
11
lib/u64.h
@@ -2,10 +2,10 @@
|
||||
|
||||
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 2, or (at your option) any
|
||||
later version.
|
||||
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
|
||||
@@ -13,8 +13,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, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user