mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2025-09-10 07:59:52 +02:00
Compare commits
503 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 | ||
|
|
93ff956de7 | ||
|
|
0c1e917d6c | ||
|
|
6d8e33952a | ||
|
|
9f2adbf0be | ||
|
|
8fb6d7a9b9 | ||
|
|
cee06314e1 | ||
|
|
ebc2235bd7 | ||
|
|
cece28a8bc | ||
|
|
94986c1d0a | ||
|
|
c12e44d891 |
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.7
|
||||
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$
|
||||
@@ -8,4 +8,4 @@ ChangeLog
|
||||
^lib/group-member\.c$
|
||||
^Makefile\.maint$
|
||||
^doc/coreutils.texi$
|
||||
^src/stty.c$
|
||||
^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$
|
||||
|
||||
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
|
||||
|
||||
|
||||
42
Makefile.am
42
Makefile.am
@@ -2,9 +2,9 @@
|
||||
|
||||
# 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,
|
||||
@@ -13,19 +13,17 @@
|
||||
# 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 \
|
||||
@@ -35,6 +33,7 @@ EXTRA_DIST = Makefile.cfg Makefile.maint GNUmakefile \
|
||||
bootstrap \
|
||||
bootstrap.conf \
|
||||
build-aux/cvsu \
|
||||
build-aux/git-version-gen \
|
||||
build-aux/vc-list-files \
|
||||
gl/modules/getloadavg.diff \
|
||||
m4/ChangeLog \
|
||||
@@ -56,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
|
||||
@@ -69,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; \
|
||||
|
||||
12
Makefile.cfg
12
Makefile.cfg
@@ -1,10 +1,10 @@
|
||||
# Customize Makefile.maint. -*- makefile -*-
|
||||
# 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,7 +25,7 @@ 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
|
||||
|
||||
137
Makefile.maint
137
Makefile.maint
@@ -2,12 +2,12 @@
|
||||
# This Makefile fragment is shared between the coreutils,
|
||||
# CPPI, Bison, and Autoconf.
|
||||
|
||||
## Copyright (C) 2001-2007 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))
|
||||
@@ -46,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.
|
||||
@@ -122,7 +126,14 @@ sc_space_tab:
|
||||
# Instead, use strto* functions.
|
||||
sc_prohibit_atoi_atof:
|
||||
@grep -nE '\<([fs]?scanf|ato([filq]|ll))\>' $$($(CVS_LIST_EXCEPT)) && \
|
||||
{ echo '$(ME): do not use *scan''f, ato''f, ato''i, ato''l, ato''ll, or ato''q' \
|
||||
{ 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,
|
||||
@@ -167,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)) && \
|
||||
@@ -324,21 +359,26 @@ 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 -p2 -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+set}" = set; then \
|
||||
diff -upr src src-c89 > new-diff || : ; fi
|
||||
if test "$$REGEN_PATCH" = yes; then \
|
||||
diff -upr src src-c89 | sed 's,src-c89/,src/,' \
|
||||
| grep -v '^Only in' > new-diff || : ; fi
|
||||
grep -v '^patching file ' $@.1 > $@.2 || :
|
||||
msg=ok; test -s $@.2 && msg='fuzzy patch' || : ; \
|
||||
rm -f src-c89/*.o || msg='rm failed'; \
|
||||
$(MAKE) -C src-c89 CFLAGS='-Wdeclaration-after-statement -Werror' \
|
||||
|| msg='compile failure with extra options'; \
|
||||
rm -rf src-c89 $@.1 $@.2; \
|
||||
test "$$msg" = ok && : || echo "$$msg" 1>&2; \
|
||||
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
|
||||
@@ -450,7 +490,9 @@ writable-files:
|
||||
|
||||
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) \
|
||||
@@ -464,21 +506,11 @@ copyright-check:
|
||||
|| { echo 'out of date copyright in $(sample-test); 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 $(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:
|
||||
@@ -491,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
|
||||
@@ -514,16 +544,28 @@ null_AM_MAKEFLAGS = \
|
||||
AUTOHEADER=false \
|
||||
MAKEINFO=false
|
||||
|
||||
built_programs = $$(cd src && MAKEFLAGS= $(MAKE) -s built_programs.list)
|
||||
|
||||
warn_cflags = -Dlint -O -Werror -Wall -Wformat -Wshadow -Wpointer-arith
|
||||
bin=bin-$$$$
|
||||
|
||||
write_loser = printf '\#!%s\necho $$0: bad path 1>&2; exit 1\n' '$(SHELL)'
|
||||
|
||||
# Use -Wformat -Werror to detect format-string/arg-list mismatches.
|
||||
# Also, check for shadowing problems with -Wshadow, and for pointer
|
||||
# arithmetic problems with -Wpointer-arith.
|
||||
# These CFLAGS are pretty strict. If you build this target, you probably
|
||||
# have to have a recent version of gcc and glibc headers.
|
||||
# The for-loop below ensures that there is a bin/ directory full of all
|
||||
# of the programs under test (except the few that are required for basic
|
||||
# Makefile rules), all symlinked to the just-built "false" program.
|
||||
# This is to ensure that if ever a test neglects to make PATH include
|
||||
# the build srcdir, these always-failing programs will run.
|
||||
# Otherwise, it is too easy to test the wrong programs.
|
||||
# Note that "false" itself is a symlink to true, so it too will malfunction.
|
||||
TMPDIR ?= /tmp
|
||||
t=$(TMPDIR)/$(PACKAGE)/test
|
||||
my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
||||
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
|
||||
@@ -532,7 +574,20 @@ my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
||||
&& $(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
|
||||
@@ -541,7 +596,7 @@ my-distcheck: $(local-check) $(release_archive_dir)/$(prev-tgz)
|
||||
cd $(t)/$(distdir) \
|
||||
&& (cd src && patch -V never --fuzz=0 <c99-to-c89.diff) \
|
||||
&& ./configure --disable-largefile \
|
||||
CFLAGS='-Werror -ansi -pedantic -Wno-long-long' \
|
||||
CFLAGS='-Werror -ansi -Wno-long-long' \
|
||||
&& $(MAKE); \
|
||||
fi
|
||||
-rm -rf $(t)
|
||||
@@ -562,10 +617,15 @@ 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)
|
||||
@@ -579,7 +639,7 @@ announcement: NEWS ChangeLog $(rel-files)
|
||||
--gpg-key-id=$(gpg_key_ID) \
|
||||
--news=NEWS \
|
||||
--bootstrap-tools=autoconf,automake,bison,gnulib \
|
||||
--gnulib-snapshot-time-stamp="$$utc_date" \
|
||||
--gnulib-version=$(gnulib-version) \
|
||||
$(addprefix --url-dir=, $(url_dir_list))
|
||||
|
||||
## ---------------- ##
|
||||
@@ -606,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) writable-files
|
||||
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)
|
||||
|
||||
247
NEWS
247
NEWS
@@ -1,5 +1,227 @@
|
||||
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
|
||||
@@ -13,7 +235,6 @@ GNU coreutils NEWS -*- outline -*-
|
||||
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
|
||||
@@ -51,11 +272,33 @@ GNU coreutils NEWS -*- outline -*-
|
||||
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
|
||||
@@ -87,7 +330,7 @@ GNU coreutils NEWS -*- outline -*-
|
||||
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 coreutils 6.0 through 6.6.
|
||||
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
|
||||
|
||||
48
README
48
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/>.
|
||||
|
||||
|
||||
***********************
|
||||
@@ -124,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
|
||||
|
||||
@@ -15,24 +15,40 @@ tools we depend upon, including:
|
||||
- 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/>
|
||||
- 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 `git-pull && make' should be sufficient.
|
||||
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
|
||||
|
||||
Obviously, if you are reading these notes, you did manage to check out
|
||||
this package from GIT. The next step is to get other files needed to
|
||||
build, which are extracted from other source packages:
|
||||
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
|
||||
|
||||
@@ -45,7 +61,7 @@ And there you are! Just
|
||||
At this point, there should be no difference between your local copy,
|
||||
and the GIT master copy:
|
||||
|
||||
$ git-diff
|
||||
$ git diff
|
||||
|
||||
should output no difference.
|
||||
|
||||
@@ -55,10 +71,10 @@ Enjoy!
|
||||
|
||||
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
|
||||
@@ -66,6 +82,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/>.
|
||||
|
||||
@@ -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 \
|
||||
|
||||
18
THANKS
18
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
|
||||
@@ -174,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
|
||||
@@ -186,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
|
||||
@@ -225,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
|
||||
@@ -236,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
|
||||
@@ -274,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
|
||||
@@ -347,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
|
||||
@@ -385,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
|
||||
@@ -396,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
|
||||
@@ -411,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
|
||||
@@ -439,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
|
||||
@@ -460,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
|
||||
|
||||
67
TODO
67
TODO
@@ -1,13 +1,35 @@
|
||||
stty.c:
|
||||
use xstrtoul, not sscanf
|
||||
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 form Eric Blake.
|
||||
Suggestion from Eric Blake.
|
||||
|
||||
strip: add an option to specify the program used to strip binaries.
|
||||
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:
|
||||
@@ -29,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.
|
||||
@@ -50,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
|
||||
@@ -64,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"
|
||||
@@ -110,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
|
||||
@@ -140,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.
|
||||
|
||||
@@ -161,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.
|
||||
|
||||
@@ -172,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
|
||||
@@ -194,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/>.
|
||||
|
||||
255
bootstrap
255
bootstrap
@@ -4,10 +4,10 @@
|
||||
|
||||
# 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,11 @@ 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'`
|
||||
@@ -49,10 +48,8 @@ Options:
|
||||
--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 username to use when checking out
|
||||
sources from 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.
|
||||
@@ -61,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
|
||||
}
|
||||
@@ -104,6 +108,9 @@ gnulib_extra_files="
|
||||
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=
|
||||
|
||||
@@ -124,9 +131,21 @@ 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.
|
||||
@@ -139,8 +158,6 @@ do
|
||||
exit;;
|
||||
--gnulib-srcdir=*)
|
||||
GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;;
|
||||
--cvs-user=*)
|
||||
CVS_USER=`expr "$option" : '--cvs-user=\(.*\)'`;;
|
||||
--skip-po)
|
||||
SKIP_PO=t;;
|
||||
--force)
|
||||
@@ -163,6 +180,7 @@ fi
|
||||
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
|
||||
@@ -176,15 +194,17 @@ 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.
|
||||
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 ig in .cvsignore .gitignore; do
|
||||
test -f $ig && insert_sorted_if_absent $ig $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
|
||||
|
||||
@@ -203,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
|
||||
@@ -232,71 +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
|
||||
|
||||
if test -d po; then
|
||||
get_translations po $package || exit
|
||||
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" || {
|
||||
@@ -341,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=' */';;
|
||||
@@ -350,6 +368,11 @@ 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" &&
|
||||
@@ -394,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
|
||||
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
|
||||
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
|
||||
@@ -429,14 +456,21 @@ 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
|
||||
if test -n "$copied"; then
|
||||
insert_sorted_if_absent $ig "$copied"
|
||||
# If an ignored file name ends with _.h, then also add
|
||||
# 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_.h -> stdint.h, dirent_.h ->..., etc.
|
||||
f=`echo "$copied"|sed 's/_\.h$/.h/'`
|
||||
# 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
|
||||
@@ -459,14 +493,15 @@ gnulib_tool_options="\
|
||||
--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
|
||||
|
||||
|
||||
@@ -484,6 +519,24 @@ if test $with_gettext = yes; then
|
||||
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.
|
||||
|
||||
@@ -505,13 +558,13 @@ 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
|
||||
|
||||
if test $with_gettext = yes; then
|
||||
@@ -547,4 +600,12 @@ if test $with_gettext = yes; then
|
||||
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'."
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
# 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,13 @@
|
||||
# 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 and fchdir dependencies.
|
||||
avoided_gnulib_modules='
|
||||
--avoid=lock
|
||||
--avoid=size_max
|
||||
--avoid=xsize
|
||||
--avoid=canonicalize-lgpl
|
||||
'
|
||||
|
||||
@@ -38,35 +34,62 @@ obsolete_gnulib_modules='
|
||||
gnulib_modules="
|
||||
$avoided_gnulib_modules
|
||||
$obsolete_gnulib_modules
|
||||
acl alloca announce-gen argmatch assert backupfile base64
|
||||
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
|
||||
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 fsusage ftruncate fts getdate getgroups gethrxtime
|
||||
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 mpsort 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 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 xreadlink-with-size xstrtod xstrtoimax
|
||||
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
|
||||
"
|
||||
|
||||
@@ -76,9 +99,16 @@ 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\\\
|
||||
'
|
||||
|
||||
# If "AM_GNU_GETTEXT(external" or "AM_GNU_GETTEXT([external]"
|
||||
@@ -102,11 +132,10 @@ if test $gettext_external = 1; then
|
||||
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
|
||||
'
|
||||
fi
|
||||
|
||||
gnulib_tool_option_extras="--tests-base=$bt/gnulib-tests --with-tests"
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
announce-gen
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
gnupload
|
||||
install-sh
|
||||
link-warning.h
|
||||
mdate-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
texinfo.tex
|
||||
ylwrap
|
||||
1
build-aux/.gitignore
vendored
1
build-aux/.gitignore
vendored
@@ -4,6 +4,7 @@ config.guess
|
||||
config.rpath
|
||||
config.sub
|
||||
depcomp
|
||||
git-version-gen
|
||||
gnupload
|
||||
install-sh
|
||||
link-warning.h
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
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
|
||||
|
||||
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;
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
# 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 2
|
||||
else
|
||||
hg manifest | cut -d ' ' -f 2 | 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
|
||||
|
||||
154
configure.ac
154
configure.ac
@@ -1,12 +1,12 @@
|
||||
# -*- autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
# Copyright (C) 1991, 1993-2007 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.61)
|
||||
AC_INIT([GNU coreutils],[6.9],[bug-coreutils@gnu.org])
|
||||
|
||||
# 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.10 dist-bzip2])
|
||||
AM_INIT_AUTOMAKE([1.10 dist-lzma])
|
||||
|
||||
AC_PROG_CC_STDC
|
||||
AM_PROG_CC_C_O
|
||||
@@ -41,15 +46,13 @@ 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
|
||||
|
||||
@@ -130,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
|
||||
@@ -172,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,
|
||||
@@ -218,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>
|
||||
@@ -244,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])
|
||||
|
||||
@@ -260,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
|
||||
|
||||
@@ -1,3 +1,42 @@
|
||||
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
|
||||
|
||||
@@ -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
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
@dircategory Individual utilities
|
||||
@direntry
|
||||
* arch: (coreutils)arch invocation. Print machine hardware name.
|
||||
* base64: (coreutils)base64 invocation. Base64 encode/decode data.
|
||||
* basename: (coreutils)basename invocation. Strip directory and suffix.
|
||||
* cat: (coreutils)cat invocation. Concatenate and write files.
|
||||
@@ -131,8 +132,7 @@
|
||||
This manual documents version @value{VERSION} of the @sc{gnu} core
|
||||
utilities, including the standard programs for text and file manipulation.
|
||||
|
||||
Copyright @copyright{} 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2004,
|
||||
2005, 2006 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1994-1996, 2000-2008 Free Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
@@ -197,8 +197,8 @@ Free Documentation License''.
|
||||
* File permissions:: Access modes.
|
||||
* Date input formats:: Specifying date strings.
|
||||
* Opening the software toolbox:: The software tools philosophy.
|
||||
* Copying This Manual:: License for copying this manual.
|
||||
* Index:: General index.
|
||||
* GNU Free Documentation License:: Copying and sharing this manual.
|
||||
* Concept index:: General index.
|
||||
|
||||
@detailmenu
|
||||
--- The Detailed Node Listing ---
|
||||
@@ -361,7 +361,7 @@ Conditions
|
||||
|
||||
Redirection
|
||||
|
||||
* tee invocation:: Redirect output to multiple files
|
||||
* tee invocation:: Redirect output to multiple files or processes
|
||||
|
||||
File name manipulation
|
||||
|
||||
@@ -397,6 +397,7 @@ User information
|
||||
|
||||
System context
|
||||
|
||||
* arch invocation:: Print machine hardware name
|
||||
* date invocation:: Print or set system date and time
|
||||
* uname invocation:: Print system information
|
||||
* hostname invocation:: Print or set system name
|
||||
@@ -410,6 +411,7 @@ System context
|
||||
* Padding and other flags:: Pad with zeros, spaces, etc.
|
||||
* Setting the time:: Changing the system clock.
|
||||
* Options for date:: Instead of the current time.
|
||||
* Date input formats:: Specifying date strings.
|
||||
* Examples of date:: Examples.
|
||||
|
||||
Modified command invocation
|
||||
@@ -465,7 +467,7 @@ Opening the software toolbox
|
||||
|
||||
Copying This Manual
|
||||
|
||||
* GNU Free Documentation License:: License for copying this manual.
|
||||
* GNU Free Documentation License:: Copying and sharing this manual.
|
||||
|
||||
@end detailmenu
|
||||
@end menu
|
||||
@@ -574,6 +576,7 @@ you prefer powers of 1024.
|
||||
@cindex human-readable output
|
||||
Append a size letter to each size, such as @samp{M} for mebibytes.
|
||||
Powers of 1024 are used, not 1000; @samp{M} stands for 1,048,576 bytes.
|
||||
This option is equivalent to @option{--block-size=human-readable}.
|
||||
Use the @option{--si} option if you prefer powers of 1000.
|
||||
@end macro
|
||||
|
||||
@@ -858,7 +861,7 @@ kilobyte: @math{10^3 = 1000}.
|
||||
@itemx K
|
||||
@itemx KiB
|
||||
@cindex kibibyte, definition of
|
||||
kibibyte: @math{2^10 = 1024}. @samp{K} is special: the SI prefix is
|
||||
kibibyte: @math{2^{10} = 1024}. @samp{K} is special: the SI prefix is
|
||||
@samp{k} and the IEC 60027-2 prefix is @samp{Ki}, but tradition and
|
||||
@acronym{POSIX} use @samp{k} to mean @samp{KiB}.
|
||||
@item MB
|
||||
@@ -867,48 +870,48 @@ megabyte: @math{10^6 = 1,000,000}.
|
||||
@item M
|
||||
@itemx MiB
|
||||
@cindex mebibyte, definition of
|
||||
mebibyte: @math{2^20 = 1,048,576}.
|
||||
mebibyte: @math{2^{20} = 1,048,576}.
|
||||
@item GB
|
||||
@cindex gigabyte, definition of
|
||||
gigabyte: @math{10^9 = 1,000,000,000}.
|
||||
@item G
|
||||
@itemx GiB
|
||||
@cindex gibibyte, definition of
|
||||
gibibyte: @math{2^30 = 1,073,741,824}.
|
||||
gibibyte: @math{2^{30} = 1,073,741,824}.
|
||||
@item TB
|
||||
@cindex terabyte, definition of
|
||||
terabyte: @math{10^12 = 1,000,000,000,000}.
|
||||
terabyte: @math{10^{12} = 1,000,000,000,000}.
|
||||
@item T
|
||||
@itemx TiB
|
||||
@cindex tebibyte, definition of
|
||||
tebibyte: @math{2^40 = 1,099,511,627,776}.
|
||||
tebibyte: @math{2^{40} = 1,099,511,627,776}.
|
||||
@item PB
|
||||
@cindex petabyte, definition of
|
||||
petabyte: @math{10^15 = 1,000,000,000,000,000}.
|
||||
petabyte: @math{10^{15} = 1,000,000,000,000,000}.
|
||||
@item P
|
||||
@itemx PiB
|
||||
@cindex pebibyte, definition of
|
||||
pebibyte: @math{2^50 = 1,125,899,906,842,624}.
|
||||
pebibyte: @math{2^{50} = 1,125,899,906,842,624}.
|
||||
@item EB
|
||||
@cindex exabyte, definition of
|
||||
exabyte: @math{10^18 = 1,000,000,000,000,000,000}.
|
||||
exabyte: @math{10^{18} = 1,000,000,000,000,000,000}.
|
||||
@item E
|
||||
@itemx EiB
|
||||
@cindex exbibyte, definition of
|
||||
exbibyte: @math{2^60 = 1,152,921,504,606,846,976}.
|
||||
exbibyte: @math{2^{60} = 1,152,921,504,606,846,976}.
|
||||
@item ZB
|
||||
@cindex zettabyte, definition of
|
||||
zettabyte: @math{10^21 = 1,000,000,000,000,000,000,000}
|
||||
zettabyte: @math{10^{21} = 1,000,000,000,000,000,000,000}
|
||||
@item Z
|
||||
@itemx ZiB
|
||||
@math{2^70 = 1,180,591,620,717,411,303,424}.
|
||||
@math{2^{70} = 1,180,591,620,717,411,303,424}.
|
||||
(@samp{Zi} is a @acronym{GNU} extension to IEC 60027-2.)
|
||||
@item YB
|
||||
@cindex yottabyte, definition of
|
||||
yottabyte: @math{10^24 = 1,000,000,000,000,000,000,000,000}.
|
||||
yottabyte: @math{10^{24} = 1,000,000,000,000,000,000,000,000}.
|
||||
@item Y
|
||||
@itemx YiB
|
||||
@math{2^80 = 1,208,925,819,614,629,174,706,176}.
|
||||
@math{2^{80} = 1,208,925,819,614,629,174,706,176}.
|
||||
(@samp{Yi} is a @acronym{GNU} extension to IEC 60027-2.)
|
||||
@end table
|
||||
|
||||
@@ -1308,7 +1311,7 @@ Equivalent to @option{-vET}.
|
||||
@itemx --number-nonblank
|
||||
@opindex -b
|
||||
@opindex --number-nonblank
|
||||
Number all nonblank output lines, starting with 1.
|
||||
Number all nonempty output lines, starting with 1.
|
||||
|
||||
@item -e
|
||||
@opindex -e
|
||||
@@ -1330,8 +1333,9 @@ Number all output lines, starting with 1.
|
||||
@itemx --squeeze-blank
|
||||
@opindex -s
|
||||
@opindex --squeeze-blank
|
||||
@cindex squeezing blank lines
|
||||
Replace multiple adjacent blank lines with a single blank line.
|
||||
@cindex squeezing empty lines
|
||||
Suppress repeated adjacent empty lines; output just one empty line
|
||||
instead of several.
|
||||
|
||||
@item -t
|
||||
@opindex -t
|
||||
@@ -1661,8 +1665,11 @@ The default is octal.
|
||||
Skip @var{bytes} input bytes before formatting and writing. If
|
||||
@var{bytes} begins with @samp{0x} or @samp{0X}, it is interpreted in
|
||||
hexadecimal; otherwise, if it begins with @samp{0}, in octal; otherwise,
|
||||
in decimal. Appending @samp{b} multiplies @var{bytes} by 512, @samp{k}
|
||||
by 1024, and @samp{m} by 1048576.
|
||||
in decimal. Appending @samp{b} multiplies @var{bytes} by 512,
|
||||
@samp{kB} by 1000, @samp{K} by 1024,
|
||||
@samp{MB} by 1000*1000, @samp{M} by 1024*1024,
|
||||
@samp{GB} by 1000*1000*1000, @samp{GB} by 1024*1024*1024,
|
||||
and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
|
||||
|
||||
@item -N @var{bytes}
|
||||
@itemx --read-bytes=@var{bytes}
|
||||
@@ -1671,14 +1678,16 @@ by 1024, and @samp{m} by 1048576.
|
||||
Output at most @var{bytes} bytes of the input. Prefixes and suffixes on
|
||||
@code{bytes} are interpreted as for the @option{-j} option.
|
||||
|
||||
@item -S @var{n}
|
||||
@itemx --strings[=@var{n}]
|
||||
@item -S @var{bytes}
|
||||
@itemx --strings[=@var{bytes}]
|
||||
@opindex -S
|
||||
@opindex --strings
|
||||
@cindex string constants, outputting
|
||||
Instead of the normal output, output only @dfn{string constants}: at
|
||||
least @var{n} consecutive @acronym{ASCII} graphic characters,
|
||||
least @var{bytes} consecutive @acronym{ASCII} graphic characters,
|
||||
followed by a null (zero) byte.
|
||||
Prefixes and suffixes on @code{bytes} are interpreted as for the
|
||||
@option{-j} option.
|
||||
|
||||
If @var{n} is omitted with @option{--strings}, the default is 3.
|
||||
|
||||
@@ -2034,11 +2043,9 @@ pr [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
By default, a 5-line header is printed at each page: two blank lines;
|
||||
a line with the date, the file name, and the page count; and two more
|
||||
blank lines. A footer of five blank lines is also printed.
|
||||
With the @option{-F}
|
||||
option, a 3-line header is printed: the leading two blank lines are
|
||||
omitted; no footer is used. The default @var{page_length} in both cases is 66
|
||||
lines. The default number of text lines changes from 56 (without @option{-F})
|
||||
to 63 (with @option{-F}). The text line of the header takes the form
|
||||
The default @var{page_length} is 66
|
||||
lines. The default number of text lines is therefore 56.
|
||||
The text line of the header takes the form
|
||||
@samp{@var{date} @var{string} @var{page}}, with spaces inserted around
|
||||
@var{string} so that the line takes up the full @var{page_width}. Here,
|
||||
@var{date} is the date (see the @option{-D} or @option{--date-format}
|
||||
@@ -2192,9 +2199,8 @@ is 8).
|
||||
@opindex -F
|
||||
@opindex -f
|
||||
@opindex --form-feed
|
||||
Use a form feed instead of newlines to separate output pages. The default
|
||||
page length of 66 lines is not altered. But the number of lines of text
|
||||
per page changes from default 56 to 63 lines.
|
||||
Use a form feed instead of newlines to separate output pages. This does
|
||||
not alter the default page length of 66 lines.
|
||||
|
||||
@item -h @var{HEADER}
|
||||
@itemx --header=@var{HEADER}
|
||||
@@ -2234,9 +2240,8 @@ to disentangle the old (@acronym{POSIX}-compliant) options @option{-w} and
|
||||
@opindex --length
|
||||
Set the page length to @var{page_length} (default 66) lines, including
|
||||
the lines of the header [and the footer]. If @var{page_length} is less
|
||||
than or equal to 10 (or <= 3 with @option{-F}), the header and footer are
|
||||
omitted, and all form feeds set in input files are eliminated, as if
|
||||
the @option{-T} option had been given.
|
||||
than or equal to 10, the header and footer are omitted, as if the
|
||||
@option{-t} option had been given.
|
||||
|
||||
@item -m
|
||||
@itemx --merge
|
||||
@@ -2490,11 +2495,14 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@itemx --bytes=@var{n}
|
||||
@opindex -c
|
||||
@opindex --bytes
|
||||
Print the first @var{n} bytes, instead of initial lines. Appending
|
||||
@samp{b} multiplies @var{n} by 512, @samp{k} by 1024, and @samp{m}
|
||||
by 1048576.
|
||||
Print the first @var{n} bytes, instead of initial lines.
|
||||
However, if @var{n} starts with a @samp{-},
|
||||
print all but the last @var{n} bytes of each file.
|
||||
Appending @samp{b} multiplies @var{n} by 512,
|
||||
@samp{kB} by 1000, @samp{K} by 1024,
|
||||
@samp{MB} by 1000*1000, @samp{M} by 1024*1024,
|
||||
@samp{GB} by 1000*1000*1000, @samp{GB} by 1024*1024*1024,
|
||||
and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
|
||||
|
||||
@itemx -n @var{n}
|
||||
@itemx --lines=@var{n}
|
||||
@@ -2503,6 +2511,7 @@ print all but the last @var{n} bytes of each file.
|
||||
Output the first @var{n} lines.
|
||||
However, if @var{n} starts with a @samp{-},
|
||||
print all but the last @var{n} lines of each file.
|
||||
Size multiplier suffixes are the same as with the @option{-c} option.
|
||||
|
||||
@item -q
|
||||
@itemx --quiet
|
||||
@@ -2567,10 +2576,6 @@ only reverse files that are at most as large as its buffer, which is
|
||||
typically 32 KiB@. A more reliable and versatile way to reverse files is
|
||||
the @sc{gnu} @command{tac} command.
|
||||
|
||||
If any option-argument is a number @var{n} starting with a @samp{+},
|
||||
@command{tail} begins printing with the @var{n}th item from the start of
|
||||
each file, instead of from the end.
|
||||
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
@@ -2579,9 +2584,14 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@itemx --bytes=@var{bytes}
|
||||
@opindex -c
|
||||
@opindex --bytes
|
||||
Output the last @var{bytes} bytes, instead of final lines. Appending
|
||||
@samp{b} multiplies @var{bytes} by 512, @samp{k} by 1024, and @samp{m}
|
||||
by 1048576.
|
||||
Output the last @var{bytes} bytes, instead of final lines.
|
||||
However, if @var{n} starts with a @samp{+}, start printing with the
|
||||
@var{n}th byte from the start of each file, instead of from the end.
|
||||
Appending @samp{b} multiplies @var{bytes} by 512,
|
||||
@samp{kB} by 1000, @samp{K} by 1024,
|
||||
@samp{MB} by 1000*1000, @samp{M} by 1024*1024,
|
||||
@samp{GB} by 1000*1000*1000, @samp{GB} by 1024*1024*1024,
|
||||
and so on for @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
|
||||
|
||||
@item -f
|
||||
@itemx --follow[=@var{how}]
|
||||
@@ -2691,6 +2701,9 @@ This option is meaningful only when following by name.
|
||||
@opindex -n
|
||||
@opindex --lines
|
||||
Output the last @var{n} lines.
|
||||
However, if @var{n} starts with a @samp{+}, start printing with the
|
||||
@var{n}th line from the start of each file, instead of from the end.
|
||||
Size multiplier suffixes are the same as with the @option{-c} option.
|
||||
|
||||
@item -q
|
||||
@itemx --quiet
|
||||
@@ -2776,12 +2789,6 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
|
||||
@item -a @var{length}
|
||||
@itemx --suffix-length=@var{length}
|
||||
@opindex -a
|
||||
@opindex --suffix-length
|
||||
Use suffixes of length @var{length}. The default @var{length} is 2.
|
||||
|
||||
@item -l @var{lines}
|
||||
@itemx --lines=@var{lines}
|
||||
@opindex -l
|
||||
@@ -2792,24 +2799,36 @@ For compatibility @command{split} also supports an obsolete
|
||||
option syntax @option{-@var{lines}}. New scripts should use @option{-l
|
||||
@var{lines}} instead.
|
||||
|
||||
@item -b @var{bytes}
|
||||
@itemx --bytes=@var{bytes}
|
||||
@item -b @var{size}
|
||||
@itemx --bytes=@var{size}
|
||||
@opindex -b
|
||||
@opindex --bytes
|
||||
Put the first @var{bytes} bytes of @var{input} into each output file.
|
||||
Appending @samp{b} multiplies @var{bytes} by 512, @samp{k} by 1024, and
|
||||
@samp{m} by 1048576.
|
||||
Put @var{size} bytes of @var{input} into each output file.
|
||||
@var{size} is a number which may be followed by one of these
|
||||
multiplicative suffixes:
|
||||
@example
|
||||
@samp{b} => 512 ("blocks")
|
||||
@samp{KB} => 1000 (KiloBytes)
|
||||
@samp{K} => 1024 (KibiBytes)
|
||||
@samp{MB} => 1000*1000 (MegaBytes)
|
||||
@samp{M} => 1024*1024 (MebiBytes)
|
||||
@end example
|
||||
and so on for @samp{G}, @samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.
|
||||
|
||||
@item -C @var{bytes}
|
||||
@itemx --line-bytes=@var{bytes}
|
||||
@item -C @var{size}
|
||||
@itemx --line-bytes=@var{size}
|
||||
@opindex -C
|
||||
@opindex --line-bytes
|
||||
Put into each output file as many complete lines of @var{input} as
|
||||
possible without exceeding @var{bytes} bytes. For lines longer than
|
||||
@var{bytes} bytes, put @var{bytes} bytes into each output file until
|
||||
less than @var{bytes} bytes of the line are left, then continue
|
||||
normally. @var{bytes} has the same format as for the @option{--bytes}
|
||||
option.
|
||||
possible without exceeding @var{size} bytes. Individual lines longer than
|
||||
@var{size} bytes are broken into multiple files.
|
||||
@var{size} has the same format as for the @option{--bytes} option.
|
||||
|
||||
@item -a @var{length}
|
||||
@itemx --suffix-length=@var{length}
|
||||
@opindex -a
|
||||
@opindex --suffix-length
|
||||
Use suffixes of length @var{length}. The default @var{length} is 2.
|
||||
|
||||
@item -d
|
||||
@itemx --numeric-suffixes
|
||||
@@ -4213,11 +4232,15 @@ This is equivalent to @option{--all-repeated} (@option{-D}).
|
||||
|
||||
@item prepend
|
||||
Output a newline before each group of repeated lines.
|
||||
With @option{--zero-terminated} (@option{-z}), use
|
||||
an @acronym{ASCII} @sc{nul} (zero) byte instead of a newline.
|
||||
|
||||
@item separate
|
||||
Separate groups of repeated lines with a single newline.
|
||||
With @option{--zero-terminated} (@option{-z}), use
|
||||
an @acronym{ASCII} @sc{nul} (zero) byte instead of a newline.
|
||||
This is the same as using @samp{prepend}, except that
|
||||
there is no newline before the first group, and hence
|
||||
no delimiter is inserted before the first group, and hence
|
||||
may be better suited for output direct to users.
|
||||
@end table
|
||||
|
||||
@@ -4245,6 +4268,19 @@ Compare at most @var{n} characters on each line (after skipping any specified
|
||||
fields and characters). By default the entire rest of the lines are
|
||||
compared.
|
||||
|
||||
@item -z
|
||||
@itemx --zero-terminated
|
||||
@opindex -z
|
||||
@opindex --zero-terminated
|
||||
@cindex sort zero-terminated lines
|
||||
Treat the input as a set of lines, each terminated by a null character
|
||||
(@acronym{ASCII} @sc{nul}) instead of a line feed
|
||||
(@acronym{ASCII} @sc{lf}).
|
||||
This option can be useful in conjunction with @samp{sort -z}, @samp{perl -0} or
|
||||
@samp{find -print0} and @samp{xargs -0} which do the same in order to
|
||||
reliably handle arbitrary file names (even those containing blanks
|
||||
or other special characters).
|
||||
|
||||
@end table
|
||||
|
||||
@exitstatus
|
||||
@@ -4921,7 +4957,7 @@ input file, or standard input if no files are given or for a file name of
|
||||
@samp{-}. Synopsis:
|
||||
|
||||
@example
|
||||
cut [@var{option}]@dots{} [@var{file}]@dots{}
|
||||
cut @var{option}@dots{} [@var{file}]@dots{}
|
||||
@end example
|
||||
|
||||
In the table which follows, the @var{byte-list}, @var{character-list},
|
||||
@@ -6876,13 +6912,27 @@ By default, @command{cp} does not copy directories. However, the
|
||||
copy recursively by descending into source directories and copying files
|
||||
to corresponding destination directories.
|
||||
|
||||
By default, @command{cp} follows symbolic links only when not copying
|
||||
When copying from a symbolic link, @command{cp} normally follows the
|
||||
link only when not copying
|
||||
recursively. This default can be overridden with the
|
||||
@option{--archive} (@option{-a}), @option{-d}, @option{--dereference}
|
||||
(@option{-L}), @option{--no-dereference} (@option{-P}), and
|
||||
@option{-H} options. If more than one of these options is specified,
|
||||
the last one silently overrides the others.
|
||||
|
||||
When copying to a symbolic link, @command{cp} follows the
|
||||
link only when it refers to an existing regular file.
|
||||
However, when copying to a dangling symbolic link, @command{cp}
|
||||
refuses by default, and fails with a diagnostic, since the operation
|
||||
is inherently dangerous. This behavior is contrary to historical
|
||||
practice and to @acronym{POSIX}.
|
||||
Set @env{POSIXLY_CORRECT} to make @command{cp} attempt to create
|
||||
the target of a dangling destination symlink, in spite of the possible risk.
|
||||
Also, when an option like
|
||||
@option{--backup} or @option{--link} acts to rename or remove the
|
||||
destination before copying, @command{cp} renames or removes the
|
||||
symbolic link rather than the file it points to.
|
||||
|
||||
By default, @command{cp} copies the contents of special files only
|
||||
when not copying recursively. This default can be overridden with the
|
||||
@option{--copy-contents} option.
|
||||
@@ -6907,7 +6957,7 @@ Preserve as much as possible of the structure and attributes of the
|
||||
original files in the copy (but do not attempt to preserve internal
|
||||
directory structure; i.e., @samp{ls -U} may list the entries in a copied
|
||||
directory in a different order).
|
||||
Equivalent to @option{-dpPR}.
|
||||
Equivalent to @option{-dpR}.
|
||||
|
||||
@item -b
|
||||
@itemx @w{@kbd{--backup}[=@var{method}]}
|
||||
@@ -6962,10 +7012,10 @@ Equivalent to @option{--no-dereference --preserve=links}.
|
||||
@opindex --force
|
||||
When copying without this option and an existing destination file cannot
|
||||
be opened for writing, the copy fails. However, with @option{--force}),
|
||||
when a destination file cannot be opened, @command{cp} then unlinks it and
|
||||
when a destination file cannot be opened, @command{cp} then removes it and
|
||||
tries to open it again. Contrast this behavior with that enabled by
|
||||
@option{--link} and @option{--symbolic-link}, whereby the destination file
|
||||
is never opened but rather is unlinked unconditionally. Also see the
|
||||
is never opened but rather is removed unconditionally. Also see the
|
||||
description of @option{--remove-destination}.
|
||||
|
||||
This option is independent of the @option{--interactive} or
|
||||
@@ -6995,7 +7045,7 @@ Make hard links instead of copies of non-directories.
|
||||
@itemx --dereference
|
||||
@opindex -L
|
||||
@opindex --dereference
|
||||
Always follow symbolic links.
|
||||
Follow symbolic links when copying from them.
|
||||
|
||||
@item -P
|
||||
@itemx --no-dereference
|
||||
@@ -7003,7 +7053,8 @@ Always follow symbolic links.
|
||||
@opindex --no-dereference
|
||||
@cindex symbolic links, copying
|
||||
Copy symbolic links as symbolic links rather than copying the files that
|
||||
they point to.
|
||||
they point to. This option affects only symbolic links in the source;
|
||||
symbolic links in the destination are always followed if possible.
|
||||
|
||||
@item -p
|
||||
@itemx @w{@kbd{--preserve}[=@var{attribute_list}]}
|
||||
@@ -7028,7 +7079,7 @@ Preserve the times of last access and last modification, when possible.
|
||||
In general, it is not possible to preserve these attributes
|
||||
when the affected file is a symbolic link.
|
||||
However, FreeBSD now provides the @code{lutimes} function, which makes
|
||||
it possibile even for symbolic links. However, this implementation does
|
||||
it possible even for symbolic links. However, this implementation does
|
||||
not yet take advantage of that.
|
||||
@c FIXME: once we provide lutimes support, update the above.
|
||||
@itemx links
|
||||
@@ -7093,8 +7144,8 @@ about each existing destination file.
|
||||
@cindex copying directories recursively
|
||||
@cindex recursively copying directories
|
||||
@cindex non-directories, copying as special files
|
||||
Copy directories recursively. Symbolic links are not followed by
|
||||
default; see the @option{--archive} (@option{-a}), @option{-d},
|
||||
Copy directories recursively. By default, do not follow symbolic
|
||||
links in the source; see the @option{--archive} (@option{-a}), @option{-d},
|
||||
@option{--dereference} (@option{-L}), @option{--no-dereference}
|
||||
(@option{-P}), and @option{-H} options. Special files are copied by
|
||||
creating a destination file of the same type as the source; see the
|
||||
@@ -7582,6 +7633,13 @@ The program accepts the following options. Also see @ref{Common options}.
|
||||
@opindex -c
|
||||
Ignored; for compatibility with old Unix versions of @command{install}.
|
||||
|
||||
@item -D
|
||||
@opindex -D
|
||||
Create any missing parent directories of @var{dest},
|
||||
then copy @var{source} to @var{dest}.
|
||||
This option is ignored if a destination directory is specified
|
||||
via @option{--target-directory=DIR}.
|
||||
|
||||
@item -d
|
||||
@itemx --directory
|
||||
@opindex -d
|
||||
@@ -8686,7 +8744,7 @@ rmdir [@var{option}]@dots{} @var{directory}@dots{}
|
||||
If any @var{directory} argument does not refer to an existing empty
|
||||
directory, it is an error.
|
||||
|
||||
The program accepts the following option. Also see @ref{Common options}.
|
||||
The program accepts the following options. Also see @ref{Common options}.
|
||||
|
||||
@table @samp
|
||||
|
||||
@@ -9229,10 +9287,11 @@ touch [@var{option}]@dots{} @var{file}@dots{}
|
||||
@end example
|
||||
|
||||
@cindex empty files, creating
|
||||
Any @var{file} that does not exist is created empty.
|
||||
Any @var{file} argument that does not exist is created empty.
|
||||
|
||||
A @var{file} of @samp{-} causes @command{touch} to change the
|
||||
times of the file associated with standard output.
|
||||
A @var{file} argument string of @samp{-} is handled specially and
|
||||
causes @command{touch} to change the times of the file associated with
|
||||
standard output.
|
||||
|
||||
@cindex permissions, for changing file timestamps
|
||||
If changing both the access and modification times to the current
|
||||
@@ -9733,13 +9792,7 @@ Output a null byte at the end of each line, rather than a newline.
|
||||
This option enables other programs to parse the output of @command{du}
|
||||
even when that output would contain file names with embedded newlines.
|
||||
|
||||
@itemx --si
|
||||
@opindex --si
|
||||
@cindex SI output
|
||||
Append an SI-style abbreviation to each size, such as @samp{MB} for
|
||||
megabytes. Powers of 1000 are used, not 1024; @samp{MB} stands for
|
||||
1,000,000 bytes. Use the @option{-h} or @option{--human-readable} option if
|
||||
you prefer powers of 1024.
|
||||
@optSi
|
||||
|
||||
@item -s
|
||||
@itemx --summarize
|
||||
@@ -10634,9 +10687,9 @@ True if the strings are not equal.
|
||||
@cindex numeric tests
|
||||
@cindex arithmetic tests
|
||||
|
||||
Numeric relationals. The arguments must be entirely numeric (possibly
|
||||
negative), or the special expression @w{@code{-l @var{string}}}, which
|
||||
evaluates to the length of @var{string}.
|
||||
Numeric relational operators. The arguments must be entirely numeric
|
||||
(possibly negative), or the special expression @w{@code{-l @var{string}}},
|
||||
which evaluates to the length of @var{string}.
|
||||
|
||||
@table @samp
|
||||
|
||||
@@ -10767,7 +10820,7 @@ Exit status:
|
||||
@cindex expressions, string
|
||||
|
||||
@command{expr} supports pattern matching and other string operators. These
|
||||
have lower precedence than both the numeric and relational operators (in
|
||||
have higher precedence than both the numeric and relational operators (in
|
||||
the next sections).
|
||||
|
||||
@table @samp
|
||||
@@ -10847,8 +10900,9 @@ To make @command{expr} interpret keywords as strings, you must use the
|
||||
@cindex expressions, numeric
|
||||
|
||||
@command{expr} supports the usual numeric operators, in order of increasing
|
||||
precedence. The string operators (previous section) have lower precedence,
|
||||
the connectives (next section) have higher.
|
||||
precedence. These numeric operators have lower precedence than the
|
||||
string operators described in the previous section, and higher precedence
|
||||
than the connectives (next section).
|
||||
|
||||
@table @samp
|
||||
|
||||
@@ -10881,7 +10935,7 @@ integers; an error occurs if this cannot be done.
|
||||
@cindex relations, numeric or string
|
||||
|
||||
@command{expr} supports the usual logical connectives and relations. These
|
||||
are higher precedence than either the string or numeric operators
|
||||
have lower precedence than the string and numeric operators
|
||||
(previous sections). Here is the list, lowest-precedence operator first.
|
||||
|
||||
@table @samp
|
||||
@@ -10971,12 +11025,12 @@ useful redirection is performed by a separate command, not by the shell;
|
||||
it's described here.
|
||||
|
||||
@menu
|
||||
* tee invocation:: Redirect output to multiple files.
|
||||
* tee invocation:: Redirect output to multiple files or processes.
|
||||
@end menu
|
||||
|
||||
|
||||
@node tee invocation
|
||||
@section @command{tee}: Redirect output to multiple files
|
||||
@section @command{tee}: Redirect output to multiple files or processes
|
||||
|
||||
@pindex tee
|
||||
@cindex pipe fitting
|
||||
@@ -11017,6 +11071,112 @@ Ignore interrupt signals.
|
||||
|
||||
@end table
|
||||
|
||||
The @command{tee} command is useful when you happen to be transferring a large
|
||||
amount of data and also want to summarize that data without reading
|
||||
it a second time. For example, when you are downloading a DVD image,
|
||||
you often want to verify its signature or checksum right away.
|
||||
The inefficient way to do it is simply:
|
||||
|
||||
@example
|
||||
wget http://example.com/some.iso && sha1sum some.iso
|
||||
@end example
|
||||
|
||||
One problem with the above is that it makes you wait for the
|
||||
download to complete before starting the time-consuming SHA1 computation.
|
||||
Perhaps even more importantly, the above requires reading
|
||||
the DVD image a second time (the first was from the network).
|
||||
|
||||
The efficient way to do it is to interleave the download
|
||||
and SHA1 computation. Then, you'll get the checksum for
|
||||
free, because the entire process parallelizes so well:
|
||||
|
||||
@example
|
||||
# slightly contrived, to demonstrate process substitution
|
||||
wget -O - http://example.com/dvd.iso \
|
||||
| tee >(sha1sum > dvd.sha1) > dvd.iso
|
||||
@end example
|
||||
|
||||
That makes @command{tee} write not just to the expected output file,
|
||||
but also to a pipe running @command{sha1sum} and saving the final
|
||||
checksum in a file named @file{dvd.sha1}.
|
||||
|
||||
Note, however, that this example relies on a feature of modern shells
|
||||
called @dfn{process substitution}
|
||||
(the @samp{>(command)} syntax, above;
|
||||
@xref{Process Substitution,,Process Substitution, bashref,
|
||||
The Bash Reference Manual}.),
|
||||
so it works with @command{zsh}, @command{bash}, and @command{ksh},
|
||||
but not with @command{/bin/sh}. So if you write code like this
|
||||
in a shell script, be sure to start the script with @samp{#!/bin/bash}.
|
||||
|
||||
Since the above example writes to one file and one process,
|
||||
a more conventional and portable use of @command{tee} is even better:
|
||||
|
||||
@example
|
||||
wget -O - http://example.com/dvd.iso \
|
||||
| tee dvd.iso | sha1sum > dvd.sha1
|
||||
@end example
|
||||
|
||||
You can extend this example to make @command{tee} write to two processes,
|
||||
computing MD5 and SHA1 checksums in parallel. In this case,
|
||||
process substitution is required:
|
||||
|
||||
@example
|
||||
wget -O - http://example.com/dvd.iso \
|
||||
| tee >(sha1sum > dvd.sha1) \
|
||||
>(md5sum > dvd.md5) \
|
||||
> dvd.iso
|
||||
@end example
|
||||
|
||||
This technique is also useful when you want to make a @emph{compressed}
|
||||
copy of the contents of a pipe.
|
||||
Consider a tool to graphically summarize disk usage data from @samp{du -ak}.
|
||||
For a large hierarchy, @samp{du -ak} can run for a long time,
|
||||
and can easily produce terabytes of data, so you won't want to
|
||||
rerun the command unnecessarily. Nor will you want to save
|
||||
the uncompressed output.
|
||||
|
||||
Doing it the inefficient way, you can't even start the GUI
|
||||
until after you've compressed all of the @command{du} output:
|
||||
|
||||
@example
|
||||
du -ak | gzip -9 > /tmp/du.gz
|
||||
gzip -d /tmp/du.gz | xdiskusage -a
|
||||
@end example
|
||||
|
||||
With @command{tee} and process substitution, you start the GUI
|
||||
right away and eliminate the decompression completely:
|
||||
|
||||
@example
|
||||
du -ak | tee >(gzip -9 > /tmp/du.gz) | xdiskusage -a
|
||||
@end example
|
||||
|
||||
Finally, if you regularly create more than one type of
|
||||
compressed tarball at once, for example when @code{make dist} creates
|
||||
both @command{gzip}-compressed and @command{bzip2}-compressed tarballs,
|
||||
there may be a better way.
|
||||
Typical @command{automake}-generated @file{Makefile} rules create
|
||||
the two compressed tar archives with commands in sequence, like this
|
||||
(slightly simplified):
|
||||
|
||||
@example
|
||||
tardir=your-pkg-M.N
|
||||
tar chof - "$tardir" | gzip -9 -c > your-pkg-M.N.tar.gz
|
||||
tar chof - "$tardir" | bzip2 -9 -c > your-pkg-M.N.tar.bz2
|
||||
@end example
|
||||
|
||||
However, if the hierarchy you are archiving and compressing is larger
|
||||
than a couple megabytes, and especially if you are using a multi-processor
|
||||
system with plenty of memory, then you can do much better by reading the
|
||||
directory contents only once and running the compression programs in parallel:
|
||||
|
||||
@example
|
||||
tardir=your-pkg-M.N
|
||||
tar chof - "$tardir" \
|
||||
| tee >(gzip -9 -c > your-pkg-M.N.tar.gz) \
|
||||
| bzip2 -9 -c > your-pkg-M.N.tar.bz2
|
||||
@end example
|
||||
|
||||
@exitstatus
|
||||
|
||||
|
||||
@@ -12302,6 +12462,7 @@ This section describes commands that print or change system-wide
|
||||
information.
|
||||
|
||||
@menu
|
||||
* arch invocation:: Print machine hardware name.
|
||||
* date invocation:: Print or set system date and time.
|
||||
* uname invocation:: Print system information.
|
||||
* hostname invocation:: Print or set system name.
|
||||
@@ -12356,6 +12517,9 @@ described below.
|
||||
* Padding and other flags:: Pad with zeros, spaces, etc.
|
||||
* Setting the time:: Changing the system clock.
|
||||
* Options for date:: Instead of the current time.
|
||||
@detailmenu
|
||||
* Date input formats:: Specifying date strings.
|
||||
@end detailmenu
|
||||
* Examples of date:: Examples.
|
||||
@end menu
|
||||
|
||||
@@ -12686,7 +12850,7 @@ format. It can contain month names, time zones, @samp{am} and @samp{pm},
|
||||
@samp{yesterday}, etc. For example, @option{--date="2004-02-27
|
||||
14:19:13.489392193 +0530"} specifies the instant of time that is
|
||||
489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a
|
||||
time zone that is 5 hours and 30 minutes east of @acronym{UTC}.
|
||||
time zone that is 5 hours and 30 minutes east of @acronym{UTC}.@*
|
||||
@xref{Date input formats}.
|
||||
|
||||
@item -f @var{datefile}
|
||||
@@ -12934,6 +13098,26 @@ date -u -d '1970-01-01 946684800 seconds' +"%Y-%m-%d %T %z"
|
||||
@end itemize
|
||||
|
||||
|
||||
@node arch invocation
|
||||
@section @command{arch}: Print machine hardware name
|
||||
|
||||
@pindex arch
|
||||
@cindex print machine hardware name
|
||||
@cindex system information, printing
|
||||
|
||||
@command{arch} prints the machine hardware name,
|
||||
and is equivalent to @samp{uname -m}.
|
||||
Synopsis:
|
||||
|
||||
@example
|
||||
arch [@var{option}]
|
||||
@end example
|
||||
|
||||
The program accepts the @ref{Common options} only.
|
||||
|
||||
@exitstatus
|
||||
|
||||
|
||||
@node uname invocation
|
||||
@section @command{uname}: Print system information
|
||||
|
||||
@@ -13140,7 +13324,11 @@ user, etc.
|
||||
@cindex root directory, running a program in a specified
|
||||
|
||||
@command{chroot} runs a command with a specified root directory.
|
||||
On many systems, only the super-user can do this.
|
||||
On many systems, only the super-user can do this.@footnote{However,
|
||||
some systems (e.g., FreeBSD) can be configured to allow certain regular
|
||||
users to use the @code{chroot} system call, and hence to run this program.
|
||||
Also, on Cygwin, anyone can run the @command{chroot} command, because the
|
||||
underlying function is non-privileged due to lack of support in MS-Windows.}
|
||||
Synopses:
|
||||
|
||||
@example
|
||||
@@ -13441,6 +13629,14 @@ However, if standard output is closed, standard error terminal output
|
||||
is instead appended to the file @file{nohup.out} or
|
||||
@file{$HOME/nohup.out} as above.
|
||||
|
||||
To capture the command's output to a file other than @file{nohup.out}
|
||||
you can redirect it. For example, to capture the output of
|
||||
@command{make}:
|
||||
|
||||
@example
|
||||
nohup make > make.log
|
||||
@end example
|
||||
|
||||
@command{nohup} does not automatically put the command it runs in the
|
||||
background; you must do that explicitly, by ending the command line
|
||||
with an @samp{&}. Also, @command{nohup} does not alter the
|
||||
@@ -13994,9 +14190,9 @@ To generate octal output, use the printf @code{%o} format instead
|
||||
of @code{%x}.
|
||||
|
||||
On most systems, seq can produce whole-number output for values up to
|
||||
at least @code{2^53}. Larger integers are approximated. The details
|
||||
at least @math{2^{53}}. Larger integers are approximated. The details
|
||||
differ depending on your floating-point implementation, but a common
|
||||
case is that @command{seq} works with integers through @code{2^64},
|
||||
case is that @command{seq} works with integers through @math{2^{64}},
|
||||
and larger integers may not be numerically correct:
|
||||
|
||||
@example
|
||||
@@ -14006,34 +14202,16 @@ $ seq 18446744073709551616 1 18446744073709551618
|
||||
18446744073709551618
|
||||
@end example
|
||||
|
||||
Be careful when using @command{seq} with a fractional @var{increment};
|
||||
otherwise you may see surprising results. Most people would expect to
|
||||
see @code{0.000003} printed as the last number in this example:
|
||||
Be careful when using @command{seq} with outlandish values: otherwise
|
||||
you may see surprising results, as @command{seq} uses floating point
|
||||
internally. For example, on the x86 platform, where the internal
|
||||
representation uses a 64-bit fraction, the command:
|
||||
|
||||
@example
|
||||
$ seq -s ' ' 0 0.000001 0.000003
|
||||
0.000000 0.000001 0.000002
|
||||
seq 1 0.0000000000000000001 1.0000000000000000009
|
||||
@end example
|
||||
|
||||
But that doesn't happen on many systems because @command{seq} is
|
||||
implemented using binary floating point arithmetic (via the C
|
||||
@code{long double} type)---which means decimal fractions like @code{0.000001}
|
||||
cannot be represented exactly. That in turn means some nonintuitive
|
||||
conditions like @w{@code{0.000001 * 3 > 0.000003}} will end up being true.
|
||||
|
||||
To work around that in the above example, use a slightly larger number as
|
||||
the @var{last} value:
|
||||
|
||||
@example
|
||||
$ seq -s ' ' 0 0.000001 0.0000031
|
||||
0.000000 0.000001 0.000002 0.000003
|
||||
@end example
|
||||
|
||||
In general, when using an @var{increment} with a fractional part, where
|
||||
(@var{last} - @var{first}) / @var{increment} is (mathematically) a whole
|
||||
number, specify a slightly larger (or smaller, if @var{increment} is negative)
|
||||
value for @var{last} to ensure that @var{last} is the final value printed
|
||||
by seq.
|
||||
outputs 1.0000000000000000007 twice and skips 1.0000000000000000008.
|
||||
|
||||
@exitstatus
|
||||
|
||||
@@ -14615,16 +14793,12 @@ philosophy, these books are unparalleled, and I recommend them highly.
|
||||
Acknowledgment: I would like to express my gratitude to Brian Kernighan
|
||||
of Bell Labs, the original Software Toolsmith, for reviewing this column.
|
||||
|
||||
@node Copying This Manual
|
||||
@appendix Copying This Manual
|
||||
|
||||
@menu
|
||||
* GNU Free Documentation License:: License for copying this manual.
|
||||
@end menu
|
||||
@node GNU Free Documentation License
|
||||
@appendix GNU Free Documentation License
|
||||
|
||||
@include fdl.texi
|
||||
|
||||
@node Index
|
||||
@node Concept index
|
||||
@unnumbered Index
|
||||
|
||||
@printindex cp
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
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
|
||||
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 Simon Josefsson. Partially adapted from GNU MailUtils
|
||||
* (mailbox/filter_trans.c, as of 2004-11-28). Improved by review
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
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
|
||||
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 BASE64_H
|
||||
# define 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. */
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
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. */
|
||||
|
||||
@@ -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. */
|
||||
|
||||
@@ -45,7 +44,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef __attribute__
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
||||
# define __attribute__(x)
|
||||
# endif
|
||||
#endif
|
||||
@@ -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
|
||||
412
lib/.cvsignore
412
lib/.cvsignore
@@ -1,412 +0,0 @@
|
||||
.deps
|
||||
Makefile
|
||||
Makefile.in
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl-internal.h
|
||||
acl.c
|
||||
acl.h
|
||||
acl_entries.c
|
||||
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-ctype.c
|
||||
c-ctype.h
|
||||
c-strcase.h
|
||||
c-strcasecmp.c
|
||||
c-strncasecmp.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
|
||||
concatpath.c
|
||||
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
|
||||
dirent.h
|
||||
dirent_.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
|
||||
fchdir.c
|
||||
fchmodat.c
|
||||
fchown-stub.c
|
||||
fchownat.c
|
||||
fcntl--.h
|
||||
fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-has-acl.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
filemode.c
|
||||
filemode.h
|
||||
filenamecat.c
|
||||
filenamecat.h
|
||||
findprog.c
|
||||
findprog.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
|
||||
mbscasecmp.c
|
||||
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
|
||||
memrchr.c
|
||||
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
|
||||
mpsort.c
|
||||
mpsort.h
|
||||
nanosleep.c
|
||||
netinet_in.h
|
||||
netinet_in_.h
|
||||
obstack.c
|
||||
obstack.h
|
||||
offtostr.c
|
||||
open-safer.c
|
||||
openat-die.c
|
||||
openat-priv.h
|
||||
openat-proc.c
|
||||
openat.c
|
||||
openat.h
|
||||
pathmax.h
|
||||
pathname.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
|
||||
socket_.h
|
||||
stamp-h1
|
||||
stat-macros.h
|
||||
stat-time.h
|
||||
stat.h
|
||||
stat_.h
|
||||
stdbool.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdio.h
|
||||
stdio_.h
|
||||
stdlib--.h
|
||||
stdlib-safer.h
|
||||
stdlib.h
|
||||
stdlib_.h
|
||||
stpcpy.c
|
||||
strcasecmp.c
|
||||
strcspn.c
|
||||
strdup.c
|
||||
strftime.c
|
||||
strftime.h
|
||||
string.h
|
||||
string_.h
|
||||
stripslash.c
|
||||
strncasecmp.c
|
||||
strndup.c
|
||||
strnlen.c
|
||||
strnlen1.c
|
||||
strnlen1.h
|
||||
strpbrk.c
|
||||
strtod.c
|
||||
strtoimax.c
|
||||
strtol.c
|
||||
strtoll.c
|
||||
strtoul.c
|
||||
strtoull.c
|
||||
strtoumax.c
|
||||
strverscmp.c
|
||||
strverscmp.h
|
||||
sys
|
||||
sys_time.h
|
||||
sys_time_.h
|
||||
t-fpending
|
||||
tempname.c
|
||||
tempname.h
|
||||
time.h
|
||||
time_.h
|
||||
time_r.c
|
||||
time_r.h
|
||||
timespec.h
|
||||
uinttostr.c
|
||||
umaxtostr.c
|
||||
unicodeio.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unistd.h
|
||||
unistd_.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
|
||||
wchar.h
|
||||
wchar_.h
|
||||
wctype.h
|
||||
wctype_.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-with-size.c
|
||||
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
|
||||
403
lib/.gitignore
vendored
403
lib/.gitignore
vendored
@@ -1,403 +0,0 @@
|
||||
__fpending.c
|
||||
__fpending.h
|
||||
acl-internal.h
|
||||
acl.c
|
||||
acl.h
|
||||
acl_entries.c
|
||||
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-ctype.c
|
||||
c-ctype.h
|
||||
c-strcase.h
|
||||
c-strcasecmp.c
|
||||
c-strncasecmp.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
|
||||
concatpath.c
|
||||
config.charset
|
||||
configmake.h
|
||||
creat-safer.c
|
||||
cycle-check.c
|
||||
cycle-check.h
|
||||
dev-ino.h
|
||||
diacrit.c
|
||||
diacrit.h
|
||||
dirchownmod.c
|
||||
dirchownmod.h
|
||||
dirent.h
|
||||
dirent_.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
|
||||
fchdir.c
|
||||
fchmodat.c
|
||||
fchown-stub.c
|
||||
fchownat.c
|
||||
fcntl--.h
|
||||
fcntl-safer.h
|
||||
fcntl.h
|
||||
fcntl_.h
|
||||
fd-safer.c
|
||||
file-has-acl.c
|
||||
file-type.c
|
||||
file-type.h
|
||||
fileblocks.c
|
||||
filemode.c
|
||||
filemode.h
|
||||
filenamecat.c
|
||||
filenamecat.h
|
||||
findprog.c
|
||||
findprog.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.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
|
||||
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
|
||||
mbscasecmp.c
|
||||
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
|
||||
memrchr.c
|
||||
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
|
||||
mpsort.c
|
||||
mpsort.h
|
||||
nanosleep.c
|
||||
netinet_in.h
|
||||
netinet_in_.h
|
||||
obstack.c
|
||||
obstack.h
|
||||
offtostr.c
|
||||
open-safer.c
|
||||
openat-die.c
|
||||
openat-priv.h
|
||||
openat-proc.c
|
||||
openat.c
|
||||
openat.h
|
||||
pathmax.h
|
||||
pathname.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
|
||||
socket_.h
|
||||
stat-macros.h
|
||||
stat-time.h
|
||||
stat.h
|
||||
stat_.h
|
||||
stdbool.h
|
||||
stdbool_.h
|
||||
stdint.h
|
||||
stdint_.h
|
||||
stdio--.h
|
||||
stdio-safer.h
|
||||
stdio.h
|
||||
stdio_.h
|
||||
stdlib--.h
|
||||
stdlib-safer.h
|
||||
stdlib.h
|
||||
stdlib_.h
|
||||
stpcpy.c
|
||||
strcasecmp.c
|
||||
strcspn.c
|
||||
strdup.c
|
||||
strftime.c
|
||||
strftime.h
|
||||
string.h
|
||||
string_.h
|
||||
stripslash.c
|
||||
strncasecmp.c
|
||||
strndup.c
|
||||
strnlen.c
|
||||
strnlen1.c
|
||||
strnlen1.h
|
||||
strpbrk.c
|
||||
strtod.c
|
||||
strtoimax.c
|
||||
strtol.c
|
||||
strtoll.c
|
||||
strtoul.c
|
||||
strtoull.c
|
||||
strtoumax.c
|
||||
strverscmp.c
|
||||
strverscmp.h
|
||||
sys
|
||||
sys_time.h
|
||||
sys_time_.h
|
||||
t-fpending
|
||||
tempname.c
|
||||
tempname.h
|
||||
time.h
|
||||
time_.h
|
||||
time_r.c
|
||||
time_r.h
|
||||
timespec.h
|
||||
uinttostr.c
|
||||
umaxtostr.c
|
||||
unicodeio.h
|
||||
unistd--.h
|
||||
unistd-safer.h
|
||||
unistd.h
|
||||
unistd_.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
|
||||
wchar.h
|
||||
wchar_.h
|
||||
wctype.h
|
||||
wctype_.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-with-size.c
|
||||
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,8 @@
|
||||
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.
|
||||
|
||||
@@ -1,38 +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 \
|
||||
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. */
|
||||
|
||||
|
||||
@@ -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,538 +0,0 @@
|
||||
/* Formatted output to strings.
|
||||
This file is intended to provide exactly the same functionality
|
||||
as the version in gnulib, but without the need for the xsize module.
|
||||
|
||||
Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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, SIZE_MAX. */
|
||||
#include <stdint.h>
|
||||
|
||||
/* malloc(), realloc(), free(). */
|
||||
#include <stdlib.h>
|
||||
|
||||
#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++;
|
||||
}
|
||||
#if 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':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lld" into TYPE_LONGINT. */
|
||||
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':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_ULONGLONGINT;
|
||||
else
|
||||
#endif
|
||||
/* If 'unsigned long long' exists and is the same as
|
||||
'unsigned long', we parse "llu" into TYPE_ULONGINT. */
|
||||
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':
|
||||
#if HAVE_LONG_DOUBLE
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_LONGDOUBLE;
|
||||
else
|
||||
#endif
|
||||
type = TYPE_DOUBLE;
|
||||
break;
|
||||
case 'c':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WINT_T
|
||||
type = TYPE_WIDE_CHAR;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_CHAR;
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case 'C':
|
||||
type = TYPE_WIDE_CHAR;
|
||||
c = 'c';
|
||||
break;
|
||||
#endif
|
||||
case 's':
|
||||
if (flags >= 8)
|
||||
#if HAVE_WCHAR_T
|
||||
type = TYPE_WIDE_STRING;
|
||||
#else
|
||||
goto error;
|
||||
#endif
|
||||
else
|
||||
type = TYPE_STRING;
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case 'S':
|
||||
type = TYPE_WIDE_STRING;
|
||||
c = 's';
|
||||
break;
|
||||
#endif
|
||||
case 'p':
|
||||
type = TYPE_POINTER;
|
||||
break;
|
||||
case 'n':
|
||||
#if HAVE_LONG_LONG_INT
|
||||
/* If 'long long' exists and is larger than 'long': */
|
||||
if (flags >= 16 || (flags & 4))
|
||||
type = TYPE_COUNT_LONGLONGINT_POINTER;
|
||||
else
|
||||
#endif
|
||||
/* If 'long long' exists and is the same as 'long', we parse
|
||||
"lln" into TYPE_COUNT_LONGINT_POINTER. */
|
||||
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);
|
||||
}
|
||||
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. */
|
||||
|
||||
|
||||
257
lib/unicodeio.c
257
lib/unicodeio.c
@@ -1,257 +0,0 @@
|
||||
/* Unicode character output to streams with locale dependent encoding.
|
||||
|
||||
Copyright (C) 2000-2003, 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. */
|
||||
|
||||
/* Written by Bruno Haible <haible@clisp.cons.org>. */
|
||||
|
||||
/* Note: This file requires the locale_charset() function. See in
|
||||
libiconv-1.8/libcharset/INTEGRATE for how to obtain it. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "unicodeio.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if HAVE_ICONV
|
||||
# include <iconv.h>
|
||||
#endif
|
||||
|
||||
#include <error.h>
|
||||
|
||||
#include "gettext.h"
|
||||
#define _(msgid) gettext (msgid)
|
||||
#define N_(msgid) msgid
|
||||
|
||||
#ifndef __attribute__
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
|
||||
# define __attribute__(x) /* empty */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#endif
|
||||
|
||||
#include "localcharset.h"
|
||||
|
||||
/* When we pass a Unicode character to iconv(), we must pass it in a
|
||||
suitable encoding. The standardized Unicode encodings are
|
||||
UTF-8, UCS-2, UCS-4, UTF-16, UTF-16BE, UTF-16LE, UTF-7.
|
||||
UCS-2 supports only characters up to \U0000FFFF.
|
||||
UTF-16 and variants support only characters up to \U0010FFFF.
|
||||
UTF-7 is way too complex and not supported by glibc-2.1.
|
||||
UCS-4 specification leaves doubts about endianness and byte order
|
||||
mark. glibc currently interprets it as big endian without byte order
|
||||
mark, but this is not backed by an RFC.
|
||||
So we use UTF-8. It supports characters up to \U7FFFFFFF and is
|
||||
unambiguously defined. */
|
||||
|
||||
/* Stores the UTF-8 representation of the Unicode character wc in r[0..5].
|
||||
Returns the number of bytes stored, or -1 if wc is out of range. */
|
||||
static int
|
||||
utf8_wctomb (unsigned char *r, unsigned int wc)
|
||||
{
|
||||
int count;
|
||||
|
||||
if (wc < 0x80)
|
||||
count = 1;
|
||||
else if (wc < 0x800)
|
||||
count = 2;
|
||||
else if (wc < 0x10000)
|
||||
count = 3;
|
||||
else if (wc < 0x200000)
|
||||
count = 4;
|
||||
else if (wc < 0x4000000)
|
||||
count = 5;
|
||||
else if (wc <= 0x7fffffff)
|
||||
count = 6;
|
||||
else
|
||||
return -1;
|
||||
|
||||
switch (count)
|
||||
{
|
||||
/* Note: code falls through cases! */
|
||||
case 6: r[5] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x4000000;
|
||||
case 5: r[4] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x200000;
|
||||
case 4: r[3] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x10000;
|
||||
case 3: r[2] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0x800;
|
||||
case 2: r[1] = 0x80 | (wc & 0x3f); wc = wc >> 6; wc |= 0xc0;
|
||||
case 1: r[0] = wc;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Luckily, the encoding's name is platform independent. */
|
||||
#define UTF8_NAME "UTF-8"
|
||||
|
||||
/* Converts the Unicode character CODE to its multibyte representation
|
||||
in the current locale and calls the SUCCESS callback on the resulting
|
||||
byte sequence. If an error occurs, invokes the FAILURE callback instead,
|
||||
passing it CODE and an English error string.
|
||||
Returns whatever the callback returned.
|
||||
Assumes that the locale doesn't change between two calls. */
|
||||
long
|
||||
unicode_to_mb (unsigned int code,
|
||||
long (*success) (const char *buf, size_t buflen,
|
||||
void *callback_arg),
|
||||
long (*failure) (unsigned int code, const char *msg,
|
||||
void *callback_arg),
|
||||
void *callback_arg)
|
||||
{
|
||||
static int initialized;
|
||||
static int is_utf8;
|
||||
#if HAVE_ICONV
|
||||
static iconv_t utf8_to_local;
|
||||
#endif
|
||||
|
||||
char inbuf[6];
|
||||
int count;
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
const char *charset = locale_charset ();
|
||||
|
||||
is_utf8 = !strcmp (charset, UTF8_NAME);
|
||||
#if HAVE_ICONV
|
||||
if (!is_utf8)
|
||||
{
|
||||
utf8_to_local = iconv_open (charset, UTF8_NAME);
|
||||
if (utf8_to_local == (iconv_t)(-1))
|
||||
/* For an unknown encoding, assume ASCII. */
|
||||
utf8_to_local = iconv_open ("ASCII", UTF8_NAME);
|
||||
}
|
||||
#endif
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
/* Test whether the utf8_to_local converter is available at all. */
|
||||
if (!is_utf8)
|
||||
{
|
||||
#if HAVE_ICONV
|
||||
if (utf8_to_local == (iconv_t)(-1))
|
||||
return failure (code, N_("iconv function not usable"), callback_arg);
|
||||
#else
|
||||
return failure (code, N_("iconv function not available"), callback_arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Convert the character to UTF-8. */
|
||||
count = utf8_wctomb ((unsigned char *) inbuf, code);
|
||||
if (count < 0)
|
||||
return failure (code, N_("character out of range"), callback_arg);
|
||||
|
||||
#if HAVE_ICONV
|
||||
if (!is_utf8)
|
||||
{
|
||||
char outbuf[25];
|
||||
const char *inptr;
|
||||
size_t inbytesleft;
|
||||
char *outptr;
|
||||
size_t outbytesleft;
|
||||
size_t res;
|
||||
|
||||
inptr = inbuf;
|
||||
inbytesleft = count;
|
||||
outptr = outbuf;
|
||||
outbytesleft = sizeof (outbuf);
|
||||
|
||||
/* Convert the character from UTF-8 to the locale's charset. */
|
||||
res = iconv (utf8_to_local,
|
||||
(ICONV_CONST char **)&inptr, &inbytesleft,
|
||||
&outptr, &outbytesleft);
|
||||
if (inbytesleft > 0 || res == (size_t)(-1)
|
||||
/* Irix iconv() inserts a NUL byte if it cannot convert. */
|
||||
# if !defined _LIBICONV_VERSION && (defined sgi || defined __sgi)
|
||||
|| (res > 0 && code != 0 && outptr - outbuf == 1 && *outbuf == '\0')
|
||||
# endif
|
||||
)
|
||||
return failure (code, NULL, callback_arg);
|
||||
|
||||
/* Avoid glibc-2.1 bug and Solaris 7 bug. */
|
||||
# if defined _LIBICONV_VERSION \
|
||||
|| !((__GLIBC__ - 0 == 2 && __GLIBC_MINOR__ - 0 <= 1) || defined __sun)
|
||||
|
||||
/* Get back to the initial shift state. */
|
||||
res = iconv (utf8_to_local, NULL, NULL, &outptr, &outbytesleft);
|
||||
if (res == (size_t)(-1))
|
||||
return failure (code, NULL, callback_arg);
|
||||
# endif
|
||||
|
||||
return success (outbuf, outptr - outbuf, callback_arg);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* At this point, is_utf8 is true, so no conversion is needed. */
|
||||
return success (inbuf, count, callback_arg);
|
||||
}
|
||||
|
||||
/* Simple success callback that outputs the converted string.
|
||||
The STREAM is passed as callback_arg. */
|
||||
long
|
||||
fwrite_success_callback (const char *buf, size_t buflen, void *callback_arg)
|
||||
{
|
||||
FILE *stream = (FILE *) callback_arg;
|
||||
|
||||
fwrite (buf, 1, buflen, stream);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Simple failure callback that displays an error and exits. */
|
||||
static long
|
||||
exit_failure_callback (unsigned int code, const char *msg,
|
||||
void *callback_arg ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (msg == NULL)
|
||||
error (1, 0, _("cannot convert U+%04X to local character set"), code);
|
||||
else
|
||||
error (1, 0, _("cannot convert U+%04X to local character set: %s"), code,
|
||||
gettext (msg));
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Simple failure callback that displays a fallback representation in plain
|
||||
ASCII, using the same notation as ISO C99 strings. */
|
||||
static long
|
||||
fallback_failure_callback (unsigned int code, const char *msg ATTRIBUTE_UNUSED
|
||||
, void *callback_arg)
|
||||
{
|
||||
FILE *stream = (FILE *) callback_arg;
|
||||
|
||||
if (code < 0x10000)
|
||||
fprintf (stream, "\\u%04X", code);
|
||||
else
|
||||
fprintf (stream, "\\U%08X", code);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Outputs the Unicode character CODE to the output stream STREAM.
|
||||
Upon failure, exit if exit_on_error is true, otherwise output a fallback
|
||||
notation. */
|
||||
void
|
||||
print_unicode_char (FILE *stream, unsigned int code, int exit_on_error)
|
||||
{
|
||||
unicode_to_mb (code, fwrite_success_callback,
|
||||
exit_on_error
|
||||
? exit_failure_callback
|
||||
: fallback_failure_callback,
|
||||
stream);
|
||||
}
|
||||
935
lib/vasnprintf.c
935
lib/vasnprintf.c
@@ -1,935 +0,0 @@
|
||||
/* vsprintf with automatic memory allocation.
|
||||
This file is intended to provide exactly the same functionality
|
||||
as the version in gnulib, but without the need for the xsize module.
|
||||
|
||||
Copyright (C) 1999, 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 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. */
|
||||
|
||||
/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
|
||||
This must come before <config.h> because <config.h> may include
|
||||
<features.h>, and once <features.h> has been included, it's too late. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <config.h>
|
||||
#ifndef IN_LIBINTL
|
||||
# include <alloca.h>
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#if WIDE_CHAR_VERSION
|
||||
# include "vasnwprintf.h"
|
||||
#else
|
||||
# include "vasnprintf.h"
|
||||
#endif
|
||||
|
||||
#include <stdio.h> /* snprintf(), sprintf() */
|
||||
#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
|
||||
#include <stdint.h> /* SIZE_MAX */
|
||||
#include <string.h> /* memcpy(), strlen() */
|
||||
#include <errno.h> /* errno */
|
||||
#include <limits.h> /* CHAR_BIT, INT_MAX */
|
||||
#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
|
||||
#if WIDE_CHAR_VERSION
|
||||
# include "wprintf-parse.h"
|
||||
#else
|
||||
# include "printf-parse.h"
|
||||
#endif
|
||||
|
||||
#if HAVE_WCHAR_T
|
||||
# if HAVE_WCSLEN
|
||||
# define local_wcslen wcslen
|
||||
# else
|
||||
/* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
|
||||
a dependency towards this library, here is a local substitute.
|
||||
Define this substitute only once, even if this file is included
|
||||
twice in the same compilation unit. */
|
||||
# ifndef local_wcslen_defined
|
||||
# define local_wcslen_defined 1
|
||||
static size_t
|
||||
local_wcslen (const wchar_t *s)
|
||||
{
|
||||
const wchar_t *ptr;
|
||||
|
||||
for (ptr = s; *ptr != (wchar_t) 0; ptr++)
|
||||
;
|
||||
return ptr - s;
|
||||
}
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if WIDE_CHAR_VERSION
|
||||
# define VASNPRINTF vasnwprintf
|
||||
# define CHAR_T wchar_t
|
||||
# define DIRECTIVE wchar_t_directive
|
||||
# define DIRECTIVES wchar_t_directives
|
||||
# define PRINTF_PARSE wprintf_parse
|
||||
# define USE_SNPRINTF 1
|
||||
# if HAVE_DECL__SNWPRINTF
|
||||
/* On Windows, the function swprintf() has a different signature than
|
||||
on Unix; we use the _snwprintf() function instead. */
|
||||
# define SNPRINTF _snwprintf
|
||||
# else
|
||||
/* Unix. */
|
||||
# define SNPRINTF swprintf
|
||||
# endif
|
||||
#else
|
||||
# define VASNPRINTF vasnprintf
|
||||
# define CHAR_T char
|
||||
# define DIRECTIVE char_directive
|
||||
# define DIRECTIVES char_directives
|
||||
# define PRINTF_PARSE printf_parse
|
||||
# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
|
||||
# if HAVE_DECL__SNPRINTF
|
||||
/* Windows. */
|
||||
# define SNPRINTF _snprintf
|
||||
# else
|
||||
/* Unix. */
|
||||
# define SNPRINTF snprintf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
CHAR_T *
|
||||
VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
|
||||
{
|
||||
DIRECTIVES d;
|
||||
arguments a;
|
||||
|
||||
if (PRINTF_PARSE (format, &d, &a) < 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define CLEANUP() \
|
||||
free (d.dir); \
|
||||
if (a.arg) \
|
||||
free (a.arg);
|
||||
|
||||
if (printf_fetchargs (args, &a) < 0)
|
||||
{
|
||||
CLEANUP ();
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
{
|
||||
size_t buf_neededlength;
|
||||
CHAR_T *buf;
|
||||
CHAR_T *buf_malloced;
|
||||
const CHAR_T *cp;
|
||||
size_t i;
|
||||
DIRECTIVE *dp;
|
||||
/* Output string accumulator. */
|
||||
CHAR_T *result;
|
||||
size_t allocated;
|
||||
size_t length;
|
||||
|
||||
/* Allocate a small buffer that will hold a directive passed to
|
||||
sprintf or snprintf. */
|
||||
buf_neededlength = 7 + d.max_width_length + d.max_precision_length + 6;
|
||||
#if HAVE_ALLOCA
|
||||
if (buf_neededlength < 4000 / sizeof (CHAR_T))
|
||||
{
|
||||
buf = alloca (buf_neededlength * sizeof (CHAR_T));
|
||||
buf_malloced = NULL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (SIZE_MAX / sizeof (CHAR_T) < buf_neededlength)
|
||||
goto out_of_memory_1;
|
||||
buf = (CHAR_T *) malloc (buf_neededlength * sizeof (CHAR_T));
|
||||
if (buf == NULL)
|
||||
goto out_of_memory_1;
|
||||
buf_malloced = buf;
|
||||
}
|
||||
|
||||
if (resultbuf != NULL)
|
||||
{
|
||||
result = resultbuf;
|
||||
allocated = *lengthp;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = NULL;
|
||||
allocated = 0;
|
||||
}
|
||||
length = 0;
|
||||
/* Invariants:
|
||||
result is either == resultbuf or == NULL or malloc-allocated.
|
||||
If length > 0, then result != NULL. */
|
||||
|
||||
/* Ensures that allocated >= length + extra. Aborts through a jump to
|
||||
out_of_memory if size is too big. */
|
||||
#define ENSURE_ALLOCATION(extra) \
|
||||
{ \
|
||||
size_t needed = length + (extra); \
|
||||
if (needed < length) \
|
||||
goto out_of_memory; \
|
||||
if (needed > allocated) \
|
||||
{ \
|
||||
size_t memory_size; \
|
||||
CHAR_T *memory; \
|
||||
\
|
||||
allocated = (allocated > 0 ? 2 * allocated : 12); \
|
||||
if (needed > allocated) \
|
||||
allocated = needed; \
|
||||
if (SIZE_MAX / sizeof (CHAR_T) < allocated) \
|
||||
goto out_of_memory; \
|
||||
memory_size = allocated * sizeof (CHAR_T); \
|
||||
if (result == resultbuf || result == NULL) \
|
||||
memory = (CHAR_T *) malloc (memory_size); \
|
||||
else \
|
||||
memory = (CHAR_T *) realloc (result, memory_size); \
|
||||
if (memory == NULL) \
|
||||
goto out_of_memory; \
|
||||
if (result == resultbuf && length > 0) \
|
||||
memcpy (memory, result, length * sizeof (CHAR_T)); \
|
||||
result = memory; \
|
||||
} \
|
||||
}
|
||||
|
||||
for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
|
||||
{
|
||||
if (cp != dp->dir_start)
|
||||
{
|
||||
size_t n = dp->dir_start - cp;
|
||||
|
||||
ENSURE_ALLOCATION (n);
|
||||
memcpy (result + length, cp, n * sizeof (CHAR_T));
|
||||
length += n;
|
||||
}
|
||||
if (i == d.count)
|
||||
break;
|
||||
|
||||
/* Execute a single directive. */
|
||||
if (dp->conversion == '%')
|
||||
{
|
||||
if (!(dp->arg_index == ARG_NONE))
|
||||
abort ();
|
||||
ENSURE_ALLOCATION (1);
|
||||
result[length] = '%';
|
||||
length += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(dp->arg_index != ARG_NONE))
|
||||
abort ();
|
||||
|
||||
if (dp->conversion == 'n')
|
||||
{
|
||||
switch (a.arg[dp->arg_index].type)
|
||||
{
|
||||
case TYPE_COUNT_SCHAR_POINTER:
|
||||
*a.arg[dp->arg_index].a.a_count_schar_pointer = length;
|
||||
break;
|
||||
case TYPE_COUNT_SHORT_POINTER:
|
||||
*a.arg[dp->arg_index].a.a_count_short_pointer = length;
|
||||
break;
|
||||
case TYPE_COUNT_INT_POINTER:
|
||||
*a.arg[dp->arg_index].a.a_count_int_pointer = length;
|
||||
break;
|
||||
case TYPE_COUNT_LONGINT_POINTER:
|
||||
*a.arg[dp->arg_index].a.a_count_longint_pointer = length;
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_COUNT_LONGLONGINT_POINTER:
|
||||
*a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
arg_type type = a.arg[dp->arg_index].type;
|
||||
CHAR_T *p;
|
||||
unsigned int prefix_count;
|
||||
int prefixes[2];
|
||||
#if !USE_SNPRINTF
|
||||
size_t tmp_length;
|
||||
CHAR_T tmpbuf[700];
|
||||
CHAR_T *tmp;
|
||||
|
||||
/* Allocate a temporary buffer of sufficient size for calling
|
||||
sprintf. */
|
||||
{
|
||||
size_t width;
|
||||
size_t precision;
|
||||
|
||||
width = 0;
|
||||
if (dp->width_start != dp->width_end)
|
||||
{
|
||||
if (dp->width_arg_index != ARG_NONE)
|
||||
{
|
||||
int arg;
|
||||
|
||||
if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
|
||||
abort ();
|
||||
arg = a.arg[dp->width_arg_index].a.a_int;
|
||||
width = (arg < 0 ? (unsigned int) (-arg) : arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
const CHAR_T *digitp = dp->width_start;
|
||||
|
||||
do
|
||||
{
|
||||
size_t w_tmp = width * 10 + (*digitp++ - '0');
|
||||
if (SIZE_MAX / 10 < width || w_tmp < width)
|
||||
goto out_of_memory;
|
||||
width = w_tmp;
|
||||
}
|
||||
while (digitp != dp->width_end);
|
||||
}
|
||||
}
|
||||
|
||||
precision = 6;
|
||||
if (dp->precision_start != dp->precision_end)
|
||||
{
|
||||
if (dp->precision_arg_index != ARG_NONE)
|
||||
{
|
||||
int arg;
|
||||
|
||||
if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
|
||||
abort ();
|
||||
arg = a.arg[dp->precision_arg_index].a.a_int;
|
||||
precision = (arg < 0 ? 0 : arg);
|
||||
}
|
||||
else
|
||||
{
|
||||
const CHAR_T *digitp = dp->precision_start + 1;
|
||||
|
||||
precision = 0;
|
||||
while (digitp != dp->precision_end)
|
||||
{
|
||||
size_t p1 = 10 * precision + (*digitp++ - '0');
|
||||
precision = ((SIZE_MAX / 10 < precision
|
||||
|| p1 < precision)
|
||||
? SIZE_MAX : p1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (dp->conversion)
|
||||
{
|
||||
|
||||
case 'd': case 'i': case 'u':
|
||||
# if HAVE_LONG_LONG_INT
|
||||
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
|
||||
* 0.30103 /* binary -> decimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
# endif
|
||||
if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long) * CHAR_BIT
|
||||
* 0.30103 /* binary -> decimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned int) * CHAR_BIT
|
||||
* 0.30103 /* binary -> decimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
if (tmp_length < precision)
|
||||
tmp_length = precision;
|
||||
/* Multiply by 2, as an estimate for FLAG_GROUP. */
|
||||
/* Add 1, to account for a leading sign. */
|
||||
tmp_length = (tmp_length < SIZE_MAX / 2
|
||||
? 2 * tmp_length + 1
|
||||
: SIZE_MAX);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
# if HAVE_LONG_LONG_INT
|
||||
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
|
||||
* 0.333334 /* binary -> octal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
# endif
|
||||
if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long) * CHAR_BIT
|
||||
* 0.333334 /* binary -> octal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned int) * CHAR_BIT
|
||||
* 0.333334 /* binary -> octal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
if (tmp_length < precision)
|
||||
tmp_length = precision;
|
||||
/* Add 1, to account for a leading sign. */
|
||||
tmp_length += (tmp_length < SIZE_MAX);
|
||||
break;
|
||||
|
||||
case 'x': case 'X':
|
||||
# if HAVE_LONG_LONG_INT
|
||||
if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long long) * CHAR_BIT
|
||||
* 0.25 /* binary -> hexadecimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
# endif
|
||||
if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned long) * CHAR_BIT
|
||||
* 0.25 /* binary -> hexadecimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (unsigned int) * CHAR_BIT
|
||||
* 0.25 /* binary -> hexadecimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
if (tmp_length < precision)
|
||||
tmp_length = precision;
|
||||
/* Add 2, to account for a leading sign or alternate form. */
|
||||
tmp_length += 2;
|
||||
if (tmp_length < 2)
|
||||
goto out_of_memory;
|
||||
break;
|
||||
|
||||
case 'f': case 'F':
|
||||
# if HAVE_LONG_DOUBLE
|
||||
if (type == TYPE_LONGDOUBLE)
|
||||
tmp_length =
|
||||
(unsigned int) (LDBL_MAX_EXP
|
||||
* 0.30103 /* binary -> decimal */
|
||||
* 2 /* estimate for FLAG_GROUP */
|
||||
)
|
||||
+ 1 /* turn floor into ceil */
|
||||
+ 10; /* sign, decimal point etc. */
|
||||
else
|
||||
# endif
|
||||
tmp_length =
|
||||
(unsigned int) (DBL_MAX_EXP
|
||||
* 0.30103 /* binary -> decimal */
|
||||
* 2 /* estimate for FLAG_GROUP */
|
||||
)
|
||||
+ 1 /* turn floor into ceil */
|
||||
+ 10; /* sign, decimal point etc. */
|
||||
tmp_length += precision;
|
||||
if (tmp_length < precision)
|
||||
goto out_of_memory;
|
||||
break;
|
||||
|
||||
case 'e': case 'E': case 'g': case 'G':
|
||||
tmp_length =
|
||||
12; /* sign, decimal point, exponent etc. */
|
||||
tmp_length += precision;
|
||||
if (tmp_length < precision)
|
||||
goto out_of_memory;
|
||||
break;
|
||||
|
||||
case 'a': case 'A':
|
||||
# if HAVE_LONG_DOUBLE
|
||||
if (type == TYPE_LONGDOUBLE)
|
||||
tmp_length =
|
||||
(unsigned int) (LDBL_DIG
|
||||
* 0.831 /* decimal -> hexadecimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
else
|
||||
# endif
|
||||
tmp_length =
|
||||
(unsigned int) (DBL_DIG
|
||||
* 0.831 /* decimal -> hexadecimal */
|
||||
)
|
||||
+ 1; /* turn floor into ceil */
|
||||
if (tmp_length < precision)
|
||||
tmp_length = precision;
|
||||
/* Account for sign, decimal point etc. */
|
||||
tmp_length += 12;
|
||||
if (tmp_length < 12)
|
||||
goto out_of_memory;
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
# if HAVE_WINT_T && !WIDE_CHAR_VERSION
|
||||
if (type == TYPE_WIDE_CHAR)
|
||||
tmp_length = MB_CUR_MAX;
|
||||
else
|
||||
# endif
|
||||
tmp_length = 1;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
# if HAVE_WCHAR_T
|
||||
if (type == TYPE_WIDE_STRING)
|
||||
{
|
||||
tmp_length =
|
||||
local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
|
||||
|
||||
# if !WIDE_CHAR_VERSION
|
||||
if (SIZE_MAX / MB_CUR_MAX < tmp_length)
|
||||
goto out_of_memory;
|
||||
tmp_length *= MB_CUR_MAX;
|
||||
# endif
|
||||
}
|
||||
else
|
||||
# endif
|
||||
tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
tmp_length =
|
||||
(unsigned int) (sizeof (void *) * CHAR_BIT
|
||||
* 0.25 /* binary -> hexadecimal */
|
||||
)
|
||||
+ 1 /* turn floor into ceil */
|
||||
+ 2; /* account for leading 0x */
|
||||
break;
|
||||
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
|
||||
if (tmp_length < width)
|
||||
tmp_length = width;
|
||||
|
||||
tmp_length++; /* account for trailing NUL */
|
||||
if (!tmp_length)
|
||||
goto out_of_memory;
|
||||
}
|
||||
|
||||
if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
|
||||
tmp = tmpbuf;
|
||||
else
|
||||
{
|
||||
if (SIZE_MAX / sizeof (CHAR_T) < tmp_length)
|
||||
/* Overflow, would lead to out of memory. */
|
||||
goto out_of_memory;
|
||||
tmp = (CHAR_T *) malloc (tmp_length * sizeof (CHAR_T));
|
||||
if (tmp == NULL)
|
||||
/* Out of memory. */
|
||||
goto out_of_memory;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Construct the format string for calling snprintf or
|
||||
sprintf. */
|
||||
p = buf;
|
||||
*p++ = '%';
|
||||
if (dp->flags & FLAG_GROUP)
|
||||
*p++ = '\'';
|
||||
if (dp->flags & FLAG_LEFT)
|
||||
*p++ = '-';
|
||||
if (dp->flags & FLAG_SHOWSIGN)
|
||||
*p++ = '+';
|
||||
if (dp->flags & FLAG_SPACE)
|
||||
*p++ = ' ';
|
||||
if (dp->flags & FLAG_ALT)
|
||||
*p++ = '#';
|
||||
if (dp->flags & FLAG_ZERO)
|
||||
*p++ = '0';
|
||||
if (dp->width_start != dp->width_end)
|
||||
{
|
||||
size_t n = dp->width_end - dp->width_start;
|
||||
memcpy (p, dp->width_start, n * sizeof (CHAR_T));
|
||||
p += n;
|
||||
}
|
||||
if (dp->precision_start != dp->precision_end)
|
||||
{
|
||||
size_t n = dp->precision_end - dp->precision_start;
|
||||
memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
|
||||
p += n;
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_LONGLONGINT:
|
||||
case TYPE_ULONGLONGINT:
|
||||
*p++ = 'l';
|
||||
/*FALLTHROUGH*/
|
||||
#endif
|
||||
case TYPE_LONGINT:
|
||||
case TYPE_ULONGINT:
|
||||
#if HAVE_WINT_T
|
||||
case TYPE_WIDE_CHAR:
|
||||
#endif
|
||||
#if HAVE_WCHAR_T
|
||||
case TYPE_WIDE_STRING:
|
||||
#endif
|
||||
*p++ = 'l';
|
||||
break;
|
||||
#if HAVE_LONG_DOUBLE
|
||||
case TYPE_LONGDOUBLE:
|
||||
*p++ = 'L';
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
*p = dp->conversion;
|
||||
#if USE_SNPRINTF
|
||||
p[1] = '%';
|
||||
p[2] = 'n';
|
||||
p[3] = '\0';
|
||||
#else
|
||||
p[1] = '\0';
|
||||
#endif
|
||||
|
||||
/* Construct the arguments for calling snprintf or sprintf. */
|
||||
prefix_count = 0;
|
||||
if (dp->width_arg_index != ARG_NONE)
|
||||
{
|
||||
if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
|
||||
abort ();
|
||||
prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
|
||||
}
|
||||
if (dp->precision_arg_index != ARG_NONE)
|
||||
{
|
||||
if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
|
||||
abort ();
|
||||
prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
|
||||
}
|
||||
|
||||
#if USE_SNPRINTF
|
||||
/* Prepare checking whether snprintf returns the count
|
||||
via %n. */
|
||||
ENSURE_ALLOCATION (1);
|
||||
result[length] = '\0';
|
||||
#endif
|
||||
|
||||
for (;;)
|
||||
{
|
||||
size_t maxlen;
|
||||
int count;
|
||||
int retcount;
|
||||
|
||||
maxlen = allocated - length;
|
||||
count = -1;
|
||||
retcount = 0;
|
||||
|
||||
#if USE_SNPRINTF
|
||||
# define SNPRINTF_BUF(arg) \
|
||||
switch (prefix_count) \
|
||||
{ \
|
||||
case 0: \
|
||||
retcount = SNPRINTF (result + length, maxlen, buf, \
|
||||
arg, &count); \
|
||||
break; \
|
||||
case 1: \
|
||||
retcount = SNPRINTF (result + length, maxlen, buf, \
|
||||
prefixes[0], arg, &count); \
|
||||
break; \
|
||||
case 2: \
|
||||
retcount = SNPRINTF (result + length, maxlen, buf, \
|
||||
prefixes[0], prefixes[1], arg, \
|
||||
&count); \
|
||||
break; \
|
||||
default: \
|
||||
abort (); \
|
||||
}
|
||||
#else
|
||||
# define SNPRINTF_BUF(arg) \
|
||||
switch (prefix_count) \
|
||||
{ \
|
||||
case 0: \
|
||||
count = sprintf (tmp, buf, arg); \
|
||||
break; \
|
||||
case 1: \
|
||||
count = sprintf (tmp, buf, prefixes[0], arg); \
|
||||
break; \
|
||||
case 2: \
|
||||
count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
|
||||
arg); \
|
||||
break; \
|
||||
default: \
|
||||
abort (); \
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_SCHAR:
|
||||
{
|
||||
int arg = a.arg[dp->arg_index].a.a_schar;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_UCHAR:
|
||||
{
|
||||
unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_SHORT:
|
||||
{
|
||||
int arg = a.arg[dp->arg_index].a.a_short;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_USHORT:
|
||||
{
|
||||
unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_INT:
|
||||
{
|
||||
int arg = a.arg[dp->arg_index].a.a_int;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_UINT:
|
||||
{
|
||||
unsigned int arg = a.arg[dp->arg_index].a.a_uint;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_LONGINT:
|
||||
{
|
||||
long int arg = a.arg[dp->arg_index].a.a_longint;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_ULONGINT:
|
||||
{
|
||||
unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#if HAVE_LONG_LONG_INT
|
||||
case TYPE_LONGLONGINT:
|
||||
{
|
||||
long long int arg = a.arg[dp->arg_index].a.a_longlongint;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
case TYPE_ULONGLONGINT:
|
||||
{
|
||||
unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_DOUBLE:
|
||||
{
|
||||
double arg = a.arg[dp->arg_index].a.a_double;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#if HAVE_LONG_DOUBLE
|
||||
case TYPE_LONGDOUBLE:
|
||||
{
|
||||
long double arg = a.arg[dp->arg_index].a.a_longdouble;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_CHAR:
|
||||
{
|
||||
int arg = a.arg[dp->arg_index].a.a_char;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#if HAVE_WINT_T
|
||||
case TYPE_WIDE_CHAR:
|
||||
{
|
||||
wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_STRING:
|
||||
{
|
||||
const char *arg = a.arg[dp->arg_index].a.a_string;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#if HAVE_WCHAR_T
|
||||
case TYPE_WIDE_STRING:
|
||||
{
|
||||
const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case TYPE_POINTER:
|
||||
{
|
||||
void *arg = a.arg[dp->arg_index].a.a_pointer;
|
||||
SNPRINTF_BUF (arg);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
|
||||
#if USE_SNPRINTF
|
||||
/* Portability: Not all implementations of snprintf()
|
||||
are ISO C 99 compliant. Determine the number of
|
||||
bytes that snprintf() has produced or would have
|
||||
produced. */
|
||||
if (count >= 0)
|
||||
{
|
||||
/* Verify that snprintf() has NUL-terminated its
|
||||
result. */
|
||||
if (count < maxlen && result[length + count] != '\0')
|
||||
abort ();
|
||||
/* Portability hack. */
|
||||
if (retcount > count)
|
||||
count = retcount;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* snprintf() doesn't understand the '%n'
|
||||
directive. */
|
||||
if (p[1] != '\0')
|
||||
{
|
||||
/* Don't use the '%n' directive; instead, look
|
||||
at the snprintf() return value. */
|
||||
p[1] = '\0';
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Look at the snprintf() return value. */
|
||||
if (retcount < 0)
|
||||
{
|
||||
/* HP-UX 10.20 snprintf() is doubly deficient:
|
||||
It doesn't understand the '%n' directive,
|
||||
*and* it returns -1 (rather than the length
|
||||
that would have been required) when the
|
||||
buffer is too small. */
|
||||
size_t bigger_need =
|
||||
(allocated > 12 ? allocated : 12);
|
||||
ENSURE_ALLOCATION (bigger_need);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
count = retcount;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Attempt to handle failure. */
|
||||
if (count < 0)
|
||||
{
|
||||
if (!(result == resultbuf || result == NULL))
|
||||
free (result);
|
||||
if (buf_malloced != NULL)
|
||||
free (buf_malloced);
|
||||
CLEANUP ();
|
||||
errno = EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if !USE_SNPRINTF
|
||||
if (count >= tmp_length)
|
||||
/* tmp_length was incorrectly calculated - fix the
|
||||
code above! */
|
||||
abort ();
|
||||
#endif
|
||||
|
||||
/* Make room for the result. */
|
||||
if (count >= maxlen)
|
||||
{
|
||||
/* Need at least count bytes. But allocate
|
||||
proportionally, to avoid looping eternally if
|
||||
snprintf() reports a too small count. */
|
||||
ENSURE_ALLOCATION (count < allocated
|
||||
? allocated : count);
|
||||
#if USE_SNPRINTF
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_SNPRINTF
|
||||
/* The snprintf() result did fit. */
|
||||
#else
|
||||
/* Append the sprintf() result. */
|
||||
memcpy (result + length, tmp, count * sizeof (CHAR_T));
|
||||
if (tmp != tmpbuf)
|
||||
free (tmp);
|
||||
#endif
|
||||
|
||||
length += count;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Add the final NUL. */
|
||||
ENSURE_ALLOCATION (1);
|
||||
result[length] = '\0';
|
||||
|
||||
if (result != resultbuf && length + 1 < allocated)
|
||||
{
|
||||
/* Shrink the allocated memory if possible. */
|
||||
CHAR_T *memory;
|
||||
|
||||
memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
|
||||
if (memory != NULL)
|
||||
result = memory;
|
||||
}
|
||||
|
||||
if (buf_malloced != NULL)
|
||||
free (buf_malloced);
|
||||
CLEANUP ();
|
||||
*lengthp = length;
|
||||
if (length > INT_MAX)
|
||||
goto length_overflow;
|
||||
return result;
|
||||
|
||||
length_overflow:
|
||||
/* We could produce such a big string, but its length doesn't fit into
|
||||
an 'int'. POSIX says that snprintf() fails with errno = EOVERFLOW in
|
||||
this case. */
|
||||
if (result != resultbuf)
|
||||
free (result);
|
||||
errno = EOVERFLOW;
|
||||
return NULL;
|
||||
|
||||
out_of_memory:
|
||||
if (!(result == resultbuf || result == NULL))
|
||||
free (result);
|
||||
if (buf_malloced != NULL)
|
||||
free (buf_malloced);
|
||||
out_of_memory_1:
|
||||
CLEANUP ();
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#undef SNPRINTF
|
||||
#undef USE_SNPRINTF
|
||||
#undef PRINTF_PARSE
|
||||
#undef DIRECTIVES
|
||||
#undef DIRECTIVE
|
||||
#undef CHAR_T
|
||||
#undef VASNPRINTF
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
Copyright (C) 2003, 2005-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., 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) 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>. */
|
||||
|
||||
|
||||
257
m4/.cvsignore
257
m4/.cvsignore
@@ -1,257 +0,0 @@
|
||||
_inttypes_h.m4
|
||||
absolute-header.m4
|
||||
acl.m4
|
||||
alloca.m4
|
||||
allocsa.m4
|
||||
argmatch.m4
|
||||
arpa_inet_h.m4
|
||||
assert.m4
|
||||
atexit.m4
|
||||
backupfile.m4
|
||||
base64.m4
|
||||
bison.m4
|
||||
c-strtod.m4
|
||||
calloc.m4
|
||||
canon-host.m4
|
||||
canonicalize.m4
|
||||
chdir-long.m4
|
||||
chown.m4
|
||||
clock_time.m4
|
||||
cloexec.m4
|
||||
close-stream.m4
|
||||
closeout.m4
|
||||
codeset.m4
|
||||
config-h.m4
|
||||
cycle-check.m4
|
||||
d-ino.m4
|
||||
d-type.m4
|
||||
dirfd.m4
|
||||
dirname.m4
|
||||
dos.m4
|
||||
double-slash-root.m4
|
||||
dup2.m4
|
||||
eaccess.m4
|
||||
eealloc.m4
|
||||
eoverflow.m4
|
||||
error.m4
|
||||
euidaccess.m4
|
||||
exclude.m4
|
||||
exitfail.m4
|
||||
extensions.m4
|
||||
fchdir.m4
|
||||
fcntl-safer.m4
|
||||
fcntl_h.m4
|
||||
file-type.m4
|
||||
fileblocks.m4
|
||||
filemode.m4
|
||||
filenamecat.m4
|
||||
findprog.m4
|
||||
flexmember.m4
|
||||
fnmatch.m4
|
||||
fpending.m4
|
||||
fprintftime.m4
|
||||
free.m4
|
||||
fstypename.m4
|
||||
fsusage.m4
|
||||
ftruncate.m4
|
||||
fts.m4
|
||||
getaddrinfo.m4
|
||||
getcwd-abort-bug.m4
|
||||
getcwd-path-max.m4
|
||||
getcwd.m4
|
||||
getdate.m4
|
||||
getdelim.m4
|
||||
getgroups.m4
|
||||
gethostname.m4
|
||||
gethrxtime.m4
|
||||
getline.m4
|
||||
getloadavg.m4
|
||||
getndelim2.m4
|
||||
getopt.m4
|
||||
getpagesize.m4
|
||||
getpass.m4
|
||||
gettext.m4
|
||||
gettime.m4
|
||||
gettimeofday.m4
|
||||
getugroups.m4
|
||||
getusershell.m4
|
||||
glibc2.m4
|
||||
glibc21.m4
|
||||
gnulib-cache.m4
|
||||
gnulib-common.m4
|
||||
gnulib-comp.m4
|
||||
gnulib-tool.m4
|
||||
group-member.m4
|
||||
hard-locale.m4
|
||||
hash.m4
|
||||
host-os.m4
|
||||
human.m4
|
||||
i-ring.m4
|
||||
iconv.m4
|
||||
idcache.m4
|
||||
include_next.m4
|
||||
inet_ntop.m4
|
||||
inline.m4
|
||||
intdiv0.m4
|
||||
intl.m4
|
||||
intldir.m4
|
||||
intmax.m4
|
||||
intmax_t.m4
|
||||
inttostr.m4
|
||||
inttypes-h.m4
|
||||
inttypes-pri.m4
|
||||
inttypes.m4
|
||||
inttypes_h.m4
|
||||
isapipe.m4
|
||||
jm-winsz1.m4
|
||||
jm-winsz2.m4
|
||||
lchmod.m4
|
||||
lchown.m4
|
||||
lcmessage.m4
|
||||
lib-ignore.m4
|
||||
lib-ld.m4
|
||||
lib-link.m4
|
||||
lib-prefix.m4
|
||||
link-follow.m4
|
||||
localcharset.m4
|
||||
lock.m4
|
||||
long-options.m4
|
||||
longdouble.m4
|
||||
longlong.m4
|
||||
ls-mntd-fs.m4
|
||||
lstat.m4
|
||||
mbchar.m4
|
||||
mbiter.m4
|
||||
mbrtowc.m4
|
||||
mbscasecmp.m4
|
||||
mbstate_t.m4
|
||||
mbswidth.m4
|
||||
md5.m4
|
||||
memcasecmp.m4
|
||||
memchr.m4
|
||||
memcmp.m4
|
||||
memcoll.m4
|
||||
memcpy.m4
|
||||
memmove.m4
|
||||
mempcpy.m4
|
||||
memrchr.m4
|
||||
memset.m4
|
||||
mkancesdirs.m4
|
||||
mkdir-p.m4
|
||||
mkdir-slash.m4
|
||||
mkstemp.m4
|
||||
mktime.m4
|
||||
modechange.m4
|
||||
mountlist.m4
|
||||
mpsort.m4
|
||||
nanosleep.m4
|
||||
netinet_in_h.m4
|
||||
nls.m4
|
||||
openat.m4
|
||||
pathmax.m4
|
||||
perl.m4
|
||||
physmem.m4
|
||||
po.m4
|
||||
posixtm.m4
|
||||
posixver.m4
|
||||
printf-posix.m4
|
||||
progtest.m4
|
||||
putenv.m4
|
||||
quote.m4
|
||||
quotearg.m4
|
||||
readlink.m4
|
||||
readtokens.m4
|
||||
readutmp.m4
|
||||
regex.m4
|
||||
rename-dest-slash.m4
|
||||
rename.m4
|
||||
rmdir-errno.m4
|
||||
rmdir.m4
|
||||
root-dev-ino.m4
|
||||
rpmatch.m4
|
||||
safe-read.m4
|
||||
safe-write.m4
|
||||
same.m4
|
||||
save-cwd.m4
|
||||
savedir.m4
|
||||
savewd.m4
|
||||
setenv.m4
|
||||
settime.m4
|
||||
sha1.m4
|
||||
sig2str.m4
|
||||
signed.m4
|
||||
size_max.m4
|
||||
snprintf.m4
|
||||
socklen.m4
|
||||
sockpfaf.m4
|
||||
ssize_t.m4
|
||||
st_dm_mode.m4
|
||||
stat-macros.m4
|
||||
stat-time.m4
|
||||
stdarg.m4
|
||||
stdbool.m4
|
||||
stdint.m4
|
||||
stdint_h.m4
|
||||
stdio-safer.m4
|
||||
stdio_h.m4
|
||||
stdlib-safer.m4
|
||||
stdlib_h.m4
|
||||
stpcpy.m4
|
||||
strcase.m4
|
||||
strcspn.m4
|
||||
strdup.m4
|
||||
strftime.m4
|
||||
string_h.m4
|
||||
strndup.m4
|
||||
strnlen.m4
|
||||
strpbrk.m4
|
||||
strtod.m4
|
||||
strtoimax.m4
|
||||
strtol.m4
|
||||
strtoll.m4
|
||||
strtoul.m4
|
||||
strtoull.m4
|
||||
strtoumax.m4
|
||||
strverscmp.m4
|
||||
sys_socket_h.m4
|
||||
sys_stat_h.m4
|
||||
sys_time_h.m4
|
||||
tempname.m4
|
||||
time_h.m4
|
||||
time_r.m4
|
||||
timespec.m4
|
||||
tm_gmtoff.m4
|
||||
tzset.m4
|
||||
uintmax_t.m4
|
||||
ulonglong.m4
|
||||
unicodeio.m4
|
||||
unistd-safer.m4
|
||||
unistd_h.m4
|
||||
unlink-busy.m4
|
||||
unlinkdir.m4
|
||||
unlocked-io.m4
|
||||
uptime.m4
|
||||
userspec.m4
|
||||
utimbuf.m4
|
||||
utime.m4
|
||||
utimecmp.m4
|
||||
utimens.m4
|
||||
utimes-null.m4
|
||||
utimes.m4
|
||||
vasnprintf.m4
|
||||
vasprintf.m4
|
||||
visibility.m4
|
||||
wchar.m4
|
||||
wchar_t.m4
|
||||
wctype.m4
|
||||
wcwidth.m4
|
||||
wint_t.m4
|
||||
xalloc.m4
|
||||
xgetcwd.m4
|
||||
xnanosleep.m4
|
||||
xreadlink.m4
|
||||
xsize.m4
|
||||
xstrndup.m4
|
||||
xstrtod.m4
|
||||
xstrtol.m4
|
||||
yesno.m4
|
||||
245
m4/.gitignore
vendored
245
m4/.gitignore
vendored
@@ -1,245 +0,0 @@
|
||||
absolute-header.m4
|
||||
acl.m4
|
||||
alloca.m4
|
||||
allocsa.m4
|
||||
argmatch.m4
|
||||
arpa_inet_h.m4
|
||||
assert.m4
|
||||
atexit.m4
|
||||
backupfile.m4
|
||||
base64.m4
|
||||
bison.m4
|
||||
c-strtod.m4
|
||||
calloc.m4
|
||||
canon-host.m4
|
||||
canonicalize.m4
|
||||
chdir-long.m4
|
||||
chown.m4
|
||||
clock_time.m4
|
||||
cloexec.m4
|
||||
close-stream.m4
|
||||
closeout.m4
|
||||
codeset.m4
|
||||
config-h.m4
|
||||
cycle-check.m4
|
||||
d-ino.m4
|
||||
d-type.m4
|
||||
dirfd.m4
|
||||
dirname.m4
|
||||
dos.m4
|
||||
double-slash-root.m4
|
||||
dup2.m4
|
||||
eaccess.m4
|
||||
eealloc.m4
|
||||
eoverflow.m4
|
||||
error.m4
|
||||
euidaccess.m4
|
||||
exclude.m4
|
||||
exitfail.m4
|
||||
extensions.m4
|
||||
fchdir.m4
|
||||
fcntl-safer.m4
|
||||
fcntl_h.m4
|
||||
file-type.m4
|
||||
fileblocks.m4
|
||||
filemode.m4
|
||||
filenamecat.m4
|
||||
findprog.m4
|
||||
flexmember.m4
|
||||
fnmatch.m4
|
||||
fpending.m4
|
||||
fprintftime.m4
|
||||
free.m4
|
||||
fstypename.m4
|
||||
fsusage.m4
|
||||
ftruncate.m4
|
||||
fts.m4
|
||||
getaddrinfo.m4
|
||||
getcwd-abort-bug.m4
|
||||
getcwd-path-max.m4
|
||||
getcwd.m4
|
||||
getdate.m4
|
||||
getdelim.m4
|
||||
getgroups.m4
|
||||
gethostname.m4
|
||||
gethrxtime.m4
|
||||
getline.m4
|
||||
getloadavg.m4
|
||||
getndelim2.m4
|
||||
getopt.m4
|
||||
getpagesize.m4
|
||||
getpass.m4
|
||||
gettext.m4
|
||||
gettime.m4
|
||||
gettimeofday.m4
|
||||
getugroups.m4
|
||||
getusershell.m4
|
||||
glibc21.m4
|
||||
gnulib-cache.m4
|
||||
gnulib-common.m4
|
||||
gnulib-comp.m4
|
||||
gnulib-tool.m4
|
||||
group-member.m4
|
||||
hard-locale.m4
|
||||
hash.m4
|
||||
host-os.m4
|
||||
human.m4
|
||||
i-ring.m4
|
||||
iconv.m4
|
||||
idcache.m4
|
||||
inet_ntop.m4
|
||||
inline.m4
|
||||
intl.m4
|
||||
intldir.m4
|
||||
intmax.m4
|
||||
intmax_t.m4
|
||||
inttostr.m4
|
||||
inttypes-h.m4
|
||||
inttypes-pri.m4
|
||||
inttypes.m4
|
||||
inttypes_h.m4
|
||||
isapipe.m4
|
||||
jm-winsz1.m4
|
||||
jm-winsz2.m4
|
||||
lchmod.m4
|
||||
lchown.m4
|
||||
lib-ignore.m4
|
||||
lib-ld.m4
|
||||
lib-link.m4
|
||||
lib-prefix.m4
|
||||
link-follow.m4
|
||||
localcharset.m4
|
||||
long-options.m4
|
||||
longdouble.m4
|
||||
longlong.m4
|
||||
ls-mntd-fs.m4
|
||||
lstat.m4
|
||||
mbchar.m4
|
||||
mbiter.m4
|
||||
mbrtowc.m4
|
||||
mbscasecmp.m4
|
||||
mbstate_t.m4
|
||||
mbswidth.m4
|
||||
md5.m4
|
||||
memcasecmp.m4
|
||||
memchr.m4
|
||||
memcmp.m4
|
||||
memcoll.m4
|
||||
memcpy.m4
|
||||
memmove.m4
|
||||
mempcpy.m4
|
||||
memrchr.m4
|
||||
memset.m4
|
||||
mkancesdirs.m4
|
||||
mkdir-p.m4
|
||||
mkdir-slash.m4
|
||||
mkstemp.m4
|
||||
mktime.m4
|
||||
modechange.m4
|
||||
mountlist.m4
|
||||
mpsort.m4
|
||||
nanosleep.m4
|
||||
netinet_in_h.m4
|
||||
nls.m4
|
||||
openat.m4
|
||||
pathmax.m4
|
||||
perl.m4
|
||||
physmem.m4
|
||||
po.m4
|
||||
posixtm.m4
|
||||
posixver.m4
|
||||
progtest.m4
|
||||
putenv.m4
|
||||
quote.m4
|
||||
quotearg.m4
|
||||
readlink.m4
|
||||
readtokens.m4
|
||||
readutmp.m4
|
||||
regex.m4
|
||||
rename-dest-slash.m4
|
||||
rename.m4
|
||||
rmdir-errno.m4
|
||||
rmdir.m4
|
||||
root-dev-ino.m4
|
||||
rpmatch.m4
|
||||
safe-read.m4
|
||||
safe-write.m4
|
||||
same.m4
|
||||
save-cwd.m4
|
||||
savedir.m4
|
||||
savewd.m4
|
||||
setenv.m4
|
||||
settime.m4
|
||||
sha1.m4
|
||||
sig2str.m4
|
||||
signed.m4
|
||||
snprintf.m4
|
||||
socklen.m4
|
||||
sockpfaf.m4
|
||||
ssize_t.m4
|
||||
st_dm_mode.m4
|
||||
stat-macros.m4
|
||||
stat-time.m4
|
||||
stdarg.m4
|
||||
stdbool.m4
|
||||
stdint.m4
|
||||
stdint_h.m4
|
||||
stdio-safer.m4
|
||||
stdio_h.m4
|
||||
stdlib-safer.m4
|
||||
stdlib_h.m4
|
||||
stpcpy.m4
|
||||
strcase.m4
|
||||
strcspn.m4
|
||||
strdup.m4
|
||||
strftime.m4
|
||||
string_h.m4
|
||||
strndup.m4
|
||||
strnlen.m4
|
||||
strpbrk.m4
|
||||
strtod.m4
|
||||
strtoimax.m4
|
||||
strtol.m4
|
||||
strtoll.m4
|
||||
strtoul.m4
|
||||
strtoull.m4
|
||||
strtoumax.m4
|
||||
strverscmp.m4
|
||||
sys_socket_h.m4
|
||||
sys_stat_h.m4
|
||||
sys_time_h.m4
|
||||
tempname.m4
|
||||
time_h.m4
|
||||
time_r.m4
|
||||
timespec.m4
|
||||
tm_gmtoff.m4
|
||||
tzset.m4
|
||||
unicodeio.m4
|
||||
unistd-safer.m4
|
||||
unistd_h.m4
|
||||
unlink-busy.m4
|
||||
unlinkdir.m4
|
||||
unlocked-io.m4
|
||||
uptime.m4
|
||||
userspec.m4
|
||||
utimbuf.m4
|
||||
utime.m4
|
||||
utimecmp.m4
|
||||
utimens.m4
|
||||
utimes-null.m4
|
||||
utimes.m4
|
||||
vasnprintf.m4
|
||||
vasprintf.m4
|
||||
wchar.m4
|
||||
wchar_t.m4
|
||||
wctype.m4
|
||||
wcwidth.m4
|
||||
wint_t.m4
|
||||
xalloc.m4
|
||||
xgetcwd.m4
|
||||
xnanosleep.m4
|
||||
xreadlink.m4
|
||||
xstrndup.m4
|
||||
xstrtod.m4
|
||||
xstrtol.m4
|
||||
yesno.m4
|
||||
10
m4/ChangeLog
10
m4/ChangeLog
@@ -1,3 +1,11 @@
|
||||
2007-08-30 Eric Blake <ebb9@byu.net>
|
||||
|
||||
* jm-macros.m4 (coreutils_MACROS): Remove GNU_PACKAGE.
|
||||
|
||||
2007-04-25 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* autobuild.m4: Remove file. Now, provided by gnulib.
|
||||
|
||||
2007-01-19 Jim Meyering <jim@meyering.net>
|
||||
|
||||
* .cvsignore, .gitignore: Add more bootstrap-inserted file names.
|
||||
@@ -549,7 +557,7 @@
|
||||
Apply this change from gnulib:
|
||||
|
||||
2006-05-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
Bruno Haible <bruno@clisp.org>
|
||||
Bruno Haible <bruno@clisp.org>
|
||||
|
||||
* strndup.m4 (gl_FUNC_STRNDUP): Replace the AC_REPLACE_FUNCS with a
|
||||
check for the declaration of strnlen and a run test that exposes the
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user