Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
546074853e | ||
|
|
7deef78ea5 | ||
|
|
a38e05e749 | ||
|
|
493634e26c | ||
|
|
f96a43e366 | ||
|
|
b434c858a2 | ||
|
|
30e30f0196 | ||
|
|
1a70cc228a | ||
|
|
17ca4fc9c9 | ||
|
|
0aac6d6aac | ||
|
|
61021eab6b | ||
|
|
e59452d765 | ||
|
|
d2647ac55c | ||
|
|
c2c58762f0 | ||
|
|
0a55710cfc | ||
|
|
660d3da704 | ||
|
|
972f8b7df8 | ||
|
|
a40bdfb55f | ||
|
|
3c9ab822fe | ||
|
|
fb5ce33518 | ||
|
|
5c15337662 | ||
|
|
71f929e29c | ||
|
|
c21ad6fdf1 | ||
|
|
f0895177e7 | ||
|
|
72686655cf | ||
|
|
2efe598855 | ||
|
|
54913fddbe | ||
|
|
023cf22a59 | ||
|
|
164d7f7738 | ||
|
|
6b8acd9e01 | ||
|
|
3f6dc99aa5 | ||
|
|
d939d45c27 | ||
|
|
fc8326a2b4 | ||
|
|
8d939c9b99 | ||
|
|
72d9efc993 | ||
|
|
64c4e8efb9 | ||
|
|
25dadb2bfd | ||
|
|
80b68a73ee | ||
|
|
3437b75256 | ||
|
|
462415a88a | ||
|
|
d23a7e929e | ||
|
|
f18fa637c6 | ||
|
|
9bff7f0bb5 | ||
|
|
771b61db30 | ||
|
|
615c1d5321 | ||
|
|
3442d7651a | ||
|
|
7982badb65 | ||
|
|
a83a549de5 | ||
|
|
b1797c51e6 | ||
|
|
8504964f1a | ||
|
|
f83aa2272b | ||
|
|
fb7c05c262 | ||
|
|
e6f611f4de | ||
|
|
bd4ca7301c | ||
|
|
242297a3c6 | ||
|
|
0a658f99bb | ||
|
|
8df1c29c37 | ||
|
|
a8b7cd19bd | ||
|
|
b4f525fd79 | ||
|
|
8caa977a35 | ||
|
|
f6d398738e | ||
|
|
11dc25966d | ||
|
|
efc8b33e81 | ||
|
|
be066f6c8c | ||
|
|
6a1ad7d374 | ||
|
|
751263376b | ||
|
|
d903a7d188 | ||
|
|
a4e2243102 | ||
|
|
9fe604df1a | ||
|
|
64cd9cd85c | ||
|
|
10ef5a8596 | ||
|
|
77ed2e5989 | ||
|
|
8ae549c47f | ||
|
|
284ceba52b | ||
|
|
3ea19829d7 | ||
|
|
c49fc4aa57 | ||
|
|
7fdb6716e1 | ||
|
|
c61c589378 | ||
|
|
c688987087 | ||
|
|
0b2f9ec397 | ||
|
|
8a8e6d71a4 | ||
|
|
a0a9d682ca | ||
|
|
05a72bf75e | ||
|
|
22bf08f8e4 | ||
|
|
b5fbd1978e | ||
|
|
db80f838ff | ||
|
|
8c2e934768 | ||
|
|
dbce5b355e | ||
|
|
12cc996d32 | ||
|
|
4a0f9e713c | ||
|
|
8771b901d9 | ||
|
|
48ac509af7 | ||
|
|
f70627c031 | ||
|
|
1e6c9704b1 | ||
|
|
a629a488d7 | ||
|
|
ad1d0e1c9a | ||
|
|
4f9d746823 | ||
|
|
9fc9b6a8ed | ||
|
|
9ab82cde1e | ||
|
|
a7f392e3c3 | ||
|
|
574ea04502 | ||
|
|
5282a521b5 | ||
|
|
52634f01f9 | ||
|
|
a0f2d9c9c7 | ||
|
|
8386c05978 | ||
|
|
6a2b9a2788 | ||
|
|
e04f50f0dc | ||
|
|
021dc6e054 | ||
|
|
7d7efac7c6 | ||
|
|
f79bed3cb8 | ||
|
|
2171f40703 | ||
|
|
960ff1572f | ||
|
|
da2a2e6fd2 | ||
|
|
005bc2f841 | ||
|
|
ecc0c0e414 | ||
|
|
18548d217b | ||
|
|
653326ca9b | ||
|
|
0cf8902d9b | ||
|
|
762676f4e1 | ||
|
|
3bd49a0c3f | ||
|
|
870dfad9fd | ||
|
|
3b0891b128 | ||
|
|
b3c854b27a | ||
|
|
a923bdaca4 | ||
|
|
0070a74390 | ||
|
|
283bafa228 | ||
|
|
03bd428345 | ||
|
|
f77b853f3f | ||
|
|
43a89a5c61 | ||
|
|
44d7f94c31 | ||
|
|
7c84dc9890 | ||
|
|
025577a13f | ||
|
|
c180cc85cf | ||
|
|
092a30dd7d | ||
|
|
cd7c8f7849 | ||
|
|
89ee1332fe | ||
|
|
b926fffe80 | ||
|
|
7924a796ea | ||
|
|
8d45738126 | ||
|
|
e687c9b4d9 | ||
|
|
d2e9028726 | ||
|
|
e6638faffc | ||
|
|
f000530746 | ||
|
|
5bf04f841b | ||
|
|
5d95797aff | ||
|
|
9db2907a48 | ||
|
|
5423ae40d6 | ||
|
|
2de68acfea | ||
|
|
71e29b7388 | ||
|
|
6d6619cbb4 | ||
|
|
651053491e | ||
|
|
81f9919992 | ||
|
|
b57170d596 | ||
|
|
60462c033b | ||
|
|
3f597e59e0 | ||
|
|
a62051e5ff | ||
|
|
5483ddf024 | ||
|
|
62ef4b91fc | ||
|
|
8664521f08 | ||
|
|
6ef23916f0 | ||
|
|
73f8a2fb02 | ||
|
|
a552fc5329 | ||
|
|
505a91a6ed | ||
|
|
0d3b678800 | ||
|
|
efb115c2aa | ||
|
|
8721d285ce | ||
|
|
f421f9979d | ||
|
|
d5ad641102 | ||
|
|
ec6199c973 | ||
|
|
0eb09d097e | ||
|
|
13265b3d6b | ||
|
|
dbc7cd7bac | ||
|
|
4c1f36cda4 | ||
|
|
987af6ba16 | ||
|
|
58451ae18b | ||
|
|
cd2f5cbbfa | ||
|
|
896ff890d8 | ||
|
|
8ba24e39e0 | ||
|
|
0cf4e50e96 | ||
|
|
c8ad7eb0e2 | ||
|
|
42e47e8291 | ||
|
|
7d6c7d0735 | ||
|
|
16177a3b9d | ||
|
|
16a16460fc | ||
|
|
24d3351d5d | ||
|
|
daa06e5415 | ||
|
|
dc6cd1819d | ||
|
|
1ef1d858f8 | ||
|
|
74c75d36cc | ||
|
|
7a4264fe1e | ||
|
|
5decddeb42 | ||
|
|
0f08153214 | ||
|
|
5c3743e1f8 | ||
|
|
4a287f96fd | ||
|
|
0c35ae8d9e | ||
|
|
ddb2ff9b06 | ||
|
|
32398dd5fb | ||
|
|
cec252f98f | ||
|
|
c186198a7e | ||
|
|
ec46261757 | ||
|
|
ff0355ca9c | ||
|
|
2bd364fee8 | ||
|
|
823350a186 | ||
|
|
c58ddb4d66 | ||
|
|
447ec06234 | ||
|
|
21ca350946 | ||
|
|
46902e1c0c | ||
|
|
02bf302f96 | ||
|
|
76327fdf01 | ||
|
|
0044ed18ae | ||
|
|
a9bbb55220 | ||
|
|
69a2358d47 | ||
|
|
8664395e5b | ||
|
|
3c09b31f92 | ||
|
|
43e2eaa4db | ||
|
|
f3e98da13b | ||
|
|
25eaa2661a | ||
|
|
4f58a3d751 | ||
|
|
7d18083dda | ||
|
|
f0aca0a2ce | ||
|
|
18c76175b2 | ||
|
|
6dbde0c559 | ||
|
|
8fa9df6e7a | ||
|
|
e3382b1a62 | ||
|
|
29c7a21725 | ||
|
|
7a0ee9c7fa | ||
|
|
cb71277df4 | ||
|
|
9f5923864b | ||
|
|
60563f3e3c | ||
|
|
c49abf1608 | ||
|
|
250a794873 | ||
|
|
78f4a60bf7 | ||
|
|
2a93e33d38 | ||
|
|
5efd4d045f | ||
|
|
0516ba53bd | ||
|
|
1d76c0bc64 | ||
|
|
73bc1ab139 | ||
|
|
35fdb331e4 | ||
|
|
9ceda2059d | ||
|
|
0e24c9f453 | ||
|
|
ad54067b48 | ||
|
|
e99a58b430 | ||
|
|
51a5de71c1 | ||
|
|
06eca8cefa | ||
|
|
a4494159ea | ||
|
|
c95e25776e | ||
|
|
c2a5be6aa9 | ||
|
|
135eb71a75 | ||
|
|
af99120067 | ||
|
|
2d28520ae4 | ||
|
|
35d5b9efab | ||
|
|
f495303177 | ||
|
|
fb2e6b4074 | ||
|
|
4ffdee0002 | ||
|
|
5c5d53e1d1 | ||
|
|
269d2f5729 | ||
|
|
57149c2d03 | ||
|
|
838ebcb78f | ||
|
|
6298a7be9d | ||
|
|
cfea00b200 | ||
|
|
3d52919411 | ||
|
|
52ea1b5ba2 | ||
|
|
619a84949f | ||
|
|
c3648af57f | ||
|
|
53b5ea54c6 | ||
|
|
c4c7b9ec00 | ||
|
|
b428e7613d | ||
|
|
0e9534c10e | ||
|
|
7f8aa3f985 | ||
|
|
238e07e7d7 | ||
|
|
b6462ad865 | ||
|
|
2d7d854a97 | ||
|
|
0626737a15 | ||
|
|
17a1c9d639 | ||
|
|
31ea20dbd3 | ||
|
|
97c48c8901 | ||
|
|
bb339ba519 | ||
|
|
499f8418bf | ||
|
|
b84432ec7f | ||
|
|
111b514a05 | ||
|
|
90829dad51 | ||
|
|
943e433f7e | ||
|
|
02e6d0e04c | ||
|
|
1e7c92a107 | ||
|
|
2a97d699a8 | ||
|
|
2d0321e544 | ||
|
|
ebb209a371 | ||
|
|
ddd9430bc9 | ||
|
|
cc37877607 | ||
|
|
b35591ff8d | ||
|
|
29423f1f9a | ||
|
|
d51c57379a | ||
|
|
5f86aed17d | ||
|
|
99bd1fc8d5 | ||
|
|
70f2f9f1b7 | ||
|
|
cf9e33a4e4 | ||
|
|
c07d6f9c49 | ||
|
|
503a559b2a | ||
|
|
2dac3d1128 | ||
|
|
d7d87fed76 | ||
|
|
c08349517b | ||
|
|
f3774b5987 | ||
|
|
dccc7345ab | ||
|
|
7e51fb8371 | ||
|
|
0d7c9ac091 | ||
|
|
aee34fce32 | ||
|
|
c29d306d10 | ||
|
|
a5edc8071c | ||
|
|
106a673ba8 | ||
|
|
99fe01a0d6 | ||
|
|
94e496c77e | ||
|
|
5a9a694050 | ||
|
|
68c8046a55 | ||
|
|
c3fae61dda | ||
|
|
b783e5fa63 | ||
|
|
869a4e68a4 | ||
|
|
2ad827dfb9 | ||
|
|
fa745f2cfe | ||
|
|
e8cc443681 | ||
|
|
97fc6a10a4 | ||
|
|
d0218bfe54 | ||
|
|
b8b7ff882d | ||
|
|
c17b6a8821 | ||
|
|
2b489bae26 | ||
|
|
a9d4bf4a25 | ||
|
|
0d618efd0d | ||
|
|
5b0697b68c | ||
|
|
725b5f7932 | ||
|
|
2945d4ce08 | ||
|
|
14ff1451ce | ||
|
|
27716597d5 | ||
|
|
fd86520e91 | ||
|
|
815ed8e768 | ||
|
|
08f61b33f0 | ||
|
|
cb8f37bd2a | ||
|
|
b13277c156 | ||
|
|
b4438bbdfb | ||
|
|
5af711465d | ||
|
|
32cbad389a | ||
|
|
6022578901 | ||
|
|
740acf3664 | ||
|
|
46e07b2ec3 | ||
|
|
0318db838e | ||
|
|
04400b0d18 | ||
|
|
69c5572161 | ||
|
|
0d63932eab | ||
|
|
bb6c120691 | ||
|
|
e657f745f4 | ||
|
|
9a1c9173a3 | ||
|
|
dc648a5368 | ||
|
|
84651210e6 | ||
|
|
054183b73a | ||
|
|
d0612752f0 | ||
|
|
c3a1810890 | ||
|
|
51de6abbed | ||
|
|
94f4a239cc | ||
|
|
14a23268ad | ||
|
|
35a9bfe025 | ||
|
|
212bf3e96e | ||
|
|
9021a7ceec | ||
|
|
b56cf08319 | ||
|
|
a09ef9576d | ||
|
|
ea70bbc1b6 | ||
|
|
6fce88d93a | ||
|
|
82edb8cdf1 | ||
|
|
5ba70e05fc | ||
|
|
5c036059f8 | ||
|
|
a3c52ca679 | ||
|
|
f8138974c1 | ||
|
|
08908a5511 | ||
|
|
50df3e415d | ||
|
|
b3b385dd06 | ||
|
|
1047e9096a | ||
|
|
772afe4b5b | ||
|
|
6a791267a0 | ||
|
|
e9b7e13be1 | ||
|
|
516d64a1ff | ||
|
|
af7079f708 | ||
|
|
93502bb64b | ||
|
|
0b74716668 | ||
|
|
61a8f2adea | ||
|
|
4d9701613f | ||
|
|
90ab359ed3 | ||
|
|
8ef234dacf | ||
|
|
ea82ae5090 | ||
|
|
65aa347a9f | ||
|
|
3ba6d78241 | ||
|
|
0e2bb55483 | ||
|
|
c0b64f4bae | ||
|
|
6d70c0889d | ||
|
|
22a614bbf4 | ||
|
|
1fec5622b6 | ||
|
|
a1e2651b4c | ||
|
|
ec498ec476 | ||
|
|
e433ad319e | ||
|
|
30f9d01df9 | ||
|
|
579b592c12 | ||
|
|
dfbab9a7c0 | ||
|
|
d1730258bf | ||
|
|
1afd3e821a | ||
|
|
9e36b0fdc7 | ||
|
|
857637c1fb | ||
|
|
40854f6edb | ||
|
|
7f403b8050 | ||
|
|
2a59199870 | ||
|
|
6712d8c844 | ||
|
|
856da09741 | ||
|
|
c4cf410a59 | ||
|
|
0994dd4070 | ||
|
|
6cddce9f15 | ||
|
|
ac44fd59e3 | ||
|
|
5c25f9270c | ||
|
|
bfe301ae1c | ||
|
|
29aa64092a | ||
|
|
d9a0041870 | ||
|
|
ea3787e393 | ||
|
|
de2fe7f6be | ||
|
|
c548d1f2d8 | ||
|
|
fbe726e4c4 | ||
|
|
208ac286f8 | ||
|
|
9aef419c4c | ||
|
|
a2c6490d31 | ||
|
|
4b399995f5 | ||
|
|
877bb1f91f | ||
|
|
cd696e60ab | ||
|
|
9bd5a518ea | ||
|
|
fe4cc4b01d | ||
|
|
65d568c283 | ||
|
|
a118f110fa | ||
|
|
f803f29158 | ||
|
|
954c2d32c1 | ||
|
|
5112251894 | ||
|
|
545769885d | ||
|
|
94ea82c10a | ||
|
|
a6c978573f | ||
|
|
31d70dae49 | ||
|
|
9a639b40b7 | ||
|
|
e84f47abc8 | ||
|
|
741e4b0b30 | ||
|
|
52a720ec33 | ||
|
|
416c61a663 | ||
|
|
23bd296aeb | ||
|
|
2c8843fc86 | ||
|
|
aa07373c4e | ||
|
|
a3b5a44f79 | ||
|
|
d5fad8db39 | ||
|
|
ef5d703682 | ||
|
|
40efaf848e | ||
|
|
575854c8b9 | ||
|
|
3299947cc1 | ||
|
|
9daeea7400 | ||
|
|
4e51afc36c | ||
|
|
f1f333dc7a | ||
|
|
69a56ced7a | ||
|
|
2c468b0bb2 | ||
|
|
c67248ffc7 | ||
|
|
60936080da | ||
|
|
4db04564a9 | ||
|
|
f6b0ddc0b3 | ||
|
|
b42399e9a9 | ||
|
|
ba72056bf2 | ||
|
|
b8e4a51228 | ||
|
|
0b12f7db42 | ||
|
|
5053cffdad | ||
|
|
02f852604f | ||
|
|
e4ab8c56a0 | ||
|
|
86016d41d7 | ||
|
|
3fdfd07443 | ||
|
|
d801cdd722 | ||
|
|
72e5078ce9 | ||
|
|
a7c3f3dd35 | ||
|
|
729fc10674 | ||
|
|
12f0312b00 | ||
|
|
8c0e3e9dad | ||
|
|
c7104f0c0d | ||
|
|
679638beb2 | ||
|
|
f8fc5844b1 | ||
|
|
d86d8cf65a | ||
|
|
11e5b5fe95 | ||
|
|
42b623e9b0 | ||
|
|
21e65b8742 | ||
|
|
c6ac4d11be | ||
|
|
2d48e07139 | ||
|
|
3fee341ac2 | ||
|
|
2bed6776e4 | ||
|
|
01e0290d6e | ||
|
|
1c61154206 | ||
|
|
addf25ff16 | ||
|
|
578c1613d1 | ||
|
|
6073445551 | ||
|
|
30763684b7 | ||
|
|
ace8f44f59 | ||
|
|
98994bbeaa |
+37
-7
@@ -5,10 +5,10 @@ AUTOMAKE_OPTIONS = subdir-objects
|
||||
SUBDIRS = po
|
||||
|
||||
bin_PROGRAMS = pv
|
||||
dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md docs/TODO.md docs/benchmark.sh
|
||||
dist_doc_DATA = README.md docs/INSTALL docs/COPYING docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/DEVELOPERS.md
|
||||
dist_man1_MANS = docs/pv.1
|
||||
|
||||
EXTRA_DIST = docs/pv.1.md
|
||||
EXTRA_DIST = docs/pv.1.md docs/benchmark.sh docs/test-on-vm-lab.sh docs/build-package.sh docs/release.sh
|
||||
|
||||
pv_SOURCES = \
|
||||
src/main/debug.c \
|
||||
@@ -17,12 +17,27 @@ src/main/main.c \
|
||||
src/main/options.c \
|
||||
src/main/remote.c \
|
||||
src/main/version.c \
|
||||
src/pv/calc.c \
|
||||
src/pv/cursor.c \
|
||||
src/pv/display.c \
|
||||
src/pv/elapsedtime.c \
|
||||
src/pv/file.c \
|
||||
src/pv/format/averagerate.c \
|
||||
src/pv/format/barstyle.c \
|
||||
src/pv/format/bufferpercent.c \
|
||||
src/pv/format/bytes.c \
|
||||
src/pv/format/eta.c \
|
||||
src/pv/format/fineta.c \
|
||||
src/pv/format/lastwritten.c \
|
||||
src/pv/format/name.c \
|
||||
src/pv/format/previousline.c \
|
||||
src/pv/format/progressbar.c \
|
||||
src/pv/format/rate.c \
|
||||
src/pv/format/sgr.c \
|
||||
src/pv/format/timer.c \
|
||||
src/pv/loop.c \
|
||||
src/pv/number.c \
|
||||
src/pv/proctitle.c \
|
||||
src/pv/signal.c \
|
||||
src/pv/state.c \
|
||||
src/pv/string.c \
|
||||
@@ -69,8 +84,10 @@ tests/Integrity_-_Large_file_support.test \
|
||||
tests/Integrity_-_On_output_pipe_close.test \
|
||||
tests/Integrity_-_When_adjusted_remotely.test \
|
||||
tests/Memory_safety_-_Basic.test \
|
||||
tests/Memory_safety_-_Process_title.test \
|
||||
tests/Memory_safety_-_Remote_control_receiver.test \
|
||||
tests/Memory_safety_-_Remote_control_sender.test \
|
||||
tests/Memory_safety_-_Watchfd.test \
|
||||
tests/Modifiers_-_--direct-io.test \
|
||||
tests/Modifiers_-_--force.test \
|
||||
tests/Modifiers_-_--interval.test \
|
||||
@@ -78,16 +95,20 @@ tests/Modifiers_-_--line-mode.test \
|
||||
tests/Modifiers_-_--size_from_file_size.test \
|
||||
tests/Modifiers_-_--size.test \
|
||||
tests/Modifiers_-_--sync.test \
|
||||
tests/Sparse_-_Basic.test \
|
||||
tests/Terminal_-_Detect_width.test \
|
||||
tests/Transfer_-_--rate-limit.test \
|
||||
tests/Transfer_-_--remote.test \
|
||||
tests/Transfer_-_--stop-at-size.test
|
||||
tests/Transfer_-_--stop-at-size.test \
|
||||
tests/Transfer_-_--stop-at-size_reads.test \
|
||||
tests/Watchfd_-_Multiple_descriptors.test \
|
||||
tests/Watchfd_-_Single_descriptor.test
|
||||
|
||||
EXTRA_DIST += $(TESTS) tests/run-valgrind.sh tests/test-env.sh
|
||||
|
||||
docs/pv.1.md: $(srcdir)/docs/pv.1
|
||||
test -d docs || mkdir docs
|
||||
pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' > $@
|
||||
pandoc --from man --to markdown < $< | sed '/\*\*\*\*/{s/\*//g;s/^/**/;s/$$/**/}' | sed '/^```/,/^```/d' | sed 's/^\\\[/[/' > $@
|
||||
|
||||
SUFFIXES = .c .o .e
|
||||
|
||||
@@ -96,10 +117,10 @@ SUFFIXES = .c .o .e
|
||||
-flawfinder $< >> $@ 2>&1
|
||||
|
||||
indent:
|
||||
cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c
|
||||
cd $(srcdir) && indent -npro -kr -i8 -cd42 -c45 -l120 src/*/*.c src/*/*/*.c
|
||||
|
||||
indentclean:
|
||||
rm -f $(srcdir)/*/*.c~
|
||||
rm -f $(srcdir)/src/*/*.c~ $(srcdir)/src/*/*/*.c~
|
||||
|
||||
analyse: $(pv_SOURCES:.c=.e) FORCE
|
||||
grep -E -e '^Finished checking --' -e 'Hits = ' $+ 2>/dev/null || true
|
||||
@@ -107,11 +128,20 @@ analyse: $(pv_SOURCES:.c=.e) FORCE
|
||||
FORCE:
|
||||
|
||||
clean-local:
|
||||
rm -f src/*/*.e
|
||||
rm -f src/*/*.e src/*/*/*.e
|
||||
|
||||
# Convenience alias for "make check": "make test"
|
||||
test: check
|
||||
|
||||
# Generate a package manifest if MAINTAINER is set.
|
||||
dist-hook:
|
||||
if test -n "$(MAINTAINER)"; then \
|
||||
cd "$(top_distdir)" \
|
||||
&& { printf "%s\n\n" "Check file integrity with 'sha512sum -c MANIFEST && echo OK'."; \
|
||||
find -type f -not -name MANIFEST -exec sha512sum '{}' ';' | sort -k 2; } \
|
||||
| gpg -u "$(MAINTAINER)" --clearsign > MANIFEST; \
|
||||
else true; fi
|
||||
|
||||
# "release" target - requires MAINTAINER variable to select GPG key.
|
||||
release: distcheck
|
||||
gpg --list-secret-keys 2>&1 | grep -F 'uid' | grep -Fq "$(MAINTAINER)"
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
# Introduction
|
||||
|
||||
This is the README for **pv** ("Pipe Viewer"), a terminal-based tool for
|
||||
monitoring the progress of data through a pipeline. It can be inserted into
|
||||
any normal pipeline between two processes to give a visual indication of how
|
||||
quickly data is passing through, how long it has taken, how near to
|
||||
completion it is, and an estimate of how long it will be until completion.
|
||||
**pv** ("Pipe Viewer") is a terminal-based tool for monitoring the progress
|
||||
of data through a pipeline and modifying its flow.
|
||||
|
||||
It can be inserted into any normal pipeline between two processes to give a
|
||||
visual indication of how quickly data is passing through, how long it has
|
||||
taken, how near to completion it is, and an estimate of how long it will be
|
||||
until completion. Data flow rate, error handling strategy, buffer size, and
|
||||
cache interaction can all be adjusted.
|
||||
|
||||
In "**\--watchfd**" mode, **pv** will inspect another process and show its
|
||||
progress through the files it has open.
|
||||
|
||||
|
||||
# Documentation
|
||||
@@ -12,28 +18,46 @@ completion it is, and an estimate of how long it will be until completion.
|
||||
A manual page is included in this distribution ("`man pv`"). Before
|
||||
installation, it is in "[docs/pv.1](./docs/pv.1.md)".
|
||||
|
||||
Changes are listed in "[docs/NEWS.md](./docs/NEWS.md)". The to-do list is "[docs/TODO.md](./docs/TODO.md)".
|
||||
Changes are listed in "[docs/NEWS.md](./docs/NEWS.md)".
|
||||
|
||||
Developers and translators, please see "[docs/DEVELOPERS.md](./docs/DEVELOPERS.md)".
|
||||
|
||||
Translators can use the Weblate instance hosted by Codeberg:
|
||||
[https://translate.codeberg.org/engage/pv/](https://translate.codeberg.org/engage/pv/)
|
||||
|
||||
# Compilation
|
||||
[](https://translate.codeberg.org/engage/pv/)
|
||||
|
||||
To compile the package, type "`sh ./configure`", which should generate a
|
||||
Makefile for your system. You may then type "`make`" to build everything,
|
||||
and "`make install`" to install it.
|
||||
If you don't see your language listed, raise an issue on the issue tracker
|
||||
(or just email the maintainer) asking for it to be added.
|
||||
|
||||
See the file "[docs/INSTALL](./docs/INSTALL)" for more about the _configure_ script.
|
||||
|
||||
If this is not a packaged release, you will need the GNU build system tools
|
||||
(`autoconf`, `aclocal`, `autopoint`, `automake`) and the `gettext`
|
||||
development tools. You can then run "`autoreconf -is`" to generate the
|
||||
"`configure`" script.
|
||||
# Installation
|
||||
|
||||
See "[docs/INSTALL](./docs/INSTALL)" for more about the _configure_ script.
|
||||
|
||||
The typical process for a system-wide install is:
|
||||
|
||||
sh ./configure --prefix=/usr
|
||||
make
|
||||
sudo make install
|
||||
|
||||
This requires the build toolchain ("`sudo apt install build-essential`" on
|
||||
Debian or Ubuntu systems).
|
||||
|
||||
If this is not a packaged release, the _configure_ script is not included.
|
||||
It is generated with the GNU build system tools (_autoconf_, _aclocal_,
|
||||
_autopoint_, _automake_); _gettext_ is also needed. On Debian or Ubuntu,
|
||||
run "`sudo apt install automake autopoint gettext`". Once those tools are
|
||||
in place, call "`autoreconf -is`" to generate the _configure_ script, and
|
||||
run it as described above.
|
||||
|
||||
|
||||
# Copyright, bug reporting, and acknowledgements
|
||||
|
||||
Copyright (C) 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood.
|
||||
See "[docs/ACKNOWLEDGEMENTS.md](./docs/ACKNOWLEDGEMENTS.md)" for a list of
|
||||
contributors.
|
||||
|
||||
Copyright (C) 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood.
|
||||
|
||||
License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl-3.0.html>.
|
||||
|
||||
@@ -51,15 +75,13 @@ You should have received a copy of the GNU General Public License, version
|
||||
3, in "[docs/COPYING](./docs/COPYING)". If not, see
|
||||
<https://www.gnu.org/licenses/gpl-3.0.html>.
|
||||
|
||||
Please report any bugs to **pv@ivarch.com**, or use the issue tracker linked
|
||||
from the **pv** home page.
|
||||
Please report bugs or request features via the issue tracker linked from the
|
||||
home page.
|
||||
|
||||
The **pv** home page is at:
|
||||
|
||||
[https://www.ivarch.com/programs/pv.shtml](https://www.ivarch.com/programs/pv.shtml)
|
||||
> [https://ivarch.com/p/pv](https://ivarch.com/p/pv)
|
||||
|
||||
The latest version can always be found here.
|
||||
|
||||
**Please see "[docs/ACKNOWLEDGEMENTS.md](./docs/ACKNOWLEDGEMENTS.md)" for a list of contributors.**
|
||||
|
||||
---
|
||||
|
||||
+77
-7
@@ -1,10 +1,10 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
dnl Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
dnl
|
||||
dnl License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
|
||||
AC_INIT([pv], [1.8.9], [pv@ivarch.com], [pv], [https://www.ivarch.com/programs/pv.shtml])
|
||||
AC_INIT([pv], [1.9.44], [https://codeberg.org/ivarch/pv/issues], [pv], [https://ivarch.com/p/pv])
|
||||
AC_CONFIG_SRCDIR([src/include/config.h.in])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_HEADERS([src/include/config.h])
|
||||
@@ -30,20 +30,30 @@ AC_CHECK_FUNCS([fdatasync])
|
||||
AC_CHECK_FUNCS([fpathconf sysconf posix_memalign posix_fadvise])
|
||||
AC_CHECK_FUNCS([nanosleep])
|
||||
AC_CHECK_FUNCS([setitimer])
|
||||
AC_CHECK_FUNCS([setproctitle])
|
||||
AC_CHECK_HEADERS([getopt.h])
|
||||
AC_CHECK_HEADERS([limits.h])
|
||||
AC_CHECK_HEADERS([langinfo.h])
|
||||
AC_CHECK_HEADERS([wctype.h])
|
||||
AC_CHECK_HEADERS([termios.h])
|
||||
AC_CHECK_HEADERS([libgen.h])
|
||||
AC_CHECK_HEADERS([sys/ioctl.h])
|
||||
AC_CHECK_HEADERS([libintl.h locale.h])
|
||||
AC_CHECK_HEADERS([sys/sysmacros.h])
|
||||
AC_CHECK_MEMBERS([struct stat.st_blksize])
|
||||
AC_CHECK_DECLS([SA_SIGINFO], [], [], [[#include <signal.h>]])
|
||||
|
||||
AC_SEARCH_LIBS([sqrtl],[m])
|
||||
AC_SEARCH_LIBS([fmod],[m])
|
||||
AC_CHECK_HEADERS([math.h])
|
||||
AC_CHECK_FUNCS([sqrtl])
|
||||
AC_CHECK_FUNCS([fmod])
|
||||
|
||||
dnl Libraries that may contain key functions.
|
||||
AC_SEARCH_LIBS([clock_gettime],[rt])
|
||||
|
||||
dnl Items we can't do without.
|
||||
AC_CHECK_FUNCS([alarm basename clock_gettime dup2 getcwd memcpy memmove memset select setlocale strchr strerror strrchr strstr], [], [AC_MSG_ERROR([required function is missing])])
|
||||
AC_CHECK_FUNCS([alarm basename clock_gettime dup2 getcwd memcpy memmove memset mkdir select setlocale strchr strerror strrchr strstr], [], [AC_MSG_ERROR([required function is missing])])
|
||||
AC_CHECK_HEADERS([fcntl.h sys/file.h sys/time.h unistd.h], [], [AC_MSG_ERROR([required header file is missing])])
|
||||
|
||||
dnl Make sure all the types we use are defined.
|
||||
@@ -55,10 +65,53 @@ AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_UID_T
|
||||
|
||||
AC_CHECK_MEMBERS([struct stat.st_rdev])
|
||||
|
||||
dnl Check whether a signal handler can see the PID of the sender.
|
||||
AC_MSG_CHECKING([siginfo_t provides a signal sender's PID])
|
||||
AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static pid_t signalSender = 0;
|
||||
|
||||
#ifdef SA_SIGINFO
|
||||
static void receiveUSR2( __attribute__((unused))
|
||||
int sig, siginfo_t * info, __attribute__((unused))
|
||||
void *ucontext)
|
||||
{
|
||||
if (NULL != info)
|
||||
signalSender = info->si_pid;
|
||||
}
|
||||
#endif
|
||||
]], [[
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
#ifdef SA_SIGINFO
|
||||
sa.sa_sigaction = receiveUSR2;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
(void) sigaction(SIGUSR2, &sa, NULL);
|
||||
raise(SIGUSR2);
|
||||
#endif
|
||||
return signalSender < 1 ? 1 : 0;
|
||||
]])], [
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([SIGINFO_PROVIDES_PID], [1], [Signal handlers can determine the sending PID])
|
||||
], [
|
||||
AC_MSG_RESULT([no])
|
||||
], [
|
||||
AC_MSG_RESULT([cannot check, assuming yes])
|
||||
AC_DEFINE([SIGINFO_PROVIDES_PID], [1], [Signal handlers can determine the sending PID])
|
||||
]
|
||||
)
|
||||
|
||||
AH_BOTTOM([#include "config-aux.h"])
|
||||
|
||||
AC_ARG_ENABLE([debugging],
|
||||
[ --enable-debugging compile with debugging support],
|
||||
[AS_HELP_STRING([--enable-debugging], [compile with debugging support])],
|
||||
if test "$enable_debugging" = "yes"; then
|
||||
CFLAGS="$CFLAGS -g -Wall"
|
||||
AC_DEFINE([ENABLE_DEBUGGING], [1], [Debugging support enabled])
|
||||
@@ -66,14 +119,15 @@ AC_ARG_ENABLE([debugging],
|
||||
)
|
||||
|
||||
AC_ARG_ENABLE([profiling],
|
||||
[ --enable-profiling compile with profiling support],
|
||||
[AS_HELP_STRING([--enable-profiling], [compile with profiling support])],
|
||||
if test "$enable_profiling" = "yes"; then
|
||||
CFLAGS="-pg $CFLAGS"
|
||||
fi
|
||||
)
|
||||
|
||||
SPLICE_SUPPORT="no"
|
||||
AC_ARG_ENABLE([splice], [ --disable-splice do not use splice system call],
|
||||
AC_ARG_ENABLE([splice],
|
||||
[AS_HELP_STRING([--disable-splice], [do not use splice system call])],
|
||||
if test "$enable_splice" = "yes"; then
|
||||
SPLICE_SUPPORT="yes"
|
||||
fi,
|
||||
@@ -81,13 +135,28 @@ AC_ARG_ENABLE([splice], [ --disable-splice do not use splice system call
|
||||
)
|
||||
|
||||
IPC_SUPPORT="no"
|
||||
AC_ARG_ENABLE([ipc], [ --disable-ipc turn off IPC messaging],
|
||||
AC_ARG_ENABLE([ipc],
|
||||
[AS_HELP_STRING([--disable-ipc], [turn off IPC messaging])],
|
||||
if test "$enable_ipc" = "yes"; then
|
||||
IPC_SUPPORT="yes"
|
||||
fi,
|
||||
IPC_SUPPORT="yes"
|
||||
)
|
||||
|
||||
AC_ARG_WITH([ncurses],
|
||||
[AS_HELP_STRING([--without-ncurses], [disable the use of ncurses for terminal info])],
|
||||
[],
|
||||
[with_curses=yes])
|
||||
AS_IF([test "x$with_ncurses" != xno],
|
||||
[
|
||||
AC_SEARCH_LIBS([tigetnum],[tinfo ncurses], [
|
||||
AC_CHECK_HEADERS([term.h],[
|
||||
AC_DEFINE([ENABLE_NCURSES], [1], [Build with ncurses support])
|
||||
])
|
||||
], [])
|
||||
],
|
||||
[])
|
||||
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static], [enable static linking])],
|
||||
[
|
||||
@@ -104,6 +173,7 @@ yes
|
||||
|
||||
if test "$IPC_SUPPORT" = "yes"; then
|
||||
AC_CHECK_HEADERS([sys/ipc.h], [], [IPC_SUPPORT=no])
|
||||
AC_CHECK_HEADERS([sys/shm.h], [], [IPC_SUPPORT=no])
|
||||
AC_CHECK_HEADERS([sys/param.h])
|
||||
if test "$IPC_SUPPORT" = "yes"; then
|
||||
AC_CHECK_FUNCS([shmget], [], [IPC_SUPPORT=no])
|
||||
|
||||
+74
-33
@@ -12,18 +12,18 @@ is acknowledged and greatly appreciated:
|
||||
* Joshua Jensen - reported RPM installation bug
|
||||
* Boris Folgmann <http://www.folgmann.com/en/> - reported cursor handling bug
|
||||
* Mathias Gumz - reported NLS bug
|
||||
* Daniel Roethlisberger - submitted patch to use lockfiles for "`-c`" if terminal locking fails
|
||||
* Adam Buchbinder - lots of help with a Cygwin port of "`-c`"
|
||||
* Mark Tomich <http://metuchen.dyndns.org> - suggested "`-B`" option
|
||||
* Daniel Roethlisberger - submitted patch to use lockfiles for **-c** if terminal locking fails
|
||||
* Adam Buchbinder - lots of help with a Cygwin port of **-c**
|
||||
* Mark Tomich <http://metuchen.dyndns.org> - suggested **-B** option
|
||||
* Gert Menke - reported bug when piping to `dd` with a large input buffer size
|
||||
* Ville Herva <Ville.Herva@iki.fi> - informative bug report about rate limiting performance
|
||||
* Elias Pipping - patch to compile properly on Darwin 9; potential NULL deref report
|
||||
* Patrick Collison - similar patch for OS X
|
||||
* Boris Lohner - reported problem that "`-L`" does not complain if given non-numeric value
|
||||
* Boris Lohner - reported problem that **-L** does not complain if given non-numeric value
|
||||
* Sebastian Kayser - supplied testing for *SIGPIPE*, demonstrated internationalisation problem
|
||||
* Laszlo Ersek <http://phptest11.atw.hu/> - reported shared memory leak on *SIGINT* with "`-c`"
|
||||
* Laszlo Ersek <http://phptest11.atw.hu/> - reported shared memory leak on *SIGINT* with **-c**
|
||||
* Phil Rutschman <http://bandgap.rsnsoft.com/> - provided a patch for fully restoring terminal state on exit
|
||||
* Henry Precheur <http://henry.precheur.org/> - reporting and suggestions for "`--rate-limit`" bug when rate is under 10
|
||||
* Henry Precheur <http://henry.precheur.org/> - reporting and suggestions for **--rate-limit** bug when rate is under 10
|
||||
* E. Rosten <http://mi.eng.cam.ac.uk/~er258/> - supplied patch for block buffering in line mode
|
||||
* Kjetil Torgrim Homme - reported compilation error with default *CFLAGS* on non-GCC compilers
|
||||
* Alexandre de Verteuil - reported bug in OS X build and supplied test environment to fix in
|
||||
@@ -31,65 +31,106 @@ is acknowledged and greatly appreciated:
|
||||
* Sam Nelson <http://www.siliconfuture.net/> - supplied patch to fix trailing slash on *DESTDIR*
|
||||
* Daniel Pape - reported Cygwin installation problem due to *DESTDIR*
|
||||
* Philipp Beckers - ported to the Syabas PopcornHour A-100 series
|
||||
* Henry Gebhard <hsggebhardt@googlemail.com> - supplied patches to improve SI prefixes and add "`--average-rate`"
|
||||
* Henry Gebhard <hsggebhardt@googlemail.com> - supplied patches to improve SI prefixes and add **--average-rate**
|
||||
* Vladimir Kokarev, Alexander Leo - reported that exit status did not reflect file errors
|
||||
* Thomas Rachel - submitted patches for IEEE1541 (MiB suffixes), 1+e03 bug
|
||||
* Guillaume Marcais - submitted speedup patch for line mode
|
||||
* Moritz Barsnick - submitted patch for compile warning in size calculation
|
||||
* Pawel Piatek - submitted RPM and patches for AIX
|
||||
* Sami Liedes - submitted patch for "`--timer`" and "`--bytes`" with "`--numeric`"
|
||||
* Steven Willis - reported problem with "`-R`" killing non-PV remote processes
|
||||
* Vladimir Pal, Vladimir Ermakov - submitted patch which led to development of "`--format`" option
|
||||
* Sami Liedes - submitted patch for **--timer** and **--bytes** with **--numeric**
|
||||
* Steven Willis - reported problem with **-R** killing non-PV remote processes
|
||||
* Vladimir Pal, Vladimir Ermakov - submitted patch which led to development of **--format** option
|
||||
* Peter Samuelson <peter@p12n.org> - submitted patch to calculate size if stdout is a block device
|
||||
* Miguel Diaz - much Cygwin help (and packaging), found narrow-terminal bug
|
||||
* Jim Salter <http://ubuntuwiki.net> - commissioned work on the "`--skip-errors`" option
|
||||
* Jim Salter <http://ubuntuwiki.net> - commissioned work on the **--skip-errors** option
|
||||
* Wouter Pronk - reported build problem on SCO
|
||||
* Bryan Dongray <http://www.dongrays.com> - provided patches for test scripts failing on older Red Hats
|
||||
* Zev Weiss <www.bewilderbeest.net> - provided patch to fix `splice()` not using stdin
|
||||
* Zing Shishak - provided patch for "`--null`" / "`-0`" (count null terminated lines)
|
||||
* Jacek Wielemborek <http://deetah.jogger.pl/kategorie/english> - implemented fdwatch in Python, suggested PV port; reported bug with "`-l`" and ETA / size; many other contributions
|
||||
* Zing Shishak - provided patch for **--null** / **-0** (count null terminated lines)
|
||||
* Jacek Wielemborek <http://deetah.jogger.pl/kategorie/english> - implemented fdwatch in Python, suggested PV port; reported bug with **-l** and ETA / size; many other contributions
|
||||
* Kim Krecht - suggested buffer fill status and last bytes output display options
|
||||
* Cristian Ciupitu <http://ciupicri.github.io>, Josh Stone - pointed out file descriptor leak with helpful suggestions (Josh Stone initially noticed the missing close)
|
||||
* Jan Seda - found issue with `splice()` and *SPLICE_F_NONBLOCK* causing slowdown
|
||||
* André Stapf - pointed out formatting problem e.g. 13GB -> 13.1GB which should be shown 13.0GB -> 13.1GB; highlighted on-startup row swapping in "`-c`", and suggested "`--discard`"
|
||||
* Damon Harper <http://www.usrbin.ca/> - suggested "`-D`" / "`--delay-start`" option
|
||||
* André Stapf - pointed out formatting problem e.g. 13GB -> 13.1GB which should be shown 13.0GB -> 13.1GB; highlighted on-startup row swapping in **-c**, and suggested **--discard**; suggested making **--fineta** have a "FIN" prefix
|
||||
* Damon Harper <http://www.usrbin.ca/> - suggested **-D** / **--delay-start** option
|
||||
* Ganaël Laplanche <http://www.martymac.org> - provided patch for `lstat64()` on systems that do not support it
|
||||
* Peter Korsgaard <http://www.buildroot.net/> - provided similar patch for `lstat64()`, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in "`-lc128`" check
|
||||
* Peter Korsgaard <http://www.buildroot.net/> - provided similar patch for `lstat64()`, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in **-lc128** check
|
||||
* Ralf Ramsauer <https://blog.ramses-pyramidenbau.de/> - reported bug which dropped transfer rate on terminal resize
|
||||
* Michiel Van Herwegen - reported and discussed bug with "`-l`" and ETA / size
|
||||
* Erkki Seppälä <http://www.inside.org/~flux/> - provided patch implementing "`-I`"
|
||||
* Michiel Van Herwegen - reported and discussed bug with **-l** and ETA / size
|
||||
* Erkki Seppälä <http://www.inside.org/~flux/> - provided patch implementing **-I**
|
||||
* Eric A. Borisch - provided details of compatibility fix for "`%Lu`" in watchpid code
|
||||
* Jan Venekamp - reported MacOS buffer size interactions with pipes
|
||||
* Matt <https://github.com/lemonsqueeze/pv> - provided "rate-window" patches for rate calculation
|
||||
* [Filippo Valsorda](https://github.com/FiloSottile) - provided patch for stat64 issue on Apple Silicon
|
||||
* Matt Koscica, William Dillon - also reported stat64 issue on Apple Silicon
|
||||
* [Demitri Muna](https://github.com/demitri) - assisted with stat64 patch on Apple Silicon
|
||||
* Norman Rasmussen - suggested "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`"
|
||||
* Norman Rasmussen - suggested **-c** with **-d PID:FD**, reject **-N** with **-d PID**
|
||||
* Andriy Gapon, Jonathan Elchison - reported bug where "`pv /dev/zero >/dev/null &`" stops immediately
|
||||
* Marcelo Chiesa - reported unused-result warnings when compiling PV 1.6.6
|
||||
* Jered Floyd - provided patches to improve "`--rate-limit`"
|
||||
* Jered Floyd - provided patches to improve **--rate-limit**
|
||||
* Christoph Biedl - provided ETA and dynamic interval patches
|
||||
* Richard Fonfara - provided German translations for "`pv --help`"
|
||||
* Johannes Gerer <http://johannesgerer.com> - suggested that "`-B`" should enable "`-C`"
|
||||
* Johannes Gerer <http://johannesgerer.com> - suggested that **-B** should enable **-C**
|
||||
* Sam James - provided fix for number.c build issue caused by missing stddef.h
|
||||
* Jakub Wilk <jwilk@jwilk.net> - corrected README encoding
|
||||
* Frederik Eaton - reported issue with `<()` shell constructs
|
||||
* [gray](https://github.com/gray) - reported issue with "`--force`" and terminal process groups, and proposed a patch
|
||||
* [gray](https://github.com/gray) - reported issue with **--force** and terminal process groups, and proposed a patch
|
||||
* [Luc Gommans](https://github.com/lgommans) / https://lgms.nl/ - provided a "momentary ETA" patch
|
||||
* [ikasty](https://github.com/ikasty) - added relative filename display to "`--watchfd`"
|
||||
* [ikasty](https://github.com/ikasty) - added relative filename display to **--watchfd**
|
||||
* [Michael Weiß](https://github.com/quitschbo) - corrected behaviour when not attached to a terminal
|
||||
* [christoph-zededa](https://github.com/christoph-zededa) - provided OS X support for "`--watchfd`"
|
||||
* [Dave Beckett](https://github.com/dajobe) - added "`@filename`" syntax to "`--size`", and corrected an autoconf problem with stat64 on OS X
|
||||
* [christoph-zededa](https://github.com/christoph-zededa) - provided OS X support for **--watchfd**
|
||||
* [Dave Beckett](https://github.com/dajobe) - added "`@filename`" syntax to **--size**, and corrected an autoconf problem with stat64 on OS X
|
||||
* [Volodymyr Bychkovyak](https://github.com/vbychkoviak) - provided fix for rate limit behaviour with bursty traffic
|
||||
* [Nick Black](https://nick-black.com) - added "`--bits`" option
|
||||
* [Nick Black](https://nick-black.com) - added **--bits** option
|
||||
* [Andrew Schulman](https://github.com/andrew-schulman) - provided reproducible example of terminal size detection issue in 1.7.17/1.7.18
|
||||
* [fuschia74](https://github.com/fuchsia74) - provided "`--enable-static`" patch for "`configure`"
|
||||
* [Wilhelm von Thiele](https://github.com/TurtleWilly) - assisted with OS X cleanups ([#73](https://codeberg.org/a-j-wood/pv/issues/73), [#74](https://codeberg.org/a-j-wood/pv/issues/74))
|
||||
* Matějů Miroslav, Ing. - suggested fix for ETA and elapsed time faults when suspending and resuming a machine ([#13](https://codeberg.org/a-j-wood/pv/issues/13))
|
||||
* Anthony DeRobertis - suggested the "`--error-skip-block`" option ([#37](https://codeberg.org/a-j-wood/pv/issues/37))
|
||||
* [fuschia74](https://github.com/fuchsia74) - provided **--enable-static** patch for "`configure`"
|
||||
* [Wilhelm von Thiele](https://github.com/TurtleWilly) - assisted with OS X cleanups ([#73](https://codeberg.org/ivarch/pv/issues/73), [#74](https://codeberg.org/ivarch/pv/issues/74))
|
||||
* Matějů Miroslav, Ing. - suggested fix for ETA and elapsed time faults when suspending and resuming a machine ([#13](https://codeberg.org/ivarch/pv/issues/13))
|
||||
* Anthony DeRobertis - suggested the **--error-skip-block** option ([#37](https://codeberg.org/ivarch/pv/issues/37))
|
||||
* Benoit Pierre - provided patches for compilation without IPC support, without HAVE_STRUCT_STAT_ST_BLKSIZE, and on MacOS
|
||||
* [gustav-b](https://codeberg.org/gustav-b) - suggested percentage formatting correction ([#80](https://codeberg.org/a-j-wood/pv/issues/80))
|
||||
* [Thomas Bertels](https://codeberg.org/tbertels) - updated French translations ([#83](https://codeberg.org/a-j-wood/pv/pulls/83))
|
||||
* [kevinruddy](https://codeberg.org/kevinruddy) - added decimal units option ([#85](https://codeberg.org/a-j-wood/pv/pulls/85))
|
||||
* [gustav-b](https://codeberg.org/gustav-b) - suggested percentage formatting correction ([#80](https://codeberg.org/ivarch/pv/issues/80))
|
||||
* [Thomas Bertels](https://codeberg.org/tbertels) - updated French translations ([#83](https://codeberg.org/ivarch/pv/pulls/83))
|
||||
* [kevinruddy](https://codeberg.org/kevinruddy) - added decimal units option ([#85](https://codeberg.org/ivarch/pv/pulls/85))
|
||||
* [xmort](https://codeberg.org/xmort) - added **--output** option ([#90](https://codeberg.org/ivarch/pv/pulls/90))
|
||||
* [bogiord](https://codeberg.org/bogiord) - reported the loss of output block device size detection in 1.8.10, and suggested the fix ([#91](https://codeberg.org/ivarch/pv/issues/91))
|
||||
* [eborisch](https://codeberg.org/eborisch) - provided fix for misbehaviour when used with "`zfs send`" due to treating zero sized writes (generally due to timer interruption) as end of file ([#92](https://codeberg.org/ivarch/pv/pulls/92), [#93](https://codeberg.org/ivarch/pv/pulls/93))
|
||||
* [alexanderperlis](https://codeberg.org/alexanderperlis) - provided initial support for block devices with **--size `@`FILE** ([#94](https://codeberg.org/ivarch/pv/pulls/94))
|
||||
* [jettero](https://codeberg.org/jettero) - reported double-free coredump when using **--watchfd** after 1.8.10 ([#96](https://codeberg.org/ivarch/pv/issues/96))
|
||||
* Venky.N.Iyer - suggested **--stats** ([#49](https://codeberg.org/ivarch/pv/issues/49))
|
||||
* Roland Kletzing - suggested **--rate** with **--numeric** ([#17](https://codeberg.org/ivarch/pv/issues/17))
|
||||
* [Michael Mior](https://codeberg.org/michaelmior) - suggested **--store-and-forward** ([#100](https://codeberg.org/ivarch/pv/issues/100))
|
||||
* [dbungert](https://codeberg.org/dbungert) - reported issue with *valgrind* 3.23 misreporting leaking file descriptors ([#97](https://codeberg.org/ivarch/pv/issues/97))
|
||||
* Joachim Haga - suggested showing progress in the window title ([#3](https://codeberg.org/ivarch/pv/issues/3))
|
||||
* [Martin Sarsale](https://github.com/runa) - suggested showing progress in the process title ([#4](https://codeberg.org/ivarch/pv/issues/4))
|
||||
* [2bits](https://github.com/2bits) - reported position sensing fault with **--watchfd** in 1.9.0 ([#118](https://codeberg.org/ivarch/pv/issues/118))
|
||||
* [heitbaum](https://codeberg.org/heitbaum) - assisted with cross-compilation fault introduced in 1.9.7 ([#120](https://codeberg.org/ivarch/pv/issues/120))
|
||||
* [meego](https://codeberg.org/meego) - suggested "**%nL**", the last line preview ([#121](https://codeberg.org/ivarch/pv/issues/121))
|
||||
* [Alexander Petrossian](https://github.com/neopaf) - suggested using Unicode output for a more granular progress bar, and provided the codepoints to use ([#15](https://codeberg.org/ivarch/pv/issues/15))
|
||||
* [jmealo](https://codeberg.org/jmealo) - suggested JSON progress output ([#127](https://codeberg.org/ivarch/pv/issues/127))
|
||||
* [ipaqmaster](https://codeberg.org/ipaqmaster) - investigated 100%-CPU utilisation bug when piping to a command that has exited ([#164](https://codeberg.org/ivarch/pv/issues/164))
|
||||
* Andriy Galetski, and also [thinrope](https://codeberg.org/thinrope) - suggested the "**--sparse**" option ([#45](https://codeberg.org/ivarch/pv/issues/45))
|
||||
* [KimHansen](https://codeberg.org/KimHansen) - suggested that "**--watchfd**" should keep its display when the process ends ([#81](https://codeberg.org/ivarch/pv/issues/81))
|
||||
|
||||
Translations provided through [Codeberg Weblate](https://translate.codeberg.org/projects/pv/):
|
||||
|
||||
* **Czech**
|
||||
* [mmatous](https://translate.codeberg.org/user/mmatous/) (135)
|
||||
* **French**
|
||||
* anonymous suggestions (7)
|
||||
* [milimarg](https://codeberg.org/milimarg) (13)
|
||||
* [Maxi_Mega](https://translate.codeberg.org/user/Maxi_Mega/) (11)
|
||||
* **German**
|
||||
* [Hartmut Goebel](https://translate.codeberg.org/user/htgoebel/) (77)
|
||||
* [m0yellow](https://translate.codeberg.org/user/m0yellow/) (9)
|
||||
* [Benny](https://translate.codeberg.org/user/Benny/) (7)
|
||||
* [kre](https://translate.codeberg.org/user/kre/) (2)
|
||||
* [fnetX](https://translate.codeberg.org/user/fnetX/) (1)
|
||||
* **Polish**
|
||||
* [coralpink](https://translate.codeberg.org/user/coralpink/) (106)
|
||||
* **Russian**
|
||||
* [0ko](https://translate.codeberg.org/user/0ko/) (157)
|
||||
* **Turkish**
|
||||
* [omerdduran](https://translate.codeberg.org/user/omerdduran/) (129)
|
||||
* [Oğuz Ersen](https://codeberg.org/ersen) (8)
|
||||
|
||||
---
|
||||
|
||||
+89
-52
@@ -1,30 +1,30 @@
|
||||
# Notes for developers and translators
|
||||
|
||||
The following "`configure`" options will be of interest to developers and
|
||||
The following _configure_ options will be of interest to developers and
|
||||
translators:
|
||||
|
||||
* `--enable-debugging` - build in debugging support
|
||||
* `--enable-profiling` - build in support for profiling
|
||||
* **--enable-debugging** - build in debugging support
|
||||
* **--enable-profiling** - build in support for profiling
|
||||
|
||||
These "`make`" targets are available:
|
||||
These targets are available when running _make_:
|
||||
|
||||
* `make analyse` - run _splint_ and _flawfinder_ on all C source files
|
||||
* "`make analyse`" - run _splint_ and _flawfinder_ on all C source files
|
||||
|
||||
|
||||
## Debugging and profiling support
|
||||
|
||||
When "`./configure --enable-debugging`" is used, the "`pv`" produced by
|
||||
"`make`" will support an extra option, "`--debug FILE`", which will cause
|
||||
debugging output to be written to *FILE*. This is not recommended for
|
||||
production builds due to the extra processing it introduces, and the
|
||||
potential size of the output.
|
||||
When "`./configure --enable-debugging`" is used, the _pv_ produced by _make_
|
||||
will support an extra option, "**--debug FILE**", which will cause debugging
|
||||
output to be written to *FILE*. This is not recommended for production
|
||||
builds due to the extra processing it introduces, and the potential size of
|
||||
the output.
|
||||
|
||||
Within the code, "`debug()`" is used in a similar way to "`printf()`". It
|
||||
will automatically include the calling function, source file, and line
|
||||
Within the code, "**debug()**" is used in a similar way to "**printf()**".
|
||||
It will automatically include the calling function, source file, and line
|
||||
number, so they don't need to be included in the parameters. When debugging
|
||||
support is not enabled, it evaluates to a null statement.
|
||||
|
||||
This does mean that if you call "`debug()`", make sure it has no side
|
||||
This does mean that if you call "**debug()**", make sure it has no side
|
||||
effects, as they won't be present in builds without debugging support.
|
||||
|
||||
Builds produced after "`./configure --enable-profiling`" will write profile
|
||||
@@ -35,11 +35,11 @@ Please note that the memory safety checks will fail with profiling enabled.
|
||||
## Source code analysis
|
||||
|
||||
Running "`make analyse`" runs _splint_ and _flawfinder_ on all C sources,
|
||||
writing the output of both programs to files named "`*.e`" for each "`*.c`".
|
||||
writing the output of both programs to files named _"*.e"_ for each _"*.c"_.
|
||||
|
||||
There are no dependency rules set up for these "`.e`" files, so if a header
|
||||
file is altered, manually remove the relevant "`.e`" files, or update the
|
||||
timestamp of the relevant "`.c`" files, before running "`make analyse`"
|
||||
There are no dependency rules set up for these _".e"_ files, so if a header
|
||||
file is altered, manually remove the relevant _".e"_ files, or update the
|
||||
timestamp of the relevant _".c"_ files, before running "`make analyse`"
|
||||
again.
|
||||
|
||||
The goal is for all C source files to generate zero warnings from either
|
||||
@@ -55,9 +55,18 @@ altered in future.
|
||||
|
||||
## Translation notes
|
||||
|
||||
Translators can use the Weblate instance hosted by Codeberg:
|
||||
[https://translate.codeberg.org/projects/pv/](https://translate.codeberg.org/projects/pv/)
|
||||
|
||||
If you don't see your language listed, raise an issue on the issue tracker
|
||||
(or just email the maintainer) asking for it to be added.
|
||||
|
||||
Alternatively, read on for details of how to maintain the translations
|
||||
directly within the source tree.
|
||||
|
||||
The message catalogues used to translate program messages into other
|
||||
languages are in the "`po/`" directory, named "`xx.po`", where "`xx`"
|
||||
is the ISO 639-1 2-letter language code, such as "`fr`" for French.
|
||||
languages are in the _"po/"_ directory, named _"xx.po"_, where _"xx"_
|
||||
is the ISO 639-1 2-letter language code, such as "**fr**" for French.
|
||||
|
||||
Each of these files contains lines like this:
|
||||
|
||||
@@ -65,43 +74,62 @@ Each of these files contains lines like this:
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "erro ao ler o nome do terminal"
|
||||
|
||||
The comment line, starting "`#`", shows the source filename and line number
|
||||
at which this message can be found. The "`msgid`" is the original message
|
||||
in the program, in English. The "`msgstr`" is the translated text.
|
||||
The comment line, starting _"#"_, shows the source filename and line number
|
||||
at which this message can be found. The _"msgid"_ is the original message
|
||||
in the program, in English. The _"msgstr"_ is the translated text.
|
||||
|
||||
It is the "`msgstr`" lines which need to be updated by translators.
|
||||
It is the _"msgstr"_ lines which need to be updated by translators.
|
||||
|
||||
Message catalogue files should all be encoded as UTF-8.
|
||||
|
||||
_FIXME: The test below doesn't work on Debian with only en_GB installed, and
|
||||
also it looks like the compiled-in LOCALEDIR is overriding LOCPATH._
|
||||
After making a change to a _".po"_ file, test it by compiling it and
|
||||
installing to a temporary location, like this:
|
||||
|
||||
After making a change to a "`.po`" file, test it by compiling it and installing
|
||||
to a temporary location, like this:
|
||||
./configure --enable-debugging --prefix=/tmp/yourtest
|
||||
make clean
|
||||
make install
|
||||
localedef -f UTF-8 -i de_DE /tmp/yourtest/share/locale/de_DE.UTF-8
|
||||
bash
|
||||
export LOCPATH=/tmp/yourtest/share/locale
|
||||
export LC_ALL=de_DE.UTF-8
|
||||
export LANGUAGE=de_DE
|
||||
/tmp/yourtest/bin/pv --help
|
||||
exit
|
||||
|
||||
make install DESTDIR=/tmp/yourtest
|
||||
localedef -f UTF-8 -i de_DE /tmp/yourtest/usr/local/share/locale/de_DE.UTF-8
|
||||
LOCPATH=/tmp/yourtest/usr/local/share/locale \
|
||||
LC_ALL=de_DE.UTF-8 ./pv --help
|
||||
|
||||
Replace "`--help`" with whatever is appropriate for your test. In this
|
||||
example, the language being tested is "`de`" (German), on a system which is
|
||||
Replace "**--help**" with whatever is appropriate for your test. In this
|
||||
example, the language being tested is _"de"_ (German), on a system which is
|
||||
running with UTF-8 support.
|
||||
|
||||
To add a new language, create the new message catalogue file under "`po/`"
|
||||
by copying "`po/pv.pot`" to "`po/xx.po`", where "`xx`" is the language code,
|
||||
and adjusting it. The "`.pot`" file is generated automatically by "`make`".
|
||||
In the example above, a new shell is started by typing "`bash`" so that
|
||||
after your tests, "`exit`" will return you to your previous shell with your
|
||||
language settings intact.
|
||||
|
||||
Next, add the language code to "`po/LINGUAS`" - this is a list of the
|
||||
Note that at the start, you have to re-run _configure_ with "**--prefix**"
|
||||
rather than using "`make DESTDIR=...`", because the locale directory is set
|
||||
at compile time. Also, on Debian at least, both the environment variables
|
||||
_"LC_ALL"_ and _"LANGUAGE"_ must be set.
|
||||
|
||||
To find untranslated strings in a language that's already supported but
|
||||
which you can help with gaps in, use this command:
|
||||
|
||||
msgattrib --untranslated < po/fr.po
|
||||
|
||||
replacing _"po/fr.po"_ as appropriate.
|
||||
|
||||
To add a new language, create the new message catalogue file under _"po/"_
|
||||
by copying _"po/pv.pot"_ to _"po/xx.po"_, where _"xx"_ is the language code,
|
||||
and adjusting it. The _".pot"_ file is generated automatically by _make_.
|
||||
|
||||
Next, add the language code to _"po/LINGUAS"_ - this is a list of the
|
||||
2-letter codes of the supported languages.
|
||||
|
||||
Finally, run "`./config.status`" and "`make -C po update-po`".
|
||||
|
||||
When the source code is updated, running "`make -C po update-po`" will
|
||||
update the "`pv.pot`" file so that it lists where all the messages are in
|
||||
the source. It will also use _msgmerge_ to update all of the "`.po`" files
|
||||
from the updated "`pv.pot`" file. After doing this, look for missing
|
||||
translations (empty "`msgstr`" lines) or translations marked as "fuzzy", as
|
||||
update the _"pv.pot"_ file so that it lists where all the messages are in
|
||||
the source. It will also use _msgmerge_ to update all of the _".po"_ files
|
||||
from the updated _"pv.pot"_ file. After doing this, look for missing
|
||||
translations (empty _"msgstr"_ lines) or translations marked as "fuzzy", as
|
||||
these will need to be corrected by translators.
|
||||
|
||||
|
||||
@@ -109,27 +137,36 @@ these will need to be corrected by translators.
|
||||
|
||||
The package maintainer should run through these steps for a new release:
|
||||
|
||||
* Check for patches and bug reports at https://tracker.debian.org/pkg/pv
|
||||
* Check for patches and bug reports:
|
||||
* <https://codeberg.org/ivarch/pv/issues>
|
||||
* <https://tracker.debian.org/pkg/pv>
|
||||
* <https://launchpad.net/ubuntu/+source/pv>
|
||||
* <https://archlinux.org/packages/extra/x86_64/pv/>
|
||||
* <https://packages.gentoo.org/packages/sys-apps/pv>
|
||||
* <https://cvsweb.openbsd.org/ports/sysutils/pv/>
|
||||
* <https://packages.fedoraproject.org/pkgs/pv/pv/>
|
||||
* Run "`make indent; make indent indentclean check`"
|
||||
* Check that _po/POTFILES.in_ is up to date
|
||||
* Run "`make -C po update-po`"
|
||||
* Run "`make analyse`" and see whether remaining warnings can be addressed
|
||||
* Version bump and documentation checks:
|
||||
* Update the version in `configure.ac` and `docs/NEWS.md`
|
||||
* Check that `docs/NEWS.md` is up to date
|
||||
* Check that `docs/TODO.md` is up to date
|
||||
* Check that the manual `docs/pv.1` is up to date
|
||||
* Update the version in _configure.ac_ and _docs/NEWS.md_
|
||||
* Check that _docs/NEWS.md_ is up to date
|
||||
* Check that the manual _docs/pv.1_ is up to date
|
||||
* Run "`make docs/pv.1.md`" and, if using VPATH, copy the result to the source directory
|
||||
* Check that the year displayed by _src/main/version.c_ is correct
|
||||
* Ensure everything has been committed to the repository
|
||||
* Run "`autoreconf`" in the source directory
|
||||
* Run "`autoreconf -is`" in the source directory
|
||||
* Consistency and build checks:
|
||||
* Wipe the build directory, and run "`configure`" there
|
||||
* Wipe the build directory, and run _configure_ there
|
||||
* Run "`make distcheck`"
|
||||
* Run "`./configure && make check`" on all test systems including Cygwin, using the `tar.gz` that was just created
|
||||
* Run a cross-compilation check
|
||||
* Run "`make release MAINTAINER=<signing-user>`"
|
||||
* Update the project web site:
|
||||
* Copy the release `.tar.gz`, `.txt`, and `.asc` files to the web site
|
||||
* Use "`pandoc --from markdown --to html`" to convert the TODO, news, and manual to HTML
|
||||
* Update the TODO, news, and manual on the web site
|
||||
* Copy the release _.tar.gz_, _.txt_, and _.asc_ files to the web site
|
||||
* Use "`pandoc --from markdown --to html`" to convert the news and manual to HTML
|
||||
* Update the news and manual on the web site
|
||||
* Update the version numbers on the web site
|
||||
* Update the package index on the web site
|
||||
* Create a new release in the repository, and apply the associated tag
|
||||
|
||||
+256
-140
@@ -1,59 +1,175 @@
|
||||
### 1.9.44 - 18 October 2025
|
||||
|
||||
* *feature:* new **--sparse** option to write sparse output ([#45](https://codeberg.org/ivarch/pv/issues/45))
|
||||
* *fix:* don't clear the **--watchfd** display when the watched process ends ([#81](https://codeberg.org/ivarch/pv/issues/81))
|
||||
|
||||
### 1.9.42 - 11 October 2025
|
||||
|
||||
* *feature:* permit multiple arguments to **--watchfd** ([#12](https://codeberg.org/ivarch/pv/issues/12))
|
||||
* *feature:* new "**=NAME**" syntax for **--watchfd** to watch processes by name using **pgrep**(1) ([#95](https://codeberg.org/ivarch/pv/issues/95))
|
||||
* *feature:* new "**@LISTFILE**" syntax for **--watchfd** to watch processes listed in a file
|
||||
* *fix:* improve support for changing the format of a **--watchfd** process with **--remote**
|
||||
* *fix:* don't read more than **--size** bytes when using **--stop-at-size** ([#166](https://codeberg.org/ivarch/pv/issues/166))
|
||||
* *fix:* transfer nothing if **--stop-at-size** is given a **--size** of 0 ([#166](https://codeberg.org/ivarch/pv/issues/166))
|
||||
* *i18n:* Finnish translation stub added
|
||||
* *i18n:* Turkish translations updated
|
||||
|
||||
### 1.9.34 - 26 July 2025
|
||||
|
||||
* *fix:* prevent tight loop consuming CPU when waiting for a partially filled output pipe to be drained ([#164](https://codeberg.org/ivarch/pv/issues/164))
|
||||
* *fix:* correct a memory handling fault when using **--bar-style** with **--watchfd** ([#163](https://codeberg.org/ivarch/pv/issues/163))
|
||||
* *i18n:* French translations updated
|
||||
|
||||
### 1.9.31 - 28 January 2025
|
||||
|
||||
* *feature:* the **--format** option can now be used with **--numeric** for customised numeric output, such as JSON ([#127](https://codeberg.org/ivarch/pv/issues/127))
|
||||
* *i18n:* German translations updated
|
||||
* *i18n:* Polish translations updated
|
||||
* *i18n:* Russian translations updated
|
||||
|
||||
### 1.9.27 - 12 January 2025
|
||||
|
||||
* *fix:* turn off IPC support if _sys/shm.h_ is not available, for compilation on Termux
|
||||
* *fix:* bypass valgrind checks on ARM by default due to false positives
|
||||
|
||||
### 1.9.25 - 22 December 2024
|
||||
|
||||
* *fix:* test failure of **--watchfd** on macOS corrected ([#124](https://codeberg.org/ivarch/pv/issues/124))
|
||||
|
||||
### 1.9.24 - 19 December 2024
|
||||
|
||||
* *feature:* new **--format** sequences for graphical progress bars - "**%{bar-block}**", "**%{bar-granular}**", and "**%{bar-shaded}**" ([#15](https://codeberg.org/ivarch/pv/issues/15))
|
||||
* *feature:* new **--format** sequence "**%{sgr:colour,...}**" to use ECMA-48 Select Graphic Rendition codes to add colours
|
||||
* *feature:* new **--bar-style** option to change the default bar style ([#15](https://codeberg.org/ivarch/pv/issues/15))
|
||||
* *feature:* allow decimal values such as "1.5G" with "**--size**", "**--rate-limit**", "**--buffer-size**", and "**error-skip-block**" ([#35](https://codeberg.org/ivarch/pv/issues/35))
|
||||
* *cleanup:* improve progress bar granularity on wide displays by internally tracking the transfer percentage as a decimal number
|
||||
* *cleanup:* correct detection of **--remote** usability on GNU Hurd
|
||||
* *cleanup:* reduce likelihood of race conditions in tests when running on slow systems
|
||||
* *cleanup:* reduce memory footprint
|
||||
* *docs:* simplified the synopsis section of the manual
|
||||
|
||||
### 1.9.15 - 8 December 2024
|
||||
|
||||
* *feature:* new **--format** sequence "**%nL**", showing the most recent line written ([#121](https://codeberg.org/ivarch/pv/issues/121))
|
||||
* *feature:* each **--format** sequence now has a more readable equivalent name, for example "**%r**" can be written as "**%{rate}**"
|
||||
* *feature:* new **--format** sequences "**%{progress-bar-only}**" and "**%{progress-amount-only}**"
|
||||
* *fix:* allow **--format** to include "%nA" more than once, with different "n" values ([#122](https://codeberg.org/ivarch/pv/issues/122))
|
||||
* *fix:* allow **--format** to include "%p" more than once, with optional width prefix
|
||||
* *fix:* calculate width correctly when wide characters are in **--format** strings
|
||||
* *fix:* add _configure_ script fallback for **--remote** check when cross-compiling ([#120](https://codeberg.org/ivarch/pv/issues/120))
|
||||
* *fix:* allow **extra-display** to be changed by **--remote** ([#123](https://codeberg.org/ivarch/pv/issues/123))
|
||||
* *cleanup:* refactored display formatters into separate functions
|
||||
* *cleanup:* improve format parser handling of dangling or invalid "%" sequences
|
||||
|
||||
### 1.9.7 - 2 December 2024
|
||||
|
||||
* *feature:* new **--extra-display** option to update window and process titles ([#3](https://codeberg.org/ivarch/pv/issues/3), [#4](https://codeberg.org/ivarch/pv/issues/4))
|
||||
* *fix:* correct failure to report file positions in **--watchfd** ([#118](https://codeberg.org/ivarch/pv/issues/118))
|
||||
* *i18n:* Russian translations added
|
||||
* *cleanup:* tests added for **--watchfd** ([#10](https://codeberg.org/ivarch/pv/issues/10))
|
||||
* *cleanup:* worked around file descriptor leak false positives in valgrind 3.23 ([#97](https://codeberg.org/ivarch/pv/issues/97))
|
||||
* *cleanup:* cleared all *shellcheck* warnings in the test scripts
|
||||
* *cleanup:* check at compile-time whether **--remote** is going to be usable ([#119](https://codeberg.org/ivarch/pv/issues/119))
|
||||
|
||||
### 1.9.0 - 15 October 2024
|
||||
|
||||
* *feature:* new **--store-and-forward** option to read input to a file first, then write it to the output ([#100](https://codeberg.org/ivarch/pv/issues/100))
|
||||
* *feature:* new **--stats** option to show transfer stats at the end, like "`ping`" ([#49](https://codeberg.org/ivarch/pv/issues/49))
|
||||
* *feature:* **--rate** can now be used with **--numeric** ([#17](https://codeberg.org/ivarch/pv/issues/17))
|
||||
* *feature:* **--gauge** with **--progress** to show rate gauge when size is unknown ([#46](https://codeberg.org/ivarch/pv/issues/46))
|
||||
* *i18n:* comprehensive German translations update
|
||||
* *i18n:* comprehensive Polish translations update
|
||||
* *i18n:* complete Turkish translations added
|
||||
* *i18n:* complete Czech translations added
|
||||
* *i18n:* updates to French translations
|
||||
* *fix:* resume stopped pipelines when running in the background (part of [#56](https://codeberg.org/ivarch/pv/issues/56))
|
||||
* *fix:* inspect the output pipe buffer to give a more accurate progress indicator of how much the next command has consumed
|
||||
* *fix:* prefix completion time (**--fineta**) with *FIN* rather than *ETA* ([#43](https://codeberg.org/ivarch/pv/issues/43))
|
||||
* *fix:* surround average rate (**--average-rate**) with brackets rather than square brackets
|
||||
* *fix:* correct a memory leak in **--watchfd PID**
|
||||
* *fix:* make **--direct-io** work correctly with **--output** instead of assuming stdout
|
||||
* *fix:* call `posix_fadvise()` on every input, not just the first one
|
||||
* *fix:* write UTC timestamps in debugging mode to avoid lockups in signal handlers
|
||||
* *security:* added a signed *MANIFEST* file to releases
|
||||
* *cleanup:* removed TODO.md, since it's just an outdated copy of the issue tracker
|
||||
* *cleanup:* re-ordered structure members to reduce padding
|
||||
* *cleanup:* improved readability of *SIGTTOU* handling code
|
||||
* *cleanup:* refactored to separate display, transfer, and calculation more cleanly
|
||||
* *cleanup:* instead of moving stderr when backgrounded, set a suspend-output flag
|
||||
|
||||
### 1.8.14 - 7 September 2024
|
||||
|
||||
* *fix:* correct double-free on exit when using **--watchfd** ([#96](https://codeberg.org/ivarch/pv/issues/96)) reported by [jettero](https://codeberg.org/jettero)
|
||||
|
||||
### 1.8.13 - 18 August 2024
|
||||
|
||||
* *feature:* when using **--size @FILE**, *FILE* can be a block device, and its size will be used (pull request [#94](https://codeberg.org/ivarch/pv/pulls/94)) supplied by [alexanderperlis](https://codeberg.org/alexanderperlis)
|
||||
|
||||
### 1.8.12 - 18 July 2024
|
||||
|
||||
* *fix:* correct the detection of output block device size that was broken in 1.8.10 ([#91](https://codeberg.org/ivarch/pv/issues/91))
|
||||
* *fix:* do not treat a zero/interrupted write as an end of file (pull requests [#92](https://codeberg.org/ivarch/pv/pulls/92) and [#93](https://codeberg.org/ivarch/pv/pulls/93))
|
||||
|
||||
### 1.8.10 - 15 June 2024
|
||||
|
||||
* *feature:* new **--output** option to write to a file instead of standard output (pull request [#90](https://codeberg.org/ivarch/pv/pulls/90)) supplied by [xmort](https://codeberg.org/xmort)
|
||||
|
||||
### 1.8.9 - 21 April 2024
|
||||
|
||||
* feature: new "`--si`" option to display and interpret size suffixes in multiples of 1000 rather than 1024 (pull request [#85](https://codeberg.org/a-j-wood/pv/pulls/85)) supplied by [kevinruddy](https://codeberg.org/kevinruddy)
|
||||
* fix: continue producing progress output when the output is blocking writes ([#34](https://codeberg.org/a-j-wood/pv/issues/34), [#86](https://codeberg.org/a-j-wood/pv/issues/86), [#87](https://codeberg.org/a-j-wood/pv/issues/87))
|
||||
* fix: honour the _TMPDIR_ / _TMP_ environment variables again, rather than hard-coding "`/tmp`", when using a terminal lock file (originally removed in 1.8.0) ([#88](https://codeberg.org/a-j-wood/pv/issues/88))
|
||||
* i18n: corrections and missing strings added to French translations (pull request [#83](https://codeberg.org/a-j-wood/pv/pulls/83)) supplied by [Thomas Bertels](https://codeberg.org/tbertels)
|
||||
* *feature:* new **--si** option to display and interpret size suffixes in multiples of 1000 rather than 1024 (pull request [#85](https://codeberg.org/ivarch/pv/pulls/85)) supplied by [kevinruddy](https://codeberg.org/kevinruddy)
|
||||
* *fix:* continue producing progress output when the output is blocking writes ([#34](https://codeberg.org/ivarch/pv/issues/34), [#86](https://codeberg.org/ivarch/pv/issues/86), [#87](https://codeberg.org/ivarch/pv/issues/87))
|
||||
* *fix:* honour the *TMPDIR* / *TMP* environment variables again, rather than hard-coding "`/tmp`", when using a terminal lock file (originally removed in 1.8.0) ([#88](https://codeberg.org/ivarch/pv/issues/88))
|
||||
* *i18n:* corrections and missing strings added to French translations (pull request [#83](https://codeberg.org/ivarch/pv/pulls/83)) supplied by [Thomas Bertels](https://codeberg.org/tbertels)
|
||||
|
||||
### 1.8.5 - 19 November 2023
|
||||
|
||||
* fix: corrected percentage formatting so it doesn't jump from 2 to 3 characters wide at 100% ([#80](https://codeberg.org/a-j-wood/pv/issues/80))
|
||||
* fix: replaced "`--remote`" mechanism, using a temporary file instead of SysV IPC, so it can work reliably even when there are multiple PV instances
|
||||
* fix: corrected compilation failure when without IPC support
|
||||
* security: addressed all issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see "`make analyse`") ([#77](https://codeberg.org/a-j-wood/pv/issues/77))
|
||||
* cleanup: compilation warnings fixed on non-IPC and MacOS systems
|
||||
* *fix:* corrected percentage formatting so it doesn't jump from 2 to 3 characters wide at 100% ([#80](https://codeberg.org/ivarch/pv/issues/80))
|
||||
* *fix:* replaced **--remote** mechanism, using a temporary file instead of SysV IPC, so it can work reliably even when there are multiple PV instances
|
||||
* *fix:* corrected compilation failure when without IPC support
|
||||
* *security:* addressed all issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see "`make analyse`") ([#77](https://codeberg.org/ivarch/pv/issues/77))
|
||||
* *cleanup:* compilation warnings fixed on non-IPC and MacOS systems
|
||||
|
||||
### 1.8.0 - 24 September 2023
|
||||
|
||||
#### Features
|
||||
|
||||
* feature: new "`--discard`" option to discard input as if writing to */dev/null* ([#42](https://codeberg.org/a-j-wood/pv/issues/42))
|
||||
* feature: new "`--error-skip-block`" option to make "`--skip-errors`" skip whole blocks ([#37](https://codeberg.org/a-j-wood/pv/issues/37))
|
||||
* feature: use `posix_fadvise()` like `cat`(1) does, to improve efficiency ([#39](https://codeberg.org/a-j-wood/pv/issues/39))
|
||||
* feature: new "`--enable-static`" option to "`configure`" for static builds ([#75](https://codeberg.org/a-j-wood/pv/pull/75))
|
||||
* *feature:* new **--discard** option to discard input as if writing to */dev/null* ([#42](https://codeberg.org/ivarch/pv/issues/42))
|
||||
* *feature:* new **--error-skip-block** option to make **--skip-errors** skip whole blocks ([#37](https://codeberg.org/ivarch/pv/issues/37))
|
||||
* *feature:* use `posix_fadvise()` like `cat`(1) does, to improve efficiency ([#39](https://codeberg.org/ivarch/pv/issues/39))
|
||||
* *feature:* new **--enable-static** option to "`configure`" for static builds ([#75](https://codeberg.org/ivarch/pv/pull/75))
|
||||
|
||||
#### Security
|
||||
|
||||
* security: with "`--pidfile`", write to a temporary file and rename it into place, to improve security
|
||||
* security: keep self-contained copies of name and format string in PV internal state for memory safety
|
||||
* security: ignore _TMP_ / _TMPDIR_ environment variables when using a terminal lock file
|
||||
* *security:* with **--pidfile**, write to a temporary file and rename it into place, to improve security
|
||||
* *security:* keep self-contained copies of name and format string in PV internal state for memory safety
|
||||
* *security:* ignore *TMP* / *TMPDIR* environment variables when using a terminal lock file
|
||||
|
||||
#### Fixes
|
||||
|
||||
* fix: only report errors about missing files when starting to transfer from them, not while calculating size, and behave more like `cat`(1) by skipping them and moving on
|
||||
* fix: auto-calculate total line count with "`--line-mode`" when all inputs are regular files
|
||||
* fix: use `clock_gettime()` in ETA calculation to cope with machine suspend/resume ([#13](https://codeberg.org/a-j-wood/pv/issues/13))
|
||||
* fix: if "`--width`" or "`--height`" were provided, do not change them when the window size changes ([#36](https://codeberg.org/a-j-wood/pv/issues/36))
|
||||
* fix: when a file descriptor position in "`--watchfd`" moves backwards, show the rate using the correct prefix ([#41](https://codeberg.org/a-j-wood/pv/issues/41))
|
||||
* fix: rewrite terminal state save/restore so state is not intermittently garbled on exit when using "`--cursor`" ([#20](https://codeberg.org/a-j-wood/pv/issues/20)), ([#24](https://codeberg.org/a-j-wood/pv/issues/24))
|
||||
* *fix:* only report errors about missing files when starting to transfer from them, not while calculating size, and behave more like `cat`(1) by skipping them and moving on
|
||||
* *fix:* auto-calculate total line count with **--line-mode** when all inputs are regular files
|
||||
* *fix:* use `clock_gettime()` in ETA calculation to cope with machine suspend/resume ([#13](https://codeberg.org/ivarch/pv/issues/13))
|
||||
* *fix:* if **--width** or **--height** were provided, do not change them when the window size changes ([#36](https://codeberg.org/ivarch/pv/issues/36))
|
||||
* *fix:* when a file descriptor position in **--watchfd** moves backwards, show the rate using the correct prefix ([#41](https://codeberg.org/ivarch/pv/issues/41))
|
||||
* *fix:* rewrite terminal state save/restore so state is not intermittently garbled on exit when using **--cursor** ([#20](https://codeberg.org/ivarch/pv/issues/20)), ([#24](https://codeberg.org/ivarch/pv/issues/24))
|
||||
|
||||
#### Cleanups
|
||||
|
||||
* cleanup: addressed many potential issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see new target "`make analyse`")
|
||||
* cleanup: switched the build system to GNU Automake
|
||||
* cleanup: replaced the test harness with the one native to GNU Automake
|
||||
* cleanup: added a test for terminal width detection to "`make check`"
|
||||
* cleanup: added a test to "`make check`" to ensure that "`make install`" installs everything expected
|
||||
* cleanup: replaced *AC_HEADER_TIOCGWINSZ* with *AC_CHECK_HEADERS(sys/ioctl.h)* for better MacOS compatibility ([#74](https://codeberg.org/a-j-wood/pv/issues/74))
|
||||
* cleanup: with "`--sync`", call `fsync()` instead of `fdatasync()` on incapable systems ([#73](https://codeberg.org/a-j-wood/pv/issues/73))
|
||||
* cleanup: the manual is now a static file instead of needing to be built with "`configure`"
|
||||
* *cleanup:* addressed many potential issues highlighted by the software auditing tools "`splint`" and "`flawfinder`" (see new target "`make analyse`")
|
||||
* *cleanup:* switched the build system to GNU Automake
|
||||
* *cleanup:* replaced the test harness with the one native to GNU Automake
|
||||
* *cleanup:* added a test for terminal width detection to "`make check`"
|
||||
* *cleanup:* added a test to "`make check`" to ensure that "`make install`" installs everything expected
|
||||
* *cleanup:* replaced *AC_HEADER_TIOCGWINSZ* with *AC_CHECK_HEADERS(sys/ioctl.h)* for better MacOS compatibility ([#74](https://codeberg.org/ivarch/pv/issues/74))
|
||||
* *cleanup:* with **--sync**, call `fsync()` instead of `fdatasync()` on incapable systems ([#73](https://codeberg.org/ivarch/pv/issues/73))
|
||||
* *cleanup:* the manual is now a static file instead of needing to be built with "`configure`"
|
||||
|
||||
#### Dropped items
|
||||
|
||||
* dropped: dropped support for "`--enable-static-nls`"
|
||||
* dropped: removed the Linux Software Map file, as the LSM project appears to be long dead
|
||||
* dropped: will no longer publish to SourceForge as it has a chequered history and is unnecessary
|
||||
* dropped: removed project from GitHub and moved to Codeberg - see "[Give Up GitHub](https://giveupgithub.org/)"
|
||||
* *dropped:* dropped support for **--enable-static-nls**
|
||||
* *dropped:* removed the Linux Software Map file, as the LSM project appears to be long dead
|
||||
* *dropped:* will no longer publish to SourceForge as it has a chequered history and is unnecessary
|
||||
* *dropped:* removed project from GitHub and moved to Codeberg - see "[Give Up GitHub](https://giveupgithub.org/)"
|
||||
|
||||
#### Other items
|
||||
|
||||
@@ -61,89 +177,89 @@
|
||||
|
||||
### 1.7.24 - 30 July 2023
|
||||
|
||||
* fix: correct terminal size detection, broken in 1.7.17 by the configuration script rewrite ([#72](https://codeberg.org/a-j-wood/pv/issues/72))
|
||||
* security: removed *DEBUG* environment variable in debug mode, added "`--debug`" instead
|
||||
* cleanup: added "`make analyse`" to run "`splint`" and "`flawfinder`" on all source files
|
||||
* cleanup: corrected detection of boolean capability
|
||||
* cleanup: word wrapping of "`--help`" output is now multi-byte locale aware
|
||||
* cleanup: adjusted "`indent`" rules to line length of 120 and reformatted code
|
||||
* *fix:* correct terminal size detection, broken in 1.7.17 by the configuration script rewrite ([#72](https://codeberg.org/ivarch/pv/issues/72))
|
||||
* *security:* removed *DEBUG* environment variable in debug mode, added **--debug** instead
|
||||
* *cleanup:* added "`make analyse`" to run "`splint`" and "`flawfinder`" on all source files
|
||||
* *cleanup:* corrected detection of boolean capability
|
||||
* *cleanup:* word wrapping of **--help** output is now multi-byte locale aware
|
||||
* *cleanup:* adjusted "`indent`" rules to line length of 120 and reformatted code
|
||||
|
||||
### 1.7.18 - 28 July 2023
|
||||
|
||||
* fix: language file installation had been broken by the configuration script rewrite
|
||||
* *fix:* language file installation had been broken by the configuration script rewrite
|
||||
|
||||
### 1.7.17 - 27 July 2023
|
||||
|
||||
* feature: new "`--sync`" option to flush cache to disk after every write (related to [#6](https://codeberg.org/a-j-wood/pv/issues/6), to improve accuracy when writing to slow disks)
|
||||
* feature: new "`--direct-io`" option to bypass cache - implements [#29 "Option to enable *O_DIRECT*"](https://codeberg.org/a-j-wood/pv/issues/29) - requested by Romain Kang, Jacek Wielemborek
|
||||
* fix: correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates
|
||||
* cleanup: rewrote `configure.in` as per suggestions in newer "`autoconf`" manuals
|
||||
* cleanup: replaced `header.in` with one generated by "`autoheader`", moving custom logic to a separate header file "`config-aux.h`"
|
||||
* cleanup: added copyright notice to all source files as per GNU standards
|
||||
* cleanup: changed "`--version`" output to conform to GNU standards
|
||||
* cleanup: replaced backticks with `$()` in all shell scripts that did not come from elsewhere, as backticks are deprecated and harder to read
|
||||
* cleanup: improved the output formatting of "`make test`"
|
||||
* cleanup: extended the "`make test`" mechanism to allow certain tests to be skipped on platforms that cannot support them
|
||||
* cleanup: skip the "pipe" test (for *SIGPIPE*) if GNU "`head`" is not available, so that "`make test`" on stock OpenBSD 7.3 works
|
||||
* cleanup: added a lot more tests to "`make test`"
|
||||
* cleanup: replace all calls to `sprintf()` and `snprintf()` with a new wrapper function `pv_snprintf()` to improve security and compatibility
|
||||
* cleanup: replace all calls to `strcat()` with a wrapper `pv_strlcat()` to improve security and compatibility
|
||||
* cleanup: replace all `write()` calls to the terminal with a wrapper `pv_write_retry()` for consistency
|
||||
* cleanup: tidy up and fix compilation warning in "`--watchfd`" code
|
||||
* cleanup: rewrote all local shell scripts to pass analysis by [ShellCheck](https://www.shellcheck.net)
|
||||
* *feature:* new **--sync** option to flush cache to disk after every write (related to [#6](https://codeberg.org/ivarch/pv/issues/6), to improve accuracy when writing to slow disks)
|
||||
* *feature:* new **--direct-io** option to bypass cache - implements [#29 "Option to enable O_DIRECT"](https://codeberg.org/ivarch/pv/issues/29) - requested by Romain Kang, Jacek Wielemborek
|
||||
* *fix:* correct byte prefix size to 2 spaces in rate display, so progress display size remains constant at low transfer rates
|
||||
* *cleanup:* rewrote `configure.in` as per suggestions in newer "`autoconf`" manuals
|
||||
* *cleanup:* replaced `header.in` with one generated by "`autoheader`", moving custom logic to a separate header file "`config-aux.h`"
|
||||
* *cleanup:* added copyright notice to all source files as per GNU standards
|
||||
* *cleanup:* changed **--version** output to conform to GNU standards
|
||||
* *cleanup:* replaced backticks with `$()` in all shell scripts that did not come from elsewhere, as backticks are deprecated and harder to read
|
||||
* *cleanup:* improved the output formatting of "`make test`"
|
||||
* *cleanup:* extended the "`make test`" mechanism to allow certain tests to be skipped on platforms that cannot support them
|
||||
* *cleanup:* skip the "pipe" test (for *SIGPIPE*) if GNU "`head`" is not available, so that "`make test`" on stock OpenBSD 7.3 works
|
||||
* *cleanup:* added a lot more tests to "`make test`"
|
||||
* *cleanup:* replace all calls to `sprintf()` and `snprintf()` with a new wrapper function `pv_snprintf()` to improve security and compatibility
|
||||
* *cleanup:* replace all calls to `strcat()` with a wrapper `pv_strlcat()` to improve security and compatibility
|
||||
* *cleanup:* replace all `write()` calls to the terminal with a wrapper `pv_write_retry()` for consistency
|
||||
* *cleanup:* tidy up and fix compilation warning in **--watchfd** code
|
||||
* *cleanup:* rewrote all local shell scripts to pass analysis by [ShellCheck](https://www.shellcheck.net)
|
||||
|
||||
### 1.7.0 - 17 July 2023
|
||||
|
||||
* dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries
|
||||
* feature: the "`--size`" option now accepts "`@filename`" to use the size of another file (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe))
|
||||
* feature: the "`--watchfd`" option is now available on OS X (pull request [#60](https://codeberg.org/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa))
|
||||
* feature: new "`--bits`" option to show bit count instead of byte count (adapted from pull request [#63](https://codeberg.org/a-j-wood/pv/pull/63) supplied by [Nick Black](https://nick-black.com))
|
||||
* feature: new "`--average-rate-window`" option, to set the window over which the average rate is calculated, also used for ETA (modified from pull request [#65](https://codeberg.org/a-j-wood/pv/pull/65) supplied by [lemonsqueeze](https://github.com/lemonsqueeze))
|
||||
* feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://codeberg.org/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty))
|
||||
* fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [#19 "No output in Arch Linux initcpio after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/19), [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31), [#55 "pv Stopped Working in the Background"](https://codeberg.org/a-j-wood/pv/issues/55) (pull request [#64](https://codeberg.org/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo))
|
||||
* fix: workaround for OS X 11 behaviour in configure script regarding stat64 at compile time (pull request [#57](https://codeberg.org/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe))
|
||||
* fix: workaround for macOS equivalence of stat to stat64 - patches from [Filippo Valsorda](https://github.com/FiloSottile) and [Demitri Muna](https://github.com/demitri), correcting [#33 "Fix compilation problems due to `stat64()` on Apple Silicon"](https://codeberg.org/a-j-wood/pv/issues/33)
|
||||
* fix: add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request [#62](https://codeberg.org/a-j-wood/pv/pull/62) supplied by [Volodymyr Bychkovyak](https://github.com/vbychkoviak))
|
||||
* fix: corrected "`--force`" option so it will still output progress when not in the same process group as the owner of the terminal - corrects [#23 "No output with "`-f`" when run in background after 1.6.6"](https://codeberg.org/a-j-wood/pv/issues/23) and helps to correct [#31 "No output written from inside zsh <() construct"](https://codeberg.org/a-j-wood/pv/issues/31)
|
||||
* fix: corrected elapsed time display to show as D:HH:MM:SS after 1 day, like the ETA does - corrects [#16 "Show days in same format in ETA as in elapsed time"](https://codeberg.org/a-j-wood/pv/issues/16)
|
||||
* fix: corrected bug where percentages went down after 100% when in "`--numeric`" mode with a "`--size`" that was too small - corrects [#26 "Correct "`-n`" behaviour when going past 100% of "`-s`" size"](https://codeberg.org/a-j-wood/pv/issues/26)
|
||||
* i18n: recoded Polish translation file to UTF-8
|
||||
* i18n: removed inaccurate fuzzy translation matches
|
||||
* docs: moved all open issues into GitHub and updated the TODO list
|
||||
* docs: renamed README to README.md and altered it to Markdown format
|
||||
* docs: moved contributors from the README to docs/ACKNOWLEDGEMENTS.md
|
||||
* docs: moved TODO to TODO.md and altered it to Markdown format
|
||||
* docs: moved NEWS to NEWS.md, converted it to UTF-8, and altered it to Markdown format
|
||||
* *dropped:* support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries
|
||||
* *feature:* the **--size** option now accepts "`@filename`" to use the size of another file (pull request [#57](https://codeberg.org/ivarch/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe))
|
||||
* *feature:* the **--watchfd** option is now available on OS X (pull request [#60](https://codeberg.org/ivarch/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa))
|
||||
* *feature:* new **--bits** option to show bit count instead of byte count (adapted from pull request [#63](https://codeberg.org/ivarch/pv/pull/63) supplied by [Nick Black](https://nick-black.com))
|
||||
* *feature:* new **--average-rate-window** option, to set the window over which the average rate is calculated, also used for ETA (modified from pull request [#65](https://codeberg.org/ivarch/pv/pull/65) supplied by [lemonsqueeze](https://github.com/lemonsqueeze))
|
||||
* *feature:* the **--watchfd** option will now show relative filenames, if they are under the current directory (pull request [#66](https://codeberg.org/ivarch/pv/pull/66) supplied by [ikasty](https://github.com/ikasty))
|
||||
* *fix:* correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [#19 "No output in Arch Linux initcpio after 1.6.6"](https://codeberg.org/ivarch/pv/issues/19), [#31 "No output written from inside zsh <() construct"](https://codeberg.org/ivarch/pv/issues/31), [#55 "pv Stopped Working in the Background"](https://codeberg.org/ivarch/pv/issues/55) (pull request [#64](https://codeberg.org/ivarch/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo))
|
||||
* *fix:* workaround for OS X 11 behaviour in configure script regarding stat64 at compile time (pull request [#57](https://codeberg.org/ivarch/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe))
|
||||
* *fix:* workaround for macOS equivalence of stat to stat64 - patches from [Filippo Valsorda](https://github.com/FiloSottile) and [Demitri Muna](https://github.com/demitri), correcting [#33 "Fix compilation problems due to `stat64()` on Apple Silicon"](https://codeberg.org/ivarch/pv/issues/33)
|
||||
* *fix:* add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request [#62](https://codeberg.org/ivarch/pv/pull/62) supplied by [Volodymyr Bychkovyak](https://github.com/vbychkoviak))
|
||||
* *fix:* corrected **--force** option so it will still output progress when not in the same process group as the owner of the terminal - corrects [#23 "No output with "-f" when run in background after 1.6.6"](https://codeberg.org/ivarch/pv/issues/23) and helps to correct [#31 "No output written from inside zsh <() construct"](https://codeberg.org/ivarch/pv/issues/31)
|
||||
* *fix:* corrected elapsed time display to show as D:HH:MM:SS after 1 day, like the ETA does - corrects [#16 "Show days in same format in ETA as in elapsed time"](https://codeberg.org/ivarch/pv/issues/16)
|
||||
* *fix:* corrected bug where percentages went down after 100% when in **--numeric** mode with a **--size** that was too small - corrects [#26 "Correct "-n" behaviour when going past 100% of "-s" size"](https://codeberg.org/ivarch/pv/issues/26)
|
||||
* *i18n:* recoded Polish translation file to UTF-8
|
||||
* *i18n:* removed inaccurate fuzzy translation matches
|
||||
* *docs:* moved all open issues into GitHub and updated the TODO list
|
||||
* *docs:* renamed README to README.md and altered it to Markdown format
|
||||
* *docs:* moved contributors from the README to docs/ACKNOWLEDGEMENTS.md
|
||||
* *docs:* moved TODO to TODO.md and altered it to Markdown format
|
||||
* *docs:* moved NEWS to NEWS.md, converted it to UTF-8, and altered it to Markdown format
|
||||
|
||||
### 1.6.20 - 12 September 2021
|
||||
|
||||
* fix: add missing `stddef.h` include to `number.c` (Sam James)
|
||||
* *fix:* add missing `stddef.h` include to `number.c` (Sam James)
|
||||
|
||||
### 1.6.19 - 5 September 2021
|
||||
|
||||
* fix: starting pv in the background no longer immediately stops unless the transfer is to/from the terminal (Andriy Gapon, Jonathan Elchison)
|
||||
* fix: using "`-B`", "`-A`", or "`-T`" now switches on "`-C`" implicitly (Johannes Gerer, André Stapf)
|
||||
* fix: AIX build fixes (Peter Korsgaard)
|
||||
* i18n: updated German "`--help`" translations (Richard Fonfara)
|
||||
* i18n: switched to UTF-8 encoding, added missing translations (de,fr,pt)
|
||||
* docs: new "common switches" manual section (Jacek Wielemborek)
|
||||
* docs: use placeholder instead of `/dev/sda` in the manual (Pranav Peshwe)
|
||||
* docs: mention MacOS pipes and "`-B 1024`" in the manual (Jan Venekamp)
|
||||
* docs: correct shell in `autoconf/scripts/index.sh` (Juan Picca)
|
||||
* cleanup: various compiler warnings cleaned up
|
||||
* *fix:* starting pv in the background no longer immediately stops unless the transfer is to/from the terminal (Andriy Gapon, Jonathan Elchison)
|
||||
* *fix:* using **-B**, **-A**, or **-T** now switches on **-C** implicitly (Johannes Gerer, André Stapf)
|
||||
* *fix:* AIX build fixes (Peter Korsgaard)
|
||||
* *i18n:* updated German **--help** translations (Richard Fonfara)
|
||||
* *i18n:* switched to UTF-8 encoding, added missing translations (de,fr,pt)
|
||||
* *docs:* new "common switches" manual section (Jacek Wielemborek)
|
||||
* *docs:* use placeholder instead of `/dev/sda` in the manual (Pranav Peshwe)
|
||||
* *docs:* mention MacOS pipes and **-B 1024** in the manual (Jan Venekamp)
|
||||
* *docs:* correct shell in `autoconf/scripts/index.sh` (Juan Picca)
|
||||
* *cleanup:* various compiler warnings cleaned up
|
||||
|
||||
Full changelog is below:
|
||||
|
||||
* (r181) added common switches section to manual (Jacek Wielemborek)
|
||||
* (r184) use placeholder instead of /dev/sda in the manual (Pranav Peshwe)
|
||||
* (r185) replace ash with sh in autoconf/scripts/index.sh (Juan Picca)
|
||||
* (r185) added note to manual about "`-B 1024`" in MacOS pipes (Jan Venekamp)
|
||||
* (r185) added note to manual about **-B 1024** in MacOS pipes (Jan Venekamp)
|
||||
* (r185) fix AIX config check when the CWD contains "yes" (Peter Korsgaard)
|
||||
* (r189) (#1556) updated German "`--help`" translations (Richard Fonfara)
|
||||
* (r189) (#1556) updated German **--help** translations (Richard Fonfara)
|
||||
* (r189) updated missing German translations and changed to UTF-8 encoding
|
||||
* (r191) updated missing French translations and changed to UTF-8 encoding
|
||||
* (r193) updated missing Portuguese translations, changed to UTF-8 encoding
|
||||
* (r196) (#1563) using "`-B`", "`-A`", or "`-T`" now switches on "`-C`" implicitly (Johannes Gerer, André Stapf)
|
||||
* (r196) (#1563) using **-B**, **-A**, or **-T** now switches on **-C** implicitly (Johannes Gerer, André Stapf)
|
||||
* (r199) fixed numerous compiler warnings in newer GCC versions
|
||||
* (r200,205) fixed bug where "`pv /dev/zero >/dev/null &`" stopped immediately (Jonathan Elchison, Andriy Gapon)
|
||||
* (r203,205) marked unused arguments with GCC unused attribute, started using boolean data type for flags, corrected more compiler warnings
|
||||
@@ -151,22 +267,22 @@ Full changelog is below:
|
||||
### 1.6.6 - 30 June 2017
|
||||
|
||||
* (r161) use `%llu` instead of `%Lu` for better compatibility (Eric A. Borisch)
|
||||
* (r162) (#1532) fix target buffer size ("`-B`") being ignored (AndCycle, Ilya Basin, Antoine Beaupré)
|
||||
* (r162) (#1532) fix target buffer size (**-B**) being ignored (AndCycle, Ilya Basin, Antoine Beaupré)
|
||||
* (r164) cap read/write sizes, and check elapsed time during read/write cycles, to avoid display hangs with large buffers or slow media; also remove `select()` call from repeated_write function as it slows the transfer down and the wrapping `alarm()` means it is unnecessary
|
||||
* (r169) (#1477) use alternate form for transfer counter, such that 13GB is shown as 13.0GB so it's the same width as 13.1GB (André Stapf)
|
||||
* (r171) cleanup: units corrections in man page, of the form kb -> KiB
|
||||
* (r175) report error in "`-d`" if process fd directory is unreadable, or if process disappears before we start the main loop (Jacek Wielemborek)
|
||||
* (r175) report error in **-d** if process fd directory is unreadable, or if process disappears before we start the main loop (Jacek Wielemborek)
|
||||
|
||||
### 1.6.0 - 15 March 2015
|
||||
|
||||
* fix lstat64 support when unavailable - separate patches supplied by Ganael Laplanche and Peter Korsgaard
|
||||
* (#1506) new option "`-D`" / "`--delay-start`" to only show bar after N seconds (Damon Harper)
|
||||
* new option "`--fineta`" / "`-I`" to show ETA as time of day rather than time remaining - patch supplied by Erkki Seppälä (r147)
|
||||
* (#1509) change ETA ("`--eta`" / "`-e`") so that days are given if the hours remaining are 24 or more (Jacek Wielemborek)
|
||||
* (#1506) new option **-D** / **--delay-start** to only show bar after N seconds (Damon Harper)
|
||||
* new option **--fineta** / **-I** to show ETA as time of day rather than time remaining - patch supplied by Erkki Seppälä (r147)
|
||||
* (#1509) change ETA (**--eta** / **-e**) so that days are given if the hours remaining are 24 or more (Jacek Wielemborek)
|
||||
* (#1499) repeat read and write attempts on partial buffer fill/empty to work around post-signal transfer rate drop reported by Ralf Ramsauer
|
||||
* (#1507) do not try to calculate total size in line mode, due to bug reported by Jacek Wielemborek and Michiel Van Herwegen
|
||||
* cleanup: removed defunct RATS comments and unnecessary copyright notices
|
||||
* clean up displayed lines when using "`--watchfd PID`", when PID exits
|
||||
* clean up displayed lines when using **--watchfd PID**, when PID exits
|
||||
* output errors on a new line to avoid overwriting transfer bar
|
||||
|
||||
### 1.5.7 - 26 August 2014
|
||||
@@ -182,25 +298,25 @@ Full changelog is below:
|
||||
|
||||
### 1.5.2 - 10 February 2014
|
||||
|
||||
* allow "`--watchfd`" to look at block devices
|
||||
* let "`--watchfd PID:FD`" work with "`--size N`"
|
||||
* allow **--watchfd** to look at block devices
|
||||
* let **--watchfd PID:FD** work with **--size N**
|
||||
* moved contributors out of the manual as the list was too long (NB everyone is still listed in the README and always will be)
|
||||
|
||||
### 1.5.1 - 23 January 2014
|
||||
|
||||
* new option "`--watchfd`" - suggested by Jacek Wielemborek and "fdwatch"
|
||||
* new option **--watchfd** - suggested by Jacek Wielemborek and "fdwatch"
|
||||
* use non-block flag with `splice()`
|
||||
* new display option "`--buffer-percent`", suggested by Kim Krecht
|
||||
* new display option "`--last-written`", suggested by Kim Krecht
|
||||
* new transfer option "`--no-splice`"
|
||||
* new display option **--buffer-percent**, suggested by Kim Krecht
|
||||
* new display option **--last-written**, suggested by Kim Krecht
|
||||
* new transfer option **--no-splice**
|
||||
* fix for minor bug which dropped display elements after one empty one
|
||||
* fix for single fd leak on exit (Cristian Ciupitu)
|
||||
|
||||
### 1.4.12 - 5 August 2013
|
||||
|
||||
* new option "`--null`" - patch supplied by Zing Shishak
|
||||
* new option **--null** - patch supplied by Zing Shishak
|
||||
* AIX build fix (add "`-lc128`") - with help from Pawel Piatek
|
||||
* AIX "`-c`" fixes - with help from Pawel Piatek
|
||||
* AIX **-c** fixes - with help from Pawel Piatek
|
||||
* SCO build fix (`po2table.sh`) - reported by Wouter Pronk
|
||||
* test scripts fix for older distributions - patch from Bryan Dongray
|
||||
* fix for `splice()` not using stdin - patch from Zev Weiss
|
||||
@@ -211,41 +327,41 @@ Full changelog is below:
|
||||
|
||||
### 1.4.5 - 10 January 2013
|
||||
|
||||
* updated manual page to show known problem with "`-R`" on Cygwin
|
||||
* updated manual page to show known problem with **-R** on Cygwin
|
||||
|
||||
### 1.4.4 - 11 December 2012
|
||||
|
||||
* added debugging, see "`pv -h`" when `configure` is run with "`--enable-debugging`"
|
||||
* added debugging, see "`pv -h`" when `configure` is run with **--enable-debugging**
|
||||
* rewrote cursor positioning code used when IPC is unavailable (Cygwin)
|
||||
* fixed cursor positioning cursor read answerback problem (Cygwin/Solaris)
|
||||
* fixed bug causing crash when progress displayed with too-small terminal
|
||||
|
||||
### 1.4.0 - 6 December 2012
|
||||
|
||||
* new option "`--skip-errors`" commissioned by Jim Salter
|
||||
* new option **--skip-errors** commissioned by Jim Salter
|
||||
* if stdout is a block device, and we don't know the total size, use the size of that block device as the total (Peter Samuelson)
|
||||
* new option "`--stop-at-size`" to stop after "`--size`" bytes
|
||||
* new option **--stop-at-size** to stop after **--size** bytes
|
||||
* report correct filename on read errors
|
||||
* fix use-after-free bug in remote PID cleanup code
|
||||
* refactored large chunks of code to make it more readable and to replace most static variables with a state structure
|
||||
|
||||
### 1.3.9 - 5 November 2012
|
||||
|
||||
* allow "`--format`" parameters to be sent with "`--remote`"
|
||||
* configure option "`--disable-ipc`"
|
||||
* added tests for "`--numeric`" with "`--timer`" and "`--bytes`"
|
||||
* added tests for "`--remote`"
|
||||
* allow **--format** parameters to be sent with **--remote**
|
||||
* configure option **--disable-ipc**
|
||||
* added tests for **--numeric** with **--timer** and **--bytes**
|
||||
* added tests for **--remote**
|
||||
|
||||
### 1.3.8 - 29 October 2012
|
||||
|
||||
* new "`--pidfile`" option to save process ID to a file
|
||||
* integrated patch for "`--numeric`" with "`--timer`" and "`--bytes`" (Sami Liedes)
|
||||
* removed signalling from "`--remote`" to prevent accidental process kills
|
||||
* new "`--format`" option (originally Vladimir Pal / Vladimir Ermakov)
|
||||
* new **--pidfile** option to save process ID to a file
|
||||
* integrated patch for **--numeric** with **--timer** and **--bytes** (Sami Liedes)
|
||||
* removed signalling from **--remote** to prevent accidental process kills
|
||||
* new **--format** option (originally Vladimir Pal / Vladimir Ermakov)
|
||||
|
||||
### 1.3.4 - 27 June 2012
|
||||
|
||||
* new "`--disable-splice`" configure script option
|
||||
* new **--disable-splice** configure script option
|
||||
* fixed line mode size count with multiple files (Moritz Barsnick)
|
||||
* fixes for AIX core dumps (Pawel Piatek)
|
||||
|
||||
@@ -268,10 +384,10 @@ Full changelog is below:
|
||||
|
||||
### 1.2.0 - 14 December 2010
|
||||
|
||||
* integrated improved SI prefixes and "`--average-rate`" (Henry Gebhardt)
|
||||
* integrated improved SI prefixes and **--average-rate** (Henry Gebhardt)
|
||||
* return nonzero if exiting due to *SIGTERM* (Martin Baum)
|
||||
* patch from Phil Rutschman to restore terminal properly on exit
|
||||
* fix i18n especially for "`--help`" (Sebastian Kayser)
|
||||
* fix i18n especially for **--help** (Sebastian Kayser)
|
||||
* refactored `pv_display`
|
||||
* we now have a coherent, documented, exit status
|
||||
* modified pipe test and new cksum test from Sebastian Kayser
|
||||
@@ -285,13 +401,13 @@ Full changelog is below:
|
||||
* patch from Elias Pipping correcting compilation failure on Darwin 9
|
||||
* patch from Patrick Collison correcting similar problems on OS X
|
||||
* trap *SIGINT* / *SIGHUP* / *SIGTERM* so we clean up IPCs on exit (Laszlo Ersek)
|
||||
* abort if numeric option, eg "`-L`", has non-numeric value (Boris Lohner)
|
||||
* abort if numeric option, eg **-L**, has non-numeric value (Boris Lohner)
|
||||
|
||||
### 1.1.0 - 30 August 2007
|
||||
|
||||
* new option "`--remote`" ("`-R`") to control an already-running process
|
||||
* new option "`--line-mode`" ("`-l`") to count lines instead of bytes
|
||||
* fix for "`-L`" to be less resource intensive
|
||||
* new option **--remote** (**-R**) to control an already-running process
|
||||
* new option **--line-mode** (**-l**) to count lines instead of bytes
|
||||
* fix for **-L** to be less resource intensive
|
||||
* fix for input/output equivalence check on Mac OS X
|
||||
* fix for size calculation in pipelines on Mac OS X
|
||||
* fixed "`make uninstall`"
|
||||
@@ -300,7 +416,7 @@ Full changelog is below:
|
||||
### 1.0.1 - 4 August 2007
|
||||
|
||||
* licensing change from Artistic to Artistic 2.0
|
||||
* removed the "`-l`" / "`--license`" option
|
||||
* removed the **-l** / **--license** option
|
||||
|
||||
### 1.0.0 - 2 August 2007
|
||||
|
||||
@@ -310,7 +426,7 @@ Full changelog is below:
|
||||
|
||||
### 0.9.9 - 5 February 2007
|
||||
|
||||
* new option "`--buffer-size`" ("`-B`") suggested by Mark Tomich
|
||||
* new option **--buffer-size** (**-B**) suggested by Mark Tomich
|
||||
* build fix: HP/UX largefile compile fix from Timo Savinen
|
||||
* maintain better buffer filling during transfers
|
||||
* workaround: "`pv /dev/zero | dd bs=1M count=1k`" bug (reported by Gert Menke)
|
||||
@@ -319,7 +435,7 @@ Full changelog is below:
|
||||
### 0.9.6 - 27 February 2006
|
||||
|
||||
* bugfix: `key_t` incompatibility with Cygwin
|
||||
* bugfix: interval ("`-i`") parameter parses numbers after decimal point
|
||||
* bugfix: interval (**-i**) parameter parses numbers after decimal point
|
||||
* build fix: use static NLS if `msgfmt` is unavailable
|
||||
* on the final update, blank out the now-zero ETA
|
||||
|
||||
@@ -337,7 +453,7 @@ Full changelog is below:
|
||||
|
||||
### 0.8.9 - 6 November 2004
|
||||
|
||||
* decimal values now accepted for rate and size, eg "`-L 1.23M`"
|
||||
* decimal values now accepted for rate and size, eg **-L 1.23M**
|
||||
* code cleanup
|
||||
* developers: "`make help`" now lists Makefile targets
|
||||
|
||||
@@ -347,9 +463,9 @@ Full changelog is below:
|
||||
|
||||
### 0.8.5 - 2 May 2004
|
||||
|
||||
* cursor positioning ("`-c`") reliability improved on systems with IPC
|
||||
* cursor positioning (**-c**) reliability improved on systems with IPC
|
||||
* minor fix: made test 005 more reliable
|
||||
* new option "`--height`" ("`-H`")
|
||||
* new option **--height** (**-H**)
|
||||
|
||||
### 0.8.2 - 24 April 2004
|
||||
|
||||
@@ -358,7 +474,7 @@ Full changelog is below:
|
||||
|
||||
### 0.8.1 - 19 April 2004
|
||||
|
||||
* bugfix in cursor positioning ("`-c`")
|
||||
* bugfix in cursor positioning (**-c**)
|
||||
|
||||
### 0.8.0 - 12 February 2004
|
||||
|
||||
@@ -370,7 +486,7 @@ Full changelog is below:
|
||||
### 0.7.0 - 8 February 2004
|
||||
|
||||
* display buffer management fixes (thanks Cédric Delfosse)
|
||||
* replaced "`--enable-debug`" with "`--enable-debugging`" and "`--enable-profiling`"
|
||||
* replaced **--enable-debug** with **--enable-debugging** and **--enable-profiling**
|
||||
|
||||
### 0.6.4 - 14 January 2004
|
||||
|
||||
@@ -434,11 +550,11 @@ Full changelog is below:
|
||||
|
||||
* allow decimal interval values, eg 0.1, 0.5, etc
|
||||
* some simple tests added ("`make check`")
|
||||
* smoother throughput limiting ("`--rate-limit`"), now done in 0.1sec chunks
|
||||
* bounds-check interval values ("`-i`") - max update interval now 10 minutes
|
||||
* smoother throughput limiting (**--rate-limit**), now done in 0.1sec chunks
|
||||
* bounds-check interval values (**-i**) - max update interval now 10 minutes
|
||||
* more reliable non-blocking output to keep display updated
|
||||
* no longer rely on `atoll()`
|
||||
* don't output final blank line if "`--numeric`"
|
||||
* don't output final blank line if **--numeric**
|
||||
* use `fcntl()` instead of `flock()` for Solaris compatibility
|
||||
|
||||
### 0.3.0 - 25 November 2002
|
||||
@@ -451,11 +567,11 @@ Full changelog is below:
|
||||
* we now ignore *EINTR* on `select()`
|
||||
* variable-size buffer (still need to add code to change size)
|
||||
* added (tentative) support for internationalisation
|
||||
* removed superfluous "`--no-progress`", etc options
|
||||
* removed superfluous **--no-progress**, etc options
|
||||
* optimised transfer by using bigger buffers, based on `st_blksize`
|
||||
* added "`--wait`" option to wait until transfer begins before showing progress
|
||||
* added "`--rate-limit`" option to limit rate to a maximum throughput
|
||||
* added "`--quiet`" option (no output at all) to be used with "`--rate-limit`"
|
||||
* added **--wait** option to wait until transfer begins before showing progress
|
||||
* added **--rate-limit** option to limit rate to a maximum throughput
|
||||
* added **--quiet** option (no output at all) to be used with **--rate-limit**
|
||||
|
||||
### 0.2.5 - 23 July 2002
|
||||
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
Things still to do. (#n) indicates the issue tracker number.
|
||||
|
||||
* ([#3](https://codeberg.org/a-j-wood/pv/issues/3)) Option ("`-x`"?) to use xterm title line for status (Joachim Haga)
|
||||
* ([#4](https://codeberg.org/a-j-wood/pv/issues/4)) Option for process title (Martin Sarsale) as "`pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s`"
|
||||
* ([#9](https://codeberg.org/a-j-wood/pv/issues/9)) Option to switch rate to per minute if really slow
|
||||
* ([#10](https://codeberg.org/a-j-wood/pv/issues/10)) Add watchfd tests
|
||||
* ([#11](https://codeberg.org/a-j-wood/pv/issues/11)) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek)
|
||||
* ([#12](https://codeberg.org/a-j-wood/pv/issues/12)) Allow multiple "`-d`" options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek)
|
||||
* ([#15](https://codeberg.org/a-j-wood/pv/issues/15)) Use Unicode for more granular progress bar (Alexander Petrossian)
|
||||
* ([#17](https://codeberg.org/a-j-wood/pv/issues/17)) Allow "`-r`" with "`-l`" and "`-n`" to output lines/sec (Roland Kletzing)
|
||||
* ([#22](https://codeberg.org/a-j-wood/pv/issues/22)) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022)
|
||||
* ([#25](https://codeberg.org/a-j-wood/pv/issues/25)) Normalise progress to 100% on overrun (Andrej Gantvorg)
|
||||
* ([#35](https://codeberg.org/a-j-wood/pv/issues/35)) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020)
|
||||
* ([#38](https://codeberg.org/a-j-wood/pv/issues/38)) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019)
|
||||
* ([#40](https://codeberg.org/a-j-wood/pv/issues/40)) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020)
|
||||
* ([#43](https://codeberg.org/a-j-wood/pv/issues/43)) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017)
|
||||
* ([#45](https://codeberg.org/a-j-wood/pv/issues/45)) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019)
|
||||
* ([#46](https://codeberg.org/a-j-wood/pv/issues/46)) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019)
|
||||
* ([#47](https://codeberg.org/a-j-wood/pv/issues/47)) Analyse splice and buffer usage to improve performance
|
||||
* ([#48](https://codeberg.org/a-j-wood/pv/issues/48)) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021)
|
||||
* ([#49](https://codeberg.org/a-j-wood/pv/issues/49)) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer)
|
||||
* ([#50](https://codeberg.org/a-j-wood/pv/issues/50)) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011)
|
||||
* ([#54](https://codeberg.org/a-j-wood/pv/issues/54)) Run command every n percent ([haarp](https://github.com/haarp))
|
||||
* ([#56](https://codeberg.org/a-j-wood/pv/issues/56)) Support for backgrounding pv, and allowing it to be monitored separately ([jimbobmcgee](https://github.com/jimbobmcgee))
|
||||
* ([#67](https://codeberg.org/a-j-wood/pv/issues/67)) Wrap another process to monitor its stdin & stdout ([Alex Mason](https://github.com/axman6))
|
||||
* ([#76](https://codeberg.org/a-j-wood/pv/issues/76)) Provide a way to test translations without installing
|
||||
* ([#81](https://codeberg.org/a-j-wood/pv/issues/81)) Keep last output on terminal when "pv -d" is done
|
||||
|
||||
Any assistance would be appreciated.
|
||||
@@ -35,5 +35,3 @@ for ((buffer=100; buffer<=1000; buffer+=100)); do
|
||||
echo -e "${buffer}\t${rate}\t${rdata}\t${wdata}"
|
||||
done
|
||||
done
|
||||
|
||||
# EOF
|
||||
|
||||
Executable
+149
@@ -0,0 +1,149 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Usage: sh build-package.sh source-1.2.3.tar.gz
|
||||
#
|
||||
# Given a tar.gz, build a package for the current OS.
|
||||
#
|
||||
# Supports these packaging types:
|
||||
#
|
||||
# .deb (Debian, Ubuntu, etc) - requires dpkg-dev, debhelper
|
||||
# .rpm (AlmaLinux, Rocky Linux, OpenSUSE etc) - requires rpmbuild
|
||||
#
|
||||
# If the MAINTAINER environment variable is set, this is used as a GPG key
|
||||
# ID for package signing.
|
||||
#
|
||||
# The packages built with this script are not "official", in that they are
|
||||
# not part of any Linux distribution and may not follow the distribution's
|
||||
# policies. Use at your own risk.
|
||||
#
|
||||
# Copyright 2024-2025 Andrew Wood
|
||||
# License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
|
||||
sourceArchive="$1"
|
||||
test -n "${sourceArchive}" && test -f "${sourceArchive}" \
|
||||
|| { printf "%s: %s: %s\n" "${0##*/}" "${sourceArchive}" "source archive not found" 1>&2; exit 1; }
|
||||
|
||||
packageName="pv"
|
||||
packageSummary="Shell pipeline element to meter data passing through"
|
||||
packageDescription="\
|
||||
pv (Pipe Viewer) can be inserted into any normal pipeline between two
|
||||
processes to give a visual indication of how quickly data is passing
|
||||
through, how long it has taken, how near to completion it is, and an
|
||||
estimate of how long it will be until completion."
|
||||
packageUrl="https://ivarch.com/p/pv"
|
||||
sourceUrl="https://ivarch.com/programs/sources/${packageName}-%{version}.tar.gz"
|
||||
packageEmail="Andrew Wood <pv@ivarch.com>"
|
||||
|
||||
workDir="$(mktemp -d)" || exit 1
|
||||
trap 'rm -rf "${workDir}"' EXIT
|
||||
|
||||
# Infer the version from the most recent NEWS entry.
|
||||
version="$(tar xzf "${sourceArchive}" --wildcards -O '*/docs/NEWS.md' 2>/dev/null | awk '/^### [0-9]/{print $2}' | sed -n 1p)"
|
||||
|
||||
if command -v rpmbuild >/dev/null 2>&1; then
|
||||
# Build an RPM.
|
||||
cat > "${workDir}"/spec <<EOF
|
||||
Summary: ${packageSummary}
|
||||
Name: ${packageName}
|
||||
Version: ${version}
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
Source: ${sourceUrl}
|
||||
Url: ${packageUrl}
|
||||
|
||||
%description
|
||||
${packageDescription}
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
test -n "\${RPM_BUILD_ROOT}" && test "\${RPM_BUILD_ROOT}" != '/' && rm -rf "\${RPM_BUILD_ROOT}"
|
||||
make install DESTDIR="\${RPM_BUILD_ROOT}"
|
||||
rm -rf "\${RPM_BUILD_ROOT}/usr/share/doc"
|
||||
%find_lang %{name}
|
||||
|
||||
%check
|
||||
make check SKIP_VALGRIND_TESTS=1
|
||||
|
||||
%clean
|
||||
test -n "\${RPM_BUILD_ROOT}" && test "\${RPM_BUILD_ROOT}" != '/' && rm -rf "\${RPM_BUILD_ROOT}"
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-, root, root)
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
||||
|
||||
%doc README.md docs/NEWS.md docs/ACKNOWLEDGEMENTS.md docs/COPYING
|
||||
|
||||
%changelog
|
||||
* $(date '+%a %b %d %Y') ${packageEmail} - ${version}-1
|
||||
- Package built from main source.
|
||||
EOF
|
||||
mkdir "${workDir}/SOURCES"
|
||||
cp "${sourceArchive}" "${workDir}/SOURCES/${packageName}-${version}.tar.gz"
|
||||
rpmbuild -D "%_topdir ${workDir}" -bb "${workDir}/spec" || exit 1
|
||||
if test -n "${MAINTAINER}"; then
|
||||
# Sign the RPMs.
|
||||
rpm -D "%_gpg_name ${MAINTAINER}" --addsign "${workDir}/RPMS"/*/*.rpm || exit 1
|
||||
fi
|
||||
cp -v "${workDir}/RPMS"/*/*.rpm .
|
||||
fi
|
||||
|
||||
if command -v dpkg-buildpackage >/dev/null 2>&1; then
|
||||
# Build a Debian package.
|
||||
mkdir "${workDir}/build" "${workDir}/build/debian" "${workDir}/build/debian/source"
|
||||
|
||||
tar xzf "${sourceArchive}" -C "${workDir}/build" --strip-components=1
|
||||
|
||||
printf "%s\n" "10" > "${workDir}/build/debian/compat"
|
||||
touch "${workDir}/build/debian/copyright"
|
||||
printf "%s\n" "3.0 (quilt)" > "${workDir}/build/debian/source/format"
|
||||
|
||||
cat > "${workDir}/build/debian/rules" <<EOF
|
||||
#!/usr/bin/make -f
|
||||
export DH_VERBOSE = 1
|
||||
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
|
||||
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
|
||||
|
||||
%:
|
||||
dh \$@
|
||||
EOF
|
||||
chmod 700 "${workDir}/build/debian/rules"
|
||||
|
||||
cat > "${workDir}/build/debian/control" <<EOF
|
||||
Source: ${packageName}
|
||||
Maintainer: ${packageEmail}
|
||||
Section: misc
|
||||
Priority: optional
|
||||
Standards-Version: 3.9.2
|
||||
Build-Depends: debhelper (>= 9)
|
||||
|
||||
Package: ${packageName}
|
||||
Architecture: any
|
||||
Depends: \${misc:Depends}
|
||||
Description: ${packageSummary}
|
||||
$(printf "%s\n.\n" "${packageDescription}" | sed 's,^, ,')
|
||||
EOF
|
||||
|
||||
cat > "${workDir}/build/debian/changelog" <<EOF
|
||||
${packageName} (${version}-1) UNRELEASED; urgency=low
|
||||
|
||||
* Package built from main source.
|
||||
|
||||
-- ${packageEmail} $(date -R)
|
||||
EOF
|
||||
|
||||
if test -n "${MAINTAINER}"; then
|
||||
(cd "${workDir}/build" && dpkg-buildpackage --build=binary --force-sign --sign-key="${MAINTAINER}") || exit 1
|
||||
else
|
||||
(cd "${workDir}/build" && dpkg-buildpackage --build=binary) || exit 1
|
||||
fi
|
||||
|
||||
cp -v "${workDir}"/*.deb . || exit 1
|
||||
fi
|
||||
+504
-282
File diff suppressed because it is too large
Load Diff
Executable
+217
@@ -0,0 +1,217 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Automate a portion of the release checklist. Expects to be run from a
|
||||
# build directory, such as one in which "configure" has been run, i.e.
|
||||
# there should be a Makefile present.
|
||||
#
|
||||
# Requires "parmo" (https://ivarch.com/p/parmo); builds for all targets that
|
||||
# parmo supports.
|
||||
#
|
||||
# All of the release artefacts are placed in a "PV-RELEASE-x" directory,
|
||||
# where "x" is the version.
|
||||
#
|
||||
# Copyright 2024-2025 Andrew Wood
|
||||
# License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
|
||||
srcdir="$(awk '/^VPATH/{print $NF}' < Makefile | sed -n 1p)"
|
||||
manuals="$(find "${srcdir}/docs" -mindepth 1 -maxdepth 1 -type f -name "*.[0-9]" -printf "%f\n")"
|
||||
mainProgram="$(awk '/^[a-z]+_PROGRAMS/{print $3}' Makefile |cut -d '$' -f 1 | sed -n 1p)"
|
||||
labTestScript="${srcdir}/docs/test-on-vm-lab.sh"
|
||||
|
||||
status () {
|
||||
test -n "$*" && printf "\n"
|
||||
printf '\e]0;%s\007\r' "$*" >&2
|
||||
if test -n "$*"; then
|
||||
tput rev >&2
|
||||
printf " -- %s -- " "$*" >&2
|
||||
tput sgr0 >&2
|
||||
printf "\n\n"
|
||||
fi
|
||||
}
|
||||
|
||||
possiblyDie () {
|
||||
printf "\n" >&2
|
||||
tput bold >&2
|
||||
printf "%s: %s\n" "release" "$*" >&2
|
||||
tput sgr0 >&2
|
||||
printf "\n%s\n" "Type 'y' and hit Enter to continue anyway."
|
||||
read -r line
|
||||
test "${line}" = "y" || { status ""; exit 1; }
|
||||
}
|
||||
|
||||
test -e "${labTestScript}" || labTestScript=""
|
||||
|
||||
# The checklist is re-ordered a little so that we defer making changes (like
|
||||
# "make indent") until as late as possible, in case any checks fail.
|
||||
|
||||
status "Initial checks"
|
||||
|
||||
# Check MAINTAINER is provided.
|
||||
test -n "${MAINTAINER}" || possiblyDie "environment variable MAINTAINER is empty"
|
||||
|
||||
# * Check that _po/POTFILES.in_ is up to date
|
||||
if test -d "${srcdir}/po"; then
|
||||
inFile="$(sort < "${srcdir}/po/POTFILES.in")"
|
||||
realList="$(find "${srcdir}" -name "*.c" -printf "%P\n" | sort)"
|
||||
test "${inFile}" = "${realList}" || possiblyDie "po/POTFILES.in is incorrect"
|
||||
fi
|
||||
|
||||
status "Initial build"
|
||||
make || possiblyDie "failed 'make'"
|
||||
|
||||
# * Run "_make analyse_" and see whether remaining warnings can be addressed
|
||||
status "Source analysis"
|
||||
make analyse || possiblyDie "failed 'make analyse'"
|
||||
|
||||
# * Version bump and documentation checks:
|
||||
|
||||
status "Version checks"
|
||||
|
||||
# * Check that _docs/NEWS.md_ is up to date
|
||||
sed -n 1p docs/NEWS.md | grep -Fqi unreleased && possiblyDie "NEWS.md says 'unreleased' on line 1"
|
||||
versionInNews="$(awk 'FNR==1{print $2}' "${srcdir}/docs/NEWS.md")"
|
||||
printf "%s\n" "${versionInNews}" | grep -Eq '^[0-9]' || possiblyDie "version in NEWS.md (${versionInNews}) is not numeric"
|
||||
|
||||
# * Check the version in both _configure.ac_ and _docs/NEWS.md_ was updated
|
||||
versionInConfig="$(grep ^AC_INIT "${srcdir}/configure.ac" | cut -d '[' -f 3 | cut -d ']' -f 1)"
|
||||
test "${versionInConfig}" = "${versionInNews}" || possiblyDie "version in configure.ac (${versionInConfig}) mismatches NEWS.md (${versionInNews})"
|
||||
|
||||
# * Check that the manuals are up to date
|
||||
for manPage in ${manuals}; do
|
||||
versionInManual="$(awk 'FNR==1 {print $5}' "${srcdir}/docs/${manPage}" | cut -d - -f 2)"
|
||||
test "${versionInManual}" = "${versionInNews}" || possiblyDie "version in ${manPage} (${versionInManual}) mismatches NEWS.md (${versionInNews})"
|
||||
done
|
||||
|
||||
# * Check that the program version is correct
|
||||
versionInVersionOutput="$(./"${mainProgram}" --version | awk 'FNR==1{print $NF}')"
|
||||
test "${versionInVersionOutput}" = "${versionInNews}" || possiblyDie "version in '${mainProgram} --version' (${versionInVersionOutput}) mismatches NEWS.md (${versionInNews})"
|
||||
|
||||
# * Check that the year displayed by --version is correct
|
||||
yearInVersion="$(./"${mainProgram}" --version | awk '/^Copyright/{print $2}')"
|
||||
yearNow="$(date '+%Y')"
|
||||
test "${yearInVersion}" = "${yearNow}" || possiblyDie "the year in '--version' (${yearInVersion}) is not this year (${yearNow})"
|
||||
|
||||
# * Make the Markdown version of the manuals and, if using VPATH, copy the result to the source directory
|
||||
# We also wipe everything in "docs" so we don't accidentally package
|
||||
# leftover working files.
|
||||
|
||||
status "Markdown manual"
|
||||
|
||||
rm -f docs/*
|
||||
for manPage in ${manuals}; do
|
||||
make "docs/${manPage}.md"
|
||||
cp "docs/${manPage}.md" "${srcdir}/docs/${manPage}.md"
|
||||
done
|
||||
|
||||
# * Run "_make indent; make indent indentclean check_"
|
||||
status "Reformat source"
|
||||
make indent
|
||||
make indent indentclean
|
||||
# The check will run later as part of "make distcheck".
|
||||
|
||||
# * Run "_make -C po update-po_"
|
||||
status "Update po files"
|
||||
if test -d "${srcdir}/po"; then
|
||||
make -C po update-po || possiblyDie "update-po failed"
|
||||
fi
|
||||
|
||||
# * Run "_autoreconf_" in the source directory
|
||||
status "Run autoreconf"
|
||||
(cd "${srcdir}" && autoreconf -is) || possiblyDie "autoreconf failed"
|
||||
|
||||
# * Ensure everything has been committed to the repository
|
||||
status "Commit check"
|
||||
gitStatus="$(cd "${srcdir}" && git status --porcelain=v1)" || possiblyDie "failed to run 'git status'"
|
||||
test -z "${gitStatus}" || possiblyDie "not everything is committed - 'git status' is not empty"
|
||||
|
||||
# * Consistency and build checks:
|
||||
# * Wipe the build directory, and run "_configure_" there
|
||||
# * Run "_make distcheck_"
|
||||
# * Run "_make release MAINTAINER=<signing-user>_"
|
||||
# NB "make release" implies "make distcheck".
|
||||
# We set SKIP_VALGRIND_TESTS=1 because the full tests will run in the lab
|
||||
# check.
|
||||
status "Release archive"
|
||||
workDir="$(mktemp -d)" || possiblyDie "mktemp failed"
|
||||
trap 'chmod -R u+w "${workDir}"; rm -rf "${workDir}"' EXIT
|
||||
(
|
||||
cd "${workDir}" || exit 1
|
||||
sh "${srcdir}/configure" || exit 1
|
||||
make -j8 release SKIP_VALGRIND_TESTS=1 || exit 1
|
||||
exit 0
|
||||
) || possiblyDie "failed on 'make release'"
|
||||
|
||||
sourceArchive="$(find "${workDir}" -mindepth 1 -maxdepth 1 -type f -name "*.tar.gz")"
|
||||
test -e "${sourceArchive}.asc" || possiblyDie "release was not signed"
|
||||
|
||||
# * Run "_./configure && make check_" on all test systems, using the _tar.gz_ that was just created
|
||||
# * Run a cross-compilation check
|
||||
if test -n "${labTestScript}"; then
|
||||
status "Lab test"
|
||||
sh "${labTestScript}" "${sourceArchive}" || possiblyDie "lab test failed"
|
||||
fi
|
||||
|
||||
# * Update the project web site:
|
||||
# * Copy the release _.tar.gz_, _.txt_, and _.asc_ files to the web site
|
||||
# * Use "_pandoc --from markdown --to html_" to convert the news and manual to HTML
|
||||
status "Release dir"
|
||||
releaseDir="PV-RELEASE-${versionInNews}"
|
||||
rm -rf "${releaseDir}"
|
||||
mkdir "${releaseDir}"
|
||||
cp "${sourceArchive}" "${sourceArchive}.asc" "${sourceArchive}.txt" "${releaseDir}/" || possiblyDie "failed to copy release files"
|
||||
|
||||
status "HTML docs"
|
||||
for manPage in ${manuals}; do
|
||||
pandoc --from markdown --to html --shift-heading-level-by=1 < "${srcdir}/docs/${manPage}.md" > "${releaseDir}/${manPage}.html"
|
||||
done
|
||||
pandoc --from markdown --to html < "${srcdir}/docs/NEWS.md" > "${releaseDir}/news.html"
|
||||
|
||||
# Build OS packages.
|
||||
buildTargets=$(parmo targets)
|
||||
if test -n "${MAINTAINER}"; then
|
||||
gpg --export-secret-key --armor "${MAINTAINER}" > "${workDir}/signing-key" \
|
||||
|| possiblyDie 'failed to export signing key'
|
||||
fi
|
||||
for buildTarget in ${buildTargets}; do
|
||||
status "Package: ${buildTarget}"
|
||||
buildOK=true
|
||||
rm -rf "${workDir}/package"
|
||||
mkdir "${workDir}/package"
|
||||
if test -s "${workDir}/signing-key"; then
|
||||
parmo --key "${workDir}/signing-key" --source "${sourceArchive}" --destination "${workDir}/package" --target "${buildTarget}" build-package \
|
||||
|| possiblyDie "${buildTarget}: build failed"
|
||||
else
|
||||
parmo --source "${sourceArchive}" --destination "${workDir}/package" --target "${buildTarget}" build-package \
|
||||
|| possiblyDie "${buildTarget}: build failed"
|
||||
fi
|
||||
find "${workDir}/package" -type f \
|
||||
| while read -r packageFile; do
|
||||
destinationFile="${releaseDir}/${packageFile##*/}"
|
||||
case "${destinationFile}" in
|
||||
*.deb) destinationFile="${destinationFile%.deb}_${buildTarget}.deb" ;;
|
||||
*.txt) destinationFile="" ;;
|
||||
esac
|
||||
test -n "${destinationFile}" || continue
|
||||
cp "${packageFile}" "${destinationFile}"
|
||||
chmod 644 "${destinationFile}"
|
||||
done
|
||||
done
|
||||
|
||||
find "${releaseDir}/" -type f -exec chmod 644 '{}' ';'
|
||||
find "${releaseDir}/" -type d -exec chmod 755 '{}' ';'
|
||||
|
||||
status "Done"
|
||||
|
||||
cat <<EOF
|
||||
|
||||
Files are under: ${releaseDir}/
|
||||
|
||||
Still to do:
|
||||
* Update the news and manual on the web site
|
||||
* Update the version numbers on the web site
|
||||
* Update the package index on the web site
|
||||
* Create a new release in the repository, and apply the associated tag
|
||||
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
Executable
+343
@@ -0,0 +1,343 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run "make check" from a source tarball, on a whole lab of VMs.
|
||||
#
|
||||
# The source tarball should contain a directory; this directory must contain
|
||||
# a "configure" script. After running "configure", this script calls "make"
|
||||
# and then "make check", from a build subdirectory.
|
||||
#
|
||||
# Hostnames need to be listed on the command line after the tarball, or in
|
||||
# ~/.config/lab-hosts. They need to be reachable over SSH with no password.
|
||||
#
|
||||
# Cross-compilation is performed if the hostname is of the form "x:y", where
|
||||
# "x" is a target like "arm-linux-gnueabi", and "y" is the name of a host of
|
||||
# that architecture. The package is built locally with "--host=x" and the
|
||||
# result is copied to "y" and "make check" is run.
|
||||
#
|
||||
# Displays progress to the terminal and produces a tarball of results. In
|
||||
# the results, the file "latest-status.txt" contains the last status
|
||||
# display, and there is a directory for each host. The directories contain
|
||||
# SCW metrics files plus "output.log" (timestamped), "raw-output.log"
|
||||
# (without timestamps), "framework-output.log" (messages from this script),
|
||||
# and the "config.log", "test-suite.log", and "tests/" from the build area.
|
||||
#
|
||||
# Requires "scw" (https://ivarch.com/p/scw).
|
||||
#
|
||||
# Copyright 2024-2025 Andrew Wood
|
||||
# License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
#
|
||||
# Version: 0.0.1 / 16 Dec 2024
|
||||
|
||||
# Number of tests to run in parallel on each host.
|
||||
concurrency="1"
|
||||
|
||||
# Run a build and check, according to these environment variables:
|
||||
#
|
||||
# sourceArchive local source tarball path
|
||||
# buildHost where to build, or "" for local
|
||||
# checkHost where to test, or "" for local
|
||||
# remoteBuildDir temp directory for remote build or check
|
||||
# localBuildDir temp directory for local build
|
||||
# configureArguments extra "configure" script arguments
|
||||
#
|
||||
# Does not return - always exits.
|
||||
#
|
||||
# Expects to be run under SCW, so writes status to fd 3.
|
||||
#
|
||||
testRunner () {
|
||||
printf '%s %s\n' 'notice' 'creating build area' >&3
|
||||
if test -n "${buildHost}"; then
|
||||
ssh "${buildHost}" mkdir "${remoteBuildDir}" || exit 1
|
||||
else
|
||||
mkdir "${localBuildDir}" || exit 1
|
||||
fi
|
||||
printf '%s %s\n' 'ok' 'created build area' >&3
|
||||
|
||||
if test -n "${checkHost}"; then
|
||||
printf '%s %s\n' 'notice' 'creating check area' >&3
|
||||
ssh "${checkHost}" mkdir "${remoteBuildDir}" || exit 1
|
||||
printf '%s %s\n' 'ok' 'created check area' >&3
|
||||
fi
|
||||
|
||||
printf '%s %s\n' 'notice' 'copying source archive' >&3
|
||||
if test -n "${buildHost}"; then
|
||||
scp "${sourceArchive}" "${buildHost}:${remoteBuildDir}/" || exit 1
|
||||
elif test -n "${checkHost}"; then
|
||||
scp "${sourceArchive}" "${checkHost}:${remoteBuildDir}/" || exit 1
|
||||
fi
|
||||
printf '%s %s\n' 'ok' 'source archive copied' >&3
|
||||
|
||||
printf '%s %s\n' 'notice' 'extracting source archive' >&3
|
||||
if test -n "${buildHost}"; then
|
||||
ssh "${buildHost}" tar xzf "${remoteBuildDir}/${sourceArchive##*/}" -C "${remoteBuildDir}" || exit $?
|
||||
else
|
||||
tar xzf "${sourceArchive}" -C "${localBuildDir}" || exit $?
|
||||
ssh "${checkHost}" tar xzf "${remoteBuildDir}/${sourceArchive##*/}" -C "${remoteBuildDir}" || exit $?
|
||||
fi
|
||||
printf '%s %s\n' 'ok' 'source archive extracted' >&3
|
||||
|
||||
stepResult="ok"
|
||||
if test -n "${buildHost}"; then
|
||||
printf '%s %s\n' 'notice' 'configuring' >&3
|
||||
ssh "${buildHost}" "cd \"${remoteBuildDir}\" && mkdir BUILD && cd BUILD && ../*/configure ${configureArguments}" || exit $?
|
||||
else
|
||||
printf '%s %s\n' 'notice' 'configuring locally' >&3
|
||||
( cd "${localBuildDir}" && mkdir BUILD && cd BUILD && ../*/configure ${configureArguments} ) || exit $?
|
||||
printf '%s %s\n' 'notice' "configuring on ${checkHost}" >&3
|
||||
ssh "${checkHost}" "cd \"${remoteBuildDir}\" && mkdir BUILD && cd BUILD && ../*/configure" \
|
||||
|| { stepResult="warning"; printf '%s %s\n' 'warning' "configuration failed on ${checkHost}" >&3; }
|
||||
fi
|
||||
printf '%s %s\n' "${stepResult}" 'configuration completed' >&3
|
||||
|
||||
printf '%s %s\n' 'notice' 'building' >&3
|
||||
if test -n "${buildHost}"; then
|
||||
ssh "${buildHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency}" || exit $?
|
||||
else
|
||||
make -j${concurrency} -C "${localBuildDir}/BUILD" || exit $?
|
||||
fi
|
||||
printf '%s %s\n' 'ok' 'build completed' >&3
|
||||
|
||||
if test -n "${buildHost}"; then
|
||||
printf '%s %s\n' 'notice' 'testing' >&3
|
||||
ssh "${buildHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency} check" || exit $?
|
||||
printf '%s %s\n' 'ok' 'testing completed' >&3
|
||||
elif test -n "${checkHost}"; then
|
||||
printf '%s %s\n' 'notice' "transferring build to ${checkHost}" >&3
|
||||
tar cvf "${localBuildDir}/build.tar" -C "${localBuildDir}" BUILD || exit $?
|
||||
scp "${localBuildDir}/build.tar" "${checkHost}:${remoteBuildDir}/build.tar" || exit $?
|
||||
ssh "${checkHost}" "tar xf \"${remoteBuildDir}/build.tar\" -C \"${remoteBuildDir}\"" || exit $?
|
||||
printf '%s %s\n' 'ok' "transferred build to ${checkHost}" >&3
|
||||
printf '%s %s\n' 'notice' "testing on ${checkHost}" >&3
|
||||
ssh "${checkHost}" "cd \"${remoteBuildDir}/BUILD\" && make -j${concurrency} check-TESTS XCTEST=1" || exit $?
|
||||
printf '%s %s\n' 'ok' 'testing completed' >&3
|
||||
fi
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
# Using directory $1 for metrics and output, run the remaining arguments as
|
||||
# a command using "scw" to capture metrics and record logs.
|
||||
#
|
||||
recordCommand () {
|
||||
targetDir="$1"
|
||||
shift
|
||||
mkdir -p "${targetDir}"
|
||||
scw -c /dev/null \
|
||||
-s UserConfigFile=/dev/null \
|
||||
-s ItemsDir=/dev/null \
|
||||
-s MetricsDir="${targetDir}" \
|
||||
-s CheckLockFile="${targetDir}/.widelock" \
|
||||
-s OutputMap= \
|
||||
-s OutputMap="OES stamped ${targetDir}/output.log" \
|
||||
-s OutputMap="OES raw ${targetDir}/raw-output.log" \
|
||||
-s Command="$*" \
|
||||
run item
|
||||
}
|
||||
|
||||
if test "$1" = "--testRunner"; then
|
||||
testRunner
|
||||
exit 1
|
||||
fi
|
||||
|
||||
labHosts="$(grep -v '^#' ~/.config/lab-hosts 2>/dev/null)"
|
||||
|
||||
workDir=$(mktemp -d) || exit 1
|
||||
trap 'rm -rf "${workDir}"' EXIT
|
||||
|
||||
sourceArchive="$1"
|
||||
shift
|
||||
hostList="$*"
|
||||
test -n "${hostList}" || hostList="${labHosts}"
|
||||
|
||||
test -n "${sourceArchive}" || { echo "Usage: ${0##*/} TARBALL [HOST...]"; exit 1; }
|
||||
test -s "${sourceArchive}" || { echo "${sourceArchive}: not found"; exit 1; }
|
||||
|
||||
attrBold="$(tput bold 2>/dev/null)"
|
||||
attrUnderline="$(tput smul 2>/dev/null)"
|
||||
attrRed="$(tput setaf 1 2>/dev/null)"
|
||||
attrGreen="$(tput setaf 2 2>/dev/null)"
|
||||
attrYellow="$(tput setaf 3 2>/dev/null)"
|
||||
attrBlue="$(tput setaf 4 2>/dev/null)"
|
||||
attrMagenta="$(tput setaf 5 2>/dev/null)"
|
||||
attrCyan="$(tput setaf 6 2>/dev/null)"
|
||||
attrWhite="$(tput setaf 7 2>/dev/null)"
|
||||
attrNone="$(tput sgr0 2>/dev/null)"
|
||||
|
||||
dateStamp="$(date +%Y%m%d-%H%M)"
|
||||
resultsArchive="result-${dateStamp}.tar.gz"
|
||||
|
||||
startEpoch="$(date +%s)"
|
||||
|
||||
|
||||
for hostSpec in ${hostList}; do
|
||||
localTestDir="${workDir}/${hostSpec}"
|
||||
remoteBuildDir="test-${dateStamp}.$(date +%s).$$"
|
||||
buildHost="${hostSpec}"
|
||||
checkHost=""
|
||||
configureArguments=""
|
||||
|
||||
xcFor="${hostSpec%:*}"
|
||||
xcRunOn="${hostSpec#*:}"
|
||||
|
||||
if ! test "${xcFor}" = "${xcRunOn}"; then
|
||||
localTestDir="${workDir}/${xcFor}-${xcRunOn}"
|
||||
buildHost=""
|
||||
checkHost="${xcRunOn}"
|
||||
configureArguments="--host ${xcFor}"
|
||||
fi
|
||||
|
||||
mkdir "${localTestDir}"
|
||||
printf "%s\n" "${hostSpec}" > "${localTestDir}/hostSpec"
|
||||
|
||||
localBuildDir="${localTestDir}/XC"
|
||||
|
||||
(
|
||||
flock -x 3
|
||||
|
||||
export sourceArchive buildHost checkHost remoteBuildDir localBuildDir configureArguments
|
||||
recordCommand "${localTestDir}" "sh \"$0\" --testRunner" 3<&-
|
||||
|
||||
exec >>"${localTestDir}/output.log" 2>&1
|
||||
|
||||
printf '*** %s\n' 'retrieving build and test artefacts'
|
||||
mkdir "${localTestDir}/tests"
|
||||
if test -n "${buildHost}"; then
|
||||
scp "${buildHost}:${remoteBuildDir}/BUILD/config.log" "${localTestDir}/"
|
||||
scp "${buildHost}:${remoteBuildDir}/BUILD/test-suite.log" "${localTestDir}/"
|
||||
scp "${buildHost}:${remoteBuildDir}/BUILD/tests/*" "${localTestDir}/tests/"
|
||||
elif test -n "${checkHost}"; then
|
||||
scp "${checkHost}:${remoteBuildDir}/BUILD/config.log" "${localTestDir}/"
|
||||
scp "${checkHost}:${remoteBuildDir}/BUILD/test-suite.log" "${localTestDir}/"
|
||||
scp "${checkHost}:${remoteBuildDir}/BUILD/tests/*" "${localTestDir}/tests/"
|
||||
fi
|
||||
|
||||
printf '*** %s\n' 'removing build area'
|
||||
rm -rf "${localBuildDir}"
|
||||
if test -n "${buildHost}"; then
|
||||
ssh "${buildHost}" rm -rf "${remoteBuildDir}"
|
||||
elif test -n "${checkHost}"; then
|
||||
ssh "${checkHost}" rm -rf "${remoteBuildDir}"
|
||||
fi
|
||||
|
||||
printf '\n'
|
||||
|
||||
flock -u 3
|
||||
) > "${localTestDir}/framework-output.log" 2>&1 3>>"${localTestDir}/active" &
|
||||
done
|
||||
|
||||
sleep 0.1
|
||||
|
||||
allTestHostDirs="$(find "${workDir}" -mindepth 1 -maxdepth 1 -name "[0-9A-Za-z_]*" -type d -printf "%f\n" | sort)"
|
||||
|
||||
hostCount=0
|
||||
for testHostDir in ${allTestHostDirs}; do hostCount=$((1+hostCount)); done
|
||||
exitedCount=0
|
||||
overallStatus=""
|
||||
|
||||
while test "${exitedCount}" -lt "${hostCount}"; do
|
||||
width="$(tput cols 2>/dev/null)"
|
||||
test -n "${width}" || width=80
|
||||
|
||||
currentEpoch="$(date +%s)"
|
||||
elapsedSeconds=$((currentEpoch-startEpoch))
|
||||
|
||||
{
|
||||
nameWidth=0
|
||||
runningCount=0
|
||||
failedCount=0
|
||||
passedCount=0
|
||||
exitedCount=0
|
||||
overallStatus=""
|
||||
for testHostDir in ${allTestHostDirs}; do
|
||||
hostSpec="${testHostDir}"
|
||||
{ read -r hostSpec < "${workDir}/${testHostDir}/hostSpec"; } 2>/dev/null
|
||||
test "${#hostSpec}" -gt "${nameWidth}" && nameWidth="${#hostSpec}"
|
||||
|
||||
exec 3>>"${workDir}/${testHostDir}/active"
|
||||
flock -x -n 3 && exitedCount=$((1+exitedCount))
|
||||
exec 3<&-
|
||||
|
||||
test -e "${workDir}/${testHostDir}/ended" || runningCount=$((1+runningCount))
|
||||
if test -e "${workDir}/${testHostDir}/failed"; then
|
||||
overallStatus="FAIL"
|
||||
failedCount=$((1+failedCount))
|
||||
elif test -e "${workDir}/${testHostDir}/succeeded"; then
|
||||
test -z "${overallStatus}" && overallStatus="PASS"
|
||||
passedCount=$((1+passedCount))
|
||||
fi
|
||||
done
|
||||
test -n "${overallStatus}" || overallStatus="----"
|
||||
|
||||
printf "%sT+%04d - %s%s\n\n" "${attrUnderline}" "${elapsedSeconds}" "$(date '+%Y-%m-%d %H:%M:%S')" "${attrNone}"
|
||||
|
||||
for testHostDir in ${allTestHostDirs}; do
|
||||
hostSpec="${testHostDir}"
|
||||
{ read -r hostSpec < "${workDir}/${testHostDir}/hostSpec"; } 2>/dev/null
|
||||
|
||||
lastStatusWord="-"
|
||||
lastStatusMessage="-"
|
||||
{ read -r lastStatusWord lastStatusMessage < "${workDir}/${testHostDir}/last-status"; } 2>/dev/null
|
||||
|
||||
lastLine="-"
|
||||
test -s "${workDir}/${testHostDir}/output.log" && lastLine="$(tail -n 1 "${workDir}/${testHostDir}/output.log" 2>/dev/null | expand)"
|
||||
|
||||
testResult="----"
|
||||
test -e "${workDir}/${testHostDir}/failed" && testResult="FAIL"
|
||||
test -e "${workDir}/${testHostDir}/succeeded" && testResult="PASS"
|
||||
|
||||
remainingWidth=$((width-nameWidth-20))
|
||||
statusWidth=$((remainingWidth*2/3))
|
||||
test "${statusWidth}" -gt 40 && statusWidth=40
|
||||
lastLineWidth=$((remainingWidth-statusWidth))
|
||||
|
||||
printf " %s%${nameWidth}s%s " "${attrBold}${attrYellow}" "${hostSpec}" "${attrNone}"
|
||||
case "${testResult}" in
|
||||
"PASS") printf "%s%s%s" "${attrBold}${attrGreen}" "PASS" "${attrNone}" ;;
|
||||
"FAIL") printf "%s%s%s" "${attrBold}${attrRed}" "FAIL" "${attrNone}" ;;
|
||||
*) printf "%s" "----"
|
||||
esac
|
||||
|
||||
case "${lastStatusWord}" in
|
||||
"(begin)"|"begin") printf " (%s%s%s) " "${attrBold}${attrMagenta}" "begin" "${attrNone}" ;;
|
||||
"(end)"|"end") printf " (%s%s%s) " "${attrBold}${attrMagenta}" "end" "${attrNone}" ;;
|
||||
"(notice)"|"notice") printf " (%s%s%s) " "${attrBold}${attrCyan}" "notice" "${attrNone}" ;;
|
||||
"(ok)"|"ok") printf " (%s%s%s) " "${attrBold}${attrGreen}" "ok" "${attrNone}" ;;
|
||||
"(warning)"|"warning") printf " (%s%s%s)" "${attrBold}${attrYellow}" "warning" "${attrNone}" ;;
|
||||
"(error)"|"error") printf " (%s%s%s) " "${attrBold}${attrRed}" "error" "${attrNone}" ;;
|
||||
*) printf " %7s " ""; lastStatusMessage="${lastStatusWord} ${lastStatusMessage}" ;;
|
||||
esac
|
||||
printf " %s%-${statusWidth}.${statusWidth}s%s" "${attrWhite}" "${lastStatusMessage}" "${attrNone}"
|
||||
printf " %s%-${lastLineWidth}.${lastLineWidth}s%s" "${attrBlue}" "${lastLine}" "${attrNone}"
|
||||
printf "\n"
|
||||
done
|
||||
|
||||
printf "\n%s%s%s " "${attrBold}" "Overall status:" "${attrNone}"
|
||||
case "${overallStatus}" in
|
||||
"PASS") printf "%s%s%s" "${attrBold}${attrGreen}" "PASS" "${attrNone}" ;;
|
||||
"FAIL") printf "%s%s%s" "${attrBold}${attrRed}" "FAIL" "${attrNone}" ;;
|
||||
*) printf "%s" "----"
|
||||
esac
|
||||
|
||||
printf " %s%s%s " "${attrBold}" "Running,Passed,Failed:" "${attrNone}"
|
||||
printf "%sR%d%s" "${attrBold}${attrMagenta}" "${runningCount}" "${attrNone}"
|
||||
printf ",%sP%d%s" "${attrBold}${attrGreen}" "${passedCount}" "${attrNone}"
|
||||
printf ",%sF%d%s" "${attrBold}${attrRed}" "${failedCount}" "${attrNone}"
|
||||
printf " = %d" "${hostCount}"
|
||||
printf "\n\n"
|
||||
} > "${workDir}/latest-status.txt"
|
||||
|
||||
cat "${workDir}/latest-status.txt"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
endEpoch="$(date +%s)"
|
||||
elapsedSeconds=$((endEpoch-startEpoch))
|
||||
|
||||
printf '%s\n' 'Generating results archive'
|
||||
tar czf "${resultsArchive}" -C "${workDir}" .
|
||||
|
||||
printf '%s: %d%s\n' 'Total time taken' "${elapsedSeconds}" "s"
|
||||
printf '%s: %s\n' 'Results archive' "${resultsArchive}"
|
||||
|
||||
test "${overallStatus}" = "PASS" || exit 1
|
||||
@@ -1,4 +1,9 @@
|
||||
cs
|
||||
de
|
||||
es
|
||||
fi
|
||||
fr
|
||||
pl
|
||||
pt
|
||||
ru
|
||||
tr
|
||||
|
||||
@@ -4,11 +4,27 @@ src/main/main.c
|
||||
src/main/options.c
|
||||
src/main/remote.c
|
||||
src/main/version.c
|
||||
src/pv/calc.c
|
||||
src/pv/cursor.c
|
||||
src/pv/display.c
|
||||
src/pv/elapsedtime.c
|
||||
src/pv/file.c
|
||||
src/pv/format/averagerate.c
|
||||
src/pv/format/barstyle.c
|
||||
src/pv/format/bufferpercent.c
|
||||
src/pv/format/bytes.c
|
||||
src/pv/format/eta.c
|
||||
src/pv/format/fineta.c
|
||||
src/pv/format/lastwritten.c
|
||||
src/pv/format/name.c
|
||||
src/pv/format/previousline.c
|
||||
src/pv/format/progressbar.c
|
||||
src/pv/format/rate.c
|
||||
src/pv/format/sgr.c
|
||||
src/pv/format/timer.c
|
||||
src/pv/loop.c
|
||||
src/pv/number.c
|
||||
src/pv/proctitle.c
|
||||
src/pv/signal.c
|
||||
src/pv/state.c
|
||||
src/pv/string.c
|
||||
|
||||
@@ -0,0 +1,588 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2024-10-13 20:43+0000\n"
|
||||
"Last-Translator: mmatous <mmatous@users.noreply.translate.codeberg.org>\n"
|
||||
"Language-Team: Czech <https://translate.codeberg.org/projects/pv/pv/cs/>\n"
|
||||
"Language: cs\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 5.7.2\n"
|
||||
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "ukaž indikátor průběhu"
|
||||
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "ukaž uběhlý čas"
|
||||
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "ukaž přibližný zbývající čas"
|
||||
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "ukaž přibližný čas dokončení"
|
||||
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "ukaž okamžitou rychlost přenosu dat"
|
||||
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr "ukaž průměrnou rychlost přenosu dat"
|
||||
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "ukaž počet přenesených bajtů"
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "ukaž procento využité vyrovnávací paměti"
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr "ČÍS"
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "zobraz ČÍS posledních zapsaných bajtů"
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr "FORMÁT"
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "nastav formát výstupu na FORMÁT"
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "vypisuj procenta, ne vizuální informace"
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "nevypisuj žádné informace o přenosu"
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "ukaž počet přenesených bitů"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "zacházej se suffixy jako s násobky 1000 namísto 1024"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "nic nevypisuj, dokud není přenesen první byte"
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "SEK"
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "nic nevypisuj, dokud neuplyne SEK sekund"
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr "VEL"
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "nastav očekávanou velikost dat na VEL bajtů"
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr "pokud je velikost neznámá, ukaž rychlost vs maximální rychlost"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "počítej řádky místo bajtů"
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "řádky jsou zakončené nulovým znakem"
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "aktualizuj každých SEK sekund"
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr "počítej průměrnou rychlost za posledních SEK sekund (výchozí: 30)"
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr "ŠÍŘ"
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "předpokládej šířku terminálu ŠÍŘ znaků"
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr "VÝŠ"
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "předpokládej výšku terminálu VÝŠ znaků"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr "JMÉNO"
|
||||
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "přidej JMÉNO před vizuální informace"
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "po dokončení vypiš údaje o přenosu"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "vypisuj výstup i pokud standardní chybový výstup není terminál"
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "pozicuj kurzor pomocí řídících znaků"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr "SOUBOR"
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "zapiš výstup do SOUBORu namísto standardního výstupu"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "RYCH"
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "omez přenosovou rychlost na RYCH bajtů za sekundu"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr "BAJT"
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "použij vyrovnávací pamět BAJT bajtů"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "nepoužívej splice(), vždy použij read/write"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "ignoruj chyby při čtení vstupu"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "přeskakuj chyby v blocích BAJTů naráz"
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "zastav po přenosu --size bajtů"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "po každém zápisu vyprázdni cache na disk"
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "použij přímý V/V k obejítí cache"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "zahoď vstup namísto zápisu na výstup"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr "zapiš veškerý vstup do SOUBORu před výpisem na výstup"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "sleduj soubor DS otevřený procesem PID"
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "aktualizuj nastavení procesu PID"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "ulož id procesu do SOUBORu"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "ukaž pomoc a skonči"
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "ukaž informace o verzi a skonči"
|
||||
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr "zapiš ladící záznamy do SOUBORu"
|
||||
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Použití: %s [VOLBY] [SOUBOR]..."
|
||||
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"Spoj SOUBOR(y) nebo standardní vstup na standardního výstup, s monitoringem."
|
||||
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Prosím, hlašte veškeré chyby na: %s"
|
||||
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(vstup)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "selhala alokace stavu"
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "očekáváno ID procesu nebo dvojice PID:DS"
|
||||
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "neplatné ID procesu"
|
||||
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "nebylo možné zjistit informace o souboru"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "je adresář"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "selhalo vytváření jména pro soubor v sysfs"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "selhalo čtení velikosti souboru v sysfs"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "selhalo otevření blokového zařízení"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "selhalo zjištění velikosti blokového zařízení"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "selhala alokace struktury pro volby"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "selhala alokace struktury pro argv"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "očekáván celočíselný argument"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "očekáván číselný argument"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Zkuste `%s --help' pro více informací."
|
||||
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Zkuste `%s --h' pro více informací."
|
||||
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
"při sledování deskriptorů souborů nelze použít řádkový mód nebo volby pro "
|
||||
"modifikaci přenosu"
|
||||
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr "při sledování deskriptorů souborů nelze pozicování kurzoru použít"
|
||||
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr "při sledování deskriptorů souborů nelze použít vzdálené ovládání"
|
||||
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr "při sledování deskriptorů souborů nelze použít přenos souborů"
|
||||
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "není dostupné na systémech bez /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "zpráva nepřijata"
|
||||
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "SA_SIGINFO není na tomto systému podporováno"
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr "Licence: GPLv3+ <https://jxself.org/translations/gpl-3.cz.shtml>"
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr "Toto je svobodný software; můžete ho volně měnit a šířit."
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr "Na program se nevztahuje ŽÁDNÁ ZÁRUKA, v míře povolené zákonem."
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr "Stránka projektu"
|
||||
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "selhalo zjištění názvu terminálu"
|
||||
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "selhalo otevření zámkového souboru"
|
||||
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "selhal pokus o uzamčení"
|
||||
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "selhalo otevření terminálu"
|
||||
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr "yzafpnum kMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr "yzafpnum KMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "selhala alokace vyrovnávací paměti"
|
||||
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr "selhalo posunutí za začátek výstupu"
|
||||
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "selhalo zavření souboru"
|
||||
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "selhalo čtení ze souboru"
|
||||
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "selhalo zjištění informací o výstupním souboru"
|
||||
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "vstupní soubor je výstupní soubor"
|
||||
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr "(žádný)"
|
||||
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr "(stdin)"
|
||||
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "b/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "b"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "FIN"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "rychlost min/avg/max/std"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "rychlost neměřena"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr "pid"
|
||||
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "ds"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr "selhala alokace struktury historie"
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr "selhala alokace seznamu souborů"
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "čtení selhalo"
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "varování: detekovány chyby při čtení"
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr "souborem nelze procházet"
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr "selhal skok za chybu"
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr "chyba přeskočena"
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr "vyrovnávací paměť není alokována"
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr "selhalo nastavení intervalového časovače"
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr "selhalo vynulování intervalového časovače"
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr "selhala alokace vyrovnávací paměti pro pozici v řádcích"
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "zápis selhal"
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "selhalo volání select"
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "není obyčejný soubor nebo blokové zařízení"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "PID[:DS]"
|
||||
@@ -1,9 +1,15 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
|
||||
"POT-Creation-Date: 2024-04-21 14:15+0100\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2025-01-14 20:39+0000\n"
|
||||
"Last-Translator: Benny <benny@users.noreply.translate.codeberg.org>\n"
|
||||
"Language-Team: German <https://translate.codeberg.org/projects/pv/pv/de/>\n"
|
||||
"Language: de\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 5.9.2\n"
|
||||
"Date: 1999-06-01 15:18:29+0100\n"
|
||||
"From: Andrew Wood <ivarch@ubik>\n"
|
||||
"Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-"
|
||||
@@ -20,471 +26,586 @@ msgstr ""
|
||||
"nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-"
|
||||
"compat.c\n"
|
||||
|
||||
#: src/main/help.c:284
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "Fortschritts-Anzeige"
|
||||
|
||||
#: src/main/help.c:287
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "zeige die verstrichene Zeit an"
|
||||
|
||||
#: src/main/help.c:290
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "zeige die erwartete Zeit bis zum Ende an"
|
||||
|
||||
#: src/main/help.c:293
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "zeige die absolute geschätzte Zeit bis zur Fertigstellung"
|
||||
|
||||
#: src/main/help.c:296
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "zeige die Datentransferrate an"
|
||||
|
||||
#: src/main/help.c:299
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr ""
|
||||
msgstr "zeige die durchschnittliche Übertragungsrate"
|
||||
|
||||
#: src/main/help.c:301 src/main/help.c:332 src/main/help.c:344
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:305
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "zeige die Anzahl von Bytes, die transferiert worden sind"
|
||||
msgstr "zeige die Anzahl der übertragenen Bytes"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "zeige, wie viel Prozent des Übertragungsbuffers in Benutzung sind"
|
||||
|
||||
#: src/main/help.c:316
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
msgstr "NUM"
|
||||
|
||||
#: src/main/help.c:317
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "NUM zeige die zuletzt geschriebenen NUM Bytes"
|
||||
|
||||
#: src/main/help.c:319
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
msgstr "FORMAT"
|
||||
|
||||
#: src/main/help.c:320
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "setze das Ausgabeformat auf FORMAT"
|
||||
|
||||
#: src/main/help.c:323
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "Ausgabe von Prozent-Angaben statt visueller Darstellung"
|
||||
|
||||
#: src/main/help.c:326
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "sämtliche Transferinformationen unterdrücken"
|
||||
|
||||
#: src/main/help.c:330
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "zeige die Anzahl der übertragenen Bits"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "behandle Endungen als Vielfache von 1000 statt von 1024"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "keine Ausgabe bevor das erste Byte übertragen wurde"
|
||||
|
||||
#: src/main/help.c:333
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "SEK"
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "SEC nichts anzeigen, bis SEC Sekunden vergangen sind"
|
||||
msgstr "nichts anzeigen ehe SEK Sekunden vergangen sind"
|
||||
|
||||
#: src/main/help.c:335
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr ""
|
||||
msgstr "GRÖẞE"
|
||||
|
||||
#: src/main/help.c:336
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "setze erwartete Datenlänge auf SIZE Byte"
|
||||
|
||||
#: src/main/help.c:339
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr "zeige Rate vs maximale Rate, falls die größe unbekannt ist"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "zähle Zeilen anstelle von Bytes"
|
||||
|
||||
#: src/main/help.c:342
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "Zeilen sind nullterminiert"
|
||||
|
||||
#: src/main/help.c:345
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "aktualisiere Ausgabe nach SEC Sekunden Intervall"
|
||||
msgstr "aktualisiere Ausgabe nach SEK Sekunden Intervall"
|
||||
|
||||
#: src/main/help.c:347
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
"berechne die durchschnittliche Übertragungsrate über die letzten SEK "
|
||||
"Sekunden (Standard 30s)"
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr ""
|
||||
msgstr "BREITE"
|
||||
|
||||
#: src/main/help.c:348
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "setze Terminal-Breite auf WIDTH Zeichen"
|
||||
msgstr "setze Terminal-Breite auf BREITE Zeichen"
|
||||
|
||||
#: src/main/help.c:350
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr ""
|
||||
msgstr "HÖHE"
|
||||
|
||||
#: src/main/help.c:351
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "setze Terminal-Höhe auf HEIGHT Zeichen"
|
||||
msgstr "setze Terminal-Höhe auf HÖHE Zeichen"
|
||||
|
||||
#: src/main/help.c:353
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr ""
|
||||
msgstr "NAME"
|
||||
|
||||
#: src/main/help.c:354
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "setze den NAMEn für visuelle Darstellung"
|
||||
|
||||
#: src/main/help.c:357
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr "Stil"
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr "setze die voreingestellte Darstellung auf NAME"
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr "STIL"
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr "Fortschritt auch an SPEC senden"
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "Übertragungsstatistiken am Ende ausgeben"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr ""
|
||||
"Ausgabe auch dann erzwingen, wenn der Fehlerausgabe-Kanal kein Terminal ist"
|
||||
|
||||
#: src/main/help.c:360
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "benutze Escape-Sequenzen zur Cursor-Positionierung"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr "DATEI"
|
||||
|
||||
#: src/main/help.c:364
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "schreibe die Ausgabe in DATEI statt in die Standardausgabe"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "RATE"
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "beschränke die Transferrate auf RATE Byte pro Sekunde"
|
||||
|
||||
#: src/main/help.c:366 src/main/help.c:375
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
msgstr "BYTES"
|
||||
|
||||
#: src/main/help.c:367
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "BYTES benutze einen Puffer in der Größe von BYTES"
|
||||
msgstr "benutze einen Puffer in der Größe von BYTES"
|
||||
|
||||
#: src/main/help.c:370
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "anstelle von splice() immer read/write benutzen"
|
||||
|
||||
#: src/main/help.c:373
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "Lesefehler in der Eingabe nicht beachten"
|
||||
|
||||
#: src/main/help.c:376
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
msgstr "bei Fehlern BYTES am Stück überspringen"
|
||||
|
||||
#: src/main/help.c:379
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "anhalten, nachdem --size Bytes übertragen wurden"
|
||||
|
||||
#: src/main/help.c:382
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
msgstr "schreibe den Cache nach jedem Schreibvorgang auf die Festplatte"
|
||||
|
||||
#: src/main/help.c:385
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "verwende direkte E/A, um den Cache zu umgehen"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:388
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "verwirf die Eingabe anstatt in die Ausgabe zu schreiben"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr "Ausgabe nach FILE schrieben bevor sie ausgegeben wird"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:391
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:392
|
||||
msgid "update settings of process PID"
|
||||
msgstr "Einstellungen der Prozess-PID updaten"
|
||||
|
||||
#: src/main/help.c:396 src/main/help.c:411
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:397
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "Prozess-ID in FILE speichern"
|
||||
|
||||
#: src/main/help.c:400
|
||||
msgid "PID[:FD]"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:401
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "die vom Prozess PID geöffnete Datei FD beobachten"
|
||||
|
||||
#: src/main/help.c:405
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "Einstellungen der Prozess-PID updaten"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "Prozess-ID in DATEI speichern"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "zeige diese Hilfe und beende"
|
||||
|
||||
#: src/main/help.c:408
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "zeige Versionsinformationen und beende"
|
||||
|
||||
#: src/main/help.c:412
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr ""
|
||||
msgstr "schreibe Debug-Protokolle in DATEI"
|
||||
|
||||
#: src/main/help.c:437
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Syntax: %s [OPTION] [DATEI]..."
|
||||
msgstr "Aufruf: %s [OPTION] [DATEI]..."
|
||||
|
||||
#: src/main/help.c:448
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"Verbindet DATEI(en) oder den Standard-Eingabe-Kanal mit dem Standard-Ausgabe-"
|
||||
"Kanal und misst den Datenstrom."
|
||||
|
||||
#: src/main/help.c:585
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr "unterstützte Formate:"
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Bitte senden Sie Fehlerberichte an %s"
|
||||
|
||||
#: src/main/main.c:74
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(eingabe)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "Zustandszuweisung fehlgeschlagen"
|
||||
msgstr "Speicherzuweisung für `state' fehlgeschlagen"
|
||||
|
||||
#: src/main/options.c:174
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "`option' konnte nicht allokiert werden"
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:193
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "`option' (argv) konnte nicht allokiert werden"
|
||||
|
||||
#: src/main/options.c:255
|
||||
msgid "integer argument expected"
|
||||
msgstr "Ganzzahliges Argument erwartet"
|
||||
|
||||
#: src/main/options.c:266
|
||||
msgid "numeric argument expected"
|
||||
msgstr "numerisches Argument erwartet"
|
||||
|
||||
#: src/main/options.c:277
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "Prozess-ID oder PID:FD-Paar erwartet"
|
||||
|
||||
#: src/main/options.c:284
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "ungültige Prozess-ID"
|
||||
|
||||
#: src/main/options.c:388 src/pv/file.c:323
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "Dateiinformationen konnten nicht gelesen werden"
|
||||
msgstr "konnte Dateiinformationen nicht lesen"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "ist ein Verzeichnis"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "konnte Sysfs-Dateinamen nicht erzeugen"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "konnte Größe der Sysfs-Datei nicht lesen"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "konnte Blockgerät nicht öffnen"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "konnte Größe des Blockgeräts nicht ermitteln"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "Speicherzuweisung für `option' fehlgeschlagen"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "Speicherzuweisung für `argv' der Option fehlgeschlagen"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr "numerischen Wert nicht verstanden"
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "Ganzzahliges Argument erwartet"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "numerisches Argument erwartet"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "`%s --help' zeigt weitere Informationen an."
|
||||
|
||||
#: src/main/options.c:493
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "`%s -h' zeigt weitere Informationen an."
|
||||
|
||||
#: src/main/options.c:524
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
"Beim Anzeigen von Dateideskriptoren können keine Optionen für den "
|
||||
"Beim Beobachten von Dateideskriptoren können keine Optionen für den "
|
||||
"Zeilenmodus oder den Übertragungsmodifikator verwendet werden"
|
||||
|
||||
#: src/main/options.c:533
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
"Beim Anzeigen von Dateideskriptoren können keine Zeilenmodus- oder "
|
||||
"Übertragungsmodifikatoroptionen verwendet werden."
|
||||
"Beim Beobachten von Dateideskriptoren kann Cursor-Positionierung nicht "
|
||||
"verwendet werden"
|
||||
|
||||
#: src/main/options.c:542
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
"kann keine Fernbedienung verwenden, wenn Dateideskriptoren angezeigt werden"
|
||||
"Beim Beobachten von Dateideskriptoren kann die Fernbedienung nicht verwenden "
|
||||
"werden"
|
||||
|
||||
#: src/main/options.c:551
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
"Dateien können beim Betrachten von Dateideskriptoren nicht übertragen werden"
|
||||
"Beim Beobachten von Dateideskriptoren können Dateien nicht übertragen werden"
|
||||
|
||||
#: src/main/options.c:566
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "Nicht verfügbar auf Systemen ohne /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:302
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "Nachricht nicht empfangen"
|
||||
|
||||
#: src/main/remote.c:429
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "SA_SIGINFO wird auf diesem System nicht unterstützt"
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr ""
|
||||
msgstr "Lizenz: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
msgstr "Dies ist freie Software: Sie dürfen sie verändern und weiterverteilen."
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
msgstr "Es besteht KEINE GARANTIE, soweit dies gesetzlich zulässig ist."
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
msgstr "Projekt-Website"
|
||||
|
||||
#: src/pv/cursor.c:87
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "Terminalname konnte nicht gelesen werden"
|
||||
msgstr "konnte Terminalname nicht lesen"
|
||||
|
||||
#: src/pv/cursor.c:132
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "Sperrdatei konnte nicht geöffnet werden"
|
||||
msgstr "konnte Sperrdatei nicht öffnen"
|
||||
|
||||
#: src/pv/cursor.c:165
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "Sperrversuch fehlgeschlagen"
|
||||
|
||||
#: src/pv/cursor.c:426
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "Terminal konnte nicht geöffnet werden"
|
||||
msgstr "konnte Terminal nicht öffnen"
|
||||
|
||||
#: src/pv/display.c:193
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnµm kMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:211
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnµm KMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:750 src/pv/transfer.c:954
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "Puffer konnte nicht allokiert werden"
|
||||
msgstr "Speicherzuweisung für den Puffer fehlgeschlagen"
|
||||
|
||||
#: src/pv/display.c:856
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:859 src/pv/transfer.c:596
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/display.c:900 src/pv/display.c:916
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "B/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:947 src/pv/display.c:951 src/pv/display.c:1017
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/file.c:148
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr "Konnte nicht versuchen, die Ausgabe zu starten"
|
||||
msgstr "Konnte nicht zum Anfang der Ausgabe springen"
|
||||
|
||||
#: src/pv/file.c:293
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "Datei konnte nicht geschlossen werden"
|
||||
msgstr "konnte Datei nicht schließen"
|
||||
|
||||
#: src/pv/file.c:316
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "Datei konnte nicht gelesen werden"
|
||||
msgstr "konnte Datei nicht lesen"
|
||||
|
||||
#: src/pv/file.c:331
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "Dateiinformationen für Ausgabe-Datei konnten nicht gelesen werden"
|
||||
msgstr "konnte Dateiinformationen für Ausgabe-Datei nicht lesen"
|
||||
|
||||
#: src/pv/file.c:353
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "Eingabe-Datei ist Ausgabe-Datei"
|
||||
|
||||
#: src/pv/file.c:411
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
msgstr "(keine)"
|
||||
|
||||
#: src/pv/file.c:413
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
msgstr "(stdin)"
|
||||
|
||||
#: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128
|
||||
#: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301
|
||||
#: src/pv/watchpid.c:377 src/pv/watchpid.c:398
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "b/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "b"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "Endzeit"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "Rate min/mittel/max/abweichung"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "Übertragungsrate nicht gemessen"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
msgstr "pid"
|
||||
|
||||
#: src/pv/state.c:36
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "fd"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
msgstr "Speicherzuweisung für `history' fehlgeschlagen"
|
||||
|
||||
#: src/pv/state.c:391 src/pv/state.c:402
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr "Speicherzuweisung für die Dateiliste fehlgeschlagen"
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:458
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "read-Aufruf fehlgeschlagen"
|
||||
|
||||
#: src/pv/transfer.c:481
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "warnung: lesefehler erkannt"
|
||||
|
||||
#: src/pv/transfer.c:497
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr "datei ist nicht durchsuchbar"
|
||||
msgstr "Datei ist nicht durchsuchbar"
|
||||
|
||||
#: src/pv/transfer.c:575
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr "konnte den Fehler nicht überwinden"
|
||||
|
||||
#: src/pv/transfer.c:595
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr "über den Lesefehler hinaus verschoben"
|
||||
|
||||
#: src/pv/transfer.c:635
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
msgstr "Speicherzuweisung für den Transferpuffer fehlgeschlagen"
|
||||
|
||||
#: src/pv/transfer.c:676
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
msgstr "konnte Intervall-Timer nicht setzen"
|
||||
|
||||
#: src/pv/transfer.c:694
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
msgstr "konnte Intervall-Timer nicht löschen"
|
||||
|
||||
#: src/pv/transfer.c:818
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr "Zuweisung des Zeilenpuffers fehlgeschlagen"
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "write-Aufruf fehlgeschlagen"
|
||||
|
||||
#: src/pv/transfer.c:1051
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "select-Aufruf fehlgeschlagen"
|
||||
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130
|
||||
#: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:130 src/pv/watchpid.c:204
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "keine normale Datei oder Blockgerät"
|
||||
msgstr "ist weder eine normale Datei noch ein Blockgerät"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "PID[:FD]"
|
||||
|
||||
@@ -0,0 +1,577 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"Language: es\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,582 @@
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: pv 1.9.34\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: fi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr ""
|
||||
@@ -1,9 +1,15 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
|
||||
"POT-Creation-Date: 2024-04-21 14:15+0100\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2025-05-31 08:58+0000\n"
|
||||
"Last-Translator: milimarg <milimarg@noreply.codeberg.org>\n"
|
||||
"Language-Team: French <https://translate.codeberg.org/projects/pv/pv/fr/>\n"
|
||||
"Language: fr\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n > 1;\n"
|
||||
"X-Generator: Weblate 5.11.4\n"
|
||||
"Date: 1999-06-01 15:18:29+0100\n"
|
||||
"From: Andrew Wood <ivarch@ubik>\n"
|
||||
"Xgettext-Options: --default-domain=pkgbuild --directory=./.pkgdir --add-"
|
||||
@@ -20,280 +26,363 @@ msgstr ""
|
||||
"nls/intl/textdomain.c src/nls/intl-cat/cat-compat.c src/nls/intl-gett/intl-"
|
||||
"compat.c\n"
|
||||
|
||||
#: src/main/help.c:284
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "afficher la barre de progression"
|
||||
|
||||
#: src/main/help.c:287
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "afficher le temps écoulé"
|
||||
|
||||
#: src/main/help.c:290
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "afficher l'heure approximative de l'achèvement de la tâche"
|
||||
|
||||
#: src/main/help.c:293
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "afficher l'heure absolute de l'achèvement de la tâche"
|
||||
|
||||
#: src/main/help.c:296
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "afficher le taux de tranfert des données"
|
||||
|
||||
#: src/main/help.c:299
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr "afficher le compteur de taux moyen de transfert de données"
|
||||
|
||||
#: src/main/help.c:301 src/main/help.c:332 src/main/help.c:344
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "afficher le nombre d'octets transférés"
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "afficher le pourcentage de tampon de transfert utilisé"
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr "NUM"
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "afficher les derniers NUM octets écrits"
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr "FORMAT"
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "définir le format de sortie sur FORMAT"
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "imprimer en pourcentage plutôt que des informations visuelles"
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "n'afficher aucune information de transfert"
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "afficher le nombre de bits transférés"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "traiter les suffixes comme des multiples de 1000 au lieu de 1024"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "ne rien afficher avant qu'au moins un octet soit tranféré"
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "SEC"
|
||||
|
||||
#: src/main/help.c:302
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "ne rien afficher jusqu'à ce que SEC secondes se soient écoulées"
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr "TAILLE"
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "ajuster la taille estimée des données à TAILLE octets"
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr ""
|
||||
"si la taille est inconnue, afficher le taux de transfert par rapport au taux "
|
||||
"de transfert max"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "compter les lignes au lieu des octets"
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "les lignes sont terminées par un caractère nul"
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "mettre à jour toutes les SEC secondes"
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
"calculer le taux moyen d'après les SEC dernières secondes (30s par défaut)"
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "afficher le nombre d'octets transférés"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "afficher le nombre de bits transférés"
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "afficher le pourcentage de tampon de transfert utilisé"
|
||||
|
||||
#: src/main/help.c:316
|
||||
msgid "NUM"
|
||||
msgstr "NUM"
|
||||
|
||||
#: src/main/help.c:317
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "afficher les derniers NUM octets écrits"
|
||||
|
||||
#: src/main/help.c:319
|
||||
msgid "FORMAT"
|
||||
msgstr "FORMAT"
|
||||
|
||||
#: src/main/help.c:320
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "définir le format de sortie sur FORMAT"
|
||||
|
||||
#: src/main/help.c:323
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "imprimer en pourcentage plutôt que des informations visuelles"
|
||||
|
||||
#: src/main/help.c:326
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "n'afficher aucune information de transfert"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "ne rien afficher avant qu'au moins un octet soit tranféré"
|
||||
|
||||
#: src/main/help.c:333
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "ne rien afficher jusqu'à ce que SEC secondes se soient écoulées"
|
||||
|
||||
#: src/main/help.c:335
|
||||
msgid "SIZE"
|
||||
msgstr "TAILLE"
|
||||
|
||||
#: src/main/help.c:336
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "ajuster la taille estimée des données à TAILLE octets"
|
||||
|
||||
#: src/main/help.c:339
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "compter les lignes au lieu des octets"
|
||||
|
||||
#: src/main/help.c:342
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "les lignes sont terminées par un caractère nul"
|
||||
|
||||
#: src/main/help.c:345
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "mettre à jour toutes les SEC secondes"
|
||||
|
||||
#: src/main/help.c:347
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr "LARGEUR"
|
||||
|
||||
#: src/main/help.c:348
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "présumer la largeur du terminal à LARGEUR caractères"
|
||||
|
||||
#: src/main/help.c:350
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr "HAUTEUR"
|
||||
|
||||
#: src/main/help.c:351
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "présumer la hauteur du terminal à HAUTEUR lignes"
|
||||
|
||||
#: src/main/help.c:353
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr "NOM"
|
||||
|
||||
#: src/main/help.c:354
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "préfixer les informations visuelles avec NOM"
|
||||
|
||||
#: src/main/help.c:357
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr "STYLE"
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr "définir le style de barre par défaut à NOM"
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr "SPÉCIFICATION"
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr "aussi envoyer la progression à SPÉCIFICATION"
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "afficher les statistiques de transfert à la fin"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr ""
|
||||
"imprimer vers la sortie d'erreur standard même si ce n'est pas un terminal"
|
||||
|
||||
#: src/main/help.c:360
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "utiliser les séquences d'échappements de positionnement de curseur"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "RATE"
|
||||
msgstr "TAUX"
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "limite le taux de transfert à TAUX octets par seconde"
|
||||
|
||||
#: src/main/help.c:366 src/main/help.c:375
|
||||
msgid "BYTES"
|
||||
msgstr "OCTETS"
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "Utiliser une mémoire tampon de OCTETS octets"
|
||||
|
||||
#: src/main/help.c:370
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "ne jamais utiliser splice(), toujours utiliser read/write"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "skip read errors in input"
|
||||
msgstr "ignorer les erreurs de lecture dans l'entrée"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "ignorer les erreurs dans OCTETS blocs à la fois"
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "arrêter après le transfert de --size octets"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "vider le cache sur le disque après chaque écriture"
|
||||
|
||||
#: src/main/help.c:385
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "utiliser les E/S directes pour contourner le cache"
|
||||
|
||||
#: src/main/help.c:388
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "rejeter l'entrée au lieu de l'écrire vers la sortie"
|
||||
|
||||
#: src/main/help.c:391
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:392
|
||||
msgid "update settings of process PID"
|
||||
msgstr "mettre à jour la configuration du processus PID"
|
||||
|
||||
#: src/main/help.c:396 src/main/help.c:411
|
||||
msgid "FILE"
|
||||
msgstr "FICHIER"
|
||||
|
||||
#: src/main/help.c:397
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "enregistrer l'ID de processus dans FICHIER"
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "écrire la sortie dans FICHIER au lieu de la sortie standard"
|
||||
|
||||
#: src/main/help.c:400
|
||||
msgid "PID[:FD]"
|
||||
msgstr "PID[:FD]"
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "TAUX"
|
||||
|
||||
#: src/main/help.c:401
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "limite le taux de transfert à TAUX octets par seconde"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr "OCTETS"
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "Utiliser une mémoire tampon de OCTETS octets"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "ne jamais utiliser splice(), toujours utiliser read/write"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "ignorer les erreurs de lecture dans l'entrée"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "ignorer les erreurs dans OCTETS blocs à la fois"
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "arrêter après le transfert de --size octets"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "vider le cache sur le disque après chaque écriture"
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "utiliser les E/S directes pour contourner le cache"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "rejeter l'entrée au lieu de l'écrire vers la sortie"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr "écrire toute l'entrée vers FICHIER avant de l'écrire vers la sortie"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "surveiller le fichier FD ouvert par le processus PID"
|
||||
|
||||
#: src/main/help.c:405
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "mettre à jour la configuration du processus PID"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "enregistrer l'ID de processus dans FICHIER"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "afficher cette aide puis quitter"
|
||||
|
||||
#: src/main/help.c:408
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "afficher la version puis quitter"
|
||||
|
||||
#: src/main/help.c:412
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr "écrire les journaux de déboggage vers FICHIER"
|
||||
|
||||
#: src/main/help.c:437
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Utilisation : %s [OPTIONS] [FICHIER]..."
|
||||
|
||||
#: src/main/help.c:448
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"Concaténer FICHIER(s), ou l'entrée standard, sur la sortie standard avec "
|
||||
"monitorage."
|
||||
|
||||
#: src/main/help.c:585
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr "Séquences de formatage supportées :"
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "SVP rapporter tous bogues à %s"
|
||||
|
||||
#: src/main/main.c:74
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(entrée)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "échec de l'allocation de mémoire de condition"
|
||||
|
||||
#: src/main/options.c:174
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "l'allocation pour la structure d'une option a échoué"
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:193
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "l'allocation pour la structure de l'option argv a échoué"
|
||||
|
||||
#: src/main/options.c:255
|
||||
msgid "integer argument expected"
|
||||
msgstr "Valeur entière attendue"
|
||||
|
||||
#: src/main/options.c:266
|
||||
msgid "numeric argument expected"
|
||||
msgstr "Valeur numérique attendue"
|
||||
|
||||
#: src/main/options.c:277
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "ID de processus ou paire pid:fd attendue"
|
||||
|
||||
#: src/main/options.c:284
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "ID de processus non valide"
|
||||
|
||||
#: src/main/options.c:388 src/pv/file.c:323
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "échec à statuer sur le fichier"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "est un répertoire"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "échec de génération du nom de fichier sysfs"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "échec de la lecture de la taille du fichier sysfs"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "échec de l'ouverture du périphérique de bloc"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "échec de l'évaluation de la taille du périphérique de bloc"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "l'allocation pour la structure d'une option a échoué"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "l'allocation pour la structure de l'option argv a échoué"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr "valeur numérique non comprise"
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "Valeur entière attendue"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "Valeur numérique attendue"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Essayez `%s --help' pour plus d'informations."
|
||||
|
||||
#: src/main/options.c:493
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Essayez `%s -h' pour plus d'informations."
|
||||
|
||||
#: src/main/options.c:524
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
@@ -301,33 +390,33 @@ msgstr ""
|
||||
"impossible d'utiliser le mode ligne ou les options de modificateur de "
|
||||
"transfert lors de la visualisation des descripteurs de fichiers"
|
||||
|
||||
#: src/main/options.c:533
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
"impossible d'utiliser le positionnement du curseur lors de la visualisation "
|
||||
"des descripteurs de fichier"
|
||||
|
||||
#: src/main/options.c:542
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
"impossible d'utiliser la télécommande lors de la visualisation des "
|
||||
"descripteurs de fichiers"
|
||||
|
||||
#: src/main/options.c:551
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
"impossible de transférer des fichiers lorsque vous regardez des descripteurs "
|
||||
"de fichiers"
|
||||
|
||||
#: src/main/options.c:566
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "non disponible sur les systèmes sans /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:302
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "message non reçu"
|
||||
|
||||
#: src/main/remote.c:429
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "SA_SIGINFO non pris en charge sur ce système"
|
||||
|
||||
@@ -349,150 +438,181 @@ msgstr "Il n'y a AUCUNE GARANTIE, dans la mesure permise par la loi."
|
||||
msgid "Project web site"
|
||||
msgstr "Site web du projet"
|
||||
|
||||
#: src/pv/cursor.c:87
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "échec de lecture du nom du terminal"
|
||||
|
||||
#: src/pv/cursor.c:132
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "échec de l'ouverture du fichier de verrouillage"
|
||||
|
||||
#: src/pv/cursor.c:165
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "échec de la tentative de verrouillage"
|
||||
|
||||
#: src/pv/cursor.c:426
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "échec de l'ouverture du terminal"
|
||||
|
||||
#: src/pv/display.c:193
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnum kMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:211
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnum KMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:750 src/pv/transfer.c:954
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "échec de l'allocation de mémoire tampon"
|
||||
|
||||
#: src/pv/display.c:856
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:859 src/pv/transfer.c:596
|
||||
msgid "B"
|
||||
msgstr "O"
|
||||
|
||||
#: src/pv/display.c:900 src/pv/display.c:916
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "B/s"
|
||||
msgstr "O/s"
|
||||
|
||||
#: src/pv/display.c:947 src/pv/display.c:951 src/pv/display.c:1017
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/file.c:148
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr "ne peut pas passer au début de la sortie"
|
||||
|
||||
#: src/pv/file.c:293
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "la fermeture du fichier a échoué"
|
||||
|
||||
#: src/pv/file.c:316
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "la lecture du fichier a échoué"
|
||||
|
||||
#: src/pv/file.c:331
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "échec à statuer sur le fichier de sortie"
|
||||
|
||||
#: src/pv/file.c:353
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "fichiers d'entré et de sortie sont les mêmes"
|
||||
|
||||
#: src/pv/file.c:411
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr "(aucun)"
|
||||
|
||||
#: src/pv/file.c:413
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
msgstr "(stdin)"
|
||||
|
||||
#: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128
|
||||
#: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301
|
||||
#: src/pv/watchpid.c:377 src/pv/watchpid.c:398
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "b/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "O/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "b"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "O"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "FIN"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "taux min/moy/max/écart-type"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "taux non mesuré"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
msgstr "pid"
|
||||
|
||||
#: src/pv/state.c:36
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "fd"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr "l'allocation de la structure de l'historique a échoué"
|
||||
|
||||
#: src/pv/state.c:391 src/pv/state.c:402
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr "échec de l'allocation de la liste de fichiers"
|
||||
|
||||
#: src/pv/transfer.c:458
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "la lecture a échoué"
|
||||
|
||||
#: src/pv/transfer.c:481
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "avertissement : erreurs de lecture détectées"
|
||||
|
||||
#: src/pv/transfer.c:497
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr "ne peut pas se déplacer dans le fichier"
|
||||
|
||||
#: src/pv/transfer.c:575
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr "n'a pas réussi à dépasser l'erreur"
|
||||
|
||||
#: src/pv/transfer.c:595
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr "erreur de lecture dépassée"
|
||||
|
||||
#: src/pv/transfer.c:635
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr "aucun tampon de transfert alloué"
|
||||
|
||||
#: src/pv/transfer.c:676
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
msgstr "La définition de l'intervalle du minuteur a échoué"
|
||||
|
||||
#: src/pv/transfer.c:694
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
msgstr "La réinitialisation des intervalles du minuteur a échoué"
|
||||
|
||||
#: src/pv/transfer.c:818
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr "L'allocation de la position de la ligne de la mémoire tampon a échoué"
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "l'écriture a échoué"
|
||||
|
||||
#: src/pv/transfer.c:1051
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "l'appel de sélection a échoué"
|
||||
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130
|
||||
#: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:130 src/pv/watchpid.c:204
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "pas un fichier ordinaire ou un périphérique de bloc"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "PID[:FD]"
|
||||
|
||||
#~ msgid "failed to set alarm signal handler"
|
||||
#~ msgstr "échec de la définition du gestionnaire de signal d'alarme"
|
||||
|
||||
@@ -5,477 +5,604 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
|
||||
"POT-Creation-Date: 2024-04-21 14:15+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2025-10-02 13:23+0000\n"
|
||||
"Last-Translator: Coral Pink <coralpink@noreply.codeberg.org>\n"
|
||||
"Language-Team: Polish <https://translate.codeberg.org/projects/pv/pv/pl/>\n"
|
||||
"Language: pl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
|
||||
"|| n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 5.13.2\n"
|
||||
|
||||
#: src/main/help.c:284
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "pokaż pasek postępu"
|
||||
|
||||
#: src/main/help.c:287
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "pokaż upływający czas"
|
||||
|
||||
#: src/main/help.c:290
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "pokaż szacowany czas ukończenia"
|
||||
|
||||
#: src/main/help.c:293
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr ""
|
||||
msgstr "pokaż bezwzględny szacowany czas ukończenia"
|
||||
|
||||
#: src/main/help.c:296
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "pokaż licznik prędkości przesyłania"
|
||||
|
||||
#: src/main/help.c:299
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr ""
|
||||
msgstr "pokaż licznik uśrednionej prędkości przesyłania"
|
||||
|
||||
#: src/main/help.c:301 src/main/help.c:332 src/main/help.c:344
|
||||
msgid "SEC"
|
||||
msgstr "WARTOŚĆ"
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:305
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "pokaż ilość przesłanych bajtów"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr ""
|
||||
msgstr "pokaż procentowe użycie bufora transferu"
|
||||
|
||||
#: src/main/help.c:316
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
msgstr "LICZBA"
|
||||
|
||||
#: src/main/help.c:317
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr ""
|
||||
msgstr "pokaż ostatnie LICZBA przesłanych bajtów"
|
||||
|
||||
#: src/main/help.c:319
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
msgstr "FORMAT"
|
||||
|
||||
#: src/main/help.c:320
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr ""
|
||||
msgstr "ustaw FORMAT jako format wyjściowy"
|
||||
|
||||
#: src/main/help.c:323
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "wświetl wyjście procentowo, bez graficznej prezentacji"
|
||||
msgstr "wyświetl wyjście procentowo, bez graficznej prezentacji"
|
||||
|
||||
#: src/main/help.c:326
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "nie wyświetlaj żadnych informacji o przesyłaniu"
|
||||
|
||||
#: src/main/help.c:330
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "pokaż ilość przesłanych bitów"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "traktuj przyrostki jako wielokrotności 1000 zamiast 1024"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "nie wyświetlaj nic aż do pierwszego przesłanego bajtu"
|
||||
|
||||
#: src/main/help.c:333
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "SEKUNDY"
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr ""
|
||||
msgstr "nie wyświetlaj nic do momentu upłynięcia SEKUNDY sekund"
|
||||
|
||||
#: src/main/help.c:335
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr "WARTOŚĆ"
|
||||
msgstr "ROZMIAR"
|
||||
|
||||
#: src/main/help.c:336
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "ustaw oczekiwany rozmiar danych na WARTOŚĆ bajtów"
|
||||
msgstr "ustaw oczekiwany rozmiar danych na ROZMIAR bajtów"
|
||||
|
||||
#: src/main/help.c:339
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr ""
|
||||
"jeśli rozmiar nie jest znany, wyświetl zestawienie prędkości do maksymalnej "
|
||||
"prędkości"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr ""
|
||||
msgstr "zliczaj linie zamiast bajty"
|
||||
|
||||
#: src/main/help.c:342
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr ""
|
||||
msgstr "linie są zakończone znakiem NUL"
|
||||
|
||||
#: src/main/help.c:345
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "aktualizuj co każde WARTOŚĆ sekund"
|
||||
msgstr "aktualizuj co każde SEKUNDY sekund"
|
||||
|
||||
#: src/main/help.c:347
|
||||
msgid "WIDTH"
|
||||
msgstr "WARTOŚĆ"
|
||||
|
||||
#: src/main/help.c:348
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "przyjmij, że terminal ma szerokość WARTOŚĆ znaków"
|
||||
|
||||
#: src/main/help.c:350
|
||||
msgid "HEIGHT"
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
"oblicz średnią prędkość transferu na podstawie poprzednich SEKUNDY sekund "
|
||||
"(domyślnie 30 s)"
|
||||
|
||||
#: src/main/help.c:351
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr "SZEROKOŚĆ"
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "przyjmij, że terminal ma szerokość SZEROKOŚĆ znaków"
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr "WYSOKOŚĆ"
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "przyjmij, że terminal ma szerokość WARTOŚĆ znaków"
|
||||
msgstr "przyjmij, że terminal ma wysokość WYSOKOŚĆ linii"
|
||||
|
||||
#: src/main/help.c:353
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr "NAZWA"
|
||||
|
||||
#: src/main/help.c:354
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "poprzedź informacje prefiksem NAZWA"
|
||||
|
||||
#: src/main/help.c:357
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "pokaż wyjście nawet gdy błędy nie są typu terminal"
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr "STYL"
|
||||
|
||||
#: src/main/help.c:360
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr "ustaw domyślny styl paska postępu na STYL"
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr "SPEC"
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr "wysyłaj postęp również do SPEC"
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "wyświetl na końcu statystyki transferu"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "pokaż wyjście nawet standardowe wyjście błędu nie jest terminalem"
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "używaj sekwencji escape do pozycjonowania"
|
||||
msgstr "używaj znaków ucieczki do pozycjonowania kursora"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr "PLIK"
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "zapisz wyjście do PLIK zamiast do wyjścia standardowego"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "PRĘDKOŚĆ"
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "ogranicz przesyłane dane do PRĘDKOŚĆ bajtów na sekundę"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr "BAJTY"
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "użyj bufora o rozmiarze BAJTY"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "nigdy nie używaj splice(), zawsze używaj read/write"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "pomijaj błędy odczytu wejścia"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "pomijaj błędy w blokach po BAJTY bajtów na raz"
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "zakończ po przesłaniu --size bajtów"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "wymuś zapis pamięci podręcznej na dysk po każdym zapisie"
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
"użyj bezpośredniego wejścia/wyjścia celem pominięcia pamięci podręcznej"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "zignoruj dane wejściowe zamiast wyświetlić je na wyjściu standardowym"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr ""
|
||||
"zapisz wszystkie dane wejściowe do PLIK przed wyświetleniem ich na wyjściu"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "RATE"
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "ogranicz przesyłane dane do RATE bajtów na sekundę"
|
||||
|
||||
#: src/main/help.c:366 src/main/help.c:375
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "obserwuj plik FD otworzony przez proces PID"
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr ""
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:370
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr ""
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "zaktualizuj ustawienia procesu PID"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "skip read errors in input"
|
||||
msgstr ""
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "zapisz ID procesu do PLIK"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:382
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:385
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:388
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:391
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:392
|
||||
msgid "update settings of process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:396 src/main/help.c:411
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:397
|
||||
msgid "save process ID in FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:400
|
||||
msgid "PID[:FD]"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:401
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:405
|
||||
msgid "show this help and exit"
|
||||
msgstr "wyświetl te informacje z pomocą i wyjdź"
|
||||
|
||||
#: src/main/help.c:408
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "wyświetl informacje o wersji i wyjdź"
|
||||
|
||||
#: src/main/help.c:412
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr ""
|
||||
msgstr "zapisz logi debugujące do PLIK"
|
||||
|
||||
#: src/main/help.c:437
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Sposób użycia: %s [OPCJA] [PLIK]..."
|
||||
|
||||
#: src/main/help.c:448
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"Łączenie PLIK(ów) lub wejścia standardowego, do wyjścia standardowego z "
|
||||
"monitoringiem."
|
||||
|
||||
#: src/main/help.c:585
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr "Wspierane sekwencje formatowania:"
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Proszę przesyłać zgłoszenia błędów do %s"
|
||||
|
||||
#: src/main/main.c:74
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(wejście)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "alokacja stanu programu nie powiodła się"
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:174
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "nie udało się zaalokować struktur opcji"
|
||||
|
||||
#: src/main/options.c:193
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "nie udało się zaalokować struktur opcji argv"
|
||||
|
||||
#: src/main/options.c:255
|
||||
msgid "integer argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:266
|
||||
msgid "numeric argument expected"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:277
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr ""
|
||||
msgstr "oczekiwany proces ID lub para PID:FD"
|
||||
|
||||
#: src/main/options.c:284
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr ""
|
||||
msgstr "niepoprawne ID procesu"
|
||||
|
||||
#: src/main/options.c:388 src/pv/file.c:323
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "nie udało się wykonać operacji stat na pliku"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "jest katalogiem"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "nie udało się wygenerować nazwy pliku dla sysfs"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "nie udało się odczytać rozmiaru pliku sysfs"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "nie udało się otworzyć urządzenia blokowego"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "nie udało się ustalić rozmiaru urządzenia blokowego"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "nie udało się zaalokować struktur opcji"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "nie udało się zaalokować struktur opcji argv"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr "wartość liczbowa niezrozumiana"
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "oczekiwany argument typu liczby całkowitej"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "oczekiwany argument liczbowy"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Spróbuj `%s --help' by uzyskać więcej informacji"
|
||||
msgstr "Spróbuj `%s --help' by uzyskać więcej informacji."
|
||||
|
||||
#: src/main/options.c:493
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Spróbuj `%s -h' by uzyskać więcej informacji"
|
||||
msgstr "Spróbuj `%s -h' by uzyskać więcej informacji."
|
||||
|
||||
#: src/main/options.c:524
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
"nie można użyć trybu zliczania linii lub opcji modyfikujących przesył "
|
||||
"łącznie z opcją obserwowania deskryptorów plików"
|
||||
|
||||
#: src/main/options.c:533
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
"nie można użyć pozycjonowania kursora łącznie z opcją obserwowania "
|
||||
"deskryptorów plików"
|
||||
|
||||
#: src/main/options.c:542
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr ""
|
||||
"nie można użyć opcji zaktualizowania ustawień procesu łącznie z opcją "
|
||||
"obserwowania deskryptorów plików"
|
||||
|
||||
#: src/main/options.c:551
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr ""
|
||||
msgstr "nie można przesyłać plików z opcją obserwowania deskryptorów plików"
|
||||
|
||||
#: src/main/options.c:566
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr ""
|
||||
msgstr "niedostępne na systemach bez /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:302
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr ""
|
||||
msgstr "wiadomość nieodebrana"
|
||||
|
||||
#: src/main/remote.c:429
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr ""
|
||||
msgstr "SA_SIGINFO nie jest wspierane na tym systemie"
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr ""
|
||||
msgstr "Licencja: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
msgstr "To jest wolne oprogramowanie: masz prawo do zmian i redystrybucji."
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
msgstr "Nie udziela się GWARANCJI w zakresie dozwolonym przez prawo."
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
msgstr "Strona projektu"
|
||||
|
||||
#: src/pv/cursor.c:87
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr ""
|
||||
msgstr "nie udało się uzyskać nazwy terminala"
|
||||
|
||||
# "Przewidywany czas ukończenia" for ETA is too long
|
||||
#: src/pv/cursor.c:132
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr ""
|
||||
msgstr "nie udało się otworzyć pliku blokowania zasobów"
|
||||
|
||||
#: src/pv/cursor.c:165
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr ""
|
||||
msgstr "blokada zasobów nie powiodła się"
|
||||
|
||||
#: src/pv/cursor.c:426
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "nie udało się otworzyć terminala"
|
||||
|
||||
#: src/pv/display.c:193
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnum kMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:211
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
msgstr "yzafpnum KMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:750 src/pv/transfer.c:954
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "nie udało się zaalokować bufora"
|
||||
|
||||
#: src/pv/display.c:856
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:859 src/pv/transfer.c:596
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/display.c:900 src/pv/display.c:916
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/display.c:947 src/pv/display.c:951 src/pv/display.c:1017
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/file.c:148
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr ""
|
||||
msgstr "nie udało się przewinąć wyjścia do początku"
|
||||
|
||||
# "Przewidywany czas ukończenia" for ETA is too long
|
||||
#: src/pv/file.c:293
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "nie udało się zamknąć pliku"
|
||||
|
||||
#: src/pv/file.c:316
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "nie udało się odczytać pliku"
|
||||
|
||||
#: src/pv/file.c:331
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "nie udało się wykonać operacji stat na pliku wyjściowym"
|
||||
|
||||
#: src/pv/file.c:353
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "plik wejściowy jest zarazem plikiem wyjściowym"
|
||||
|
||||
#: src/pv/file.c:411
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
msgstr "(brak)"
|
||||
|
||||
#: src/pv/file.c:413
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
msgstr "(stdin)"
|
||||
|
||||
#: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128
|
||||
#: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301
|
||||
#: src/pv/watchpid.c:377 src/pv/watchpid.c:398
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "b/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "b"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "FIN"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "prędkość min/śr/max/odch"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "prędkość niezmierzona"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
msgstr "pid"
|
||||
|
||||
#: src/pv/state.c:36
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "fd"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
msgstr "nie udało się zaalokować struktury historii"
|
||||
|
||||
#: src/pv/state.c:391 src/pv/state.c:402
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr ""
|
||||
msgstr "nie udało się zaalokować listy plików"
|
||||
|
||||
#: src/pv/transfer.c:458
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr "nie udało się zaalokować listy procesów"
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr "nie udało się zaalokować listy deskryptorów plików"
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "błąd odczytu"
|
||||
|
||||
#: src/pv/transfer.c:481
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr ""
|
||||
msgstr "ostrzeżenie: błędy odczytu wykryte"
|
||||
|
||||
#: src/pv/transfer.c:497
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr ""
|
||||
msgstr "pliku nie da się przewijać"
|
||||
|
||||
#: src/pv/transfer.c:575
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr ""
|
||||
msgstr "nie udało się przewinąć za błąd"
|
||||
|
||||
#: src/pv/transfer.c:595
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr ""
|
||||
msgstr "pominięto błąd odczytu"
|
||||
|
||||
#: src/pv/transfer.c:635
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
msgstr "brak zaalokowanego bufora transferu"
|
||||
|
||||
#: src/pv/transfer.c:676
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
msgstr "nie udało się ustawić interwału czasowego"
|
||||
|
||||
# "Przewidywany czas ukończenia" for ETA is too long
|
||||
#: src/pv/transfer.c:694
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
msgstr "nie udało się wyczyścić interwału czasowego"
|
||||
|
||||
#: src/pv/transfer.c:818
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr "alokacja buforu pozycji linii nie powiodła się"
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "błąd zapisu"
|
||||
|
||||
#: src/pv/transfer.c:1051
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "nie udało się wywołać funkcji select"
|
||||
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130
|
||||
#: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:130 src/pv/watchpid.c:204
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr ""
|
||||
msgstr "plik nie jest plikiem regularnym lub urządzeniem blokowym"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "PID[:FD]"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
|
||||
"POT-Creation-Date: 2024-04-21 14:15+0100\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -15,278 +15,359 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: src/main/help.c:284
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "exibe barra de progressão"
|
||||
|
||||
#: src/main/help.c:287
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "exibe tempo passado"
|
||||
|
||||
#: src/main/help.c:290
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "exibe o tempo estimado de término"
|
||||
|
||||
#: src/main/help.c:293
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "exibe o tempo absoluto estimado de término"
|
||||
|
||||
#: src/main/help.c:296
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "exibe a taxa de transferência"
|
||||
|
||||
#: src/main/help.c:299
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr "exibe o contador da taxa média de transferência de dados"
|
||||
|
||||
#: src/main/help.c:301 src/main/help.c:332 src/main/help.c:344
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:305
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "exibe a quantidade de bytes transferidos"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "exibe a porcentagem de buffer de transferência em uso"
|
||||
|
||||
#: src/main/help.c:316
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:317
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "exibe NUM bytes gravados pela última vez"
|
||||
|
||||
#: src/main/help.c:319
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:320
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "definir o formato de saída para FORMAT"
|
||||
|
||||
#: src/main/help.c:323
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "exibe apenas as porcentagens, sem informações visuais"
|
||||
|
||||
#: src/main/help.c:326
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "executa programa sem exibir quaisquer informações"
|
||||
|
||||
#: src/main/help.c:330
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "não exibe nada até iniciar o processamento"
|
||||
|
||||
#: src/main/help.c:333
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "não exibir nada até que os segundos SEC tenham passado"
|
||||
|
||||
#: src/main/help.c:335
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:336
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "seta a quantidade estimada de dados em SIZE bytes"
|
||||
|
||||
#: src/main/help.c:339
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "contar linhas em vez de bytes"
|
||||
|
||||
#: src/main/help.c:342
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "linhas são terminadas em nulo"
|
||||
|
||||
#: src/main/help.c:345
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "atualiza informações a cada SEC segundos"
|
||||
|
||||
#: src/main/help.c:347
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:348
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "presuma que o terminal tem WIDTH caracteres de largura"
|
||||
|
||||
#: src/main/help.c:350
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:351
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "presuma que o terminal tem HEIGHT caracteres de altura"
|
||||
|
||||
#: src/main/help.c:353
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:354
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "exibe NAME antes das demais informações"
|
||||
|
||||
#: src/main/help.c:357
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "gera dados mesmo que a saída de erro seja redirecionada"
|
||||
|
||||
#: src/main/help.c:360
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "utiliza caracteres de escape para posicionar o cursor"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "limita a transferência a RATE bytes por segundo"
|
||||
|
||||
#: src/main/help.c:366 src/main/help.c:375
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "use um tamanho de buffer de BYTES"
|
||||
|
||||
#: src/main/help.c:370
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "nunca use splice(), sempre use read/write"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "skip read errors in input"
|
||||
msgstr "ignorar erros de leitura em entrada"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "parar após --size bytes terem sido transferidos"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:385
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:388
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:391
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:392
|
||||
msgid "update settings of process PID"
|
||||
msgstr "atualizar as configurações do processo PID"
|
||||
|
||||
#: src/main/help.c:396 src/main/help.c:411
|
||||
msgid "FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:397
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "salvar ID do processo em FILE"
|
||||
|
||||
#: src/main/help.c:400
|
||||
msgid "PID[:FD]"
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:401
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "limita a transferência a RATE bytes por segundo"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "use um tamanho de buffer de BYTES"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "nunca use splice(), sempre use read/write"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "ignorar erros de leitura em entrada"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "parar após --size bytes terem sido transferidos"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "assistir arquivo FD aberto pelo processo PID"
|
||||
|
||||
#: src/main/help.c:405
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "atualizar as configurações do processo PID"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "salvar ID do processo em FILE"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "exibe esta tela de ajuda e termina"
|
||||
|
||||
#: src/main/help.c:408
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "exibe a versão e termina"
|
||||
|
||||
#: src/main/help.c:412
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:437
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Uso: %s [OPÇÕES] [ARQUIVOS]..."
|
||||
|
||||
#: src/main/help.c:448
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"Concatena ARQUIVO(s) ou a entrada padrão e grava na saída padrão, com "
|
||||
"monitoramento."
|
||||
|
||||
#: src/main/help.c:585
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Por favor, reporte quaisquer defeitos para %s"
|
||||
|
||||
#: src/main/main.c:74
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "alocação de memória de status falhou"
|
||||
|
||||
#: src/main/options.c:174
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "erro na alocação da estrutura de opções"
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:193
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "erro na alocação da estrutura de opções argv"
|
||||
|
||||
#: src/main/options.c:255
|
||||
msgid "integer argument expected"
|
||||
msgstr "argumento inteiro esperado"
|
||||
|
||||
#: src/main/options.c:266
|
||||
msgid "numeric argument expected"
|
||||
msgstr "argumento numérico esperado"
|
||||
|
||||
#: src/main/options.c:277
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "ID do processo ou par pid:fd esperado"
|
||||
|
||||
#: src/main/options.c:284
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "ID de processo inválido"
|
||||
|
||||
#: src/main/options.c:388 src/pv/file.c:323
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "erro obtendo informações do arquivo"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "erro na alocação da estrutura de opções"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "erro na alocação da estrutura de opções argv"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "argumento inteiro esperado"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "argumento numérico esperado"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Tente `%s --help' para maiores informações."
|
||||
|
||||
#: src/main/options.c:493
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Tente `%s -h' para maiores informações."
|
||||
|
||||
#: src/main/options.c:524
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
@@ -294,29 +375,29 @@ msgstr ""
|
||||
"não pode usar o modo de linha ou opções de modificador de transferência ao "
|
||||
"assistir os descritores de arquivo"
|
||||
|
||||
#: src/main/options.c:533
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
"não pode usar o posicionamento do cursor ao observar os descritores de "
|
||||
"arquivo"
|
||||
|
||||
#: src/main/options.c:542
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr "não pode usar o controle remoto ao assistir os descritores de arquivo"
|
||||
|
||||
#: src/main/options.c:551
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr "não pode transferir arquivos ao assistir descritores de arquivo"
|
||||
|
||||
#: src/main/options.c:566
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "não disponível em sistemas sem /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:302
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "mensagem não recebida"
|
||||
|
||||
#: src/main/remote.c:429
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "SA_SIGINFO não suportado neste sistema"
|
||||
|
||||
@@ -336,147 +417,175 @@ msgstr ""
|
||||
msgid "Project web site"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/cursor.c:87
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "erro ao ler o nome do terminal"
|
||||
|
||||
#: src/pv/cursor.c:132
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "erro ao abrir arquivo de bloqueio"
|
||||
|
||||
#: src/pv/cursor.c:165
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "tentativa de bloqueio falhou"
|
||||
|
||||
#: src/pv/cursor.c:426
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "erro abrindo o terminal"
|
||||
|
||||
#: src/pv/display.c:193
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:211
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:750 src/pv/transfer.c:954
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "erro alocando o buffer"
|
||||
|
||||
#: src/pv/display.c:856
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:859 src/pv/transfer.c:596
|
||||
msgid "B"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:900 src/pv/display.c:916
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:905 src/pv/display.c:920
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/display.c:947 src/pv/display.c:951 src/pv/display.c:1017
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/file.c:148
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr "não pode mover para o início da produção"
|
||||
|
||||
#: src/pv/file.c:293
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "erro fechando o arquivo"
|
||||
|
||||
#: src/pv/file.c:316
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "erro lendo o arquivo"
|
||||
|
||||
#: src/pv/file.c:331
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "erro obtendo informações do arquivo de saída"
|
||||
|
||||
#: src/pv/file.c:353
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "os arquivos de entrada e saída são o mesmo"
|
||||
|
||||
#: src/pv/file.c:411
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:413
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:570 src/pv/loop.c:621 src/pv/loop.c:662 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:120 src/pv/watchpid.c:128
|
||||
#: src/pv/watchpid.c:165 src/pv/watchpid.c:184 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:202 src/pv/watchpid.c:293 src/pv/watchpid.c:301
|
||||
#: src/pv/watchpid.c:377 src/pv/watchpid.c:398
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:36
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:391 src/pv/state.c:402
|
||||
msgid "file list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:458
|
||||
msgid "read failed"
|
||||
msgstr "erro de leitura"
|
||||
|
||||
#: src/pv/transfer.c:481
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "aviso: erros de leitura detectados"
|
||||
|
||||
#: src/pv/transfer.c:497
|
||||
msgid "file is not seekable"
|
||||
msgstr "não pode mover dentro do arquivo"
|
||||
|
||||
#: src/pv/transfer.c:575
|
||||
msgid "failed to seek past error"
|
||||
msgstr "não pode ir além do erro"
|
||||
|
||||
#: src/pv/transfer.c:595
|
||||
msgid "skipped past read error"
|
||||
msgstr "ignorado erro de leitura"
|
||||
|
||||
#: src/pv/transfer.c:635
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:676
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:694
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:818
|
||||
msgid "write failed"
|
||||
msgstr "erro de gravação"
|
||||
|
||||
#: src/pv/transfer.c:1051
|
||||
msgid "select call failed"
|
||||
msgstr "erro na chamada da função select"
|
||||
|
||||
#: src/pv/watchpid.c:109 src/pv/watchpid.c:121 src/pv/watchpid.c:130
|
||||
#: src/pv/watchpid.c:184 src/pv/watchpid.c:193 src/pv/watchpid.c:204
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/watchpid.c:130 src/pv/watchpid.c:204
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "erro de leitura"
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "aviso: erros de leitura detectados"
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr "não pode mover dentro do arquivo"
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr "não pode ir além do erro"
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr "ignorado erro de leitura"
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "erro de gravação"
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "erro na chamada da função select"
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "não é um arquivo regular ou dispositivo de bloqueio"
|
||||
|
||||
@@ -0,0 +1,589 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2025-01-15 19:08+0000\n"
|
||||
"Last-Translator: 0ko <0ko@users.noreply.translate.codeberg.org>\n"
|
||||
"Language-Team: Russian <https://translate.codeberg.org/projects/pv/pv/ru/>\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
|
||||
"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
|
||||
"X-Generator: Weblate 5.9.2\n"
|
||||
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "показать полосу прогресса"
|
||||
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "показать прошедшее время"
|
||||
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "показать примерное время завершения"
|
||||
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "показать примерное абсолютное время завершения"
|
||||
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "показать скорость передачи данных"
|
||||
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr "показать среднюю скорость передачи данных"
|
||||
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "показать объём переданных данных в байтах"
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "показать использование буфера передачи в процентах"
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr "КОЛ"
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "показать КОЛ байт, переданных в последний раз"
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr "ФОРМАТ"
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "указать формат вывода как ФОРМАТ"
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "показать проценты вместо визуальной информации"
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "не отображать никакую информацию о передаче"
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "показать объём переданных данных в битах"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "считать суффиксы как умножители на 1000, а не на 1024"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "ничего не показывать, пока не будет передан первый байт"
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "СЕК"
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "ничего не показывать, пока не пройдёт СЕК секунд"
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr "РАЗМ"
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "указать ожидаемый объём данных как РАЗМ байт"
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr "если объём неизвестен, показать скорость и макс. скорость"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "считать линии вместо байт"
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "строки прерываются нулями"
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "обновлять каждые СЕК секунд"
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr "вычислять среднюю скорость за последние СЕК секунд (по умолчанию 30)"
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr "ШИРИНА"
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "считать, что в одной строке помещается ШИРИНА символов"
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr "ВЫСОТА"
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "считать, что на экране помещается ВЫСОТА строк"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr "ИМЯ"
|
||||
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "писать ИМЯ до визуальной информации"
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr "СТИЛЬ"
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr "задать стиль полоски по умолчанию как НАЗВАНИЕ"
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "после завершения показать статистику"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "вевести, даже если стд. ошибка не является терминалом"
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr ""
|
||||
"использовать символьные последовательности для позиционирования курсора"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr "ФАЙЛ"
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "направить вывод в ФАЙЛ вместо стд. вывода"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "СКОР"
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "ограничить скорость передачи до СКОР байт/сек"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr "БАЙТ"
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "использовать буфер размера БАЙТ"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "использовать чтение/запись вместо splice()"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "пропустить ошибки чтения во вводе"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "пропускать ошибки в <БАЙТ> блоках за раз"
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "остановить после передачи --size байт"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "сбрасывать кеш на диск каждый раз"
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "использовать прямой ввод/вывод для обхода кеша"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "отбрасывать ввод вместо записи в вывод"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr "записывать весь ввод в ФАЙЛ прежде, чем отправлять на вывод"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "следить за FD файла, открытого процессом ИДпр"
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr "ИДпр"
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "обновить настройки ИДпр процесса"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "сохранить ИД процесса в ФАЙЛ"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "показать справку и завершить работу"
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "показать версию программы и завершить работу"
|
||||
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr "вести запись отладочного журнала в ФАЙЛ"
|
||||
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Использование: %s [ОПЦИИ] [ФАЙЛ]..."
|
||||
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr "Поддерживаемые последовательности:"
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Сообщайте о проблемах на: %s"
|
||||
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(ввод)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "ожидался ИД процесса или пара ИДпр:ДФ"
|
||||
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "неправильный ИД процесса"
|
||||
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "не удалось получить информацию о файле"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "является каталогом"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "не удалось создать имя файла sysfs"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "не удалось узнать размер файла sysfs"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "не удалось открыть блочное устройство"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "не удалось определить размер блочного устройства"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "не удалось выделить память для структуры опций"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "не удалось выделить память для структуры опций argv"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr "число не распознано"
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "ожидалось целое число"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "ожидалось число"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Выполните `%s --help' для получения подробностей."
|
||||
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Выполните `%s -h' для получения подробностей."
|
||||
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr "удалённое управление невозможно при отслеживании дескрипторов файлов"
|
||||
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr "передача файлов невозможна при отслеживании дескрипторов файлов"
|
||||
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "невозможно на системах без /proc/self/fdinfo"
|
||||
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "сообщение не получено"
|
||||
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "Этой системой не поддерживается SA_SIGINFO"
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr "Лицензия: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr "Это свободная программа. Вы можете изменять и распространять её."
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr ""
|
||||
"Разработчики не дают никаких гарантий, связанных с работой этой программы, "
|
||||
"насколько это юридически возможно."
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr "Веб-сайт проекта"
|
||||
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "не удалось получить имя терминала"
|
||||
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "не удалось открыть блокирующий файл"
|
||||
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "попытка блокировки не удалась"
|
||||
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "не удалось открыть терминал"
|
||||
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "не удалось выделить память для буфера"
|
||||
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "не удалось закрыть файл"
|
||||
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "не удалось прочесть файл"
|
||||
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "не удалось получить информацию о выходном файле"
|
||||
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "пути исходного и выходного файлов одинаковы"
|
||||
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr "(нет)"
|
||||
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr "(стд. ввод)"
|
||||
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "бит/с"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/с"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "байт/с"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "бит"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "байт"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ОЖИД"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "ЗАВЕРШ"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "скор. мин/сред/макс/дев"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "скорость не изменяется"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr "ИДпр"
|
||||
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "дф"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr "не удалось выделить память для структуры истории"
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr "не удалось выделить память для списка файлов"
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "чтение не удалось"
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "внимание: замечены ошибки чтения"
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr "не выделена память для буфера передачи"
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr "не удалось задать измеритель временного промежутка"
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr "не удалось очистить измеритель временного промежутка"
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr ""
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "запись не удалась"
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "запрос выборки не удался"
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "не является обычным файлом или блочным устройством"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "ИДпр[:FD]"
|
||||
@@ -0,0 +1,590 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: pv 1.8.14\n"
|
||||
"Report-Msgid-Bugs-To: https://codeberg.org/ivarch/pv/issues\n"
|
||||
"POT-Creation-Date: 2025-10-18 19:34+0100\n"
|
||||
"PO-Revision-Date: 2025-10-05 20:09+0000\n"
|
||||
"Last-Translator: Oğuz Ersen <ersen@noreply.codeberg.org>\n"
|
||||
"Language-Team: Turkish <https://translate.codeberg.org/projects/pv/pv/tr/>\n"
|
||||
"Language: tr\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Weblate 5.13.2\n"
|
||||
|
||||
#: src/main/help.c:236
|
||||
msgid "show progress bar"
|
||||
msgstr "ilerleme çubuğunu göster"
|
||||
|
||||
#: src/main/help.c:239
|
||||
msgid "show elapsed time"
|
||||
msgstr "geçen süreyi göster"
|
||||
|
||||
#: src/main/help.c:242
|
||||
msgid "show estimated time of arrival (completion)"
|
||||
msgstr "tahmini varış (tamamlanma) zamanını göster"
|
||||
|
||||
#: src/main/help.c:245
|
||||
msgid "show absolute estimated time of arrival (completion)"
|
||||
msgstr "mutlak tahmini varış (tamamlanma) zamanını göster"
|
||||
|
||||
#: src/main/help.c:248
|
||||
msgid "show data transfer rate counter"
|
||||
msgstr "veri aktarım oranı sayacını göster"
|
||||
|
||||
#: src/main/help.c:251
|
||||
msgid "show data transfer average rate counter"
|
||||
msgstr "veri aktarımı ortalama hız sayacını göster"
|
||||
|
||||
#: src/main/help.c:254
|
||||
msgid "show number of bytes transferred"
|
||||
msgstr "aktarılan bayt sayısını göster"
|
||||
|
||||
#: src/main/help.c:257
|
||||
msgid "show percentage of transfer buffer in use"
|
||||
msgstr "aktarım tamponunun kullanım yüzdesini göster"
|
||||
|
||||
#: src/main/help.c:259
|
||||
msgid "NUM"
|
||||
msgstr "NUM"
|
||||
|
||||
#: src/main/help.c:260
|
||||
msgid "show NUM bytes last written"
|
||||
msgstr "son yazılan NUM baytlarını göster"
|
||||
|
||||
#: src/main/help.c:262
|
||||
msgid "FORMAT"
|
||||
msgstr "FORMAT"
|
||||
|
||||
#: src/main/help.c:263
|
||||
msgid "set output format to FORMAT"
|
||||
msgstr "çıktı formatını FORMAT olarak ayarlayın"
|
||||
|
||||
#: src/main/help.c:266
|
||||
msgid "output percentages, not visual information"
|
||||
msgstr "görsel bilgileri değil, yüzdeleri çıktı olarak yazdır"
|
||||
|
||||
#: src/main/help.c:269
|
||||
msgid "do not output any transfer information at all"
|
||||
msgstr "hiçbir transfer bilgisini yazdırma"
|
||||
|
||||
#: src/main/help.c:273
|
||||
msgid "show number of bits transferred"
|
||||
msgstr "aktarılan bit sayısını göster"
|
||||
|
||||
#: src/main/help.c:276
|
||||
msgid "treat suffixes as multiples of 1000 rather than 1024"
|
||||
msgstr "ekleri 1024 yerine 1000'in katları olarak değerlendir"
|
||||
|
||||
#: src/main/help.c:279
|
||||
msgid "display nothing until first byte transferred"
|
||||
msgstr "ilk bayt aktarılana kadar hiçbir şey gösterme"
|
||||
|
||||
#: src/main/help.c:281 src/main/help.c:296 src/main/help.c:299
|
||||
msgid "SEC"
|
||||
msgstr "SEC"
|
||||
|
||||
#: src/main/help.c:282
|
||||
msgid "display nothing until SEC seconds have passed"
|
||||
msgstr "SEC saniye geçene kadar hiçbir şey gösterme"
|
||||
|
||||
#: src/main/help.c:284
|
||||
msgid "SIZE"
|
||||
msgstr "BOYUT"
|
||||
|
||||
#: src/main/help.c:285
|
||||
msgid "set estimated data size to SIZE bytes"
|
||||
msgstr "tahmini veri boyutunu BOYUT bayt olarak ayarlayın"
|
||||
|
||||
#: src/main/help.c:288
|
||||
msgid "if size unknown, show rate vs max rate"
|
||||
msgstr "boyut bilinmiyorsa, oranı maksimum oranla göster"
|
||||
|
||||
#: src/main/help.c:291
|
||||
msgid "count lines instead of bytes"
|
||||
msgstr "bayt yerine satır say"
|
||||
|
||||
#: src/main/help.c:294
|
||||
msgid "lines are null-terminated"
|
||||
msgstr "satırlar boş sonlandırılır"
|
||||
|
||||
#: src/main/help.c:297
|
||||
msgid "update every SEC seconds"
|
||||
msgstr "her SEC saniyede bir güncelleme"
|
||||
|
||||
#: src/main/help.c:300
|
||||
msgid "compute average rate over past SEC seconds (default 30s)"
|
||||
msgstr "geçmiş SEC saniyeleri üzerinden ortalama hızı hesapla (varsayılan 30s)"
|
||||
|
||||
#: src/main/help.c:302
|
||||
msgid "WIDTH"
|
||||
msgstr "GENİŞLİK"
|
||||
|
||||
#: src/main/help.c:303
|
||||
msgid "assume terminal is WIDTH characters wide"
|
||||
msgstr "terminalin GENİŞLİK karakter genişliğinde olduğunu varsayalım"
|
||||
|
||||
#: src/main/help.c:305
|
||||
msgid "HEIGHT"
|
||||
msgstr "YÜKSEKLİK"
|
||||
|
||||
#: src/main/help.c:306
|
||||
msgid "assume terminal is HEIGHT rows high"
|
||||
msgstr "terminalin YÜKSEKLİK sıraları yüksekliğinde olduğunu varsayalım"
|
||||
|
||||
#: src/main/help.c:308
|
||||
msgid "NAME"
|
||||
msgstr "İSİM"
|
||||
|
||||
#: src/main/help.c:309
|
||||
msgid "prefix visual information with NAME"
|
||||
msgstr "görsel bilgiyi İSİM ile öne ekle"
|
||||
|
||||
#: src/main/help.c:311
|
||||
msgid "STYLE"
|
||||
msgstr "BİÇİM"
|
||||
|
||||
#: src/main/help.c:312
|
||||
msgid "set default bar style to NAME"
|
||||
msgstr "öntanımlı çubuk biçimini İSİM olarak ayarla"
|
||||
|
||||
#: src/main/help.c:314
|
||||
msgid "SPEC"
|
||||
msgstr "BELİRT"
|
||||
|
||||
#: src/main/help.c:315
|
||||
msgid "also send progress to SPEC"
|
||||
msgstr "ilerlemeyi BELİRT ögesine de gönder"
|
||||
|
||||
#: src/main/help.c:318
|
||||
msgid "output transfer statistics at the end"
|
||||
msgstr "transfer istatistiklerini sonda göster"
|
||||
|
||||
#: src/main/help.c:321
|
||||
msgid "output even if standard error is not a terminal"
|
||||
msgstr "standart hata bir terminal olmasa bile çıktı yazdır"
|
||||
|
||||
#: src/main/help.c:324
|
||||
msgid "use cursor positioning escape sequences"
|
||||
msgstr "imleç konumlandırma kaçış dizilerini kullan"
|
||||
|
||||
#: src/main/help.c:327 src/main/help.c:360 src/main/help.c:372
|
||||
#: src/main/help.c:382
|
||||
msgid "FILE"
|
||||
msgstr "DOSYA"
|
||||
|
||||
#: src/main/help.c:328
|
||||
msgid "write output to FILE instead of stdout"
|
||||
msgstr "çıktıyı stdout yerine DOSYA'ya yaz"
|
||||
|
||||
#: src/main/help.c:330
|
||||
msgid "RATE"
|
||||
msgstr "ORAN"
|
||||
|
||||
#: src/main/help.c:331
|
||||
msgid "limit transfer to RATE bytes per second"
|
||||
msgstr "aktarımı saniye başına ORAN bayt ile sınırlandırın"
|
||||
|
||||
#: src/main/help.c:333 src/main/help.c:342
|
||||
msgid "BYTES"
|
||||
msgstr "BAYTLAR"
|
||||
|
||||
#: src/main/help.c:334
|
||||
msgid "use a buffer size of BYTES"
|
||||
msgstr "BAYTLAR tampon boyutu kullanın"
|
||||
|
||||
#: src/main/help.c:337
|
||||
msgid "never use splice(), always use read/write"
|
||||
msgstr "splice() kullanma, her zaman read/write kullan"
|
||||
|
||||
#: src/main/help.c:340
|
||||
msgid "skip read errors in input"
|
||||
msgstr "girdideki okuma hatalarını atla"
|
||||
|
||||
#: src/main/help.c:343
|
||||
msgid "skip errors in BYTES blocks at a time"
|
||||
msgstr "BAYTLAR blokları halinde hataları atla"
|
||||
|
||||
#: src/main/help.c:346
|
||||
msgid "stop after --size bytes have been transferred"
|
||||
msgstr "--size bayt transfer edildikten sonra dur"
|
||||
|
||||
#: src/main/help.c:349
|
||||
msgid "flush cache to disk after every write"
|
||||
msgstr "her yazmadan sonra önbelleği diske boşalt"
|
||||
|
||||
#: src/main/help.c:352
|
||||
msgid "use direct I/O to bypass cache"
|
||||
msgstr "Önbelleği atlamak için doğrudan I/O kullan"
|
||||
|
||||
#: src/main/help.c:355
|
||||
msgid "try to seek instead of writing null bytes"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:358
|
||||
msgid "discard input instead of writing to output"
|
||||
msgstr "Girdiyi çıktıya yazmak yerine yok say"
|
||||
|
||||
#: src/main/help.c:361
|
||||
msgid "write all input to FILE before writing to output"
|
||||
msgstr "çıktıya yazmadan önce tüm girdiyi DOSYA'ya yaz"
|
||||
|
||||
#: src/main/help.c:363
|
||||
msgid "PID[:FD]|=NAME|@LISTFILE"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/help.c:364
|
||||
msgid "watch file FD opened by process PID"
|
||||
msgstr "FD izleme dosyası PID işlemi tarafından açıldı"
|
||||
|
||||
#: src/main/help.c:367
|
||||
msgid "PID"
|
||||
msgstr "PID"
|
||||
|
||||
#: src/main/help.c:368
|
||||
msgid "update settings of process PID"
|
||||
msgstr "süreç PID ayarlarını güncelle"
|
||||
|
||||
#: src/main/help.c:373
|
||||
msgid "save process ID in FILE"
|
||||
msgstr "FILE'da işlem kimliğini (ID) kaydet"
|
||||
|
||||
#: src/main/help.c:376
|
||||
msgid "show this help and exit"
|
||||
msgstr "bu yardımı göster ve çık"
|
||||
|
||||
#: src/main/help.c:379
|
||||
msgid "show version information and exit"
|
||||
msgstr "sürüm bilgilerini göster ve çık"
|
||||
|
||||
#: src/main/help.c:383
|
||||
msgid "write debug logs to FILE"
|
||||
msgstr "Hata ayıklama kayıtlarını DOSYA'ya yaz"
|
||||
|
||||
#: src/main/help.c:409
|
||||
#, c-format
|
||||
msgid "Usage: %s [OPTION] [FILE]..."
|
||||
msgstr "Kullanım şekli: %s [AYAR] [DOSYA]..."
|
||||
|
||||
#: src/main/help.c:420
|
||||
msgid ""
|
||||
"Concatenate FILE(s), or standard input, to standard output, with monitoring."
|
||||
msgstr ""
|
||||
"İzleme ile DOSYA(lar)ı veya standart girdiyi standart çıktı ile birleştirin."
|
||||
|
||||
#: src/main/help.c:558
|
||||
msgid "Supported format sequences:"
|
||||
msgstr "Desteklenen biçim dizileri:"
|
||||
|
||||
#: src/main/help.c:572
|
||||
#, c-format
|
||||
msgid "Please report any bugs to: %s"
|
||||
msgstr "Lütfen hataları şu adrese bildirin: %s"
|
||||
|
||||
#: src/main/main.c:232
|
||||
msgid "(input)"
|
||||
msgstr "(giriş)"
|
||||
|
||||
#: src/main/main.c:334
|
||||
msgid "state allocation failed"
|
||||
msgstr "durum tahsisi başarısız oldu"
|
||||
|
||||
#: src/main/options.c:370
|
||||
msgid "list files may not contain @ lines"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:391 src/main/options.c:393 src/main/options.c:804
|
||||
msgid "process ID or pid:fd pair expected"
|
||||
msgstr "süreç kimliği (ID) veya pid:fd çifti bekleniyor"
|
||||
|
||||
#: src/main/options.c:403 src/main/options.c:405 src/main/options.c:811
|
||||
msgid "invalid process ID"
|
||||
msgstr "geçersiz süreç kimliği (ID)"
|
||||
|
||||
#: src/main/options.c:448 src/pv/file.c:342
|
||||
msgid "failed to stat file"
|
||||
msgstr "dosya statüsünde başarısız oldu"
|
||||
|
||||
#: src/main/options.c:462
|
||||
msgid "is a directory"
|
||||
msgstr "bir dizindir"
|
||||
|
||||
#: src/main/options.c:491
|
||||
msgid "failed to generate sysfs filename"
|
||||
msgstr "sysfs dosya adı oluşturulamadı"
|
||||
|
||||
#: src/main/options.c:513
|
||||
msgid "failed to read sysfs size file"
|
||||
msgstr "sysfs boyut dosyası okunamadı"
|
||||
|
||||
#: src/main/options.c:533
|
||||
msgid "failed to open block device"
|
||||
msgstr "blok aygıtı açılamadı"
|
||||
|
||||
#: src/main/options.c:543
|
||||
msgid "failed to determine size of block device"
|
||||
msgstr "blok aygıtının boyutu belirlenemedi"
|
||||
|
||||
#: src/main/options.c:651
|
||||
msgid "option structure allocation failed"
|
||||
msgstr "seçenek yapısı tahsisi başarısız oldu"
|
||||
|
||||
#: src/main/options.c:670
|
||||
msgid "option structure argv allocation failed"
|
||||
msgstr "seçenek yapısı argv tahsisi başarısız oldu"
|
||||
|
||||
#: src/main/options.c:722
|
||||
msgid "numeric value not understood"
|
||||
msgstr "sayısal değer anlaşılmadı"
|
||||
|
||||
#: src/main/options.c:740
|
||||
msgid "integer argument expected"
|
||||
msgstr "tamsayı bağımsız değişkeni bekleniyor"
|
||||
|
||||
#: src/main/options.c:752
|
||||
msgid "numeric argument expected"
|
||||
msgstr "sayısal bağımsız değişken bekleniyor"
|
||||
|
||||
#: src/main/options.c:764
|
||||
msgid "missing filename"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:792
|
||||
msgid "missing process name"
|
||||
msgstr ""
|
||||
|
||||
#: src/main/options.c:1048
|
||||
#, c-format
|
||||
msgid "Try `%s --help' for more information."
|
||||
msgstr "Daha fazla bilgi için `%s --help' seçeneğini deneyin."
|
||||
|
||||
#: src/main/options.c:1050
|
||||
#, c-format
|
||||
msgid "Try `%s -h' for more information."
|
||||
msgstr "Daha fazla bilgi için `%s -h' seçeneğini deneyin."
|
||||
|
||||
#: src/main/options.c:1081
|
||||
msgid ""
|
||||
"cannot use line mode or transfer modifier options when watching file "
|
||||
"descriptors"
|
||||
msgstr ""
|
||||
"dosya tanımlayıcılarını izlerken satır modu veya aktarım değiştirici "
|
||||
"seçeneklerini kullanamaz"
|
||||
|
||||
#: src/main/options.c:1090
|
||||
msgid "cannot use cursor positioning when watching file descriptors"
|
||||
msgstr "dosya tanımlayıcılarını izlerken imleç konumlandırmayı kullanamaz"
|
||||
|
||||
#: src/main/options.c:1099
|
||||
msgid "cannot use remote control when watching file descriptors"
|
||||
msgstr "dosya tanımlayıcılarını izlerken uzaktan kumandayı kullanamaz"
|
||||
|
||||
#: src/main/options.c:1108
|
||||
msgid "cannot transfer files when watching file descriptors"
|
||||
msgstr "dosya tanımlayıcıları izlenirken dosya aktarılamıyor"
|
||||
|
||||
#: src/main/options.c:1133
|
||||
msgid "not available on systems without /proc/self/fdinfo"
|
||||
msgstr "/proc/self/fdinfo olmayan sistemlerde kullanılamaz"
|
||||
|
||||
#: src/main/remote.c:309
|
||||
msgid "message not received"
|
||||
msgstr "mesaj alınamadı"
|
||||
|
||||
#: src/main/remote.c:444
|
||||
msgid "SA_SIGINFO not supported on this system"
|
||||
msgstr "SA_SIGINFO bu sistemde desteklenmiyor"
|
||||
|
||||
#: src/main/version.c:28
|
||||
msgid "License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
msgstr "Lisans: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"
|
||||
|
||||
#: src/main/version.c:29
|
||||
msgid "This is free software: you are free to change and redistribute it."
|
||||
msgstr ""
|
||||
"Bu özgür bir yazılımdır: değiştirmekte ve yeniden dağıtmakta özgürsünüz."
|
||||
|
||||
#: src/main/version.c:30
|
||||
msgid "There is NO WARRANTY, to the extent permitted by law."
|
||||
msgstr "Yasaların izin verdiği ölçüde GARANTİ YOKTUR."
|
||||
|
||||
#: src/main/version.c:32
|
||||
msgid "Project web site"
|
||||
msgstr "Proje web sitesi"
|
||||
|
||||
#: src/pv/cursor.c:61
|
||||
msgid "failed to get terminal name"
|
||||
msgstr "terminal adı alınamadı"
|
||||
|
||||
#: src/pv/cursor.c:106
|
||||
msgid "failed to open lock file"
|
||||
msgstr "lock dosyası açılamadı"
|
||||
|
||||
#: src/pv/cursor.c:139
|
||||
msgid "lock attempt failed"
|
||||
msgstr "kilit denemesi başarısız oldu"
|
||||
|
||||
#: src/pv/cursor.c:400
|
||||
msgid "failed to open terminal"
|
||||
msgstr "terminal açılamadı"
|
||||
|
||||
#: src/pv/display.c:285
|
||||
msgid "yzafpnum kMGTPEZY"
|
||||
msgstr "yzafpnum kMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:303
|
||||
msgid "yzafpnum KMGTPEZY"
|
||||
msgstr "yzafpnum KMGTPEZY"
|
||||
|
||||
#: src/pv/display.c:1053 src/pv/loop.c:754 src/pv/transfer.c:1135
|
||||
msgid "buffer allocation failed"
|
||||
msgstr "arabellek tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/file.c:153
|
||||
msgid "failed to seek to start of output"
|
||||
msgstr "çıktının başlangıcına ulaşılamadı"
|
||||
|
||||
#: src/pv/file.c:303
|
||||
msgid "failed to close file"
|
||||
msgstr "dosya kapatılamadı"
|
||||
|
||||
#: src/pv/file.c:335
|
||||
msgid "failed to read file"
|
||||
msgstr "dosya okunamadı"
|
||||
|
||||
#: src/pv/file.c:350
|
||||
msgid "failed to stat output file"
|
||||
msgstr "çıktı dosyası stat edilemedi"
|
||||
|
||||
#: src/pv/file.c:372
|
||||
msgid "input file is output file"
|
||||
msgstr "girdi dosyası çıktı dosyasıdır"
|
||||
|
||||
#: src/pv/file.c:429
|
||||
msgid "(none)"
|
||||
msgstr "(yok)"
|
||||
|
||||
#: src/pv/file.c:431
|
||||
msgid "(stdin)"
|
||||
msgstr "(stdin)"
|
||||
|
||||
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:92
|
||||
#: src/pv/format/rate.c:36 src/pv/loop.c:565
|
||||
msgid "b/s"
|
||||
msgstr "b/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40
|
||||
msgid "/s"
|
||||
msgstr "/s"
|
||||
|
||||
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:96
|
||||
#: src/pv/format/rate.c:40 src/pv/loop.c:565
|
||||
msgid "B/s"
|
||||
msgstr "B/s"
|
||||
|
||||
#: src/pv/format/bytes.c:35
|
||||
msgid "b"
|
||||
msgstr "b"
|
||||
|
||||
#: src/pv/format/bytes.c:39 src/pv/transfer.c:620
|
||||
msgid "B"
|
||||
msgstr "B"
|
||||
|
||||
#: src/pv/format/eta.c:52 src/pv/format/eta.c:56
|
||||
msgid "ETA"
|
||||
msgstr "ETA"
|
||||
|
||||
#: src/pv/format/fineta.c:80
|
||||
msgid "FIN"
|
||||
msgstr "FIN"
|
||||
|
||||
#: src/pv/loop.c:564
|
||||
msgid "rate min/avg/max/mdev"
|
||||
msgstr "oran min/ortalama/maks/standart sapma"
|
||||
|
||||
#: src/pv/loop.c:576
|
||||
msgid "rate not measured"
|
||||
msgstr "oran ölçülmedi"
|
||||
|
||||
#: src/pv/loop.c:775 src/pv/loop.c:791 src/pv/loop.c:809 src/pv/watchpid.c:99
|
||||
#: src/pv/watchpid.c:108 src/pv/watchpid.c:119 src/pv/watchpid.c:127
|
||||
#: src/pv/watchpid.c:164 src/pv/watchpid.c:183 src/pv/watchpid.c:191
|
||||
#: src/pv/watchpid.c:201 src/pv/watchpid.c:299 src/pv/watchpid.c:307
|
||||
#: src/pv/watchpid.c:439 src/pv/watchpid.c:462
|
||||
msgid "pid"
|
||||
msgstr "pid"
|
||||
|
||||
#: src/pv/loop.c:809 src/pv/watchpid.c:108 src/pv/watchpid.c:120
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:183 src/pv/watchpid.c:192
|
||||
#: src/pv/watchpid.c:203
|
||||
msgid "fd"
|
||||
msgstr "fd"
|
||||
|
||||
#: src/pv/state.c:42
|
||||
msgid "history structure allocation failed"
|
||||
msgstr "geçmiş yapısı tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/state.c:741 src/pv/state.c:753
|
||||
msgid "file list allocation failed"
|
||||
msgstr "dosya listesi tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/state.c:787
|
||||
msgid "process list allocation failed"
|
||||
msgstr "işlem listesi tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/state.c:795
|
||||
msgid "file descriptor list allocation failed"
|
||||
msgstr "dosya tanımlayıcı listesi tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/transfer.c:490
|
||||
msgid "read failed"
|
||||
msgstr "okuma başarısız"
|
||||
|
||||
#: src/pv/transfer.c:506
|
||||
msgid "warning: read errors detected"
|
||||
msgstr "uyarı: okuma hataları tespit edildi"
|
||||
|
||||
#: src/pv/transfer.c:522
|
||||
msgid "file is not seekable"
|
||||
msgstr "dosya aranabilir değil"
|
||||
|
||||
#: src/pv/transfer.c:599
|
||||
msgid "failed to seek past error"
|
||||
msgstr "geçmiş hatayı aramakta başarısız oldu"
|
||||
|
||||
#: src/pv/transfer.c:619
|
||||
msgid "skipped past read error"
|
||||
msgstr "geçmiş okuma hatası atlandı"
|
||||
|
||||
#: src/pv/transfer.c:663
|
||||
msgid "no transfer buffer allocated"
|
||||
msgstr "aktarım arabelleği ayrılmamış"
|
||||
|
||||
#: src/pv/transfer.c:751
|
||||
msgid "failed to set interval timer"
|
||||
msgstr "aralık zamanlayıcısı ayarlanamadı"
|
||||
|
||||
#: src/pv/transfer.c:777
|
||||
msgid "failed to clear interval timer"
|
||||
msgstr "aralık zamanlayıcısı temizlenemedi"
|
||||
|
||||
#: src/pv/transfer.c:822
|
||||
msgid "line position buffer allocation failed"
|
||||
msgstr "satır konumu arabellek tahsisi başarısız oldu"
|
||||
|
||||
#: src/pv/transfer.c:996
|
||||
msgid "write failed"
|
||||
msgstr "yazma başarısız"
|
||||
|
||||
#: src/pv/transfer.c:1237
|
||||
msgid "select call failed"
|
||||
msgstr "seçme çağrısı başarısız oldu"
|
||||
|
||||
#: src/pv/watchpid.c:129 src/pv/watchpid.c:203
|
||||
msgid "not a regular file or block device"
|
||||
msgstr "normal bir dosya veya blok aygıtı değil"
|
||||
|
||||
#~ msgid "PID[:FD]"
|
||||
#~ msgstr "PID[:FD]"
|
||||
@@ -3,7 +3,7 @@
|
||||
* `configure' script. Include this after config.h and before anything
|
||||
* else.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -44,4 +44,10 @@ typedef bool _Bool;
|
||||
# define __bool_true_false_are_defined 1
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
/* Whether "--remote" should be available. */
|
||||
#undef PV_REMOTE_CONTROL
|
||||
#if HAVE_DECL_SA_SIGINFO
|
||||
# if SIGINFO_PROVIDES_PID
|
||||
#define PV_REMOTE_CONTROL 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
/* Debugging support enabled */
|
||||
#undef ENABLE_DEBUGGING
|
||||
|
||||
/* Build with ncurses support */
|
||||
#undef ENABLE_NCURSES
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
@@ -28,6 +31,10 @@
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define to 1 if you have the declaration of `SA_SIGINFO', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SA_SIGINFO
|
||||
|
||||
/* Define to 1 if you have the `dup2' function. */
|
||||
#undef HAVE_DUP2
|
||||
|
||||
@@ -37,6 +44,9 @@
|
||||
/* Define to 1 if you have the `fdatasync' function. */
|
||||
#undef HAVE_FDATASYNC
|
||||
|
||||
/* Define to 1 if you have the `fmod' function. */
|
||||
#undef HAVE_FMOD
|
||||
|
||||
/* Define to 1 if you have the `fpathconf' function. */
|
||||
#undef HAVE_FPATHCONF
|
||||
|
||||
@@ -61,6 +71,9 @@
|
||||
/* IPC support enabled */
|
||||
#undef HAVE_IPC
|
||||
|
||||
/* Define to 1 if you have the <langinfo.h> header file. */
|
||||
#undef HAVE_LANGINFO_H
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
#undef HAVE_LIBGEN_H
|
||||
|
||||
@@ -73,6 +86,9 @@
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if you have the <math.h> header file. */
|
||||
#undef HAVE_MATH_H
|
||||
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
@@ -88,6 +104,9 @@
|
||||
/* Define to 1 if you have the <minix/config.h> header file. */
|
||||
#undef HAVE_MINIX_CONFIG_H
|
||||
|
||||
/* Define to 1 if you have the `mkdir' function. */
|
||||
#undef HAVE_MKDIR
|
||||
|
||||
/* Define to 1 if you have the `nanosleep' function. */
|
||||
#undef HAVE_NANOSLEEP
|
||||
|
||||
@@ -106,12 +125,18 @@
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define to 1 if you have the `setproctitle' function. */
|
||||
#undef HAVE_SETPROCTITLE
|
||||
|
||||
/* Define to 1 if you have the `shmget' function. */
|
||||
#undef HAVE_SHMGET
|
||||
|
||||
/* Define to 1 if you have the `splice' function. */
|
||||
#undef HAVE_SPLICE
|
||||
|
||||
/* Define to 1 if you have the `sqrtl' function. */
|
||||
#undef HAVE_SQRTL
|
||||
|
||||
/* Define to 1 if stdbool.h conforms to C99. */
|
||||
#undef HAVE_STDBOOL_H
|
||||
|
||||
@@ -151,6 +176,9 @@
|
||||
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||
|
||||
/* Define to 1 if `st_rdev' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_RDEV
|
||||
|
||||
/* Define to 1 if you have the `sysconf' function. */
|
||||
#undef HAVE_SYSCONF
|
||||
|
||||
@@ -166,9 +194,15 @@
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/shm.h> header file. */
|
||||
#undef HAVE_SYS_SHM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
|
||||
#undef HAVE_SYS_SYSMACROS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
@@ -178,6 +212,9 @@
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define to 1 if you have the <term.h> header file. */
|
||||
#undef HAVE_TERM_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
@@ -214,6 +251,9 @@
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Signal handlers can determine the sending PID */
|
||||
#undef SIGINFO_PROVIDES_PID
|
||||
|
||||
/* Define to 1 if all of the C90 standard headers exist (not just the ones
|
||||
required in a freestanding environment). This macro is provided for
|
||||
backward compatibility; new code need not use it. */
|
||||
|
||||
+48
-26
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Global program option structure and the parsing function prototype.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -23,9 +23,50 @@ extern "C" {
|
||||
struct opts_s;
|
||||
typedef struct opts_s *opts_t;
|
||||
|
||||
struct opts_s { /* structure describing run-time options */
|
||||
/*
|
||||
* Overall program actions to select.
|
||||
*/
|
||||
typedef enum {
|
||||
PV_ACTION_NOTHING, /* do nothing, and exit */
|
||||
PV_ACTION_TRANSFER, /* transfer data */
|
||||
PV_ACTION_STORE_AND_FORWARD, /* store to file, then output from it */
|
||||
PV_ACTION_WATCHFD /* watch process file descriptors */
|
||||
} pvaction_t;
|
||||
|
||||
/*
|
||||
* Structure describing run-time options.
|
||||
*
|
||||
* Members are ordered by size to minimise padding.
|
||||
*/
|
||||
struct opts_s {
|
||||
double interval; /* interval between updates */
|
||||
double delay_start; /* delay before first display */
|
||||
/*@keep@*/ const char *program_name; /* name the program is running as */
|
||||
bool do_nothing; /* exit-without-doing-anything flag */
|
||||
/*@keep@*/ /*@null@*/ char *output; /* fd to write output to */
|
||||
/*@keep@*/ /*@null@*/ char *name; /* display name, if any */
|
||||
/*@keep@*/ /*@null@*/ char *default_bar_style; /* default bar style */
|
||||
/*@keep@*/ /*@null@*/ char *format; /* output format, if any */
|
||||
/*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */
|
||||
/*@keep@*/ /*@null@*/ char *store_and_forward_file; /* store and forward file, if any */
|
||||
/*@keep@*/ /*@null@*/ char *extra_display; /* extra display specifier, if any */
|
||||
/*@keep@*/ /*@null@*/ pid_t *watchfd_pid; /* array of processes to watch fds of */
|
||||
/*@keep@*/ /*@null@*/ int *watchfd_fd; /* array of fds to watch in each one (0=all) */
|
||||
/*@keep@*/ /*@null@*/ const char **argv; /* array of non-option arguments */
|
||||
size_t lastwritten; /* show N bytes last written */
|
||||
off_t rate_limit; /* rate limit, in bytes per second */
|
||||
size_t buffer_size; /* buffer size, in bytes (0=default) */
|
||||
off_t size; /* total size of data */
|
||||
off_t error_skip_block; /* skip block size, 0 for adaptive */
|
||||
pid_t remote; /* PID of pv to update settings of */
|
||||
unsigned int skip_errors; /* skip read errors counter */
|
||||
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
|
||||
unsigned int width; /* screen width */
|
||||
unsigned int height; /* screen height */
|
||||
unsigned int argc; /* number of non-option arguments */
|
||||
unsigned int argv_length; /* allocated array size */
|
||||
unsigned int watchfd_count; /* number of watchfd items */
|
||||
unsigned int watchfd_length; /* allocated array size */
|
||||
pvaction_t action; /* the program action to perform */
|
||||
bool progress; /* progress bar flag */
|
||||
bool timer; /* timer flag */
|
||||
bool eta; /* ETA flag */
|
||||
@@ -36,40 +77,23 @@ struct opts_s { /* structure describing run-time options */
|
||||
bool bits; /* report transfer size in bits */
|
||||
bool decimal_units; /* decimal prefix flag */
|
||||
bool bufpercent; /* transfer buffer percentage flag */
|
||||
size_t lastwritten; /* show N bytes last written */
|
||||
bool force; /* force-if-not-terminal flag */
|
||||
bool cursor; /* whether to use cursor positioning */
|
||||
bool numeric; /* numeric output only */
|
||||
bool wait; /* wait for transfer before display */
|
||||
bool rate_gauge; /* if size unknown, show rate vs max rate */
|
||||
bool linemode; /* count lines instead of bytes */
|
||||
bool null_terminated_lines; /* lines are null-terminated */
|
||||
bool no_display; /* do nothing other than pipe data */
|
||||
off_t rate_limit; /* rate limit, in bytes per second */
|
||||
size_t buffer_size; /* buffer size, in bytes (0=default) */
|
||||
unsigned int remote; /* PID of pv to update settings of */
|
||||
off_t size; /* total size of data */
|
||||
bool no_splice; /* flag set if never to use splice */
|
||||
unsigned int skip_errors; /* skip read errors counter */
|
||||
off_t error_skip_block; /* skip block size, 0 for adaptive */
|
||||
bool stop_at_size; /* set if we stop at "size" bytes */
|
||||
bool sync_after_write; /* set if we sync after every write */
|
||||
bool direct_io; /* set if O_DIRECT is to be used */
|
||||
bool discard_input; /* set to write nothing to stdout */
|
||||
double interval; /* interval between updates */
|
||||
double delay_start; /* delay before first display */
|
||||
pid_t watch_pid; /* process to watch fds of */
|
||||
int watch_fd; /* fd to watch */
|
||||
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
|
||||
unsigned int width; /* screen width */
|
||||
unsigned int height; /* screen height */
|
||||
bool sparse_output; /* set if we leave holes in the output */
|
||||
bool discard_input; /* set to write nothing to output */
|
||||
bool show_stats; /* set to write statistics at the end */
|
||||
bool width_set_manually; /* width was set manually, not detected */
|
||||
bool height_set_manually; /* height was set manually, not detected */
|
||||
/*@keep@*/ /*@null@*/ char *name; /* display name, if any */
|
||||
/*@keep@*/ /*@null@*/ char *format; /* output format, if any */
|
||||
/*@keep@*/ /*@null@*/ char *pidfile; /* PID file, if any */
|
||||
unsigned int argc; /* number of non-option arguments */
|
||||
/*@keep@*/ /*@null@*/ const char **argv; /* array of non-option arguments */
|
||||
unsigned int argv_length; /* allocated array size */
|
||||
};
|
||||
|
||||
/*@-exportlocal@*/
|
||||
@@ -84,5 +108,3 @@ extern bool opts_add_file(opts_t, const char *);
|
||||
#endif
|
||||
|
||||
#endif /* _OPTIONS_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
+392
-109
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions internal to the PV library. Include "config.h" first.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -9,6 +9,9 @@
|
||||
#ifndef _PV_INTERNAL_H
|
||||
#define _PV_INTERNAL_H 1
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
@@ -20,26 +23,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Types of display component that make up an output string.
|
||||
*/
|
||||
typedef enum {
|
||||
PV_COMPONENT_STRING, /* fixed string */
|
||||
PV_COMPONENT_PROGRESS, /* progress bar, with percentage if known */
|
||||
PV_COMPONENT_BYTES, /* number of bytes transferred */
|
||||
PV_COMPONENT_TIMER, /* elapsed time */
|
||||
PV_COMPONENT_RATE, /* current transfer rate */
|
||||
PV_COMPONENT_AVERAGERATE, /* average transfer rate */
|
||||
PV_COMPONENT_ETA, /* estimated time remaining until completion */
|
||||
PV_COMPONENT_FINETA, /* estimated time of completion */
|
||||
PV_COMPONENT_NAME, /* name prefix */
|
||||
PV_COMPONENT_BUFPERCENT, /* percentage of buffer used */
|
||||
PV_COMPONENT_OUTPUTBUF, /* recent bytes in output buffer */
|
||||
PV_COMPONENT__MAX
|
||||
} pv_display_component;
|
||||
|
||||
#define PV_SIZEOF_COMPONENT_STR 1024 /* size of buffer for each component */
|
||||
|
||||
#define RATE_GRANULARITY 100000000 /* nsec between -L rate chunks */
|
||||
#define RATE_BURST_WINDOW 5 /* rate burst window (multiples of rate) */
|
||||
#define REMOTE_INTERVAL 100000000 /* nsec between checks for -R */
|
||||
@@ -49,13 +32,16 @@ typedef enum {
|
||||
#define MAX_WRITE_AT_ONCE (size_t) 524288 /* max to write() in one go */
|
||||
#define TRANSFER_READ_TIMEOUT 0.09L /* seconds to time reads out at */
|
||||
#define TRANSFER_WRITE_TIMEOUT 0.9L /* seconds to time writes out at */
|
||||
#define MAX_LINE_POSITIONS 100000 /* number of lines to remember positions of */
|
||||
|
||||
#define MAXIMISE_BUFFER_FILL 1
|
||||
|
||||
#define PV_SIZEOF_DEFAULT_FORMAT 512
|
||||
#define PV_SIZEOF_CWD 4096
|
||||
#define PV_SIZEOF_LASTOUTPUT_BUFFER 256
|
||||
#define PV_SIZEOF_LASTWRITTEN_BUFFER 256
|
||||
#define PV_SIZEOF_PREVLINE_BUFFER 1024
|
||||
#define PV_FORMAT_ARRAY_MAX 100
|
||||
#define PV_SIZEOF_FORMAT_SEGMENTS_BUF 4096
|
||||
#define PV_SIZEOF_CRS_LOCK_FILE 1024
|
||||
|
||||
#define PV_SIZEOF_FILE_FDINFO 4096
|
||||
@@ -63,88 +49,176 @@ typedef enum {
|
||||
#define PV_SIZEOF_FILE_FDPATH 4096
|
||||
#define PV_SIZEOF_DISPLAY_NAME 512
|
||||
|
||||
#define PV_BARSTYLE_MAX 4 /* number of different styles allowed in a format */
|
||||
#define PV_BARSTYLE_SIZEOF_STRING 10 /* max length of a bar constituent component in bytes */
|
||||
#define PV_BARSTYLE_MAX_FILLERS 10 /* max number of bar filler strings */
|
||||
|
||||
#define PV_DISPLAY_WINDOWTITLE 1
|
||||
#define PV_DISPLAY_PROCESSTITLE 2
|
||||
|
||||
|
||||
/*
|
||||
* Structure for data shared between multiple "pv -c" instances.
|
||||
*/
|
||||
struct pvcursorstate_s {
|
||||
struct pvipccursorstate_s {
|
||||
int y_topmost; /* terminal row of topmost "pv" instance */
|
||||
bool tty_tostop_added; /* whether any instance had to set TOSTOP on the terminal */
|
||||
};
|
||||
|
||||
/*
|
||||
* Types of transfer count - bytes, decimal bytes or lines.
|
||||
*/
|
||||
typedef enum {
|
||||
PV_TRANSFERCOUNT_BYTES,
|
||||
PV_TRANSFERCOUNT_DECBYTES,
|
||||
PV_TRANSFERCOUNT_LINES
|
||||
} pvtransfercount_t;
|
||||
|
||||
|
||||
/*
|
||||
* Structure describing a short string used as part of a progress bar, whose
|
||||
* width in display characters may not be the same as its length in bytes.
|
||||
*/
|
||||
struct pvbarstring_spec_s {
|
||||
char string[PV_BARSTYLE_SIZEOF_STRING];
|
||||
uint8_t width;
|
||||
uint8_t bytes;
|
||||
};
|
||||
|
||||
/*
|
||||
* Structure describing a style of progress bar.
|
||||
*
|
||||
* The part that moves back and forth when the size isn't known, such as
|
||||
* "<=>", is "indicator".
|
||||
*
|
||||
* The string used to populate the rest of the bar is one of "filler", which
|
||||
* contains "filler_entries" array items. The first item "filler[0]" is
|
||||
* used for an empty part such as " ". The last item
|
||||
* "filler[filler_entries-1]" is used for a 100% full part, such as "=".
|
||||
*
|
||||
* If there are more than the minimum of 2 entries, then the intervening
|
||||
* entries are used for partial fills.
|
||||
*
|
||||
* When there are only 2 entries and the bar isn't completely empty or full,
|
||||
* the last filled portion of the bar is filled with "tip" instead of the
|
||||
* last filler item to indicate the tip of the bar, such as ">".
|
||||
*
|
||||
* Note that only the indicator is expected to ever be wider than 1 display
|
||||
* character. All other items are expected to have a width of 0 or 1.
|
||||
*
|
||||
* The "style_id" is an opaque identifier that should only be used to
|
||||
* determine whether two styles are the same. It is always nonzero.
|
||||
*/
|
||||
struct pvbarstyle_s {
|
||||
uint8_t style_id;
|
||||
uint8_t filler_entries;
|
||||
struct pvbarstring_spec_s indicator;
|
||||
struct pvbarstring_spec_s tip;
|
||||
struct pvbarstring_spec_s filler[PV_BARSTYLE_MAX_FILLERS];
|
||||
};
|
||||
typedef struct pvbarstyle_s *pvbarstyle_t;
|
||||
|
||||
|
||||
/* Display format component type, -1 for static string. */
|
||||
typedef int8_t pvdisplay_component_t;
|
||||
#define PVDISPLAY_COMPONENT_MAX (127) /* INT8_MAX */
|
||||
|
||||
/* Byte count of a part of the display. */
|
||||
typedef uint16_t pvdisplay_bytecount_t;
|
||||
#define PVDISPLAY_BYTECOUNT_MAX (65535) /* UINT16_MAX */
|
||||
|
||||
/* Width of a part of the display. */
|
||||
typedef uint16_t pvdisplay_width_t;
|
||||
#define PVDISPLAY_WIDTH_MAX (65535) /* UINT16_MAX */
|
||||
|
||||
/* String pointer, that is the only pointer to this resource, that can be null. */
|
||||
typedef /*@only@*/ /*@null@*/ char * nullable_string_t;
|
||||
|
||||
/*
|
||||
* Structure for holding PV internal state. Opaque outside the PV library.
|
||||
*
|
||||
* In general, members are ordered by size, to minimise padding.
|
||||
*/
|
||||
struct pvstate_s {
|
||||
/******************
|
||||
* Program status *
|
||||
******************/
|
||||
struct {
|
||||
/*@only@*/ char *program_name; /* program name for error reporting */
|
||||
struct pvprogramstatus_s {
|
||||
char cwd[PV_SIZEOF_CWD]; /* current working directory for relative path */
|
||||
int current_input_file; /* index of current file being read */
|
||||
int exit_status; /* exit status to give (0=OK) */
|
||||
bool terminal_supports_utf8; /* whether the terminal supports UTF-8 */
|
||||
bool terminal_supports_colour; /* whether the terminal supports colour */
|
||||
bool checked_colour_support; /* whether we have checked colour support yet */
|
||||
} status;
|
||||
|
||||
/***************
|
||||
* Input files *
|
||||
***************/
|
||||
struct {
|
||||
struct pvinputfiles_s {
|
||||
/*@only@*/ /*@null@*/ nullable_string_t *filename; /* input filenames */
|
||||
unsigned int file_count; /* number of input files */
|
||||
/*@only@*/ /*@null@*/ char **filename; /* input filenames */
|
||||
} files;
|
||||
|
||||
/*********************************
|
||||
* Items to watch with --watchfd *
|
||||
*********************************/
|
||||
struct pvwatchspec_s {
|
||||
/*@only@*/ /*@null@*/ pid_t *pid; /* array of processes to watch fds of */
|
||||
/*@only@*/ /*@null@*/ int *fd; /* array of fds to watch in each one (0=all) */
|
||||
unsigned int count; /* number of items in these arrays */
|
||||
bool multiple_pids; /* true if more than one distinct PID */
|
||||
} watchfd;
|
||||
|
||||
/*******************
|
||||
* Program control *
|
||||
*******************/
|
||||
struct {
|
||||
struct pvcontrol_s {
|
||||
char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */
|
||||
double interval; /* interval between updates */
|
||||
double delay_start; /* delay before first display */
|
||||
/*@only@*/ /*@null@*/ char *name; /* display name */
|
||||
/*@only@*/ /*@null@*/ char *format_string; /* output format string */
|
||||
/*@only@*/ /*@null@*/ char *extra_format_string; /* extra format string */
|
||||
/*@null@*/ char *output_name; /* name of the output, for diagnostics */
|
||||
/*@null@*/ char *default_bar_style; /* which bar style to use by default */
|
||||
off_t error_skip_block; /* skip block size, 0 for adaptive */
|
||||
off_t rate_limit; /* rate limit, in bytes per second */
|
||||
size_t target_buffer_size; /* buffer size (0=default) */
|
||||
off_t size; /* total size of data */
|
||||
unsigned int skip_errors; /* skip read errors counter */
|
||||
int output_fd; /* fd to write output to */
|
||||
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
|
||||
unsigned int history_interval; /* seconds between each average rate calc history entry */
|
||||
pvdisplay_width_t width; /* screen width */
|
||||
unsigned int height; /* screen height */
|
||||
unsigned int extra_displays; /* bitmask of extra display destinations */
|
||||
bool force; /* display even if not on terminal */
|
||||
bool cursor; /* use cursor positioning */
|
||||
bool numeric; /* numeric output only */
|
||||
bool wait; /* wait for data before display */
|
||||
bool rate_gauge; /* if size unknown, show rate vs max rate */
|
||||
bool linemode; /* count lines instead of bytes */
|
||||
bool bits; /* report bits instead of bytes */
|
||||
bool decimal_units; /* use decimal prefixes */
|
||||
bool null_terminated_lines; /* lines are null-terminated */
|
||||
bool no_display; /* do nothing other than pipe data */
|
||||
unsigned int skip_errors; /* skip read errors counter */
|
||||
off_t error_skip_block; /* skip block size, 0 for adaptive */
|
||||
bool no_splice; /* never use splice() */
|
||||
bool stop_at_size; /* set if we stop at "size" bytes */
|
||||
bool sync_after_write; /* set if we sync after every write */
|
||||
bool direct_io; /* set if O_DIRECT is to be used */
|
||||
bool direct_io_changed; /* set when direct_io is changed */
|
||||
bool no_splice; /* never use splice() */
|
||||
bool sparse_output; /* set if we leave holes in the output */
|
||||
bool discard_input; /* write nothing to stdout */
|
||||
off_t rate_limit; /* rate limit, in bytes per second */
|
||||
size_t target_buffer_size; /* buffer size (0=default) */
|
||||
off_t size; /* total size of data */
|
||||
double interval; /* interval between updates */
|
||||
double delay_start; /* delay before first display */
|
||||
pid_t watch_pid; /* process to watch fds of */
|
||||
int watch_fd; /* fd to watch */
|
||||
unsigned int average_rate_window; /* time window in seconds for average rate calculations */
|
||||
unsigned int width; /* screen width */
|
||||
unsigned int height; /* screen height */
|
||||
bool show_stats; /* show statistics on exit */
|
||||
bool width_set_manually; /* width was set manually, not detected */
|
||||
bool height_set_manually; /* height was set manually, not detected */
|
||||
/*@only@*/ /*@null@*/ char *name; /* display name */
|
||||
char default_format[PV_SIZEOF_DEFAULT_FORMAT]; /* default format string */
|
||||
/*@only@*/ /*@null@*/ char *format_string; /* output format string */
|
||||
} control;
|
||||
|
||||
/*******************
|
||||
* Signal handling *
|
||||
*******************/
|
||||
struct {
|
||||
int old_stderr; /* see pv_sig_ttou() */
|
||||
bool pv_tty_tostop_added; /* whether we had to set TOSTOP on the terminal */
|
||||
struct timespec tstp_time; /* see pv_sig_tstp() / __cont() */
|
||||
struct timespec toffset; /* total time spent stopped */
|
||||
#ifdef SA_SIGINFO
|
||||
volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */
|
||||
volatile pid_t sender; /* PID of sending process for SIGUSR2 */
|
||||
#endif
|
||||
struct pvsignal_s {
|
||||
/* old signal handlers to restore in pv_sig_fini(). */
|
||||
struct sigaction old_sigpipe;
|
||||
struct sigaction old_sigttou;
|
||||
@@ -154,85 +228,142 @@ struct pvstate_s {
|
||||
struct sigaction old_sigint;
|
||||
struct sigaction old_sighup;
|
||||
struct sigaction old_sigterm;
|
||||
#ifdef SA_SIGINFO
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
struct sigaction old_sigusr2;
|
||||
#endif
|
||||
struct sigaction old_sigalrm;
|
||||
struct timespec tstp_time; /* see pv_sig_tstp() / __cont() */
|
||||
struct timespec toffset; /* total time spent stopped */
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
volatile sig_atomic_t rxusr2; /* whether SIGUSR2 was received */
|
||||
volatile pid_t sender; /* PID of sending process for SIGUSR2 */
|
||||
#endif
|
||||
} signal;
|
||||
|
||||
/*******************
|
||||
* Transient flags *
|
||||
*******************/
|
||||
struct {
|
||||
struct pvtransientflags_s {
|
||||
volatile sig_atomic_t reparse_display; /* whether to re-check format string */
|
||||
volatile sig_atomic_t terminal_resized; /* whether we need to get term size again */
|
||||
volatile sig_atomic_t trigger_exit; /* whether we need to abort right now */
|
||||
} flag;
|
||||
volatile sig_atomic_t clear_tty_tostop_on_exit; /* whether to clear tty TOSTOP on exit */
|
||||
volatile sig_atomic_t suspend_stderr; /* whether writing to stderr is suspended */
|
||||
volatile sig_atomic_t skip_next_sigcont; /* whether to ignore the next SIGCONT */
|
||||
volatile sig_atomic_t pipe_closed; /* whether the output pipe was closed */
|
||||
} flags;
|
||||
|
||||
/*****************
|
||||
* Display state *
|
||||
*****************/
|
||||
struct {
|
||||
/*@only@*/ /*@null@*/ char *display_buffer; /* buffer for display string */
|
||||
size_t display_buffer_size; /* size allocated to display buffer */
|
||||
size_t display_string_len; /* length of string in display buffer */
|
||||
unsigned int prev_screen_width; /* screen width last time we were called */
|
||||
bool display_visible; /* set once anything written to terminal */
|
||||
struct pvdisplay_s {
|
||||
|
||||
int percentage; /* transfer percentage completion */
|
||||
struct pvdisplay_segment_s { /* format string broken into segments */
|
||||
/* See pv__format_init() for more details. */
|
||||
/*@dependent@*/ /*@null@*/ const char *string_parameter; /* parameter after colon in %{x:} */
|
||||
pvdisplay_bytecount_t string_parameter_bytes; /* number of bytes in string_parameter */
|
||||
pvdisplay_component_t type; /* component type, -1 for static string */
|
||||
int8_t parameter; /* component parameter, such as bar style index */
|
||||
pvdisplay_width_t chosen_size; /* "n" from %<n>A, or 0 */
|
||||
pvdisplay_bytecount_t offset; /* start offset of this segment in the build buffer */
|
||||
pvdisplay_bytecount_t bytes; /* length of segment in bytes in the build buffer */
|
||||
pvdisplay_width_t width; /* displayed width of segment */
|
||||
} format[PV_FORMAT_ARRAY_MAX];
|
||||
|
||||
struct pvbarstyle_s barstyle[PV_BARSTYLE_MAX];
|
||||
|
||||
/* The last-written "n" bytes. */
|
||||
char lastwritten_buffer[PV_SIZEOF_LASTWRITTEN_BUFFER];
|
||||
|
||||
/* The most recently output complete line. */
|
||||
char previous_line[PV_SIZEOF_PREVLINE_BUFFER];
|
||||
/* The line being received now. */
|
||||
char next_line[PV_SIZEOF_PREVLINE_BUFFER];
|
||||
|
||||
/*@only@*/ /*@null@*/ char *display_buffer; /* buffer for display string */
|
||||
off_t initial_offset; /* offset when first opened (when watching fds) */
|
||||
size_t next_line_len; /* length of currently receiving line so far */
|
||||
|
||||
size_t format_segment_count; /* number of format string segments */
|
||||
|
||||
pvtransfercount_t count_type; /* type of count for transfer, rate, etc */
|
||||
|
||||
pvdisplay_width_t prev_screen_width; /* screen width last time we were called */
|
||||
|
||||
pvdisplay_bytecount_t display_buffer_size; /* size allocated to display buffer */
|
||||
pvdisplay_bytecount_t display_string_bytes; /* byte length of string in display buffer */
|
||||
pvdisplay_width_t display_string_width; /* displayed width of string in display buffer */
|
||||
pvdisplay_bytecount_t lastwritten_bytes; /* largest number of last-written bytes to show */
|
||||
|
||||
bool showing_timer; /* set if showing timer */
|
||||
bool showing_bytes; /* set if showing byte/line count */
|
||||
bool showing_rate; /* set if showing transfer rate */
|
||||
bool showing_last_written; /* set if displaying the last few bytes written */
|
||||
bool showing_previous_line; /* set if displaying the previously output line */
|
||||
|
||||
bool format_uses_colour; /* set if the format string uses colours */
|
||||
bool colour_permitted; /* whether colour is permitted for this display */
|
||||
bool sgr_code_active; /* set while SGR code is active in a display line */
|
||||
bool final_update; /* set internally on the final update */
|
||||
bool output_produced; /* set once anything written to terminal */
|
||||
|
||||
} display;
|
||||
|
||||
/* Extra display for alternate outputs like a window title. */
|
||||
struct pvdisplay_s extra_display;
|
||||
|
||||
/************************************
|
||||
* Calculated state of the transfer *
|
||||
************************************/
|
||||
struct pvtransfercalc_s {
|
||||
long double transfer_rate; /* calculated transfer rate */
|
||||
long double average_rate; /* calculated average transfer rate */
|
||||
|
||||
long double prev_elapsed_sec; /* elapsed sec at which rate last calculated */
|
||||
long double prev_rate; /* last calculated instantaneous transfer rate */
|
||||
long double prev_trans; /* bytes transferred since last rate calculation */
|
||||
long double prev_trans; /* amount transferred since last rate calculation */
|
||||
long double current_avg_rate; /* current average rate over last history intervals */
|
||||
|
||||
long double rate_min; /* minimum measured transfer rate */
|
||||
long double rate_max; /* maximum measured transfer rate */
|
||||
long double rate_sum; /* sum of all measured transfer rates */
|
||||
long double ratesquared_sum; /* sum of the squares of each transfer rate */
|
||||
unsigned long measurements_taken; /* how many times the rate was measured */
|
||||
|
||||
/* Keep track of progress over last intervals to compute current average rate. */
|
||||
/*@null@*/ struct { /* state at previous intervals (circular buffer) */
|
||||
long double elapsed_sec; /* time since start of transfer */
|
||||
off_t total_bytes; /* amount transferred by that time */
|
||||
off_t transferred; /* amount transferred by that time */
|
||||
} *history;
|
||||
size_t history_len; /* total size of history array */
|
||||
int history_interval; /* seconds between each history entry */
|
||||
size_t history_first; /* index of oldest entry */
|
||||
size_t history_last; /* index of newest entry */
|
||||
long double current_avg_rate; /* current average rate over last history intervals */
|
||||
|
||||
off_t initial_offset; /* offset when first opened (when watching fds) */
|
||||
off_t prev_transferred; /* total amount transferred when called last time */
|
||||
|
||||
size_t lastoutput_length; /* number of last-output bytes to show */
|
||||
char lastoutput_buffer[PV_SIZEOF_LASTOUTPUT_BUFFER];
|
||||
|
||||
size_t format_segment_count; /* number of format string segments */
|
||||
struct { /* format string broken into display components */
|
||||
pv_display_component type; /* type of display component */
|
||||
size_t str_start; /* for strings: start offset */
|
||||
size_t str_length; /* for strings: length */
|
||||
} format[PV_FORMAT_ARRAY_MAX];
|
||||
|
||||
struct { /* display components */
|
||||
bool required; /* true if included in format */
|
||||
char content[PV_SIZEOF_COMPONENT_STR]; /* string to display */
|
||||
size_t length; /* number of bytes in string */
|
||||
} component[PV_COMPONENT__MAX];
|
||||
|
||||
} display;
|
||||
double percentage; /* transfer percentage completion */
|
||||
} calc;
|
||||
|
||||
/********************
|
||||
* Cursor/IPC state *
|
||||
********************/
|
||||
struct {
|
||||
struct pvcursorstate_s {
|
||||
char lock_file[PV_SIZEOF_CRS_LOCK_FILE];
|
||||
#ifdef HAVE_IPC
|
||||
/*@keep@*/ /*@null@*/ struct pvipccursorstate_s *shared; /* data shared between instances */
|
||||
int shmid; /* ID of our shared memory segment */
|
||||
int pvcount; /* number of `pv' processes in total */
|
||||
int pvmax; /* highest number of `pv's seen */
|
||||
/*@keep@*/ /*@null@*/ struct pvcursorstate_s *shared; /* data shared between instances */
|
||||
int y_lastread; /* last value of _y_top seen */
|
||||
int y_offset; /* our Y offset from this top position */
|
||||
int needreinit; /* counter if we need to reinit cursor pos */
|
||||
bool noipc; /* set if we can't use IPC */
|
||||
#endif /* HAVE_IPC */
|
||||
int lock_fd; /* fd of lockfile, -1 if none open */
|
||||
char lock_file[PV_SIZEOF_CRS_LOCK_FILE];
|
||||
int y_start; /* our initial Y coordinate */
|
||||
#ifdef HAVE_IPC
|
||||
bool noipc; /* set if we can't use IPC */
|
||||
#endif /* HAVE_IPC */
|
||||
bool disable; /* set if cursor positioning can't be used */
|
||||
} cursor;
|
||||
|
||||
/*******************
|
||||
@@ -253,12 +384,29 @@ struct pvstate_s {
|
||||
* is the offset in the buffer that we've written data up to. It
|
||||
* will always be less than or equal to read_position.
|
||||
*/
|
||||
struct {
|
||||
struct pvtransferstate_s {
|
||||
long double elapsed_seconds; /* how long we have been transferring data for */
|
||||
/*@only@*/ /*@null@*/ char *transfer_buffer; /* data transfer buffer */
|
||||
size_t buffer_size; /* size of buffer */
|
||||
size_t read_position; /* amount of data in buffer */
|
||||
size_t write_position; /* buffered data written */
|
||||
|
||||
ssize_t to_write; /* max to write this time around */
|
||||
ssize_t written; /* bytes sent to stdout this time */
|
||||
|
||||
size_t written_but_not_consumed; /* bytes in the output pipe, unread */
|
||||
|
||||
off_t total_bytes_read; /* total bytes read */
|
||||
off_t total_written; /* total bytes or lines written */
|
||||
off_t transferred; /* amount transferred (written - unconsumed) */
|
||||
|
||||
/* Keep track of line positions to backtrack written_but_not_consumed. */
|
||||
/*@only@*/ /*@null@*/ off_t *line_positions; /* line separator write positions (circular buffer) */
|
||||
size_t line_positions_capacity; /* total size of line position array */
|
||||
size_t line_positions_length; /* number of positions stored in array */
|
||||
size_t line_positions_head; /* index to use for next position */
|
||||
off_t last_output_position; /* write position last sent to output */
|
||||
|
||||
/*
|
||||
* While reading from a file descriptor we keep track of how
|
||||
* many times in a row we've seen errors
|
||||
@@ -274,9 +422,9 @@ struct pvstate_s {
|
||||
*
|
||||
* This way, we're treating each input file separately.
|
||||
*/
|
||||
int last_read_skip_fd;
|
||||
off_t read_errors_in_a_row;
|
||||
bool read_error_warning_shown;
|
||||
int last_read_skip_fd;
|
||||
/* read_error_warning_shown is defined below. */
|
||||
#ifdef HAVE_SPLICE
|
||||
/*
|
||||
* These variables are used to keep track of whether
|
||||
@@ -289,46 +437,183 @@ struct pvstate_s {
|
||||
int splice_failed_fd;
|
||||
bool splice_used;
|
||||
#endif
|
||||
ssize_t to_write; /* max to write this time around */
|
||||
ssize_t written; /* bytes sent to stdout this time */
|
||||
bool read_error_warning_shown;
|
||||
bool output_not_seekable; /* set if lseek() fails on output */
|
||||
} transfer;
|
||||
};
|
||||
|
||||
typedef struct pvprogramstatus_s *pvprogramstatus_t;
|
||||
typedef struct pvinputfiles_s *pvinputfiles_t;
|
||||
typedef struct pvcontrol_s *pvcontrol_t;
|
||||
typedef struct pvsignal_s *pvsignal_t;
|
||||
typedef struct pvtransientflags_s *pvtransientflags_t;
|
||||
typedef struct pvdisplay_s *pvdisplay_t;
|
||||
typedef struct pvdisplay_segment_s *pvdisplay_segment_t;
|
||||
typedef struct pvtransfercalc_s *pvtransfercalc_t;
|
||||
typedef struct pvcursorstate_s *pvcursorstate_t;
|
||||
typedef struct pvtransferstate_s *pvtransferstate_t;
|
||||
|
||||
/*
|
||||
* Read-only counterparts to the above structure pointers, to be used in
|
||||
* function declarations where the function definitely shouldn't be altering
|
||||
* the contents of the structure.
|
||||
*/
|
||||
typedef const struct pvprogramstatus_s * readonly_pvprogramstatus_t;
|
||||
typedef const struct pvinputfiles_s * readonly_pvinputfiles_t;
|
||||
typedef const struct pvcontrol_s * readonly_pvcontrol_t;
|
||||
typedef const struct pvsignal_s * readonly_pvsignal_t;
|
||||
typedef const struct pvtransientflags_s * readonly_pvtransientflags_t;
|
||||
typedef const struct pvdisplay_s * readonly_pvdisplay_t;
|
||||
typedef const struct pvdisplay_segment_s * readonly_pvdisplay_segment_t;
|
||||
typedef const struct pvtransfercalc_s * readonly_pvtransfercalc_t;
|
||||
typedef const struct pvcursorstate_s * readonly_pvcursorstate_t;
|
||||
typedef const struct pvtransferstate_s * readonly_pvtransferstate_t;
|
||||
|
||||
/*
|
||||
* Structure containing the parameters used by formatters.
|
||||
*/
|
||||
struct pvformatter_args_s {
|
||||
/*@dependent@*/ pvdisplay_t display; /* the display being updated */
|
||||
/*@dependent@*/ pvdisplay_segment_t segment; /* the segment of the display */
|
||||
/*@dependent@*/ readonly_pvprogramstatus_t status; /* program status */
|
||||
/*@dependent@*/ readonly_pvcontrol_t control; /* control settings */
|
||||
/*@dependent@*/ readonly_pvtransferstate_t transfer; /* transfer state */
|
||||
/*@dependent@*/ readonly_pvtransfercalc_t calc; /* calculated transfer state */
|
||||
/*@dependent@*/ char *buffer; /* buffer to write formatted segments into */
|
||||
pvdisplay_bytecount_t buffer_size; /* size of the buffer */
|
||||
pvdisplay_bytecount_t offset; /* current write position in the buffer */
|
||||
};
|
||||
typedef struct pvformatter_args_s *pvformatter_args_t;
|
||||
|
||||
|
||||
/* Pointer to a formatter function. */
|
||||
typedef pvdisplay_bytecount_t (*pvdisplay_formatter_t)(pvformatter_args_t);
|
||||
|
||||
|
||||
/*
|
||||
* Structure defining a format string sequence following a %.
|
||||
*/
|
||||
struct pvdisplay_component_s {
|
||||
/*@null@ */ const char *match; /* string to match */
|
||||
/*@null@ */ pvdisplay_formatter_t function; /* function to call */
|
||||
bool dynamic; /* whether it can scale with screen size */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Structure defining the current state of a single watched file descriptor.
|
||||
*/
|
||||
struct pvwatchfd_s {
|
||||
pid_t watch_pid; /* PID to watch */
|
||||
int watch_fd; /* fd to watch, -1 = not displayed */
|
||||
struct pvtransientflags_s flags; /* transient flags */
|
||||
struct pvtransferstate_s transfer; /* transfer state */
|
||||
struct pvtransfercalc_s calc; /* calculated transfer state */
|
||||
struct pvdisplay_s display; /* display data */
|
||||
#ifdef __APPLE__
|
||||
#else
|
||||
char file_fdinfo[PV_SIZEOF_FILE_FDINFO]; /* path to /proc fdinfo file */
|
||||
char file_fd[PV_SIZEOF_FILE_FD]; /* path to /proc fd symlink */
|
||||
#endif
|
||||
char file_fdpath[PV_SIZEOF_FILE_FDPATH]; /* path to file that was opened */
|
||||
char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */
|
||||
/*@keep@ */ char display_name[PV_SIZEOF_DISPLAY_NAME]; /* name to show on progress bar */
|
||||
struct stat sb_fd; /* stat of fd symlink */
|
||||
struct stat sb_fd_link; /* lstat of fd symlink */
|
||||
off_t size; /* size of whole file, 0 if unknown */
|
||||
off_t position; /* position last seen at */
|
||||
struct timespec start_time; /* time we started watching the fd */
|
||||
/*@null@*/ pvstate_t state; /* state object for flags and display */
|
||||
struct timespec end_time; /* time the fd was marked as closed */
|
||||
pid_t watch_pid; /* PID the fd belongs to */
|
||||
int watch_fd; /* fd to watch */
|
||||
bool closed; /* true once the fd is closed */
|
||||
bool displayable; /* false if not displayable */
|
||||
bool unused; /* true if free for re-use */
|
||||
};
|
||||
typedef struct pvwatchfd_s *pvwatchfd_t;
|
||||
|
||||
void pv_error(pvstate_t, char *, ...);
|
||||
void pv_error(char *, ...);
|
||||
|
||||
int pv_main_loop(pvstate_t);
|
||||
void pv_display(pvstate_t, long double, off_t, off_t);
|
||||
void pv_calculate_transfer_rate(pvtransfercalc_t, readonly_pvtransferstate_t, readonly_pvcontrol_t, readonly_pvdisplay_t, bool);
|
||||
|
||||
long pv_bound_long(long, long, long);
|
||||
long pv_seconds_remaining(const off_t, const off_t, const long double);
|
||||
void pv_si_prefix(long double *, char *, const long double, pvtransfercount_t);
|
||||
void pv_describe_amount(char *, size_t, char *, long double, char *, char *, pvtransfercount_t);
|
||||
|
||||
int8_t pv_display_barstyle_index(pvformatter_args_t, const char *);
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_segmentcontent(char *, pvformatter_args_t);
|
||||
|
||||
/*
|
||||
* Formatting functions.
|
||||
*
|
||||
* Each formatting function takes a state, the current display, and the
|
||||
* segment it's for; it also takes a buffer, with a particular size, and an
|
||||
* offset at which to start writing to the buffer.
|
||||
*
|
||||
* If the component is dynamically sized (such as a progress bar with no
|
||||
* chosen_size constraint), the segment's "width" is expected to have
|
||||
* already been populated by the caller, with the target width.
|
||||
*
|
||||
* The function writes the appropriate string to the buffer at the offset,
|
||||
* and updates the segment's "offset" and "bytes". The number of bytes
|
||||
* written ("bytes") is also returned; it will be 0 if the string would not
|
||||
* fit into the buffer.
|
||||
*
|
||||
* The caller is expected to update the segment's "width".
|
||||
*
|
||||
* If called with a buffer size of 0, only the side effects occur (such as
|
||||
* setting flags like display->showing_timer).
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_progress(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_progress_bar_only(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bar_default(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bar_plain(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bar_block(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bar_granular(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bar_shaded(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_eta(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_fineta(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_rate(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_buffer_percent(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_last_written(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_previous_line(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_name(pvformatter_args_t);
|
||||
pvdisplay_bytecount_t pv_formatter_sgr(pvformatter_args_t);
|
||||
|
||||
bool pv_format (pvprogramstatus_t, readonly_pvcontrol_t,
|
||||
readonly_pvtransferstate_t, readonly_pvtransfercalc_t,
|
||||
/*@null@ */ const char *, pvdisplay_t, bool, bool);
|
||||
void pv_display (pvprogramstatus_t, readonly_pvcontrol_t, pvtransientflags_t,
|
||||
readonly_pvtransferstate_t, pvtransfercalc_t,
|
||||
pvcursorstate_t, pvdisplay_t, /*@null@ */ pvdisplay_t, bool);
|
||||
|
||||
ssize_t pv_transfer(pvstate_t, int, bool *, bool *, off_t, long *);
|
||||
int pv_next_file(pvstate_t, unsigned int, int);
|
||||
/*@out@*/ const char *pv_current_file_name(pvstate_t);
|
||||
/*@keep@*/ const char *pv_current_file_name(pvstate_t);
|
||||
|
||||
unsigned int pv_update_calc_average_rate_window(pvtransfercalc_t, unsigned int);
|
||||
void pv_reset_calc(pvtransfercalc_t);
|
||||
void pv_reset_transfer(pvtransferstate_t);
|
||||
void pv_reset_flags(pvtransientflags_t);
|
||||
void pv_reset_display(pvdisplay_t);
|
||||
void pv_reset_watchfd(pvwatchfd_t);
|
||||
void pv_freecontents_display(pvdisplay_t);
|
||||
void pv_freecontents_transfer(pvtransferstate_t);
|
||||
void pv_freecontents_calc(pvtransfercalc_t);
|
||||
void pv_freecontents_watchfd(pvwatchfd_t);
|
||||
|
||||
void pv_write_retry(int, const char *, size_t);
|
||||
void pv_tty_write(readonly_pvtransientflags_t, const char *, size_t);
|
||||
|
||||
void pv_crs_fini(pvstate_t);
|
||||
void pv_crs_init(pvstate_t);
|
||||
void pv_crs_update(pvstate_t, const char *);
|
||||
void pv_crs_fini(pvcursorstate_t, readonly_pvcontrol_t, pvtransientflags_t);
|
||||
void pv_crs_init(pvcursorstate_t, readonly_pvcontrol_t, pvtransientflags_t);
|
||||
void pv_crs_update(pvcursorstate_t, readonly_pvcontrol_t, pvtransientflags_t, const char *);
|
||||
#ifdef HAVE_IPC
|
||||
void pv_crs_needreinit(pvstate_t);
|
||||
void pv_crs_needreinit(pvcursorstate_t);
|
||||
#endif
|
||||
|
||||
void pv_sig_allowpause(void);
|
||||
@@ -336,14 +621,14 @@ void pv_sig_checkbg(void);
|
||||
void pv_sig_nopause(void);
|
||||
|
||||
void pv_remote_init(pvstate_t);
|
||||
void pv_remote_check(pvstate_t);
|
||||
bool pv_remote_check(pvstate_t);
|
||||
void pv_remote_fini(pvstate_t);
|
||||
int pv_remote_set(pvstate_t);
|
||||
|
||||
int pv_watchfd_info(pvstate_t, pvwatchfd_t, bool);
|
||||
bool pv_watchfd_changed(pvwatchfd_t);
|
||||
off_t pv_watchfd_position(pvwatchfd_t);
|
||||
int pv_watchpid_scanfds(pvstate_t, pid_t, int *, pvwatchfd_t *, int *);
|
||||
int pv_watchpid_scanfds(pvstate_t, pid_t, int, int *, pvwatchfd_t *);
|
||||
void pv_watchpid_setname(pvstate_t, pvwatchfd_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -351,5 +636,3 @@ void pv_watchpid_setname(pvstate_t, pvwatchfd_t);
|
||||
#endif
|
||||
|
||||
#endif /* _PV_INTERNAL_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
+69
-16
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions used across the program.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -23,6 +23,18 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Exit status bitmask values.
|
||||
*/
|
||||
#define PV_ERROREXIT_REMOTE_OR_PID 1
|
||||
#define PV_ERROREXIT_SAF 1 /* store and forward error */
|
||||
#define PV_ERROREXIT_ACCESS 2
|
||||
#define PV_ERROREXIT_OUROBOROS 4
|
||||
#define PV_ERROREXIT_TRANSITION 8
|
||||
#define PV_ERROREXIT_TRANSFER 16
|
||||
#define PV_ERROREXIT_SIGNAL 32
|
||||
#define PV_ERROREXIT_MEMORY 64
|
||||
|
||||
/*
|
||||
* Opaque structure for PV internal state.
|
||||
*/
|
||||
@@ -33,8 +45,9 @@ typedef struct pvstate_s *pvstate_t;
|
||||
* Valid number types for pv_getnum_check().
|
||||
*/
|
||||
typedef enum {
|
||||
PV_NUMTYPE_INTEGER,
|
||||
PV_NUMTYPE_DOUBLE
|
||||
PV_NUMTYPE_ANY_WITH_SUFFIX,
|
||||
PV_NUMTYPE_BARE_INTEGER,
|
||||
PV_NUMTYPE_BARE_DOUBLE
|
||||
} pv_numtype;
|
||||
|
||||
|
||||
@@ -42,6 +55,11 @@ typedef enum {
|
||||
* Simple string functions for processing numbers.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Return true if the character is an ASCII digit.
|
||||
*/
|
||||
extern bool pv_isdigit(char);
|
||||
|
||||
/*
|
||||
* Return the given string converted to a double, for use as a time
|
||||
* interval.
|
||||
@@ -67,6 +85,13 @@ extern unsigned int pv_getnum_count(const char *, bool);
|
||||
*/
|
||||
extern bool pv_getnum_check(const char *, pv_numtype);
|
||||
|
||||
/*
|
||||
* Return a value representing the first amount as a percentage of the
|
||||
* second total, i.e. 100*amount/total. If the second value, the total, is
|
||||
* zero or less, return 0.
|
||||
*/
|
||||
extern double pv_percentage(off_t, const off_t);
|
||||
|
||||
/*
|
||||
* String handling wrappers.
|
||||
*/
|
||||
@@ -96,6 +121,16 @@ extern size_t pv_strlcat(char *, const char *, size_t);
|
||||
*/
|
||||
/*@null@ */ /*@temp@ */ extern void *pv_memrchr(const void *, int, size_t);
|
||||
|
||||
/*
|
||||
* Return the displayed width of a string.
|
||||
*/
|
||||
extern size_t pv_strwidth(const char *, size_t);
|
||||
|
||||
/*
|
||||
* Return true if the character is printable.
|
||||
*/
|
||||
extern bool pv_isprint(char);
|
||||
|
||||
/*
|
||||
* Functions relating to elapsed time.
|
||||
*/
|
||||
@@ -140,10 +175,20 @@ void pv_nanosleep(long long);
|
||||
* Main PV functions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set the prefix (program name) for any PV error messages.
|
||||
*/
|
||||
extern void pv_set_error_prefix(/*@unique@ */ const char *);
|
||||
|
||||
/*
|
||||
* Create a new state structure, and return it, or 0 (NULL) on error.
|
||||
*/
|
||||
extern /*@null@*/ /*@only@*/ pvstate_t pv_state_alloc(const char *);
|
||||
extern /*@null@*/ /*@only@*/ pvstate_t pv_state_alloc(void);
|
||||
|
||||
/*
|
||||
* Clear the calculated parts of a state structure.
|
||||
*/
|
||||
extern void pv_state_reset(pvstate_t state);
|
||||
|
||||
/*
|
||||
* Set the formatting string, given a set of old-style formatting options.
|
||||
@@ -161,9 +206,11 @@ extern void pv_state_set_format(pvstate_t state, bool progress,
|
||||
*/
|
||||
extern void pv_state_force_set(pvstate_t, bool);
|
||||
extern void pv_state_cursor_set(pvstate_t, bool);
|
||||
extern void pv_state_show_stats_set(pvstate_t, bool);
|
||||
extern void pv_state_numeric_set(pvstate_t, bool);
|
||||
extern void pv_state_wait_set(pvstate_t, bool);
|
||||
extern void pv_state_delay_start_set(pvstate_t, double);
|
||||
extern void pv_state_rate_gauge_set(pvstate_t, bool);
|
||||
extern void pv_state_linemode_set(pvstate_t, bool);
|
||||
extern void pv_state_bits_set(pvstate_t, bool);
|
||||
extern void pv_state_decimal_units_set(pvstate_t, bool);
|
||||
@@ -174,6 +221,7 @@ extern void pv_state_error_skip_block_set(pvstate_t, off_t);
|
||||
extern void pv_state_stop_at_size_set(pvstate_t, bool);
|
||||
extern void pv_state_sync_after_write_set(pvstate_t, bool);
|
||||
extern void pv_state_direct_io_set(pvstate_t, bool);
|
||||
extern void pv_state_sparse_output_set(pvstate_t, bool);
|
||||
extern void pv_state_rate_limit_set(pvstate_t, off_t);
|
||||
extern void pv_state_target_buffer_size_set(pvstate_t, size_t);
|
||||
extern void pv_state_no_splice_set(pvstate_t, bool);
|
||||
@@ -183,12 +231,15 @@ extern void pv_state_interval_set(pvstate_t, double);
|
||||
extern void pv_state_width_set(pvstate_t, unsigned int, bool);
|
||||
extern void pv_state_height_set(pvstate_t, unsigned int, bool);
|
||||
extern void pv_state_name_set(pvstate_t, /*@null@*/ const char *);
|
||||
extern void pv_state_default_bar_style_set(pvstate_t, /*@null@ */ const char *);
|
||||
extern void pv_state_format_string_set(pvstate_t, /*@null@*/ const char *);
|
||||
extern void pv_state_watch_pid_set(pvstate_t, pid_t);
|
||||
extern void pv_state_watch_fd_set(pvstate_t, int);
|
||||
extern void pv_state_extra_display_set(pvstate_t, /*@null@*/ const char *);
|
||||
extern void pv_state_output_set(pvstate_t, int, const char *);
|
||||
extern void pv_state_average_rate_window_set(pvstate_t, unsigned int);
|
||||
extern void pv_state_set_terminal_supports_utf8(pvstate_t, bool);
|
||||
|
||||
extern void pv_state_inputfiles(pvstate_t, unsigned int, const char **);
|
||||
extern void pv_state_watchfds(pvstate_t, unsigned int, const pid_t *, const int *);
|
||||
|
||||
/*
|
||||
* Work out whether we are in the foreground.
|
||||
@@ -210,7 +261,7 @@ extern off_t pv_calc_total_size(pvstate_t);
|
||||
*/
|
||||
extern void pv_sig_init(pvstate_t);
|
||||
|
||||
#ifdef SA_SIGINFO
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
/*
|
||||
* Return true if SIGUSR2 has been received, and indicate the sender.
|
||||
*/
|
||||
@@ -223,15 +274,10 @@ extern bool pv_sigusr2_received(pvstate_t, pid_t *);
|
||||
extern int pv_main_loop(pvstate_t);
|
||||
|
||||
/*
|
||||
* Watch the selected file descriptor of the selected process.
|
||||
* Watch the selected file descriptors of the selected processes.
|
||||
*/
|
||||
extern int pv_watchfd_loop(pvstate_t);
|
||||
|
||||
/*
|
||||
* Watch the selected process.
|
||||
*/
|
||||
extern int pv_watchpid_loop(pvstate_t);
|
||||
|
||||
/*
|
||||
* Shut down signal handlers after running the main loop.
|
||||
*/
|
||||
@@ -242,6 +288,15 @@ extern void pv_sig_fini(pvstate_t);
|
||||
*/
|
||||
extern void pv_state_free(/*@only@*/ pvstate_t);
|
||||
|
||||
/*
|
||||
* Return a string listing all supported format sequences.
|
||||
*/
|
||||
/*@null@*/ char *pv_format_sequences(void);
|
||||
|
||||
#if ! HAVE_SETPROCTITLE
|
||||
void initproctitle(int, char **);
|
||||
void setproctitle(const char *, ...);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DEBUGGING
|
||||
# if __STDC_VERSION__ < 199901L && !defined(__func__)
|
||||
@@ -253,7 +308,7 @@ extern void pv_state_free(/*@only@*/ pvstate_t);
|
||||
# endif
|
||||
# define debug(x,...) debugging_output(__func__, __FILE__, __LINE__, x, __VA_ARGS__)
|
||||
#else
|
||||
# define debug(x,...) do { } while (0)
|
||||
# define debug(x,...) /*@-noeffect@*/ do { } while (0) /*@+noeffect@*/
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -272,5 +327,3 @@ void debugging_output(const char *, const char *, int, const char *, ...);
|
||||
#endif
|
||||
|
||||
#endif /* _PV_H */
|
||||
|
||||
/* EOF */
|
||||
|
||||
+17
-9
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Output debugging information.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -63,8 +63,18 @@ void debugging_output(const char *function, const char *file, int line, const ch
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that here we use gmtime() rather than localtime(), otherwise
|
||||
* we can get stuck in signal handlers - testing with "strace"
|
||||
* showed many cases where "pv </dev/zero | cat >/dev/null" being
|
||||
* paused and backgrounded would cause pv to be stuck in
|
||||
* futex_wait() inside a pv_sig_alrm() inside a pv_sig_cont(). The
|
||||
* backtrace mentioned many time zone conversion steps, and all of
|
||||
* that goes away with gmtime().
|
||||
*/
|
||||
|
||||
(void) time(&t);
|
||||
tm = localtime(&t);
|
||||
tm = gmtime(&t);
|
||||
tbuf[0] = '\0';
|
||||
if (0 == strftime(tbuf, sizeof(tbuf), "%Y-%m-%d %H:%M:%S", tm)) {
|
||||
tbuf[0] = '\0';
|
||||
@@ -91,7 +101,7 @@ void debugging_output(const char *function, const char *file, int line, const ch
|
||||
/*
|
||||
* Stub debugging destination function.
|
||||
*/
|
||||
void debugging_output_destination( __attribute__((unused))
|
||||
void debugging_output_destination( /*@unused@ */ __attribute__((unused))
|
||||
const char *filename)
|
||||
{
|
||||
}
|
||||
@@ -99,14 +109,12 @@ void debugging_output_destination( __attribute__((unused))
|
||||
/*
|
||||
* Stub debugging output function.
|
||||
*/
|
||||
void debugging_output( __attribute__((unused))
|
||||
const char *function, __attribute__((unused))
|
||||
const char *file, __attribute__((unused))
|
||||
int line, __attribute__((unused))
|
||||
void debugging_output( /*@unused@ */ __attribute__((unused))
|
||||
const char *function, /*@unused@ */ __attribute__((unused))
|
||||
const char *file, /*@unused@ */ __attribute__((unused))
|
||||
int line, /*@unused@ */ __attribute__((unused))
|
||||
const char *format, ...)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* ENABLE_DEBUGGING */
|
||||
|
||||
/* EOF */
|
||||
|
||||
+66
-81
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Output command-line help to stdout.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -22,77 +22,27 @@
|
||||
|
||||
|
||||
/*
|
||||
* Return the number of display columns needed to show the given string.
|
||||
*
|
||||
* To do this, we convert it to a wide character string, and use the wide
|
||||
* character display width function "wcswidth()" on it.
|
||||
* Return the number of display columns needed to show the given
|
||||
* null-terminated string.
|
||||
*
|
||||
* If NLS is disabled, or the string cannot be converted, this is just the
|
||||
* same as "strlen()".
|
||||
*/
|
||||
static size_t display_width(const char *string)
|
||||
{
|
||||
size_t width;
|
||||
|
||||
#if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H)
|
||||
size_t wide_char_count;
|
||||
size_t wide_string_buffer_size;
|
||||
wchar_t *wide_string;
|
||||
size_t bytes;
|
||||
|
||||
if (NULL == string)
|
||||
return 0;
|
||||
|
||||
/*@-nullpass@ */
|
||||
bytes = strlen(string); /* flawfinder: ignore */
|
||||
/*
|
||||
* splint note: mbstowcs() manual page on Linux explicitly says it
|
||||
* takes NULL.
|
||||
* flawfinder rationale: we have already checked for NULL, and it is
|
||||
* explicitly required of the caller to provide a null-terminated
|
||||
* string.
|
||||
*/
|
||||
wide_char_count = mbstowcs(NULL, string, 0);
|
||||
/*@+nullpass@ */
|
||||
if (wide_char_count == (size_t) -1) {
|
||||
debug("%s: %s: %s", "mbstowcs", string, strerror(errno));
|
||||
return strlen(string); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: we have already checked for NULL,
|
||||
* and we don't know the size of the originating buffer so
|
||||
* can't use strnlen(); it is up to the caller to provide a
|
||||
* terminated string.
|
||||
*/
|
||||
}
|
||||
|
||||
wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count);
|
||||
wide_string = malloc(wide_string_buffer_size);
|
||||
if (NULL == wide_string) {
|
||||
perror("malloc");
|
||||
return strlen(string); /* flawfinder: ignore */
|
||||
/* flawfinder rationale: see above. */
|
||||
}
|
||||
memset(wide_string, 0, wide_string_buffer_size);
|
||||
|
||||
if (mbstowcs(wide_string, string, 1 + wide_char_count) == (size_t) -1) {
|
||||
debug("%s: %s: %s", "mbstowcs", string, strerror(errno));
|
||||
width = strlen(string); /* flawfinder: ignore */
|
||||
/* flawfinder rationale: see above. */
|
||||
} else if (NULL != wide_string) {
|
||||
/*@-unrecog @ */
|
||||
/* splint seems unable to see the prototype. */
|
||||
width = wcswidth(wide_string, wide_char_count);
|
||||
/*@+unrecog @ */
|
||||
} else {
|
||||
width = 0;
|
||||
}
|
||||
|
||||
free(wide_string);
|
||||
|
||||
#else /* ! defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */
|
||||
if (NULL == string)
|
||||
return 0;
|
||||
|
||||
width = strlen(string); /* flawfinder: ignore */
|
||||
/* flawfinder rationale: see above. */
|
||||
#endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */
|
||||
|
||||
return width;
|
||||
return pv_strwidth(string, bytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -134,9 +84,9 @@ static void display_word_wrap_7bit(const char *string, size_t display_width, siz
|
||||
|
||||
|
||||
/*
|
||||
* Output a string to standard output, word wrapping to "display_width"
|
||||
* display character positions, and left-padding any new lines after the
|
||||
* first one with "left_margin" spaces.
|
||||
* Output a null-terminated string to standard output, word wrapping to
|
||||
* "display_width" display character positions, and left-padding any new
|
||||
* lines after the first one with "left_margin" spaces.
|
||||
*
|
||||
* Wide characters are handled if NLS is enabled, but if they can't be, this
|
||||
* falls back to a version which just counts bytes as characters.
|
||||
@@ -153,7 +103,7 @@ static void display_word_wrap(const char *string, size_t display_width, size_t l
|
||||
return;
|
||||
|
||||
/*@-nullpass@ */
|
||||
/* splint note: see earlier mbstowcs() call. */
|
||||
/* splint note: see mbstowcs() call in pv_strwidth(). */
|
||||
wide_char_count = mbstowcs(NULL, string, 0);
|
||||
/*@+nullpass@ */
|
||||
if (wide_char_count == (size_t) -1) {
|
||||
@@ -181,7 +131,9 @@ static void display_word_wrap(const char *string, size_t display_width, size_t l
|
||||
start_idx = 0;
|
||||
chars_remaining = wide_char_count;
|
||||
|
||||
/*@-unrecog@ *//* splint seems unable to see the prototype for wcswidth(). */
|
||||
while (chars_remaining > 0 && wcswidth(&(wide_string[start_idx]), chars_remaining) > display_width) {
|
||||
/*@+unrecog@ */
|
||||
size_t next_idx;
|
||||
|
||||
end_idx = start_idx + display_width;
|
||||
@@ -298,18 +250,9 @@ void display_help(void)
|
||||
{ "-a", "--average-rate", NULL,
|
||||
N_("show data transfer average rate counter"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-m", "--average-rate-window", N_("SEC"),
|
||||
N_("compute average rate over past SEC seconds (default 30s)"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-b", "--bytes", NULL,
|
||||
N_("show number of bytes transferred"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-8", "--bits", NULL,
|
||||
N_("show number of bits transferred"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-k", "--si", NULL,
|
||||
N_("treat suffixes as multiples of 1000 rather than 1024"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-T", "--buffer-percent", NULL,
|
||||
N_("show percentage of transfer buffer in use"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -326,6 +269,12 @@ void display_help(void)
|
||||
N_("do not output any transfer information at all"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "", NULL, NULL, NULL, { 0, 0, 0, 0} },
|
||||
{ "-8", "--bits", NULL,
|
||||
N_("show number of bits transferred"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-k", "--si", NULL,
|
||||
N_("treat suffixes as multiples of 1000 rather than 1024"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-W", "--wait", NULL,
|
||||
N_("display nothing until first byte transferred"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -335,6 +284,9 @@ void display_help(void)
|
||||
{ "-s", "--size", N_("SIZE"),
|
||||
N_("set estimated data size to SIZE bytes"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-g", "--gauge", NULL,
|
||||
N_("if size unknown, show rate vs max rate"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-l", "--line-mode", NULL,
|
||||
N_("count lines instead of bytes"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -344,6 +296,9 @@ void display_help(void)
|
||||
{ "-i", "--interval", N_("SEC"),
|
||||
N_("update every SEC seconds"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-m", "--average-rate-window", N_("SEC"),
|
||||
N_("compute average rate over past SEC seconds (default 30s)"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-w", "--width", N_("WIDTH"),
|
||||
N_("assume terminal is WIDTH characters wide"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -353,6 +308,15 @@ void display_help(void)
|
||||
{ "-N", "--name", N_("NAME"),
|
||||
N_("prefix visual information with NAME"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-u", "--bar-style", N_("STYLE"),
|
||||
N_("set default bar style to NAME"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-x", "--extra-display", N_("SPEC"),
|
||||
N_("also send progress to SPEC"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-v", "--stats", NULL,
|
||||
N_("output transfer statistics at the end"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-f", "--force", NULL,
|
||||
N_("output even if standard error is not a terminal"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -360,6 +324,9 @@ void display_help(void)
|
||||
N_("use cursor positioning escape sequences"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "", NULL, NULL, NULL, { 0, 0, 0, 0} },
|
||||
{ "-o", "--output", N_("FILE"),
|
||||
N_("write output to FILE instead of stdout"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-L", "--rate-limit", N_("RATE"),
|
||||
N_("limit transfer to RATE bytes per second"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -384,23 +351,27 @@ void display_help(void)
|
||||
{ "-K", "--direct-io", NULL,
|
||||
N_("use direct I/O to bypass cache"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-O", "--sparse", NULL,
|
||||
N_("try to seek instead of writing null bytes"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-X", "--discard", NULL,
|
||||
N_("discard input instead of writing to output"),
|
||||
{ 0, 0, 0, 0} },
|
||||
#ifdef SA_SIGINFO
|
||||
{ "-U", "--store-and-forward", N_("FILE"),
|
||||
N_("write all input to FILE before writing to output"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "-d", "--watchfd", N_("PID[:FD]|=NAME|@LISTFILE"),
|
||||
N_("watch file FD opened by process PID"),
|
||||
{ 0, 0, 0, 0} },
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
{ "-R", "--remote", N_("PID"),
|
||||
N_("update settings of process PID"),
|
||||
{ 0, 0, 0, 0} },
|
||||
#endif /* SA_SIGINFO */
|
||||
#endif /* PV_REMOTE_CONTROL */
|
||||
{ "", NULL, NULL, NULL, { 0, 0, 0, 0} },
|
||||
{ "-P", "--pidfile", N_("FILE"),
|
||||
N_("save process ID in FILE"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "", NULL, NULL, NULL, { 0, 0, 0, 0} },
|
||||
{ "-d", "--watchfd", N_("PID[:FD]"),
|
||||
N_("watch file FD opened by process PID"),
|
||||
{ 0, 0, 0, 0} },
|
||||
{ "", NULL, NULL, NULL, { 0, 0, 0, 0} },
|
||||
{ "-h", "--help", NULL,
|
||||
N_("show this help and exit"),
|
||||
{ 0, 0, 0, 0} },
|
||||
@@ -421,6 +392,7 @@ void display_help(void)
|
||||
size_t right_margin = 77;
|
||||
const char *program_description;
|
||||
const char *bug_report_note;
|
||||
char *format_sequences = NULL;
|
||||
unsigned int terminal_width = 0, terminal_height = 0;
|
||||
|
||||
pv_screensize(&terminal_width, &terminal_height);
|
||||
@@ -580,6 +552,21 @@ void display_help(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
format_sequences = pv_format_sequences();
|
||||
if (NULL != format_sequences) {
|
||||
const char *format_sequence_header;
|
||||
format_sequence_header = _("Supported format sequences:");
|
||||
if (NULL != format_sequence_header) {
|
||||
printf("\n");
|
||||
display_word_wrap(format_sequence_header, right_margin, 0);
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n ");
|
||||
display_word_wrap(format_sequences, right_margin, 2);
|
||||
free(format_sequences);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
bug_report_note = _("Please report any bugs to: %s");
|
||||
@@ -595,5 +582,3 @@ void display_help(void)
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+353
-125
@@ -2,7 +2,7 @@
|
||||
* Main program entry point - read the command line options, then perform
|
||||
* the appropriate actions.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -11,9 +11,6 @@
|
||||
#include "options.h"
|
||||
#include "pv.h"
|
||||
|
||||
/* We do not set this because it breaks "dd" - see below. */
|
||||
/* #undef MAKE_STDOUT_NONBLOCKING */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
@@ -22,12 +19,257 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
int pv_remote_set(opts_t, pvstate_t);
|
||||
void pv_remote_init(void);
|
||||
void pv_remote_fini(void);
|
||||
|
||||
/*
|
||||
* Write a PID file, returning nonzero on error. Write it atomically, such
|
||||
* that the file either exists and contains the PID, or is not updated at
|
||||
* all. This is done by writing to a temporary file in the same directory
|
||||
* first, and then renaming the temporary file to the target name.
|
||||
*/
|
||||
static int pv__write_pidfile(opts_t opts)
|
||||
{
|
||||
char *pidfile_tmp_name;
|
||||
size_t pidfile_tmp_bufsize;
|
||||
int pidfile_tmp_fd;
|
||||
FILE *pidfile_tmp_fptr;
|
||||
mode_t prev_umask;
|
||||
const char *pidfile_template = "%s.XXXXXX";
|
||||
|
||||
if (NULL == opts->pidfile)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The buffer needs to be long enough to hold the pidfile with the
|
||||
* mkstemp template ".XXXXXX" after it. The "%s" of our
|
||||
* pidfile_template adds 2 extra bytes to the length, of which we
|
||||
* need 1 byte for the terminating \0, so we subtract 1 byte more to
|
||||
* get the exact amount of space we need.
|
||||
*/
|
||||
pidfile_tmp_bufsize = strlen(pidfile_template) + strlen(opts->pidfile) - 1; /* flawfinder: ignore */
|
||||
|
||||
/*
|
||||
* flawfinder rationale: flawfinder never likes strlen() in case
|
||||
* it's called on a string that isn't \0 terminated. We have to use
|
||||
* strlen() to find the length of opts->pidfile, so have to trust
|
||||
* that the arguments in argv[] were \0 terminated. We can be sure
|
||||
* that pidfile_template is \0 terminated because we've set it to a
|
||||
* constant value. So we tell flawfinder to skip this check here.
|
||||
*/
|
||||
pidfile_tmp_name = malloc(pidfile_tmp_bufsize);
|
||||
if (NULL == pidfile_tmp_name) {
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
memset(pidfile_tmp_name, 0, pidfile_tmp_bufsize);
|
||||
(void) pv_snprintf(pidfile_tmp_name, pidfile_tmp_bufsize, pidfile_template, opts->pidfile);
|
||||
|
||||
/*@-type@ *//* splint doesn't like mode_t */
|
||||
prev_umask = umask(0000); /* flawfinder: ignore */
|
||||
(void) umask(prev_umask | 0133); /* flawfinder: ignore */
|
||||
|
||||
/*@-unrecog@ *//* splint doesn't know mkstemp() */
|
||||
pidfile_tmp_fd = mkstemp(pidfile_tmp_name); /* flawfinder: ignore */
|
||||
/*@+unrecog@ */
|
||||
if (pidfile_tmp_fd < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno));
|
||||
(void) umask(prev_umask); /* flawfinder: ignore */
|
||||
free(pidfile_tmp_name);
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
(void) umask(prev_umask); /* flawfinder: ignore */
|
||||
|
||||
/*
|
||||
* flawfinder rationale (umask, mkstemp) - flawfinder
|
||||
* recommends setting the most restrictive umask possible
|
||||
* when calling mkstemp(), so this is what we have done.
|
||||
*
|
||||
* We get the original umask and OR it with 0133 to make
|
||||
* sure new files will be at least chmod 644. Then we put
|
||||
* the umask back to what it was, after creating the
|
||||
* temporary file.
|
||||
*/
|
||||
|
||||
/*@+type@ */
|
||||
|
||||
pidfile_tmp_fptr = fdopen(pidfile_tmp_fd, "w");
|
||||
if (NULL == pidfile_tmp_fptr) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno));
|
||||
(void) close(pidfile_tmp_fd);
|
||||
(void) remove(pidfile_tmp_name);
|
||||
free(pidfile_tmp_name);
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
fprintf(pidfile_tmp_fptr, "%d\n", getpid());
|
||||
if (0 != fclose(pidfile_tmp_fptr)) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno));
|
||||
}
|
||||
|
||||
if (rename(pidfile_tmp_name, opts->pidfile) < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno));
|
||||
(void) remove(pidfile_tmp_name);
|
||||
}
|
||||
|
||||
free(pidfile_tmp_name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the output file, if applicable. Returns nonzero on error.
|
||||
*/
|
||||
static int pv__set_output(pvstate_t state, opts_t opts, /*@null@ */ const char *output_file)
|
||||
{
|
||||
int output_fd;
|
||||
|
||||
if ((NULL == state) || (NULL == opts))
|
||||
return 0;
|
||||
|
||||
if (NULL == output_file || 0 == strcmp(output_file, "-")) {
|
||||
pv_state_output_set(state, STDOUT_FILENO, "(stdout)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
output_fd = open(output_file, O_WRONLY | O_CREAT | O_TRUNC, 0600); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: the output filename has been
|
||||
* explicitly provided, and in many cases the operator will
|
||||
* want to write to device files and other special
|
||||
* destinations, so there is no sense-checking we can do to
|
||||
* make this safer.
|
||||
*/
|
||||
if (output_fd < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, output_file, strerror(errno));
|
||||
return PV_ERROREXIT_ACCESS;
|
||||
}
|
||||
|
||||
pv_state_output_set(state, output_fd, output_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Run in store-and-forward mode: run the main loop once with the output
|
||||
* forced to the store-and-forward file (taking care of creation and removal
|
||||
* of a temporary file if "-" was specified); then run the main loop again
|
||||
* with the input file list forced to be just the store-and-forward file.
|
||||
* Returns nonzero on error.
|
||||
*/
|
||||
static int pv__store_and_forward(pvstate_t state, opts_t opts, bool can_have_eta)
|
||||
{
|
||||
char tmp_filename[4096]; /* flawfinder: ignore */
|
||||
bool use_temporary_file;
|
||||
char *real_store_and_forward_file;
|
||||
int retcode;
|
||||
|
||||
/* flawfinder: zeroed with memset and bounded by pv_snprintf. */
|
||||
|
||||
if ((NULL == state) || (NULL == opts) || (NULL == opts->store_and_forward_file))
|
||||
return 0;
|
||||
|
||||
memset(tmp_filename, 0, sizeof(tmp_filename));
|
||||
|
||||
use_temporary_file = false;
|
||||
if (0 == strcmp(opts->store_and_forward_file, "-"))
|
||||
use_temporary_file = true;
|
||||
|
||||
/*
|
||||
* Create a temporary file if the specified file was "-".
|
||||
*/
|
||||
if (use_temporary_file) {
|
||||
char *tmpdir;
|
||||
int tmp_fd;
|
||||
|
||||
tmpdir = (char *) getenv("TMPDIR"); /* flawfinder: ignore */
|
||||
if ((NULL == tmpdir) || ('\0' == tmpdir[0]))
|
||||
tmpdir = (char *) getenv("TMP"); /* flawfinder: ignore */
|
||||
if ((NULL == tmpdir) || ('\0' == tmpdir[0]))
|
||||
tmpdir = "/tmp";
|
||||
|
||||
/*
|
||||
* flawfinder rationale: null and zero-size values of $TMPDIR and
|
||||
* $TMP are rejected, and the destination buffer is bounded.
|
||||
*/
|
||||
|
||||
(void) pv_snprintf(tmp_filename, sizeof(tmp_filename), "%s/pv.XXXXXX", tmpdir);
|
||||
/*@-unrecog@ *//* splint doesn't know mkstemp() */
|
||||
tmp_fd = mkstemp(tmp_filename); /* flawfinder: ignore */
|
||||
/*@+unrecog@ */
|
||||
if (tmp_fd < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, tmp_filename, strerror(errno));
|
||||
return PV_ERROREXIT_SAF;
|
||||
}
|
||||
(void) close(tmp_fd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Real store-and-forward file: either the one we were given, or the
|
||||
* temporary file we created if we were given "-".
|
||||
*/
|
||||
real_store_and_forward_file = use_temporary_file ? tmp_filename : opts->store_and_forward_file;
|
||||
|
||||
/*
|
||||
* First, set the output file to the store-and-forward file.
|
||||
*/
|
||||
debug("%s: %s", "setting output to store-and-forward file", real_store_and_forward_file);
|
||||
retcode = pv__set_output(state, opts, real_store_and_forward_file);
|
||||
if (0 != retcode)
|
||||
goto end_store_and_forward;
|
||||
|
||||
/* Reset the formatting to set the displayed name to "(input)". */
|
||||
/*@-mustfreefresh@ */
|
||||
pv_state_set_format(state, opts->progress, opts->timer, can_have_eta ? opts->eta : false,
|
||||
can_have_eta ? opts->fineta : false, opts->rate, opts->average_rate,
|
||||
opts->bytes, opts->bufpercent, opts->lastwritten, _("(input)"));
|
||||
/*@+mustfreefresh@ *//* see below about gettext _() calls. */
|
||||
|
||||
/* Run the main loop as normal. */
|
||||
debug("%s", "running store-and-forward receiver");
|
||||
retcode = pv_main_loop(state);
|
||||
if (0 != retcode)
|
||||
goto end_store_and_forward;
|
||||
|
||||
/* Set the output file back to what it originally was. */
|
||||
debug("%s: %s", "setting output to original value", NULL == opts->output ? "(null)" : opts->output);
|
||||
retcode = pv__set_output(state, opts, opts->output);
|
||||
if (0 != retcode)
|
||||
goto end_store_and_forward;
|
||||
|
||||
/* Replace the list of input files with the store-and-forward file. */
|
||||
debug("%s", "resetting input file list");
|
||||
pv_state_inputfiles(state, 1, (const char **) &real_store_and_forward_file);
|
||||
|
||||
/* Recalculate the input size. */
|
||||
pv_state_size_set(state, pv_calc_total_size(state));
|
||||
|
||||
/* Reset the format, since we might have been asked to show ETA. */
|
||||
pv_state_set_format(state, opts->progress, opts->timer, opts->eta,
|
||||
opts->fineta, opts->rate, opts->average_rate,
|
||||
opts->bytes, opts->bufpercent, opts->lastwritten, opts->name);
|
||||
|
||||
/* Reset calculated values in the state. */
|
||||
pv_state_reset(state);
|
||||
|
||||
/* Run the main loop again. */
|
||||
debug("%s", "running store-and-forward transmitter");
|
||||
retcode = pv_main_loop(state);
|
||||
|
||||
end_store_and_forward:
|
||||
if (use_temporary_file)
|
||||
(void) remove(tmp_filename);
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Process command-line arguments and set option flags, then call functions
|
||||
@@ -38,32 +280,50 @@ int main(int argc, char **argv)
|
||||
/*@only@ */ opts_t opts = NULL;
|
||||
/*@only@ */ pvstate_t state = NULL;
|
||||
int retcode = 0;
|
||||
bool can_have_eta = true;
|
||||
bool terminal_supports_utf8 = false;
|
||||
|
||||
#if ! HAVE_SETPROCTITLE
|
||||
initproctitle(argc, argv);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
/* Initialise language translation. */
|
||||
(void) setlocale(LC_ALL, "");
|
||||
(void) bindtextdomain(PACKAGE, LOCALEDIR);
|
||||
(void) textdomain(PACKAGE);
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
/*@-mustfreefresh@ *//* splint thinks nl_langinfo() leaks memory */
|
||||
if (0 == strcmp(nl_langinfo(CODESET), "UTF-8"))
|
||||
terminal_supports_utf8 = true;
|
||||
/*@+mustfreefresh@ */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Parse the command line arguments. */
|
||||
opts = opts_parse(argc >= 0 ? (unsigned int) argc : 0, argv);
|
||||
if (NULL == opts) {
|
||||
debug("%s: %d", "exiting with status", 64);
|
||||
return 64;
|
||||
debug("%s: %d", "exiting with status", PV_ERROREXIT_MEMORY);
|
||||
return PV_ERROREXIT_MEMORY;
|
||||
}
|
||||
|
||||
/* Early exit if necessary, such as with "-h". */
|
||||
if (opts->do_nothing) {
|
||||
if (PV_ACTION_NOTHING == opts->action) {
|
||||
debug("%s", "nothing to do - exiting with status 0");
|
||||
opts_free(opts);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set the error message prefix. */
|
||||
/*@-keeptrans@ */
|
||||
pv_set_error_prefix(opts->program_name);
|
||||
/* splint - this function doesn't add an alias or release it. */
|
||||
/*@+keeptrans@ */
|
||||
|
||||
/*
|
||||
* Allocate our internal state buffer.
|
||||
*/
|
||||
state = pv_state_alloc(opts->program_name);
|
||||
state = pv_state_alloc();
|
||||
if (NULL == state) {
|
||||
/*@-mustfreefresh@ */
|
||||
/*
|
||||
@@ -73,8 +333,8 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, _("state allocation failed"), strerror(errno));
|
||||
opts_free(opts);
|
||||
debug("%s: %d", "exiting with status", 64);
|
||||
return 64;
|
||||
debug("%s: %d", "exiting with status", PV_ERROREXIT_MEMORY);
|
||||
return PV_ERROREXIT_MEMORY;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
@@ -99,80 +359,13 @@ int main(int argc, char **argv)
|
||||
* Write a PID file if -P was specified.
|
||||
*/
|
||||
if (opts->pidfile != NULL) {
|
||||
char *pidfile_tmp_name;
|
||||
size_t pidfile_tmp_bufsize;
|
||||
int pidfile_tmp_fd;
|
||||
FILE *pidfile_tmp_fptr;
|
||||
mode_t prev_umask;
|
||||
|
||||
pidfile_tmp_bufsize = 16 + strlen(opts->pidfile); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: pidfile was supplied as an argument
|
||||
* so we have to assume it is \0 terminated.
|
||||
*/
|
||||
pidfile_tmp_name = malloc(pidfile_tmp_bufsize);
|
||||
if (NULL == pidfile_tmp_name) {
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
|
||||
int pidfile_rc;
|
||||
pidfile_rc = pv__write_pidfile(opts);
|
||||
if (0 != pidfile_rc) {
|
||||
pv_state_free(state);
|
||||
opts_free(opts);
|
||||
return 1;
|
||||
return pidfile_rc;
|
||||
}
|
||||
memset(pidfile_tmp_name, 0, pidfile_tmp_bufsize);
|
||||
(void) pv_snprintf(pidfile_tmp_name, pidfile_tmp_bufsize, "%s.XXXXXX", opts->pidfile);
|
||||
|
||||
/*@-type@ *//* splint doesn't like mode_t */
|
||||
prev_umask = umask(0000); /* flawfinder: ignore */
|
||||
(void) umask(prev_umask | 0133); /* flawfinder: ignore */
|
||||
|
||||
/*@-unrecog@ *//* splint doesn't know mkstemp() */
|
||||
pidfile_tmp_fd = mkstemp(pidfile_tmp_name); /* flawfinder: ignore */
|
||||
/*@+unrecog@ */
|
||||
if (pidfile_tmp_fd < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno));
|
||||
(void) umask(prev_umask); /* flawfinder: ignore */
|
||||
free(pidfile_tmp_name);
|
||||
pv_state_free(state);
|
||||
opts_free(opts);
|
||||
return 1;
|
||||
}
|
||||
|
||||
(void) umask(prev_umask); /* flawfinder: ignore */
|
||||
|
||||
/*
|
||||
* flawfinder rationale (umask, mkstemp) - flawfinder
|
||||
* recommends setting the most restrictive umask possible
|
||||
* when calling mkstemp(), so this is what we have done.
|
||||
*
|
||||
* We get the original umask and OR it with 0133 to make
|
||||
* sure new files will be at least chmod 644. Then we put
|
||||
* the umask back to what it was, after creating the
|
||||
* temporary file.
|
||||
*/
|
||||
|
||||
/*@+type@ */
|
||||
|
||||
pidfile_tmp_fptr = fdopen(pidfile_tmp_fd, "w");
|
||||
if (NULL == pidfile_tmp_fptr) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, pidfile_tmp_name, strerror(errno));
|
||||
(void) close(pidfile_tmp_fd);
|
||||
(void) remove(pidfile_tmp_name);
|
||||
free(pidfile_tmp_name);
|
||||
pv_state_free(state);
|
||||
opts_free(opts);
|
||||
return 1;
|
||||
}
|
||||
|
||||
fprintf(pidfile_tmp_fptr, "%d\n", getpid());
|
||||
if (0 != fclose(pidfile_tmp_fptr)) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno));
|
||||
}
|
||||
|
||||
if (rename(pidfile_tmp_name, opts->pidfile) < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, opts->pidfile, strerror(errno));
|
||||
(void) remove(pidfile_tmp_name);
|
||||
}
|
||||
|
||||
free(pidfile_tmp_name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -183,7 +376,7 @@ int main(int argc, char **argv)
|
||||
if (!opts_add_file(opts, "-")) {
|
||||
pv_state_free(state);
|
||||
opts_free(opts);
|
||||
return 64;
|
||||
return PV_ERROREXIT_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,25 +387,11 @@ int main(int argc, char **argv)
|
||||
pv_state_inputfiles(state, opts->argc, (const char **) (opts->argv));
|
||||
}
|
||||
|
||||
/* Total size calculation, in normal transfer mode. */
|
||||
if (0 == opts->watch_pid) {
|
||||
/*
|
||||
* If no size was given, try to calculate the total size.
|
||||
*/
|
||||
if (0 == opts->size) {
|
||||
pv_state_linemode_set(state, opts->linemode);
|
||||
pv_state_null_terminated_lines_set(state, opts->null_terminated_lines);
|
||||
opts->size = pv_calc_total_size(state);
|
||||
debug("%s: %llu", "no size given - calculated", opts->size);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the size is unknown, we cannot have an ETA.
|
||||
*/
|
||||
if (opts->size < 1) {
|
||||
opts->eta = false;
|
||||
debug("%s", "size unknown - ETA disabled");
|
||||
}
|
||||
/*
|
||||
* Put the list of watchfd items into the PV internal state.
|
||||
*/
|
||||
if ((opts->watchfd_count > 0) && (NULL != opts->watchfd_pid) && (NULL != opts->watchfd_fd)) {
|
||||
pv_state_watchfds(state, opts->watchfd_count, opts->watchfd_pid, opts->watchfd_fd);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -265,24 +444,74 @@ int main(int argc, char **argv)
|
||||
opts->interval = 600;
|
||||
|
||||
/*
|
||||
* Copy parameters from options into main state.
|
||||
* Set output file, treating no output or "-" as stdout; we have to
|
||||
* do this before looking at setting the size, as the size
|
||||
* calculation looks at the output file if the input size can't be
|
||||
* calculated (issue #91).
|
||||
*
|
||||
* We have to set the sparse output flag before doing this, so that
|
||||
* in sparse mode the lseek() on O_APPEND can be done (issue #45);
|
||||
* see the comments in pv_state_output_set() in src/pv/state.c.
|
||||
*/
|
||||
pv_state_sparse_output_set(state, opts->sparse_output);
|
||||
retcode = pv__set_output(state, opts, opts->output);
|
||||
if (0 != retcode) {
|
||||
pv_state_free(state);
|
||||
opts_free(opts);
|
||||
return retcode;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the "stop at size" option before checking the total size,
|
||||
* since calculating the size from the output block device size
|
||||
* after this may want to force this setting on, and if we set it
|
||||
* afterwards, we undo the override.
|
||||
*/
|
||||
pv_state_stop_at_size_set(state, opts->stop_at_size);
|
||||
|
||||
/* Total size calculation, in normal transfer mode. */
|
||||
if (PV_ACTION_TRANSFER == opts->action) {
|
||||
/*
|
||||
* If no size was given, try to calculate the total size.
|
||||
*/
|
||||
if (0 == opts->size) {
|
||||
pv_state_linemode_set(state, opts->linemode);
|
||||
pv_state_null_terminated_lines_set(state, opts->null_terminated_lines);
|
||||
opts->size = pv_calc_total_size(state);
|
||||
debug("%s: %llu", "no size given - calculated", opts->size);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the size is unknown, we cannot have an ETA.
|
||||
*/
|
||||
if (opts->size < 1) {
|
||||
can_have_eta = false;
|
||||
debug("%s", "size unknown - ETA disabled");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the remaining parameters from the options into the main
|
||||
* state.
|
||||
*/
|
||||
|
||||
pv_state_interval_set(state, opts->interval);
|
||||
pv_state_width_set(state, opts->width, opts->width_set_manually);
|
||||
pv_state_height_set(state, opts->height, opts->height_set_manually);
|
||||
pv_state_no_display_set(state, opts->no_display);
|
||||
pv_state_force_set(state, opts->force);
|
||||
pv_state_cursor_set(state, opts->cursor);
|
||||
pv_state_show_stats_set(state, opts->show_stats);
|
||||
pv_state_numeric_set(state, opts->numeric);
|
||||
pv_state_wait_set(state, opts->wait);
|
||||
pv_state_delay_start_set(state, opts->delay_start);
|
||||
pv_state_rate_gauge_set(state, opts->rate_gauge);
|
||||
pv_state_linemode_set(state, opts->linemode);
|
||||
pv_state_bits_set(state, opts->bits);
|
||||
pv_state_decimal_units_set(state, opts->decimal_units);
|
||||
pv_state_null_terminated_lines_set(state, opts->null_terminated_lines);
|
||||
pv_state_skip_errors_set(state, opts->skip_errors);
|
||||
pv_state_error_skip_block_set(state, opts->error_skip_block);
|
||||
pv_state_stop_at_size_set(state, opts->stop_at_size);
|
||||
pv_state_sync_after_write_set(state, opts->sync_after_write);
|
||||
pv_state_direct_io_set(state, opts->direct_io);
|
||||
pv_state_discard_input_set(state, opts->discard_input);
|
||||
@@ -291,40 +520,41 @@ int main(int argc, char **argv)
|
||||
pv_state_no_splice_set(state, opts->no_splice);
|
||||
pv_state_size_set(state, opts->size);
|
||||
pv_state_name_set(state, opts->name);
|
||||
pv_state_default_bar_style_set(state, opts->default_bar_style);
|
||||
pv_state_format_string_set(state, opts->format);
|
||||
pv_state_watch_pid_set(state, opts->watch_pid);
|
||||
pv_state_watch_fd_set(state, opts->watch_fd);
|
||||
pv_state_extra_display_set(state, opts->extra_display);
|
||||
pv_state_average_rate_window_set(state, opts->average_rate_window);
|
||||
|
||||
pv_state_set_format(state, opts->progress, opts->timer, opts->eta,
|
||||
opts->fineta, opts->rate, opts->average_rate,
|
||||
pv_state_set_format(state, opts->progress, opts->timer, can_have_eta ? opts->eta : false,
|
||||
can_have_eta ? opts->fineta : false, opts->rate, opts->average_rate,
|
||||
opts->bytes, opts->bufpercent, opts->lastwritten, opts->name);
|
||||
|
||||
#ifdef MAKE_STDOUT_NONBLOCKING
|
||||
/*
|
||||
* Try and make standard output use non-blocking I/O.
|
||||
*
|
||||
* Note that this can cause problems with (broken) applications
|
||||
* such as dd.
|
||||
*/
|
||||
fcntl(STDOUT_FILENO, F_SETFL, O_NONBLOCK | fcntl(STDOUT_FILENO, F_GETFL));
|
||||
#endif /* MAKE_STDOUT_NONBLOCKING */
|
||||
debug("%s: %s", "terminal_supports_utf8", terminal_supports_utf8 ? "true" : "false");
|
||||
pv_state_set_terminal_supports_utf8(state, terminal_supports_utf8);
|
||||
|
||||
/* Initialise the signal handling. */
|
||||
pv_sig_init(state);
|
||||
|
||||
/* Run the appropriate main loop. */
|
||||
if (0 == opts->watch_pid) {
|
||||
switch (opts->action) {
|
||||
case PV_ACTION_NOTHING:
|
||||
break;
|
||||
case PV_ACTION_TRANSFER:
|
||||
/* Normal "transfer data" mode. */
|
||||
pv_remote_init();
|
||||
retcode = pv_main_loop(state);
|
||||
pv_remote_fini();
|
||||
} else if (0 != opts->watch_pid && -1 == opts->watch_fd) {
|
||||
/* "Watch all file descriptors of another process" mode. */
|
||||
retcode = pv_watchpid_loop(state);
|
||||
} else if (0 != opts->watch_pid && -1 != opts->watch_fd) {
|
||||
/* "Watch a specific file descriptor of another process" mode. */
|
||||
break;
|
||||
case PV_ACTION_STORE_AND_FORWARD:
|
||||
/* Store-and-forward transfer mode. */
|
||||
pv_remote_init();
|
||||
retcode = pv__store_and_forward(state, opts, can_have_eta);
|
||||
pv_remote_fini();
|
||||
break;
|
||||
case PV_ACTION_WATCHFD:
|
||||
/* "Watch file descriptor(s) of another process" mode. */
|
||||
retcode = pv_watchfd_loop(state);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Clear up the PID file, if one was written. */
|
||||
@@ -347,5 +577,3 @@ int main(int argc, char **argv)
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+613
-48
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Parse command-line options.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -15,7 +15,19 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_SYS_SYSMACROS_H
|
||||
#include <sys/sysmacros.h>
|
||||
#ifdef major
|
||||
#ifdef minor
|
||||
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
||||
#define CAN_BUILD_SYSFS_FILENAME 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/wait.h>
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif
|
||||
@@ -23,6 +35,14 @@
|
||||
|
||||
void display_help(void);
|
||||
void display_version(void);
|
||||
static bool opts_watchfd_parse(opts_t, const char *, /*@null@ */ const char *, unsigned int);
|
||||
|
||||
|
||||
/*
|
||||
* splint note about mustfreefresh: the gettext calls made by _() cause
|
||||
* memory leak warnings, but in these cases it's unavoidable, and mitigated
|
||||
* by the fact we only translate each string once.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@@ -44,6 +64,18 @@ void opts_free( /*@only@ */ opts_t opts)
|
||||
free(opts->format);
|
||||
if (NULL != opts->pidfile)
|
||||
free(opts->pidfile);
|
||||
if (NULL != opts->output)
|
||||
free(opts->output);
|
||||
if (NULL != opts->default_bar_style)
|
||||
free(opts->default_bar_style);
|
||||
if (NULL != opts->store_and_forward_file)
|
||||
free(opts->store_and_forward_file);
|
||||
if (NULL != opts->extra_display)
|
||||
free(opts->extra_display);
|
||||
if (NULL != opts->watchfd_pid)
|
||||
free(opts->watchfd_pid);
|
||||
if (NULL != opts->watchfd_fd)
|
||||
free(opts->watchfd_fd);
|
||||
if (NULL != opts->argv)
|
||||
free(opts->argv);
|
||||
/*@+keeptrans@ */
|
||||
@@ -85,6 +117,443 @@ bool opts_add_file(opts_t opts, const char *filename)
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add a process ID and file descriptor to the list of items to watch with
|
||||
* --watchfd, returning false on error.
|
||||
*/
|
||||
static bool opts_watchfd_add_item(opts_t opts, pid_t pid, int fd)
|
||||
{
|
||||
/*@-branchstate@ */
|
||||
if ((opts->watchfd_count >= opts->watchfd_length) || (NULL == opts->watchfd_pid)) {
|
||||
opts->watchfd_length = opts->watchfd_count + 10;
|
||||
/*@-keeptrans@ */
|
||||
opts->watchfd_pid = realloc(opts->watchfd_pid, opts->watchfd_length * sizeof(pid_t));
|
||||
opts->watchfd_fd = realloc(opts->watchfd_fd, opts->watchfd_length * sizeof(int));
|
||||
/*@+keeptrans@ */
|
||||
if ((NULL == opts->watchfd_pid) || (NULL == opts->watchfd_fd)) {
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
|
||||
opts->watchfd_length = 0;
|
||||
opts->watchfd_count = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/*@+branchstate@ */
|
||||
|
||||
/*
|
||||
* splint notes: we turned off "branchstate" and "keeptrans" above
|
||||
* because of the same reason as in opts_add_file().
|
||||
*/
|
||||
|
||||
opts->watchfd_pid[opts->watchfd_count] = pid;
|
||||
opts->watchfd_fd[opts->watchfd_count] = fd;
|
||||
opts->watchfd_count++;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Look for processes with the given name, and add all of them to the list
|
||||
* of watched PIDs. Returns false on error.
|
||||
*/
|
||||
static bool opts_watchfd_processname(opts_t opts, const char *process_name)
|
||||
{
|
||||
int fds[2];
|
||||
pid_t pid;
|
||||
FILE *fptr;
|
||||
char buffer[1024]; /* flawfinder: ignore */
|
||||
pid_t waited_pid;
|
||||
int pid_status;
|
||||
bool ok;
|
||||
|
||||
/*
|
||||
* flawfinder: buffer is zeroed before each use, and fgets() is
|
||||
* passed one less than its size so the string functions in the loop
|
||||
* always find a null byte at the end.
|
||||
*/
|
||||
|
||||
/* Pipe for communicating with pgrep. */
|
||||
if (pipe(fds) < 0) {
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Subprocess in which to run pgrep. */
|
||||
pid = (pid_t) fork();
|
||||
if (pid < 0) {
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name, strerror(errno));
|
||||
(void) close(fds[0]);
|
||||
(void) close(fds[1]);
|
||||
return false;
|
||||
} else if (0 == pid) {
|
||||
int nullfd;
|
||||
|
||||
/* Child process - close stdin, set up stdout, run pgrep. */
|
||||
|
||||
/* Replace stdin with /dev/null. */
|
||||
nullfd = open("/dev/null", O_RDONLY); /* flawfinder: ignore */
|
||||
/* flawfinder: /dev/null is trusted. */
|
||||
if (nullfd < 0) {
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, "/dev/null", strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (dup2(nullfd, STDIN_FILENO) < 0) {
|
||||
perror("dup2");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
(void) close(nullfd);
|
||||
|
||||
/* Replace stdout with the write end of the pipe. */
|
||||
if (dup2(fds[1], STDOUT_FILENO) < 0) {
|
||||
perror("dup2");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
(void) close(fds[1]);
|
||||
|
||||
/* Close the read end of the pipe. */
|
||||
(void) close(fds[0]);
|
||||
|
||||
/* Run pgrep. */
|
||||
if (execlp("pgrep", "pgrep", process_name, NULL) < 0) { /* flawfinder: ignore */
|
||||
perror("pgrep");
|
||||
}
|
||||
/*
|
||||
* flawfinder: deliberately calling pgrep as there isn't a
|
||||
* portable library to use instead.
|
||||
*/
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Close the write end of the pipe. */
|
||||
(void) close(fds[1]);
|
||||
|
||||
/* Open a file stream on the read end of the pipe. */
|
||||
fptr = fdopen(fds[0], "r");
|
||||
if (NULL == fptr) {
|
||||
perror("fdopen");
|
||||
(void) close(fds[0]);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Read the lines of output from the child process. */
|
||||
|
||||
ok = true;
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
while ((0 == feof(fptr)) && (NULL != fgets(buffer, (int) (sizeof(buffer) - 1), fptr))) {
|
||||
unsigned int watch_pid;
|
||||
|
||||
/* Skip all lines if we've hit any errors. */
|
||||
if (!ok) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Skip lines without valid PID. */
|
||||
watch_pid = 0;
|
||||
if (sscanf(buffer, "%u", &watch_pid) < 1)
|
||||
continue;
|
||||
if (watch_pid < 1)
|
||||
continue;
|
||||
|
||||
if (!opts_watchfd_parse(opts, buffer, NULL, 0))
|
||||
ok = false;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
}
|
||||
|
||||
|
||||
/* Close the stream from the read end of the pipe. */
|
||||
(void) fclose(fptr);
|
||||
|
||||
/* Wait for the child process to exit. */
|
||||
do {
|
||||
/*@-type@ */
|
||||
/* splint disagreement about __pid_t vs pid_t. */
|
||||
pid_status = 0;
|
||||
waited_pid = waitpid(pid, &pid_status, 0);
|
||||
/*@+type@ */
|
||||
} while (-1 == waited_pid && errno == EINTR);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Read additional "-d" values from the given file, returning false on
|
||||
* failure.
|
||||
*/
|
||||
static bool opts_watchfd_listfile(opts_t opts, const char *filename)
|
||||
{
|
||||
FILE *fptr;
|
||||
char buffer[1024]; /* flawfinder: ignore */
|
||||
unsigned int linenumber;
|
||||
|
||||
/*
|
||||
* flawfinder: buffer is zeroed before each use, and fgets() is
|
||||
* passed one less than its size so the string functions in the loop
|
||||
* always find a null byte at the end.
|
||||
*/
|
||||
|
||||
fptr = fopen(filename, "r"); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder note: caller directly controls filename, and we're
|
||||
* opening the file read-only.
|
||||
*/
|
||||
if (NULL == fptr) {
|
||||
fprintf(stderr, "%s: -d @: %s: %s\n", opts->program_name, filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
linenumber = 0;
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
|
||||
while ((0 == feof(fptr)) && (NULL != fgets(buffer, (int) (sizeof(buffer) - 1), fptr))) {
|
||||
char *argument;
|
||||
char *nlptr;
|
||||
|
||||
linenumber++;
|
||||
|
||||
/* Remove trailing carriage returns or newlines. */
|
||||
nlptr = strchr(buffer, '\r');
|
||||
if (NULL != nlptr)
|
||||
nlptr[0] = '\0';
|
||||
nlptr = strchr(buffer, '\n');
|
||||
if (NULL != nlptr)
|
||||
nlptr[0] = '\0';
|
||||
|
||||
/* Ignore leading spaces. */
|
||||
argument = buffer;
|
||||
while (argument[0] != '\0' && (argument[0] == ' ' || argument[0] == '\t'))
|
||||
argument++;
|
||||
|
||||
/* Ignore blank lines or comment lines. */
|
||||
if ((argument[0] == '\0') || (argument[0] == '#')) {
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Reject "@" lines. */
|
||||
if (argument[0] == '@') {
|
||||
(void) fclose(fptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!opts_watchfd_parse(opts, argument, filename, linenumber)) {
|
||||
(void) fclose(fptr);
|
||||
return false;
|
||||
}
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
}
|
||||
|
||||
(void) fclose(fptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Parse a "-d" option value and make the appropriate additions to the list
|
||||
* of watchfd items, returning false on failure.
|
||||
*/
|
||||
static bool opts_watchfd_parse(opts_t opts, const char *argument, /*@null@ */ const char *filename, unsigned int line)
|
||||
{
|
||||
unsigned int parse_pid;
|
||||
int parse_fd;
|
||||
|
||||
if ('@' == argument[0]) {
|
||||
/* "-d @FILE" syntax - read more values from FILE. */
|
||||
|
||||
/* Don't allow this syntax in a list file. */
|
||||
if (NULL != filename) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -d @: %s:%u: %s\n",
|
||||
opts->program_name, filename, line, _("list files may not contain @ lines"));
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
return opts_watchfd_listfile(opts, argument + 1);
|
||||
|
||||
} else if ('=' == argument[0]) {
|
||||
/* "-d =NAME" syntax - find processes named NAME. */
|
||||
return opts_watchfd_processname(opts, argument + 1);
|
||||
}
|
||||
|
||||
/* "-d PID[:FD]" syntax. */
|
||||
|
||||
parse_pid = 0;
|
||||
parse_fd = -1;
|
||||
|
||||
if (sscanf(argument, "%u:%d", &parse_pid, &parse_fd) < 1) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
if (NULL != filename) {
|
||||
fprintf(stderr, "%s: -d: %s:%u: %s\n",
|
||||
opts->program_name, filename, line, _("process ID or pid:fd pair expected"));
|
||||
} else {
|
||||
fprintf(stderr, "%s: -d: %s\n", opts->program_name, _("process ID or pid:fd pair expected"));
|
||||
}
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
if (parse_pid < 1) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
if (NULL != filename) {
|
||||
fprintf(stderr, "%s: -d: %s:%u: %u: %s\n",
|
||||
opts->program_name, filename, line, parse_pid, _("invalid process ID"));
|
||||
} else {
|
||||
fprintf(stderr, "%s: -d: %u: %s\n", opts->program_name, parse_pid, _("invalid process ID"));
|
||||
}
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
return opts_watchfd_add_item(opts, (pid_t) parse_pid, parse_fd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set opts->size from the size of the file whose name is size_file,
|
||||
* returning false (and reporting the error) if there is a problem.
|
||||
*
|
||||
* If size_file points to a block device, the size of the block device is
|
||||
* used.
|
||||
*/
|
||||
static bool opts_use_size_of_file(opts_t opts, const char *size_file)
|
||||
{
|
||||
struct stat sb;
|
||||
int stat_rc;
|
||||
#ifdef CAN_BUILD_SYSFS_FILENAME
|
||||
char sysfs_filename[512]; /* flawfinder: ignore */
|
||||
FILE *sysfs_fptr;
|
||||
long long sysfs_size;
|
||||
#endif /* CAN_BUILD_SYSFS_FILENAME */
|
||||
int device_fd;
|
||||
off_t device_size;
|
||||
|
||||
/*
|
||||
* flawfinder rationale: sysfs_filename is only used with
|
||||
* pv_snprintf() which guarantees it will be bounded and zero
|
||||
* terminated.
|
||||
*/
|
||||
|
||||
stat_rc = 0;
|
||||
memset(&sb, 0, sizeof(sb));
|
||||
|
||||
stat_rc = stat(size_file, &sb);
|
||||
|
||||
if (0 != stat_rc) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||
opts->program_name, size_file, _("failed to stat file"), strerror(errno));
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
/* This was a regular file - use its size and return. */
|
||||
if (S_ISREG((mode_t) (sb.st_mode))) {
|
||||
opts->size = (off_t) (sb.st_size);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* This was a directory - report an error. */
|
||||
if (S_ISDIR((mode_t) (sb.st_mode))) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s\n", opts->program_name, size_file, _("is a directory"));
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
/* This was not a block device - just use the size and return. */
|
||||
if (!S_ISBLK((mode_t) (sb.st_mode))) {
|
||||
opts->size = (off_t) (sb.st_size);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* Block device - determine its size by looking for
|
||||
* /sys/dev/block/MAJOR:MINOR/size, and if that fails, try opening
|
||||
* the file and seeking to the end.
|
||||
*/
|
||||
|
||||
#ifdef CAN_BUILD_SYSFS_FILENAME
|
||||
/*
|
||||
* Try the sysfs method - lightest touch and requires no read access
|
||||
* to the actual block device.
|
||||
*/
|
||||
|
||||
memset(sysfs_filename, 0, sizeof(sysfs_filename));
|
||||
if (pv_snprintf
|
||||
(sysfs_filename, sizeof(sysfs_filename), "/sys/dev/block/%u:%u/size", major(sb.st_rdev),
|
||||
minor(sb.st_rdev)) < 0) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||
opts->program_name, size_file, _("failed to generate sysfs filename"), strerror(errno));
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
sysfs_fptr = fopen(sysfs_filename, "r"); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: sysfs is trusted here, the filename is
|
||||
* predictable, and we are restricted to reading one number.
|
||||
*/
|
||||
if (NULL != sysfs_fptr) {
|
||||
sysfs_size = -1;
|
||||
if (1 == fscanf(sysfs_fptr, "%lld", &sysfs_size)) {
|
||||
/* Read successful - use the value (* 512) and return. */
|
||||
(void) fclose(sysfs_fptr);
|
||||
opts->size = (off_t) sysfs_size *512;
|
||||
return true;
|
||||
}
|
||||
/* Read not successful - report the error and return. */
|
||||
/* NB we must fclose() after reporting to retain errno. */
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||
opts->program_name, size_file, _("failed to read sysfs size file"), strerror(errno));
|
||||
(void) fclose(sysfs_fptr);
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
#endif /* CAN_BUILD_SYSFS_FILENAME */
|
||||
|
||||
/*
|
||||
* Try opening the block device and seeking to the end.
|
||||
*/
|
||||
device_fd = open(size_file, O_RDONLY); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: the filename is under the direct control of
|
||||
* the operator by its nature, so we can't refuse to open symlinks
|
||||
* etc as that would be counterintuitive.
|
||||
*/
|
||||
|
||||
if (device_fd < 0) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||
opts->program_name, size_file, _("failed to open block device"), strerror(errno));
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
device_size = (off_t) lseek(device_fd, 0, SEEK_END);
|
||||
|
||||
if (device_size < 0) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s: %s: %s\n",
|
||||
opts->program_name, size_file, _("failed to determine size of block device"), strerror(errno));
|
||||
/* NB close() after reporting error, to preserve errno. */
|
||||
(void) close(device_fd);
|
||||
return false;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
(void) close(device_fd);
|
||||
|
||||
/* Use the size we found. */
|
||||
opts->size = device_size;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Parse the given command-line arguments into an opts_t object, handling
|
||||
@@ -124,13 +593,17 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
{ "wait", 0, NULL, (int) 'W' },
|
||||
{ "delay-start", 1, NULL, (int) 'D' },
|
||||
{ "size", 1, NULL, (int) 's' },
|
||||
{ "gauge", 0, NULL, (int) 'g' },
|
||||
{ "line-mode", 0, NULL, (int) 'l' },
|
||||
{ "null", 0, NULL, (int) '0' },
|
||||
{ "interval", 1, NULL, (int) 'i' },
|
||||
{ "width", 1, NULL, (int) 'w' },
|
||||
{ "height", 1, NULL, (int) 'H' },
|
||||
{ "name", 1, NULL, (int) 'N' },
|
||||
{ "bar-style", 1, NULL, (int) 'u' },
|
||||
{ "format", 1, NULL, (int) 'F' },
|
||||
{ "extra-display", 1, NULL, (int) 'x' },
|
||||
{ "stats", 0, NULL, (int) 'v' },
|
||||
{ "rate-limit", 1, NULL, (int) 'L' },
|
||||
{ "buffer-size", 1, NULL, (int) 'B' },
|
||||
{ "no-splice", 0, NULL, (int) 'C' },
|
||||
@@ -139,10 +612,14 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
{ "stop-at-size", 0, NULL, (int) 'S' },
|
||||
{ "sync", 0, NULL, (int) 'Y' },
|
||||
{ "direct-io", 0, NULL, (int) 'K' },
|
||||
{ "sparse", 0, NULL, (int) 'O' },
|
||||
{ "sparse-output", 0, NULL, (int) 'O' },
|
||||
{ "discard", 0, NULL, (int) 'X' },
|
||||
{ "store-and-forward", 1, NULL, (int) 'U' },
|
||||
{ "remote", 1, NULL, (int) 'R' },
|
||||
{ "pidfile", 1, NULL, (int) 'P' },
|
||||
{ "watchfd", 1, NULL, (int) 'd' },
|
||||
{ "output", 1, NULL, (int) 'o' },
|
||||
{ "average-rate-window", 1, NULL, (int) 'm' },
|
||||
#ifdef ENABLE_DEBUGGING
|
||||
{ "debug", 1, NULL, (int) '!' },
|
||||
@@ -152,14 +629,14 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
/*@+nullassign@ */
|
||||
int option_index = 0;
|
||||
#endif /* HAVE_GETOPT_LONG */
|
||||
char *short_options = "hVpteIrab8kTA:fnqcWD:s:l0i:w:H:N:F:L:B:CEZ:SYKXR:P:d:m:"
|
||||
char *short_options = "hVpteIrab8kTA:fvnqcWD:s:gl0i:w:H:N:u:F:x:L:B:CEZ:SYKOXU:R:P:d:m:o:"
|
||||
#ifdef ENABLE_DEBUGGING
|
||||
"!:"
|
||||
#endif
|
||||
;
|
||||
int c, numopts;
|
||||
unsigned int check_pid, parse_pid;
|
||||
int check_fd, parse_fd;
|
||||
unsigned int check_pid;
|
||||
int check_fd;
|
||||
opts_t opts;
|
||||
char *leafptr;
|
||||
|
||||
@@ -199,10 +676,9 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
|
||||
numopts = 0;
|
||||
|
||||
opts->action = PV_ACTION_TRANSFER;
|
||||
opts->interval = 1;
|
||||
opts->delay_start = 0;
|
||||
opts->watch_pid = 0;
|
||||
opts->watch_fd = -1;
|
||||
opts->average_rate_window = 30;
|
||||
|
||||
opts->width_set_manually = false;
|
||||
@@ -235,24 +711,33 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
break;
|
||||
/* falls through */
|
||||
/*@fallthrough@ */
|
||||
case 'L':
|
||||
/*@fallthrough@ */
|
||||
case 'B':
|
||||
/*@fallthrough@ */
|
||||
case 'Z':
|
||||
if (!pv_getnum_check(optarg, PV_NUMTYPE_ANY_WITH_SUFFIX)) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
|
||||
_("numeric value not understood"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
break;
|
||||
case 'A':
|
||||
/*@fallthrough@ */
|
||||
case 'w':
|
||||
/*@fallthrough@ */
|
||||
case 'H':
|
||||
/*@fallthrough@ */
|
||||
case 'L':
|
||||
/*@fallthrough@ */
|
||||
case 'B':
|
||||
/*@fallthrough@ */
|
||||
case 'R':
|
||||
/*@fallthrough@ */
|
||||
case 'm':
|
||||
/*@fallthrough@ */
|
||||
case 'Z':
|
||||
if (!pv_getnum_check(optarg, PV_NUMTYPE_INTEGER)) {
|
||||
if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_INTEGER)) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("integer argument expected"));
|
||||
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
|
||||
_("integer argument expected"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
@@ -261,17 +746,59 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
case 'i':
|
||||
/*@fallthrough@ */
|
||||
case 'D':
|
||||
if (!pv_getnum_check(optarg, PV_NUMTYPE_DOUBLE)) {
|
||||
if (!pv_getnum_check(optarg, PV_NUMTYPE_BARE_DOUBLE)) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c: %s\n", opts->program_name, c, _("numeric argument expected"));
|
||||
fprintf(stderr, "%s: -%c: %s: %s\n", opts->program_name, c, optarg,
|
||||
_("numeric argument expected"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
if ('@' == optarg[0]) {
|
||||
/* "-d @FILE" syntax - check FILE exists. */
|
||||
if (optarg[1] == '\0') {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c @: %s\n",
|
||||
opts->program_name, c, _("missing filename"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
} else if (0 != access(optarg + 1, R_OK)) { /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: we're not
|
||||
* using access() to check
|
||||
* permissions, only to help give a
|
||||
* usable error message, so there's
|
||||
* no TOCTOU issue.
|
||||
*/
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c @: %s: %s\n",
|
||||
opts->program_name, c, optarg + 1, strerror(errno));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
break;
|
||||
} else if ('=' == optarg[0]) {
|
||||
/*
|
||||
* "-d =NAME" syntax - check NAME is not
|
||||
* blank.
|
||||
*/
|
||||
if (optarg[1] == '\0') {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c %c: %s\n",
|
||||
opts->program_name, c, optarg[0], _("missing process name"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (sscanf(optarg, "%u:%d", &check_pid, &check_fd)
|
||||
< 1) {
|
||||
/* "-d PID[:FD]" syntax - check numbers. */
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: -%c: %s\n",
|
||||
opts->program_name, c, _("process ID or pid:fd pair expected"));
|
||||
@@ -297,11 +824,11 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
switch (c) {
|
||||
case 'h':
|
||||
display_help();
|
||||
opts->do_nothing = true;
|
||||
opts->action = PV_ACTION_NOTHING;
|
||||
return opts; /* early return */
|
||||
case 'V':
|
||||
display_version();
|
||||
opts->do_nothing = true;
|
||||
opts->action = PV_ACTION_NOTHING;
|
||||
return opts; /* early return */
|
||||
case 'p':
|
||||
opts->progress = true;
|
||||
@@ -352,6 +879,9 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
case 'f':
|
||||
opts->force = true;
|
||||
break;
|
||||
case 'v':
|
||||
opts->show_stats = true;
|
||||
break;
|
||||
case 'n':
|
||||
opts->numeric = true;
|
||||
numopts++;
|
||||
@@ -370,30 +900,21 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
opts->delay_start = pv_getnum_interval(optarg);
|
||||
break;
|
||||
case 's':
|
||||
/* Permit "@<filename>" as well as just a number. */
|
||||
if ('@' == *optarg) {
|
||||
if ('@' != *optarg) {
|
||||
/* A number was passed, not "@<filename>". */
|
||||
opts->size = pv_getnum_size(optarg, opts->decimal_units);
|
||||
} else {
|
||||
/* Permit "@<filename>". */
|
||||
const char *size_file = 1 + optarg;
|
||||
struct stat sb;
|
||||
int rc;
|
||||
|
||||
rc = 0;
|
||||
memset(&sb, 0, sizeof(sb));
|
||||
rc = stat(size_file, &sb);
|
||||
if (0 == rc) {
|
||||
opts->size = (off_t) (sb.st_size);
|
||||
} else {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s %s: %s\n",
|
||||
opts->program_name,
|
||||
_("failed to stat file"), size_file, strerror(errno));
|
||||
if (!opts_use_size_of_file(opts, size_file)) {
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
} else {
|
||||
opts->size = pv_getnum_size(optarg, opts->decimal_units);
|
||||
}
|
||||
break;
|
||||
case 'g':
|
||||
opts->rate_gauge = true;
|
||||
break;
|
||||
case 'l':
|
||||
opts->linemode = true;
|
||||
break;
|
||||
@@ -420,6 +941,14 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case 'u':
|
||||
opts->default_bar_style = pv_strdup(optarg);
|
||||
if (NULL == opts->default_bar_style) {
|
||||
fprintf(stderr, "%s: -u: %s\n", opts->program_name, strerror(errno));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case 'L':
|
||||
opts->rate_limit = pv_getnum_size(optarg, opts->decimal_units);
|
||||
break;
|
||||
@@ -445,12 +974,25 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
case 'K':
|
||||
opts->direct_io = true;
|
||||
break;
|
||||
case 'O':
|
||||
opts->sparse_output = true;
|
||||
opts->no_splice = true;
|
||||
break;
|
||||
case 'X':
|
||||
opts->discard_input = true;
|
||||
opts->no_splice = true;
|
||||
break;
|
||||
case 'U':
|
||||
opts->store_and_forward_file = pv_strdup(optarg);
|
||||
if (NULL == opts->store_and_forward_file) {
|
||||
fprintf(stderr, "%s: -U: %s\n", opts->program_name, strerror(errno));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
opts->action = PV_ACTION_STORE_AND_FORWARD;
|
||||
break;
|
||||
case 'R':
|
||||
opts->remote = pv_getnum_count(optarg, false);
|
||||
opts->remote = (pid_t) pv_getnum_count(optarg, false);
|
||||
break;
|
||||
case 'P':
|
||||
opts->pidfile = pv_strdup(optarg);
|
||||
@@ -468,13 +1010,28 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case 'x':
|
||||
opts->extra_display = pv_strdup(optarg);
|
||||
if (NULL == opts->extra_display) {
|
||||
fprintf(stderr, "%s: -x: %s\n", opts->program_name, strerror(errno));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case 'd':
|
||||
parse_pid = 0;
|
||||
parse_fd = -1;
|
||||
/* No syntax check here, already done earlier */
|
||||
(void) sscanf(optarg, "%u:%d", &parse_pid, &parse_fd);
|
||||
opts->watch_pid = (pid_t) parse_pid;
|
||||
opts->watch_fd = parse_fd;
|
||||
if (!opts_watchfd_parse(opts, optarg, NULL, 0)) {
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
opts->action = PV_ACTION_WATCHFD;
|
||||
break;
|
||||
case 'o':
|
||||
opts->output = pv_strdup(optarg);
|
||||
if (NULL == opts->output) {
|
||||
fprintf(stderr, "%s: -o: %s\n", opts->program_name, strerror(errno));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
case 'm':
|
||||
opts->average_rate_window = pv_getnum_count(optarg, opts->decimal_units);
|
||||
@@ -515,7 +1072,7 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
if (NULL == opts)
|
||||
return NULL;
|
||||
|
||||
if (0 != opts->watch_pid) {
|
||||
if (PV_ACTION_WATCHFD == opts->action) {
|
||||
if (opts->linemode || opts->null_terminated_lines || opts->stop_at_size
|
||||
|| (opts->skip_errors > 0) || (opts->buffer_size > 0)
|
||||
|| (opts->rate_limit > 0)) {
|
||||
@@ -545,14 +1102,24 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
if (optind < (int) argc) {
|
||||
if (NULL != opts->output) {
|
||||
/*@-mustfreefresh@ *//* see above */
|
||||
fprintf(stderr, "%s: %s\n", opts->program_name,
|
||||
fprintf(stderr, "%s: -o: %s\n", opts->program_name,
|
||||
_("cannot transfer files when watching file descriptors"));
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
/*@+mustfreefresh@ */
|
||||
}
|
||||
|
||||
/* Accept additional watchfd arguments. */
|
||||
while (optind < (int) argc) {
|
||||
if (!opts_watchfd_parse(opts, argv[optind], NULL, 0)) {
|
||||
opts_free(opts);
|
||||
return NULL;
|
||||
}
|
||||
optind++;
|
||||
}
|
||||
|
||||
#ifndef __APPLE__
|
||||
if (0 != access("/proc/self/fdinfo", X_OK)) { /* flawfinder: ignore */
|
||||
/*
|
||||
@@ -598,5 +1165,3 @@ opts_t opts_parse(unsigned int argc, char **argv)
|
||||
|
||||
return opts;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+49
-36
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Remote-control functions.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -21,8 +21,8 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef SA_SIGINFO
|
||||
void pv_error(pvstate_t, char *, ...);
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
void pv_error(char *, ...);
|
||||
|
||||
struct remote_msg {
|
||||
bool progress; /* progress bar flag */
|
||||
@@ -44,11 +44,13 @@ struct remote_msg {
|
||||
bool height_set_manually; /* height was set manually, not detected */
|
||||
char name[256]; /* flawfinder: ignore */
|
||||
char format[256]; /* flawfinder: ignore */
|
||||
char extra_display[256]; /* flawfinder: ignore */
|
||||
};
|
||||
|
||||
/*
|
||||
* flawfinder rationale: name and format are always explicitly zeroed and
|
||||
* bounded to one less than their size so they are always \0 terminated.
|
||||
* flawfinder rationale: name, format, and extra_display are always
|
||||
* explicitly zeroed and bounded to one less than their size so they are
|
||||
* always \0 terminated.
|
||||
*/
|
||||
|
||||
|
||||
@@ -57,10 +59,12 @@ struct remote_msg {
|
||||
* file associated with a particular process ID; it will be opened for
|
||||
* writing if "sender" is true. Returns NULL on error.
|
||||
*/
|
||||
/*@null@ */
|
||||
/*@dependent@ */
|
||||
static FILE *pv__control_file(char *filename, size_t bufsize, pid_t control_pid, bool sender)
|
||||
{
|
||||
int open_flags, open_mode, control_fd;
|
||||
FILE *control_fptr;
|
||||
/*@dependent@ */ FILE *control_fptr = NULL;
|
||||
|
||||
open_flags = O_RDONLY;
|
||||
#ifdef O_NOFOLLOW
|
||||
@@ -157,8 +161,8 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
* Check that the remote process exists.
|
||||
*/
|
||||
if (kill((pid_t) (opts->remote), 0) != 0) {
|
||||
pv_error(state, "%u: %s", opts->remote, strerror(errno));
|
||||
return 1;
|
||||
pv_error("%u: %s", opts->remote, strerror(errno));
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -205,21 +209,24 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
if (opts->format != NULL) {
|
||||
strncpy(msgbuf.format, opts->format, sizeof(msgbuf.format) - 1); /* flawfinder: ignore */
|
||||
}
|
||||
if (opts->extra_display != NULL) {
|
||||
strncpy(msgbuf.extra_display, opts->extra_display, sizeof(msgbuf.extra_display) - 1); /* flawfinder: ignore */
|
||||
}
|
||||
|
||||
/*
|
||||
* flawfinder rationale: both name and format are explicitly bounded
|
||||
* to 1 less than the size of their buffer and the buffer is \0
|
||||
* terminated by memset() earlier.
|
||||
* flawfinder rationale: name, format, and extra_display are
|
||||
* explicitly bounded to 1 less than the size of their buffer and
|
||||
* the buffer is \0 terminated by memset() earlier.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Get the filename and file stream to use for remote control.
|
||||
*/
|
||||
memset(control_filename, 0, sizeof(control_filename));
|
||||
control_fptr = pv__control_file(control_filename, sizeof(control_filename), getpid(), true);
|
||||
control_fptr = pv__control_file(control_filename, sizeof(control_filename), (pid_t) getpid(), true);
|
||||
if (NULL == control_fptr) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
return 1;
|
||||
pv_error("%s", strerror(errno));
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -227,16 +234,16 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
* it.
|
||||
*/
|
||||
if (1 != fwrite(&msgbuf, sizeof(msgbuf), 1, control_fptr)) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
pv_error("%s", strerror(errno));
|
||||
(void) fclose(control_fptr);
|
||||
(void) remove(control_filename);
|
||||
return 1;
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
if (0 != fclose(control_fptr)) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
pv_error("%s", strerror(errno));
|
||||
(void) remove(control_filename);
|
||||
return 1;
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -246,9 +253,9 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
signal_sender = 0;
|
||||
(void) pv_sigusr2_received(state, &signal_sender);
|
||||
if (kill((pid_t) (opts->remote), SIGUSR2) != 0) {
|
||||
pv_error(state, "%u: %s", opts->remote, strerror(errno));
|
||||
pv_error("%u: %s", opts->remote, strerror(errno));
|
||||
(void) remove(control_filename);
|
||||
return 1;
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
debug("%s", "message sent");
|
||||
@@ -284,7 +291,7 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
* Remove the remote control file.
|
||||
*/
|
||||
if (0 != remove(control_filename)) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
pv_error("%s", strerror(errno));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -299,8 +306,8 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
* warnings, but in this case it's unavoidable, and mitigated by the
|
||||
* fact we only translate each string once.
|
||||
*/
|
||||
pv_error(state, "%u: %s", opts->remote, _("message not received"));
|
||||
return 1;
|
||||
pv_error("%u: %s", opts->remote, _("message not received"));
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
/*@+mustfreefresh @ */
|
||||
}
|
||||
|
||||
@@ -311,8 +318,10 @@ int pv_remote_set(opts_t opts, pvstate_t state)
|
||||
*
|
||||
* NB relies on pv_state_set_format() causing the output format to be
|
||||
* reparsed.
|
||||
*
|
||||
* Returns true if something was received, false otherwise.
|
||||
*/
|
||||
void pv_remote_check(pvstate_t state)
|
||||
bool pv_remote_check(pvstate_t state)
|
||||
{
|
||||
pid_t signal_sender;
|
||||
char control_filename[4096]; /* flawfinder: ignore */
|
||||
@@ -326,13 +335,13 @@ void pv_remote_check(pvstate_t state)
|
||||
*/
|
||||
signal_sender = 0;
|
||||
if (!pv_sigusr2_received(state, &signal_sender))
|
||||
return;
|
||||
return false;
|
||||
|
||||
memset(control_filename, 0, sizeof(control_filename));
|
||||
control_fptr = pv__control_file(control_filename, sizeof(control_filename), signal_sender, false);
|
||||
if (NULL == control_fptr) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
return;
|
||||
pv_error("%s: %s", control_filename, strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -340,14 +349,14 @@ void pv_remote_check(pvstate_t state)
|
||||
* it.
|
||||
*/
|
||||
if (1 != fread(&msgbuf, sizeof(msgbuf), 1, control_fptr)) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
pv_error("%s", strerror(errno));
|
||||
(void) fclose(control_fptr);
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 != fclose(control_fptr)) {
|
||||
pv_error(state, "%s", strerror(errno));
|
||||
return;
|
||||
pv_error("%s", strerror(errno));
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -362,9 +371,11 @@ void pv_remote_check(pvstate_t state)
|
||||
|
||||
pv_state_format_string_set(state, NULL);
|
||||
pv_state_name_set(state, NULL);
|
||||
pv_state_extra_display_set(state, NULL);
|
||||
|
||||
msgbuf.name[sizeof(msgbuf.name) - 1] = '\0';
|
||||
msgbuf.format[sizeof(msgbuf.format) - 1] = '\0';
|
||||
msgbuf.extra_display[sizeof(msgbuf.extra_display) - 1] = '\0';
|
||||
|
||||
pv_state_set_format(state, msgbuf.progress, msgbuf.timer,
|
||||
msgbuf.eta, msgbuf.fineta, msgbuf.rate,
|
||||
@@ -387,6 +398,10 @@ void pv_remote_check(pvstate_t state)
|
||||
pv_state_height_set(state, msgbuf.height, msgbuf.height_set_manually);
|
||||
if (msgbuf.format[0] != '\0')
|
||||
pv_state_format_string_set(state, msgbuf.format);
|
||||
if (msgbuf.extra_display[0] != '\0')
|
||||
pv_state_extra_display_set(state, msgbuf.extra_display);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -405,10 +420,10 @@ void pv_remote_fini(void)
|
||||
{
|
||||
}
|
||||
|
||||
#else /* !SA_SIGINFO */
|
||||
#else /* !PV_REMOTE_CONTROL */
|
||||
|
||||
/*
|
||||
* Dummy stubs for remote control when we don't have SA_SIGINFO.
|
||||
* Dummy stubs for remote control when we don't have PV_REMOTE_CONTROL.
|
||||
*/
|
||||
void pv_remote_init(void)
|
||||
{
|
||||
@@ -428,9 +443,7 @@ int pv_remote_set( /*@unused@ */
|
||||
/*@-mustfreefresh@ *//* splint - see above */
|
||||
fprintf(stderr, "%s\n", _("SA_SIGINFO not supported on this system"));
|
||||
/*@+mustfreefresh@ */
|
||||
return 1;
|
||||
return PV_ERROREXIT_REMOTE_OR_PID;
|
||||
}
|
||||
|
||||
#endif /* SA_SIGINFO */
|
||||
|
||||
/* EOF */
|
||||
|
||||
+2
-4
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Output version information to stdout.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -23,7 +23,7 @@ void display_version(void)
|
||||
/* GNU standard first line format: program and version only */
|
||||
printf("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
|
||||
/* GNU standard second line format - "Copyright" always in English */
|
||||
printf("Copyright %s %s\n", "2023", "Andrew Wood");
|
||||
printf("Copyright %s %s\n", "2025", "Andrew Wood");
|
||||
/* GNU standard license line and free software notice */
|
||||
printf("%s\n", _("License: GPLv3+ <https://www.gnu.org/licenses/gpl-3.0.html>"));
|
||||
printf("%s\n", _("This is free software: you are free to change and redistribute it."));
|
||||
@@ -31,5 +31,3 @@ void display_version(void)
|
||||
/* Project web site link */
|
||||
printf("\n%s: <%s>\n", _("Project web site"), PACKAGE_URL);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Functions for updating the calculated state of the transfer.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Update the current average rate, using a ring buffer of past transfer
|
||||
* positions - if this is the first entry, use the provided instantaneous
|
||||
* rate, otherwise calulate the average rate from the difference between the
|
||||
* current position + elapsed time pair, and the oldest pair in the buffer.
|
||||
*/
|
||||
static void pv__update_average_rate_history(pvtransfercalc_t calc, readonly_pvtransferstate_t transfer,
|
||||
unsigned int history_interval, long double rate)
|
||||
{
|
||||
size_t first = calc->history_first;
|
||||
size_t last = calc->history_last;
|
||||
long double last_elapsed;
|
||||
|
||||
if (NULL == calc->history)
|
||||
return;
|
||||
|
||||
last_elapsed = calc->history[last].elapsed_sec;
|
||||
|
||||
/*
|
||||
* Do nothing if this is not the first call but not enough time has
|
||||
* elapsed since the previous call yet.
|
||||
*/
|
||||
if ((last_elapsed > 0.0)
|
||||
&& (transfer->elapsed_seconds < (last_elapsed + history_interval)))
|
||||
return;
|
||||
|
||||
/*
|
||||
* If this is not the first call, add a new entry to the circular
|
||||
* buffer.
|
||||
*/
|
||||
if (last_elapsed > 0.0) {
|
||||
size_t len = calc->history_len;
|
||||
last = (last + 1) % len;
|
||||
calc->history_last = last;
|
||||
if (last == first) {
|
||||
first = (first + 1) % len;
|
||||
calc->history_first = first;
|
||||
}
|
||||
}
|
||||
|
||||
calc->history[last].elapsed_sec = transfer->elapsed_seconds;
|
||||
calc->history[last].transferred = transfer->transferred;
|
||||
|
||||
if (first == last) {
|
||||
calc->current_avg_rate = rate;
|
||||
} else {
|
||||
off_t bytes = (calc->history[last].transferred - calc->history[first].transferred);
|
||||
long double sec = (calc->history[last].elapsed_sec - calc->history[first].elapsed_sec);
|
||||
/* Safety check to avoid division by zero. */
|
||||
if (sec < 0.000001 && sec > -0.000001)
|
||||
sec = 0.000001;
|
||||
calc->current_avg_rate = (long double) bytes / sec;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Update all calculated transfer state in calc (usually from state->calc).
|
||||
*
|
||||
* If "final" is true, this is the final update, so calc->transfer_rate and
|
||||
* calc->average_rate are given as an average over the whole transfer;
|
||||
* otherwise they are the current transfer rate and current average rate.
|
||||
*
|
||||
* The value of calc->percentage will reflect the percentage completion if
|
||||
* control->size is greater than zero, otherwise it will increase by 2 each
|
||||
* call and wrap at 200.
|
||||
*/
|
||||
void pv_calculate_transfer_rate(pvtransfercalc_t calc, readonly_pvtransferstate_t transfer,
|
||||
readonly_pvcontrol_t control, readonly_pvdisplay_t display, bool final)
|
||||
{
|
||||
off_t bytes_since_last;
|
||||
long double time_since_last, transfer_rate, average_rate;
|
||||
|
||||
/* Quick safety checks for null pointers. */
|
||||
if (NULL == calc)
|
||||
return;
|
||||
if (NULL == transfer)
|
||||
return;
|
||||
if (NULL == control)
|
||||
return;
|
||||
if (NULL == display)
|
||||
return;
|
||||
|
||||
bytes_since_last = 0;
|
||||
if (transfer->transferred >= 0) {
|
||||
bytes_since_last = transfer->transferred - calc->prev_transferred;
|
||||
calc->prev_transferred = transfer->transferred;
|
||||
}
|
||||
|
||||
/*
|
||||
* In case the time since the last update is very small, we keep
|
||||
* track of amount transferred since the last update, and just keep
|
||||
* adding to that until a reasonable amount of time has passed to
|
||||
* avoid rate spikes or division by zero.
|
||||
*/
|
||||
time_since_last = transfer->elapsed_seconds - calc->prev_elapsed_sec;
|
||||
if (time_since_last <= 0.01) {
|
||||
transfer_rate = calc->prev_rate;
|
||||
calc->prev_trans += bytes_since_last;
|
||||
} else {
|
||||
long double measured_rate;
|
||||
|
||||
transfer_rate = ((long double) bytes_since_last + calc->prev_trans) / time_since_last;
|
||||
measured_rate = transfer_rate;
|
||||
|
||||
calc->prev_elapsed_sec = transfer->elapsed_seconds;
|
||||
calc->prev_trans = 0;
|
||||
|
||||
if (control->bits)
|
||||
measured_rate = 8.0 * measured_rate;
|
||||
|
||||
if ((calc->measurements_taken < 1) || (measured_rate < calc->rate_min)) {
|
||||
calc->rate_min = measured_rate;
|
||||
}
|
||||
if (measured_rate > calc->rate_max) {
|
||||
calc->rate_max = measured_rate;
|
||||
}
|
||||
calc->rate_sum += measured_rate;
|
||||
calc->ratesquared_sum += (measured_rate * measured_rate);
|
||||
calc->measurements_taken++;
|
||||
}
|
||||
calc->prev_rate = transfer_rate;
|
||||
|
||||
/* Update history and current average rate for ETA. */
|
||||
pv__update_average_rate_history(calc, transfer, control->history_interval, transfer_rate);
|
||||
average_rate = calc->current_avg_rate;
|
||||
|
||||
/*
|
||||
* If this is the final update at the end of the transfer, we
|
||||
* recalculate the rate - and the average rate - across the whole
|
||||
* period of the transfer.
|
||||
*/
|
||||
if (final) {
|
||||
long double total_elapsed_seconds = (long double) (transfer->elapsed_seconds);
|
||||
/* Safety check to avoid division by zero. */
|
||||
if (total_elapsed_seconds < 0.000001)
|
||||
total_elapsed_seconds = 0.000001;
|
||||
average_rate =
|
||||
(((long double) (transfer->transferred)) -
|
||||
((long double) display->initial_offset)) / total_elapsed_seconds;
|
||||
transfer_rate = average_rate;
|
||||
}
|
||||
|
||||
calc->transfer_rate = transfer_rate;
|
||||
calc->average_rate = average_rate;
|
||||
|
||||
if (control->size <= 0) {
|
||||
/*
|
||||
* If we don't know the total size of the incoming data,
|
||||
* then for a percentage, we gradually increase the
|
||||
* percentage completion as data arrives, to a maximum of
|
||||
* 200, then reset it - we use this if we can't calculate
|
||||
* it, so that the numeric percentage output will go
|
||||
* 0%-100%, 100%-0%, 0%-100%, and so on.
|
||||
*/
|
||||
if (transfer_rate > 0)
|
||||
calc->percentage += 2;
|
||||
if (calc->percentage > 199)
|
||||
calc->percentage = 0;
|
||||
} else {
|
||||
calc->percentage = pv_percentage(transfer->transferred, control->size);
|
||||
}
|
||||
|
||||
/* Ensure the percentage is never negative or huge. */
|
||||
if (calc->percentage < 0.0)
|
||||
calc->percentage = 0.0;
|
||||
if (calc->percentage > 100000.0)
|
||||
calc->percentage = 100000.0;
|
||||
}
|
||||
+154
-169
@@ -10,7 +10,7 @@
|
||||
* terminal, so we try to use a lockfile if terminal locking doesn't work,
|
||||
* and finally abort if even that is unavailable.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -43,54 +43,28 @@
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Write the given buffer to the given file descriptor, retrying until all
|
||||
* bytes have been written or an error has occurred.
|
||||
*/
|
||||
void pv_write_retry(int fd, const char *buf, size_t count)
|
||||
{
|
||||
while (count > 0) {
|
||||
ssize_t nwritten;
|
||||
|
||||
nwritten = write(fd, buf, count);
|
||||
|
||||
if (nwritten < 0) {
|
||||
if ((EINTR == errno) || (EAGAIN == errno)) {
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (nwritten < 1)
|
||||
return;
|
||||
|
||||
count -= nwritten;
|
||||
buf += nwritten;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create a per-euid, per-tty, lockfile in ${TMPDIR:-${TMP:-/tmp}} for the
|
||||
* tty on the given file descriptor.
|
||||
*/
|
||||
static void pv_crs_open_lockfile(pvstate_t state, int fd)
|
||||
static void pv_crs_open_lockfile(pvcursorstate_t cursor, readonly_pvcontrol_t control, int fd)
|
||||
{
|
||||
char *ttydev;
|
||||
char *tmpdir;
|
||||
int openflags;
|
||||
|
||||
state->cursor.lock_fd = -1;
|
||||
cursor->lock_fd = -1;
|
||||
|
||||
ttydev = ttyname(fd);
|
||||
if (!ttydev) {
|
||||
if (!state->control.force) {
|
||||
pv_error(state, "%s: %s", _("failed to get terminal name"), strerror(errno));
|
||||
if (!control->force) {
|
||||
pv_error("%s: %s", _("failed to get terminal name"), strerror(errno));
|
||||
}
|
||||
/*
|
||||
* If we don't know our terminal name, we can neither do IPC
|
||||
* nor make a lock file, so turn off cursor positioning.
|
||||
*/
|
||||
state->control.cursor = 0;
|
||||
cursor->disable = true;
|
||||
debug("%s", "ttyname failed - cursor positioning disabled");
|
||||
return;
|
||||
}
|
||||
@@ -106,8 +80,8 @@ static void pv_crs_open_lockfile(pvstate_t state, int fd)
|
||||
* $TMP are rejected, and the destination buffer is bounded.
|
||||
*/
|
||||
|
||||
memset(state->cursor.lock_file, 0, PV_SIZEOF_CRS_LOCK_FILE);
|
||||
(void) pv_snprintf(state->cursor.lock_file,
|
||||
memset(cursor->lock_file, 0, PV_SIZEOF_CRS_LOCK_FILE);
|
||||
(void) pv_snprintf(cursor->lock_file,
|
||||
PV_SIZEOF_CRS_LOCK_FILE, "%s/pv-%s-%i.lock", tmpdir, basename(ttydev), (int) geteuid());
|
||||
|
||||
/*
|
||||
@@ -119,7 +93,7 @@ static void pv_crs_open_lockfile(pvstate_t state, int fd)
|
||||
openflags = O_RDWR | O_CREAT;
|
||||
#endif
|
||||
|
||||
state->cursor.lock_fd = open(state->cursor.lock_file, openflags, 0600); /* flawfinder: ignore */
|
||||
cursor->lock_fd = open(cursor->lock_file, openflags, 0600); /* flawfinder: ignore */
|
||||
|
||||
/*
|
||||
* flawfinder rationale: we aren't truncating the lock file, we
|
||||
@@ -128,9 +102,9 @@ static void pv_crs_open_lockfile(pvstate_t state, int fd)
|
||||
* open() is as safe as we can make it.
|
||||
*/
|
||||
|
||||
if (state->cursor.lock_fd < 0) {
|
||||
pv_error(state, "%s: %s: %s", state->cursor.lock_file, _("failed to open lock file"), strerror(errno));
|
||||
state->control.cursor = 0;
|
||||
if (cursor->lock_fd < 0) {
|
||||
pv_error("%s: %s: %s", cursor->lock_file, _("failed to open lock file"), strerror(errno));
|
||||
cursor->disable = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -140,14 +114,14 @@ static void pv_crs_open_lockfile(pvstate_t state, int fd)
|
||||
* Lock the terminal on the given file descriptor, falling back to using a
|
||||
* lockfile if the terminal itself cannot be locked.
|
||||
*/
|
||||
static void pv_crs_lock(pvstate_t state, int fd)
|
||||
static void pv_crs_lock(pvcursorstate_t cursor, readonly_pvcontrol_t control, int fd)
|
||||
{
|
||||
struct flock lock;
|
||||
int lock_fd;
|
||||
|
||||
lock_fd = fd;
|
||||
if (state->cursor.lock_fd >= 0)
|
||||
lock_fd = state->cursor.lock_fd;
|
||||
if (cursor->lock_fd >= 0)
|
||||
lock_fd = cursor->lock_fd;
|
||||
|
||||
memset(&lock, 0, sizeof(lock));
|
||||
lock.l_type = (short) F_WRLCK;
|
||||
@@ -156,20 +130,20 @@ static void pv_crs_lock(pvstate_t state, int fd)
|
||||
lock.l_len = 1;
|
||||
while (fcntl(lock_fd, F_SETLKW, &lock) < 0) {
|
||||
if (errno != EINTR) {
|
||||
if (state->cursor.lock_fd == -2) {
|
||||
pv_crs_open_lockfile(state, fd);
|
||||
if (state->cursor.lock_fd >= 0) {
|
||||
lock_fd = state->cursor.lock_fd;
|
||||
if (cursor->lock_fd == -2) {
|
||||
pv_crs_open_lockfile(cursor, control, fd);
|
||||
if (cursor->lock_fd >= 0) {
|
||||
lock_fd = cursor->lock_fd;
|
||||
}
|
||||
} else {
|
||||
pv_error(state, "%s: %s", _("lock attempt failed"), strerror(errno));
|
||||
pv_error("%s: %s", _("lock attempt failed"), strerror(errno));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (state->cursor.lock_fd >= 0) {
|
||||
debug("%s: %s", state->cursor.lock_file, "terminal lockfile acquired");
|
||||
if (cursor->lock_fd >= 0) {
|
||||
debug("%s: %s", cursor->lock_file, "terminal lockfile acquired");
|
||||
} else {
|
||||
debug("%s", "terminal lock acquired");
|
||||
}
|
||||
@@ -180,14 +154,14 @@ static void pv_crs_lock(pvstate_t state, int fd)
|
||||
* Unlock the terminal on the given file descriptor. If pv_crs_lock used
|
||||
* lockfile locking, unlock the lockfile.
|
||||
*/
|
||||
static void pv_crs_unlock(pvstate_t state, int fd)
|
||||
static void pv_crs_unlock(pvcursorstate_t cursor, int fd)
|
||||
{
|
||||
struct flock lock;
|
||||
int lock_fd;
|
||||
|
||||
lock_fd = fd;
|
||||
if (state->cursor.lock_fd >= 0)
|
||||
lock_fd = state->cursor.lock_fd;
|
||||
if (cursor->lock_fd >= 0)
|
||||
lock_fd = cursor->lock_fd;
|
||||
|
||||
memset(&lock, 0, sizeof(lock));
|
||||
lock.l_type = (short) F_UNLCK;
|
||||
@@ -196,8 +170,8 @@ static void pv_crs_unlock(pvstate_t state, int fd)
|
||||
lock.l_len = 1;
|
||||
(void) fcntl(lock_fd, F_SETLK, &lock);
|
||||
|
||||
if (state->cursor.lock_fd >= 0) {
|
||||
debug("%s: %s", state->cursor.lock_file, "terminal lockfile released");
|
||||
if (cursor->lock_fd >= 0) {
|
||||
debug("%s: %s", cursor->lock_file, "terminal lockfile released");
|
||||
} else {
|
||||
debug("%s", "terminal lock released");
|
||||
}
|
||||
@@ -211,20 +185,20 @@ static void pv_crs_unlock(pvstate_t state, int fd)
|
||||
* cursor mode (including us), and store it in pv_crs_pvcount. If this is
|
||||
* larger than pv_crs_pvmax, update pv_crs_pvmax.
|
||||
*/
|
||||
static void pv_crs_ipccount(pvstate_t state)
|
||||
static void pv_crs_ipccount(pvcursorstate_t cursor)
|
||||
{
|
||||
struct shmid_ds buf;
|
||||
|
||||
memset(&buf, 0, sizeof(buf));
|
||||
buf.shm_nattch = 0;
|
||||
|
||||
(void) shmctl(state->cursor.shmid, IPC_STAT, &buf);
|
||||
state->cursor.pvcount = (int) (buf.shm_nattch);
|
||||
(void) shmctl(cursor->shmid, IPC_STAT, &buf);
|
||||
cursor->pvcount = (int) (buf.shm_nattch);
|
||||
|
||||
if (state->cursor.pvcount > state->cursor.pvmax)
|
||||
state->cursor.pvmax = state->cursor.pvcount;
|
||||
if (cursor->pvcount > cursor->pvmax)
|
||||
cursor->pvmax = cursor->pvcount;
|
||||
|
||||
debug("%s: %d", "pvcount", state->cursor.pvcount);
|
||||
debug("%s: %d", "pvcount", cursor->pvcount);
|
||||
}
|
||||
#endif /* HAVE_IPC */
|
||||
|
||||
@@ -320,7 +294,7 @@ static int pv_crs_get_ypos(int terminalfd)
|
||||
* count" of one, and so no initialisation occurs. So, we lock the terminal
|
||||
* with pv_crs_lock() while we are attaching and checking.
|
||||
*/
|
||||
static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd)
|
||||
static int pv_crs_ipcinit(pvcursorstate_t cursor, readonly_pvcontrol_t control, char *ttyfile, int terminalfd)
|
||||
{
|
||||
key_t key;
|
||||
|
||||
@@ -335,25 +309,25 @@ static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd)
|
||||
return 1;
|
||||
}
|
||||
|
||||
pv_crs_lock(state, terminalfd);
|
||||
if (!state->control.cursor) {
|
||||
pv_crs_lock(cursor, control, terminalfd);
|
||||
if ((!control->cursor) || (cursor->disable)) {
|
||||
debug("%s", "early return - cursor has been disabled");
|
||||
return 1;
|
||||
}
|
||||
|
||||
state->cursor.shmid = shmget(key, sizeof(struct pvcursorstate_s), 0600 | IPC_CREAT);
|
||||
if (state->cursor.shmid < 0) {
|
||||
cursor->shmid = shmget(key, sizeof(struct pvipccursorstate_s), 0600 | IPC_CREAT);
|
||||
if (cursor->shmid < 0) {
|
||||
debug("%s: %s", "shmget failed", strerror(errno));
|
||||
pv_crs_unlock(state, terminalfd);
|
||||
pv_crs_unlock(cursor, terminalfd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*@-nullpass@ */
|
||||
/* splint doesn't know shmaddr can be NULL */
|
||||
state->cursor.shared = shmat(state->cursor.shmid, NULL, 0);
|
||||
cursor->shared = shmat(cursor->shmid, NULL, 0);
|
||||
/*@+nullpass@ */
|
||||
|
||||
pv_crs_ipccount(state);
|
||||
pv_crs_ipccount(cursor);
|
||||
|
||||
/*
|
||||
* If nobody else is attached to the shared memory segment, we're
|
||||
@@ -361,29 +335,29 @@ static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd)
|
||||
* current Y cursor co-ordinate and with an initial false value for
|
||||
* the TOSTOP-added flag.
|
||||
*/
|
||||
if (state->cursor.pvcount < 2) {
|
||||
state->cursor.y_start = pv_crs_get_ypos(terminalfd);
|
||||
state->cursor.shared->y_topmost = state->cursor.y_start;
|
||||
state->cursor.shared->tty_tostop_added = false;
|
||||
state->cursor.y_lastread = state->cursor.y_start;
|
||||
if (cursor->pvcount < 2) {
|
||||
cursor->y_start = pv_crs_get_ypos(terminalfd);
|
||||
cursor->shared->y_topmost = cursor->y_start;
|
||||
cursor->shared->tty_tostop_added = false;
|
||||
cursor->y_lastread = cursor->y_start;
|
||||
debug("%s", "we are the first to attach");
|
||||
}
|
||||
|
||||
state->cursor.y_offset = state->cursor.pvcount - 1;
|
||||
if (state->cursor.y_offset < 0)
|
||||
state->cursor.y_offset = 0;
|
||||
cursor->y_offset = cursor->pvcount - 1;
|
||||
if (cursor->y_offset < 0)
|
||||
cursor->y_offset = 0;
|
||||
|
||||
/*
|
||||
* If anyone else had attached to the shared memory segment, we need
|
||||
* to read the top Y co-ordinate from it.
|
||||
*/
|
||||
if (state->cursor.pvcount > 1) {
|
||||
state->cursor.y_start = state->cursor.shared->y_topmost;
|
||||
state->cursor.y_lastread = state->cursor.y_start;
|
||||
debug("%s: %d", "not the first to attach - got top y", state->cursor.y_start);
|
||||
if (cursor->pvcount > 1) {
|
||||
cursor->y_start = cursor->shared->y_topmost;
|
||||
cursor->y_lastread = cursor->y_start;
|
||||
debug("%s: %d", "not the first to attach - got top y", cursor->y_start);
|
||||
}
|
||||
|
||||
pv_crs_unlock(state, terminalfd);
|
||||
pv_crs_unlock(cursor, terminalfd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -393,15 +367,15 @@ static int pv_crs_ipcinit(pvstate_t state, char *ttyfile, int terminalfd)
|
||||
/*
|
||||
* Initialise the terminal for cursor positioning.
|
||||
*/
|
||||
void pv_crs_init(pvstate_t state)
|
||||
void pv_crs_init(pvcursorstate_t cursor, readonly_pvcontrol_t control, pvtransientflags_t flags)
|
||||
{
|
||||
char *ttyfile;
|
||||
int terminalfd;
|
||||
|
||||
state->cursor.lock_fd = -2;
|
||||
state->cursor.lock_file[0] = '\0';
|
||||
cursor->lock_fd = -2;
|
||||
cursor->lock_file[0] = '\0';
|
||||
|
||||
if (!state->control.cursor)
|
||||
if ((!control->cursor) || (cursor->disable))
|
||||
return;
|
||||
|
||||
debug("%s", "init");
|
||||
@@ -409,7 +383,7 @@ void pv_crs_init(pvstate_t state)
|
||||
ttyfile = ttyname(STDERR_FILENO);
|
||||
if (NULL == ttyfile) {
|
||||
debug("%s: %s", "disabling cursor positioning because ttyname failed", strerror(errno));
|
||||
state->control.cursor = false;
|
||||
cursor->disable = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -423,23 +397,23 @@ void pv_crs_init(pvstate_t state)
|
||||
*/
|
||||
|
||||
if (terminalfd < 0) {
|
||||
pv_error(state, "%s: %s: %s", _("failed to open terminal"), ttyfile, strerror(errno));
|
||||
state->control.cursor = false;
|
||||
pv_error("%s: %s: %s", _("failed to open terminal"), ttyfile, strerror(errno));
|
||||
cursor->disable = true;
|
||||
return;
|
||||
}
|
||||
#ifdef HAVE_IPC
|
||||
if (pv_crs_ipcinit(state, ttyfile, terminalfd) != 0) {
|
||||
if (pv_crs_ipcinit(cursor, control, ttyfile, terminalfd) != 0) {
|
||||
debug("%s", "ipcinit failed, setting noipc flag");
|
||||
state->cursor.noipc = true;
|
||||
cursor->noipc = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we have already set the terminal TOSTOP attribute, set the
|
||||
* flag in shared memory to let the other instances know.
|
||||
*/
|
||||
if ((!state->cursor.noipc) && state->signal.pv_tty_tostop_added && (NULL != state->cursor.shared)) {
|
||||
debug("%s", "propagating local pv_tty_tostop_added true value to shared flag");
|
||||
state->cursor.shared->tty_tostop_added = true;
|
||||
if ((!cursor->noipc) && (1 == flags->clear_tty_tostop_on_exit) && (NULL != cursor->shared)) {
|
||||
debug("%s", "propagating local clear_tty_tostop_on_exit true value to shared tty_tostop_added flag");
|
||||
cursor->shared->tty_tostop_added = true;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -447,26 +421,26 @@ void pv_crs_init(pvstate_t state)
|
||||
* co-ordinate. If we are using IPC, then the pv_crs_ipcinit()
|
||||
* function takes care of this in a more multi-process-friendly way.
|
||||
*/
|
||||
if (state->cursor.noipc) {
|
||||
if (cursor->noipc) {
|
||||
#else /* ! HAVE_IPC */
|
||||
if (1) {
|
||||
#endif /* HAVE_IPC */
|
||||
/*
|
||||
* Get current cursor position + 1.
|
||||
*/
|
||||
pv_crs_lock(state, terminalfd);
|
||||
state->cursor.y_start = pv_crs_get_ypos(terminalfd);
|
||||
pv_crs_lock(cursor, control, terminalfd);
|
||||
cursor->y_start = pv_crs_get_ypos(terminalfd);
|
||||
/*
|
||||
* Move down a line while the terminal is locked, so that
|
||||
* other processes in the pipeline will get a different
|
||||
* initial ypos.
|
||||
*/
|
||||
if (state->cursor.y_start > 0)
|
||||
pv_write_retry(STDERR_FILENO, "\n", 1);
|
||||
pv_crs_unlock(state, terminalfd);
|
||||
if (cursor->y_start > 0)
|
||||
pv_tty_write(flags, "\n", 1);
|
||||
pv_crs_unlock(cursor, terminalfd);
|
||||
|
||||
if (state->cursor.y_start < 1)
|
||||
state->control.cursor = 0;
|
||||
if (cursor->y_start < 1)
|
||||
cursor->disable = true;
|
||||
}
|
||||
|
||||
(void) close(terminalfd);
|
||||
@@ -477,11 +451,11 @@ void pv_crs_init(pvstate_t state)
|
||||
/*
|
||||
* Set the "we need to reinitialise cursor positioning" flag.
|
||||
*/
|
||||
void pv_crs_needreinit(pvstate_t state)
|
||||
void pv_crs_needreinit(pvcursorstate_t cursor)
|
||||
{
|
||||
state->cursor.needreinit += 2;
|
||||
if (state->cursor.needreinit > 3)
|
||||
state->cursor.needreinit = 3;
|
||||
cursor->needreinit += 2;
|
||||
if (cursor->needreinit > 3)
|
||||
cursor->needreinit = 3;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -491,31 +465,36 @@ void pv_crs_needreinit(pvstate_t state)
|
||||
* Reinitialise the cursor positioning code (called if we are backgrounded
|
||||
* then foregrounded again).
|
||||
*/
|
||||
static void pv_crs_reinit(pvstate_t state)
|
||||
static void pv_crs_reinit(pvcursorstate_t cursor, readonly_pvcontrol_t control, pvtransientflags_t flags)
|
||||
{
|
||||
debug("%s", "reinit");
|
||||
|
||||
pv_crs_lock(state, STDERR_FILENO);
|
||||
if (1 == flags->suspend_stderr) {
|
||||
debug("%s", "reinit abandoned - stderr is suspended");
|
||||
return;
|
||||
}
|
||||
|
||||
state->cursor.needreinit--;
|
||||
if (state->cursor.y_offset < 1)
|
||||
state->cursor.needreinit = 0;
|
||||
pv_crs_lock(cursor, control, STDERR_FILENO);
|
||||
|
||||
if (state->cursor.needreinit > 0) {
|
||||
pv_crs_unlock(state, STDERR_FILENO);
|
||||
cursor->needreinit--;
|
||||
if (cursor->y_offset < 1)
|
||||
cursor->needreinit = 0;
|
||||
|
||||
if (cursor->needreinit > 0) {
|
||||
pv_crs_unlock(cursor, STDERR_FILENO);
|
||||
return;
|
||||
}
|
||||
|
||||
debug("%s", "reinit full");
|
||||
|
||||
state->cursor.y_start = pv_crs_get_ypos(STDERR_FILENO);
|
||||
cursor->y_start = pv_crs_get_ypos(STDERR_FILENO);
|
||||
|
||||
if ((state->cursor.y_offset < 1) && (NULL != state->cursor.shared)) {
|
||||
state->cursor.shared->y_topmost = state->cursor.y_start;
|
||||
if ((cursor->y_offset < 1) && (NULL != cursor->shared)) {
|
||||
cursor->shared->y_topmost = cursor->y_start;
|
||||
}
|
||||
state->cursor.y_lastread = state->cursor.y_start;
|
||||
cursor->y_lastread = cursor->y_start;
|
||||
|
||||
pv_crs_unlock(state, STDERR_FILENO);
|
||||
pv_crs_unlock(cursor, STDERR_FILENO);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -524,12 +503,17 @@ static void pv_crs_reinit(pvstate_t state)
|
||||
* Output a single-line update (\0-terminated), using the ECMA-48 CSI "CUP"
|
||||
* sequence to move the cursor to the correct position to do so.
|
||||
*/
|
||||
void pv_crs_update(pvstate_t state, const char *output_line)
|
||||
void pv_crs_update(pvcursorstate_t cursor, readonly_pvcontrol_t control, pvtransientflags_t flags,
|
||||
const char *output_line)
|
||||
{
|
||||
char cup_cmd[32]; /* flawfinder: ignore */
|
||||
size_t cup_cmd_length, output_line_length;
|
||||
int y;
|
||||
|
||||
/* Early return if cursor positioning was disabled. */
|
||||
if (cursor->disable)
|
||||
return;
|
||||
|
||||
/*
|
||||
* flawfinder rationale: the "cup_cmd" buffer is always zeroed
|
||||
* before each use, and is only written to by pv_snprintf() bounded
|
||||
@@ -541,24 +525,24 @@ void pv_crs_update(pvstate_t state, const char *output_line)
|
||||
/* flawfinder - output_line is explictly expected to be \0-terminated. */
|
||||
|
||||
#ifdef HAVE_IPC
|
||||
if (!state->cursor.noipc) {
|
||||
if (state->cursor.needreinit > 0)
|
||||
pv_crs_reinit(state);
|
||||
if (!cursor->noipc) {
|
||||
if (cursor->needreinit > 0)
|
||||
pv_crs_reinit(cursor, control, flags);
|
||||
|
||||
pv_crs_ipccount(state);
|
||||
if (NULL != state->cursor.shared) {
|
||||
if (state->cursor.y_lastread != state->cursor.shared->y_topmost) {
|
||||
state->cursor.y_start = state->cursor.shared->y_topmost;
|
||||
state->cursor.y_lastread = state->cursor.y_start;
|
||||
pv_crs_ipccount(cursor);
|
||||
if (NULL != cursor->shared) {
|
||||
if (cursor->y_lastread != cursor->shared->y_topmost) {
|
||||
cursor->y_start = cursor->shared->y_topmost;
|
||||
cursor->y_lastread = cursor->y_start;
|
||||
}
|
||||
}
|
||||
|
||||
if (state->cursor.needreinit > 0)
|
||||
if (cursor->needreinit > 0)
|
||||
return;
|
||||
}
|
||||
#endif /* HAVE_IPC */
|
||||
|
||||
y = state->cursor.y_start;
|
||||
y = cursor->y_start;
|
||||
|
||||
#ifdef HAVE_IPC
|
||||
/*
|
||||
@@ -567,41 +551,41 @@ void pv_crs_update(pvstate_t state, const char *output_line)
|
||||
* scroll the screen (only if we're the first `pv'), and then move
|
||||
* our initial Y co-ordinate up.
|
||||
*/
|
||||
if (((state->cursor.y_start + state->cursor.pvmax) > (int) (state->control.height))
|
||||
&& (!state->cursor.noipc)
|
||||
if (((cursor->y_start + cursor->pvmax) > (int) (control->height))
|
||||
&& (!cursor->noipc)
|
||||
) {
|
||||
int offs;
|
||||
|
||||
offs = ((state->cursor.y_start + state->cursor.pvmax) - state->control.height);
|
||||
offs = ((cursor->y_start + cursor->pvmax) - control->height);
|
||||
|
||||
state->cursor.y_start -= offs;
|
||||
if (state->cursor.y_start < 1)
|
||||
state->cursor.y_start = 1;
|
||||
cursor->y_start -= offs;
|
||||
if (cursor->y_start < 1)
|
||||
cursor->y_start = 1;
|
||||
|
||||
debug("%s: %d", "scroll offset", offs);
|
||||
|
||||
/*
|
||||
* Scroll the screen if we're the first `pv'.
|
||||
*/
|
||||
if (0 == state->cursor.y_offset) {
|
||||
pv_crs_lock(state, STDERR_FILENO);
|
||||
if (0 == cursor->y_offset) {
|
||||
pv_crs_lock(cursor, control, STDERR_FILENO);
|
||||
|
||||
memset(cup_cmd, 0, sizeof(cup_cmd));
|
||||
(void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H", state->control.height);
|
||||
(void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H", control->height);
|
||||
cup_cmd_length = strlen(cup_cmd); /* flawfinder: ignore */
|
||||
pv_write_retry(STDERR_FILENO, cup_cmd, cup_cmd_length);
|
||||
pv_tty_write(flags, cup_cmd, cup_cmd_length);
|
||||
for (; offs > 0; offs--) {
|
||||
pv_write_retry(STDERR_FILENO, "\n", 1);
|
||||
pv_tty_write(flags, "\n", 1);
|
||||
}
|
||||
|
||||
pv_crs_unlock(state, STDERR_FILENO);
|
||||
pv_crs_unlock(cursor, STDERR_FILENO);
|
||||
|
||||
debug("%s", "we are the first - scrolled screen");
|
||||
}
|
||||
}
|
||||
|
||||
if (!state->cursor.noipc)
|
||||
y = state->cursor.y_start + state->cursor.y_offset;
|
||||
if (!cursor->noipc)
|
||||
y = cursor->y_start + cursor->y_offset;
|
||||
#endif /* HAVE_IPC */
|
||||
|
||||
/*
|
||||
@@ -622,19 +606,19 @@ void pv_crs_update(pvstate_t state, const char *output_line)
|
||||
* pv_snprintf() fails to run the string will be of zero length.
|
||||
*/
|
||||
|
||||
pv_crs_lock(state, STDERR_FILENO);
|
||||
pv_crs_lock(cursor, control, STDERR_FILENO);
|
||||
|
||||
pv_write_retry(STDERR_FILENO, cup_cmd, cup_cmd_length);
|
||||
pv_write_retry(STDERR_FILENO, output_line, output_line_length);
|
||||
pv_tty_write(flags, cup_cmd, cup_cmd_length);
|
||||
pv_tty_write(flags, output_line, output_line_length);
|
||||
|
||||
pv_crs_unlock(state, STDERR_FILENO);
|
||||
pv_crs_unlock(cursor, STDERR_FILENO);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Reposition the cursor to a final position.
|
||||
*/
|
||||
void pv_crs_fini(pvstate_t state)
|
||||
void pv_crs_fini(pvcursorstate_t cursor, readonly_pvcontrol_t control, pvtransientflags_t flags)
|
||||
{
|
||||
char cup_cmd[32]; /* flawfinder: ignore */
|
||||
unsigned int y;
|
||||
@@ -643,15 +627,15 @@ void pv_crs_fini(pvstate_t state)
|
||||
|
||||
debug("%s", "fini");
|
||||
|
||||
y = (unsigned int) (state->cursor.y_start);
|
||||
y = (unsigned int) (cursor->y_start);
|
||||
|
||||
#ifdef HAVE_IPC
|
||||
if ((state->cursor.pvmax > 0) && (!state->cursor.noipc))
|
||||
y += state->cursor.pvmax - 1;
|
||||
if ((cursor->pvmax > 0) && (!cursor->noipc))
|
||||
y += cursor->pvmax - 1;
|
||||
#endif /* HAVE_IPC */
|
||||
|
||||
if (y > state->control.height)
|
||||
y = state->control.height;
|
||||
if (y > control->height)
|
||||
y = control->height;
|
||||
|
||||
/*
|
||||
* Absolute bounds check.
|
||||
@@ -662,9 +646,11 @@ void pv_crs_fini(pvstate_t state)
|
||||
memset(cup_cmd, 0, sizeof(cup_cmd));
|
||||
(void) pv_snprintf(cup_cmd, sizeof(cup_cmd), "\033[%u;1H\n", y);
|
||||
|
||||
pv_crs_lock(state, STDERR_FILENO);
|
||||
pv_crs_lock(cursor, control, STDERR_FILENO);
|
||||
|
||||
pv_write_retry(STDERR_FILENO, cup_cmd, strlen(cup_cmd)); /* flawfinder: ignore */
|
||||
if (!cursor->disable) {
|
||||
pv_tty_write(flags, cup_cmd, strlen(cup_cmd)); /* flawfinder: ignore */
|
||||
}
|
||||
/* flawfinder - pv_snprintf() always \0-terminates (see above). */
|
||||
|
||||
#ifdef HAVE_IPC
|
||||
@@ -673,41 +659,40 @@ void pv_crs_fini(pvstate_t state)
|
||||
* attribute, set our local flag so pv_sig_fini() will know about
|
||||
* it.
|
||||
*/
|
||||
if ((!state->cursor.noipc) && (NULL != state->cursor.shared) && state->cursor.shared->tty_tostop_added) {
|
||||
if (!state->signal.pv_tty_tostop_added) {
|
||||
debug("%s", "propagating shared tty_tostop_added true value to local flag");
|
||||
state->signal.pv_tty_tostop_added = true;
|
||||
if ((!cursor->noipc) && (NULL != cursor->shared) && cursor->shared->tty_tostop_added) {
|
||||
if (0 == flags->clear_tty_tostop_on_exit) {
|
||||
debug("%s",
|
||||
"propagating shared tty_tostop_added true value to local clear_tty_tostop_on_exit flag");
|
||||
flags->clear_tty_tostop_on_exit = 1;
|
||||
}
|
||||
}
|
||||
|
||||
pv_crs_ipccount(state);
|
||||
if (NULL != state->cursor.shared) {
|
||||
(void) shmdt(state->cursor.shared);
|
||||
pv_crs_ipccount(cursor);
|
||||
if (NULL != cursor->shared) {
|
||||
(void) shmdt(cursor->shared);
|
||||
}
|
||||
state->cursor.shared = NULL;
|
||||
cursor->shared = NULL;
|
||||
|
||||
/*
|
||||
* If we are the last instance detaching from the shared memory,
|
||||
* delete it so it's not left lying around.
|
||||
*/
|
||||
if (state->cursor.pvcount < 2) {
|
||||
if (cursor->pvcount < 2) {
|
||||
struct shmid_ds shm_buf;
|
||||
memset(&shm_buf, 0, sizeof(shm_buf));
|
||||
(void) shmctl(state->cursor.shmid, IPC_RMID, &shm_buf);
|
||||
(void) shmctl(cursor->shmid, IPC_RMID, &shm_buf);
|
||||
}
|
||||
|
||||
#endif /* HAVE_IPC */
|
||||
|
||||
pv_crs_unlock(state, STDERR_FILENO);
|
||||
pv_crs_unlock(cursor, STDERR_FILENO);
|
||||
|
||||
if (state->cursor.lock_fd >= 0) {
|
||||
(void) close(state->cursor.lock_fd);
|
||||
if (cursor->lock_fd >= 0) {
|
||||
(void) close(cursor->lock_fd);
|
||||
/*
|
||||
* We can get away with removing this on exit because all
|
||||
* the other PVs will be finishing at the same sort of time.
|
||||
*/
|
||||
(void) remove(state->cursor.lock_file);
|
||||
(void) remove(cursor->lock_file);
|
||||
}
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+815
-810
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions relating to elapsed time.
|
||||
*
|
||||
* Copyright 2023-2024 Andrew Wood
|
||||
* Copyright 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -21,7 +21,7 @@
|
||||
* suspended. See clock_gettime(2) with CLOCK_MONOTONIC.
|
||||
*
|
||||
* The read should not fail; if it does, the program is aborted with exit
|
||||
* status 16.
|
||||
* status 16 (transfer error).
|
||||
*/
|
||||
void pv_elapsedtime_read(struct timespec *return_time)
|
||||
{
|
||||
@@ -29,7 +29,7 @@ void pv_elapsedtime_read(struct timespec *return_time)
|
||||
if (0 != clock_gettime(CLOCK_MONOTONIC, return_time)) {
|
||||
fprintf(stderr, "%s: %s: %s\n", PACKAGE_NAME, "clock_gettime", strerror(errno));
|
||||
/*@-exitarg@ *//* we explicitly want a special exit status */
|
||||
exit(16);
|
||||
exit(PV_ERROREXIT_TRANSFER);
|
||||
/*@+exitarg@ */
|
||||
}
|
||||
/*@+unrecog@ */
|
||||
@@ -136,9 +136,6 @@ void pv_elapsedtime_add(struct timespec *return_time, const struct timespec *fir
|
||||
* large enough and are relying on the compiler to do the casting
|
||||
* correctly, since the manual for timespec(3) states the types are
|
||||
* implementation-defined.
|
||||
*
|
||||
* TODO: review this to make sure that this isn't just an elaborate
|
||||
* excuse for "it's hard to fix and I don't know how".
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -251,5 +248,3 @@ void pv_nanosleep(long long nanoseconds)
|
||||
/*@+null@ *//* splint doesn't know about select() */
|
||||
#endif
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+57
-41
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions for opening and closing files, and calculating their size.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -54,6 +54,10 @@ static off_t pv_calc_total_bytes(pvstate_t state)
|
||||
for (file_idx = 0; file_idx < state->files.file_count; file_idx++) {
|
||||
int rc;
|
||||
|
||||
/* Skip any NULL entries, though they should be impossible. */
|
||||
if (NULL == state->files.filename[file_idx])
|
||||
continue;
|
||||
|
||||
if (0 == strcmp(state->files.filename[file_idx], "-")) {
|
||||
rc = fstat(STDIN_FILENO, &sb);
|
||||
if (rc != 0) {
|
||||
@@ -127,26 +131,27 @@ static off_t pv_calc_total_bytes(pvstate_t state)
|
||||
* input, but we are writing to a block device, then use the size of
|
||||
* the output block device.
|
||||
*
|
||||
* Further modified to check that stdout is not in append-only mode
|
||||
* Further modified to check that output is not in append-only mode
|
||||
* and that we can seek back to the start after getting the size.
|
||||
*/
|
||||
if (total < 1) {
|
||||
int rc;
|
||||
|
||||
rc = fstat(STDOUT_FILENO, &sb);
|
||||
rc = fstat(state->control.output_fd, &sb);
|
||||
|
||||
if ((0 == rc) && S_ISBLK(sb.st_mode)
|
||||
&& (0 == (fcntl(STDOUT_FILENO, F_GETFL) & O_APPEND))) {
|
||||
&& (0 == (fcntl(state->control.output_fd, F_GETFL) & O_APPEND))) {
|
||||
off_t end_position;
|
||||
end_position = lseek(STDOUT_FILENO, 0, SEEK_END);
|
||||
end_position = lseek(state->control.output_fd, 0, SEEK_END);
|
||||
total = 0;
|
||||
if (end_position > 0) {
|
||||
total = end_position;
|
||||
}
|
||||
if (lseek(STDOUT_FILENO, 0, SEEK_SET) != 0) {
|
||||
pv_error(state, "%s: %s: %s", "(stdout)",
|
||||
if (lseek(state->control.output_fd, 0, SEEK_SET) != 0) {
|
||||
pv_error("%s: %s: %s",
|
||||
NULL == state->control.output_name ? "(null)" : state->control.output_name,
|
||||
_("failed to seek to start of output"), strerror(errno));
|
||||
state->status.exit_status |= 2;
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
}
|
||||
/*
|
||||
* If we worked out a size, then set the
|
||||
@@ -186,6 +191,10 @@ static off_t pv_calc_total_lines(pvstate_t state)
|
||||
int fd = -1;
|
||||
int rc = 0;
|
||||
|
||||
/* Skip any NULL entries, though they should be impossible. */
|
||||
if (NULL == state->files.filename[file_idx])
|
||||
continue;
|
||||
|
||||
if (0 == strcmp(state->files.filename[file_idx], "-")) {
|
||||
rc = fstat(STDIN_FILENO, &sb);
|
||||
if ((rc != 0) || (!S_ISREG(sb.st_mode))) {
|
||||
@@ -227,8 +236,8 @@ static off_t pv_calc_total_lines(pvstate_t state)
|
||||
* OK.
|
||||
*/
|
||||
if (numread < 0) {
|
||||
pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno));
|
||||
state->status.exit_status |= 2;
|
||||
pv_error("%s: %s", state->files.filename[file_idx], strerror(errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
break;
|
||||
} else if (0 == numread) {
|
||||
break;
|
||||
@@ -245,8 +254,8 @@ static off_t pv_calc_total_lines(pvstate_t state)
|
||||
}
|
||||
|
||||
if (0 != lseek(fd, 0, SEEK_SET)) {
|
||||
pv_error(state, "%s: %s", state->files.filename[file_idx], strerror(errno));
|
||||
state->status.exit_status |= 2;
|
||||
pv_error("%s: %s", state->files.filename[file_idx], strerror(errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
}
|
||||
|
||||
(void) close(fd);
|
||||
@@ -277,7 +286,7 @@ off_t pv_calc_total_size(pvstate_t state)
|
||||
* Close the given file descriptor and open the next one, whose number in
|
||||
* the list is "filenum", returning the new file descriptor (or negative on
|
||||
* error). It is an error if the next input file is the same as the file
|
||||
* stdout is pointing to.
|
||||
* the output is pointing to.
|
||||
*
|
||||
* Updates state->status.current_input_file in the process.
|
||||
*/
|
||||
@@ -286,74 +295,83 @@ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd)
|
||||
struct stat isb;
|
||||
struct stat osb;
|
||||
int fd;
|
||||
bool input_file_is_stdout;
|
||||
bool input_file_is_output;
|
||||
char *next_filename;
|
||||
|
||||
if (oldfd >= 0) {
|
||||
if (0 != close(oldfd)) {
|
||||
pv_error(state, "%s: %s", _("failed to close file"), strerror(errno));
|
||||
state->status.exit_status |= 8;
|
||||
pv_error("%s: %s", _("failed to close file"), strerror(errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSITION;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (filenum >= state->files.file_count) {
|
||||
debug("%s: %d >= %d", "filenum too large", filenum, state->files.file_count);
|
||||
state->status.exit_status |= 8;
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSITION;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((NULL == state->files.filename) || (0 == strcmp(state->files.filename[filenum], "-"))) {
|
||||
next_filename = NULL;
|
||||
if (NULL != state->files.filename) {
|
||||
next_filename = state->files.filename[filenum];
|
||||
if (NULL == next_filename) {
|
||||
debug("%s: @%d, max %d", "unexpected null filename", filenum, state->files.file_count);
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSITION;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((NULL == next_filename) || (0 == strcmp(next_filename, "-"))) {
|
||||
fd = STDIN_FILENO;
|
||||
} else {
|
||||
fd = open(state->files.filename[filenum], O_RDONLY); /* flawfinder: ignore */
|
||||
fd = open(next_filename, O_RDONLY); /* flawfinder: ignore */
|
||||
/*
|
||||
* flawfinder rationale: the input file list is under the
|
||||
* control of the operator by its nature, so we can't refuse
|
||||
* to open symlinks etc as that would be counterintuitive.
|
||||
*/
|
||||
if (fd < 0) {
|
||||
pv_error(state, "%s: %s: %s",
|
||||
_("failed to read file"), state->files.filename[filenum], strerror(errno));
|
||||
state->status.exit_status |= 2;
|
||||
pv_error("%s: %s: %s", _("failed to read file"), next_filename, strerror(errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 != fstat(fd, &isb)) {
|
||||
pv_error(state, "%s: %s: %s", _("failed to stat file"),
|
||||
NULL == state->files.filename ? "-" : state->files.filename[filenum], strerror(errno));
|
||||
pv_error("%s: %s: %s", _("failed to stat file"),
|
||||
NULL == next_filename ? "-" : next_filename, strerror(errno));
|
||||
(void) close(fd);
|
||||
state->status.exit_status |= 2;
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (0 != fstat(STDOUT_FILENO, &osb)) {
|
||||
pv_error(state, "%s: %s", _("failed to stat output file"), strerror(errno));
|
||||
if (0 != fstat(state->control.output_fd, &osb)) {
|
||||
pv_error("%s: %s", _("failed to stat output file"), strerror(errno));
|
||||
(void) close(fd);
|
||||
state->status.exit_status |= 2;
|
||||
state->status.exit_status |= PV_ERROREXIT_ACCESS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check that this new input file is not the same as stdout's
|
||||
* Check that this new input file is not the same as output's
|
||||
* destination. This restriction is ignored for anything other
|
||||
* than a regular file or block device.
|
||||
*/
|
||||
input_file_is_stdout = true;
|
||||
input_file_is_output = true;
|
||||
if (isb.st_dev != osb.st_dev)
|
||||
input_file_is_stdout = false;
|
||||
input_file_is_output = false;
|
||||
if (isb.st_ino != osb.st_ino)
|
||||
input_file_is_stdout = false;
|
||||
input_file_is_output = false;
|
||||
if (0 != isatty(fd))
|
||||
input_file_is_stdout = false;
|
||||
input_file_is_output = false;
|
||||
if ((!S_ISREG(isb.st_mode)) && (!S_ISBLK(isb.st_mode)))
|
||||
input_file_is_stdout = false;
|
||||
input_file_is_output = false;
|
||||
|
||||
if (input_file_is_stdout) {
|
||||
pv_error(state, "%s: %s", _("input file is output file"),
|
||||
NULL == state->files.filename ? "-" : state->files.filename[filenum]);
|
||||
if (input_file_is_output) {
|
||||
pv_error("%s: %s", _("input file is output file"), NULL == next_filename ? "-" : next_filename);
|
||||
(void) close(fd);
|
||||
state->status.exit_status |= 4;
|
||||
state->status.exit_status |= PV_ERROREXIT_OUROBOROS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -389,7 +407,7 @@ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd)
|
||||
* internal state and must not be passed to free() or used after "state" is
|
||||
* freed.
|
||||
*/
|
||||
/*@out@*/ const char *pv_current_file_name(pvstate_t state)
|
||||
/*@keep@*/ const char *pv_current_file_name(pvstate_t state)
|
||||
{
|
||||
static char *str_none = NULL;
|
||||
static char *str_stdin = NULL;
|
||||
@@ -446,5 +464,3 @@ int pv_next_file(pvstate_t state, unsigned int filenum, int oldfd)
|
||||
/*@+onlytrans@ */
|
||||
/*@+observertrans@ */
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Formatter function for average rate.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Average transfer rate.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
/*@-mustfreefresh@ */
|
||||
if (args->control->numeric) {
|
||||
/* numeric - raw value without suffix. */
|
||||
(void) pv_snprintf(content, sizeof(content),
|
||||
"%.4Lf", ((args->control->bits ? 8.0 : 1.0) * args->calc->average_rate));
|
||||
} else if (args->control->bits && !args->control->linemode) {
|
||||
/* bits per second */
|
||||
pv_describe_amount(content, sizeof(content),
|
||||
"(%s)", 8 * args->calc->average_rate, "", _("b/s"), args->display->count_type);
|
||||
} else {
|
||||
/* bytes or lines per second */
|
||||
pv_describe_amount(content,
|
||||
sizeof(content), "(%s)", args->calc->average_rate, _("/s"), _("B/s"),
|
||||
args->display->count_type);
|
||||
}
|
||||
/*@+mustfreefresh@ *//* splint: see above. */
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
/*
|
||||
* Formatter functions for styled progress bars.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
#include <string.h>
|
||||
#if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H)
|
||||
#include <wchar.h>
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Populate "style" with the named bar style, falling back to plain if the
|
||||
* name was not recognised. Returns true if the named style was found.
|
||||
*
|
||||
* Note that strings are copied into the structure, rather than just
|
||||
* updating pointers, to maintain separation of concern between different
|
||||
* parts of the code - and because on 64-bit architectures, the sizes of the
|
||||
* data types and their associated alignment padding tend to outweigh the
|
||||
* memory savings from using pointers and shared strings.
|
||||
*/
|
||||
static bool pv_barstyle(pvformatter_args_t args, pvbarstyle_t style, const char *name)
|
||||
{
|
||||
#define populate_string(item, str, w) { \
|
||||
item.width = w; \
|
||||
item.bytes = strlen(str); /* flawfinder: ignore */ \
|
||||
if (item.bytes > 0 && item.bytes <= PV_BARSTYLE_SIZEOF_STRING) \
|
||||
memcpy(item.string, str, item.bytes); /* flawfinder: ignore */ \
|
||||
}
|
||||
/*
|
||||
* flawfinder - strlen() on null-terminated static strings is OK,
|
||||
* and with the memcpy(), we check the buffer is big enough.
|
||||
*/
|
||||
|
||||
memset(style, 0, sizeof(*style));
|
||||
|
||||
if (args->status->terminal_supports_utf8 && 0 == strcmp(name, "block")) {
|
||||
|
||||
style->style_id = 2;
|
||||
|
||||
populate_string(style->indicator, "◀▶", 2);
|
||||
populate_string(style->tip, "", 0);
|
||||
|
||||
populate_string(style->filler[0], " ", 1);
|
||||
populate_string(style->filler[1], "█", 1);
|
||||
|
||||
style->filler_entries = 2;
|
||||
|
||||
return true;
|
||||
|
||||
} else if (args->status->terminal_supports_utf8 && 0 == strcmp(name, "granular")) {
|
||||
|
||||
style->style_id = 3;
|
||||
|
||||
populate_string(style->indicator, "◀▶", 2);
|
||||
populate_string(style->tip, "", 0);
|
||||
|
||||
populate_string(style->filler[0], " ", 1);
|
||||
populate_string(style->filler[1], "▏", 1);
|
||||
populate_string(style->filler[2], "▎", 1);
|
||||
populate_string(style->filler[3], "▍", 1);
|
||||
populate_string(style->filler[4], "▌", 1);
|
||||
populate_string(style->filler[5], "▋", 1);
|
||||
populate_string(style->filler[6], "▊", 1);
|
||||
populate_string(style->filler[7], "▉", 1);
|
||||
populate_string(style->filler[8], "█", 1);
|
||||
|
||||
style->filler_entries = 9;
|
||||
|
||||
return true;
|
||||
|
||||
} else if (args->status->terminal_supports_utf8 && 0 == strcmp(name, "shaded")) {
|
||||
|
||||
style->style_id = 4;
|
||||
|
||||
populate_string(style->indicator, "▒▓▒", 3);
|
||||
populate_string(style->tip, "", 0);
|
||||
|
||||
populate_string(style->filler[0], "░", 1);
|
||||
populate_string(style->filler[1], "▒", 1);
|
||||
populate_string(style->filler[2], "▓", 1);
|
||||
populate_string(style->filler[3], "█", 1);
|
||||
|
||||
style->filler_entries = 4;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Default plain style. */
|
||||
|
||||
style->style_id = 1;
|
||||
|
||||
populate_string(style->indicator, "<=>", 3);
|
||||
populate_string(style->tip, ">", 1);
|
||||
|
||||
populate_string(style->filler[0], " ", 1);
|
||||
populate_string(style->filler[1], "=", 1);
|
||||
|
||||
style->filler_entries = 2;
|
||||
|
||||
if (0 == strcmp(name, "plain"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the index into args->display->barstyle for the style with the
|
||||
* given name, adding that style to the array if it's not there already and
|
||||
* there's room.
|
||||
*
|
||||
* If there is no room, returns zero, so the first style is re-used.
|
||||
*/
|
||||
int8_t pv_display_barstyle_index(pvformatter_args_t args, const char *name)
|
||||
{
|
||||
struct pvbarstyle_s style;
|
||||
int8_t barstyle_index;
|
||||
#ifdef ENABLE_DEBUGGING
|
||||
bool found;
|
||||
#endif
|
||||
|
||||
memset(&style, 0, sizeof(style));
|
||||
#ifdef ENABLE_DEBUGGING
|
||||
found = pv_barstyle(args, &style, name);
|
||||
if (!found)
|
||||
debug("%s: %s", name, "bar style not found, using plain");
|
||||
#else
|
||||
(void) pv_barstyle(args, &style, name);
|
||||
#endif
|
||||
|
||||
for (barstyle_index = 0;
|
||||
barstyle_index < PV_BARSTYLE_MAX && args->display->barstyle[barstyle_index].style_id > 0;
|
||||
barstyle_index++) {
|
||||
if (args->display->barstyle[barstyle_index].style_id == style.style_id) {
|
||||
debug("%s: %s: %d", name, "found in bar style array", barstyle_index);
|
||||
return barstyle_index;
|
||||
}
|
||||
}
|
||||
|
||||
if (barstyle_index >= PV_BARSTYLE_MAX) {
|
||||
debug("%s: %s", name, "no room to add another bar style - returning 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(&(args->display->barstyle[barstyle_index]), &style, sizeof(style)); /* flawfinder: ignore */
|
||||
/* flawfinder - the destination is an array element of the right size. */
|
||||
debug("%s: %s: %d", name, "added to bar style array", barstyle_index);
|
||||
return barstyle_index;
|
||||
}
|
||||
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_bar_default(pvformatter_args_t args)
|
||||
{
|
||||
if (0 == args->segment->parameter) {
|
||||
const char *default_name;
|
||||
default_name = args->control->default_bar_style;
|
||||
/*@-branchstate@ */
|
||||
if (NULL == default_name)
|
||||
default_name = "plain";
|
||||
/*@+branchstate@ */
|
||||
/* splint - it doesn't matter that default_name may be static */
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name);
|
||||
}
|
||||
return pv_formatter_progress_bar_only(args);
|
||||
}
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_bar_plain(pvformatter_args_t args)
|
||||
{
|
||||
if (0 == args->segment->parameter)
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, "plain");
|
||||
return pv_formatter_progress_bar_only(args);
|
||||
}
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_bar_block(pvformatter_args_t args)
|
||||
{
|
||||
if (0 == args->segment->parameter)
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, "block");
|
||||
return pv_formatter_progress_bar_only(args);
|
||||
}
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_bar_granular(pvformatter_args_t args)
|
||||
{
|
||||
if (0 == args->segment->parameter)
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, "granular");
|
||||
return pv_formatter_progress_bar_only(args);
|
||||
}
|
||||
|
||||
pvdisplay_bytecount_t pv_formatter_bar_shaded(pvformatter_args_t args)
|
||||
{
|
||||
if (0 == args->segment->parameter)
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, "shaded");
|
||||
return pv_formatter_progress_bar_only(args);
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Formatter function for transfer buffer percentage utilisation.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Percentage transfer buffer utilisation.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_buffer_percent(pvformatter_args_t args)
|
||||
{
|
||||
char content[16]; /* flawfinder: ignore - always bounded */
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
if (args->transfer->buffer_size > 0) {
|
||||
double pct_used = pv_percentage((off_t)
|
||||
(args->transfer->read_position - args->transfer->write_position),
|
||||
(off_t)
|
||||
(args->transfer->buffer_size));
|
||||
(void) pv_snprintf(content, sizeof(content), "{%3.0f%%}", pct_used);
|
||||
}
|
||||
#ifdef HAVE_SPLICE
|
||||
if (args->transfer->splice_used)
|
||||
(void) pv_snprintf(content, sizeof(content), "{%s}", "----");
|
||||
#endif
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Formatter function for bytes or lines transferred.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Number of bytes or lines transferred.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
|
||||
args->display->showing_bytes = true;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
/*@-mustfreefresh@ */
|
||||
if (args->control->numeric) {
|
||||
/* Numeric mode - raw values only, no suffix. */
|
||||
(void) pv_snprintf(content, sizeof(content),
|
||||
"%lld", (long long) ((args->control->bits ? 8 : 1) * args->transfer->transferred));
|
||||
} else if (args->control->bits && !args->control->linemode) {
|
||||
pv_describe_amount(content, sizeof(content), "%s",
|
||||
(long double) (args->transfer->transferred * 8), "", _("b"),
|
||||
args->display->count_type);
|
||||
} else {
|
||||
pv_describe_amount(content, sizeof(content), "%s",
|
||||
(long double) (args->transfer->transferred), "", _("B"), args->display->count_type);
|
||||
}
|
||||
/*@+mustfreefresh@ *//* splint - false positive from gettext(). */
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Formatter function for ETA display.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Estimated time until completion.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_eta(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
long eta;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
/*
|
||||
* Don't try to calculate this if the size is not known.
|
||||
*/
|
||||
if (args->control->size < 1)
|
||||
return 0;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
eta =
|
||||
pv_seconds_remaining((args->transfer->transferred - args->display->initial_offset),
|
||||
args->control->size - args->display->initial_offset, args->calc->current_avg_rate);
|
||||
|
||||
/*
|
||||
* Bounds check, so we don't overrun the suffix buffer. This means
|
||||
* the ETA will always be less than 100,000 hours.
|
||||
*/
|
||||
eta = pv_bound_long(eta, 0, (long) 360000000L);
|
||||
|
||||
/*
|
||||
* If the ETA is more than a day, include a day count as well as
|
||||
* hours, minutes, and seconds.
|
||||
*/
|
||||
/*@-mustfreefresh@ */
|
||||
if (eta > 86400L) {
|
||||
(void) pv_snprintf(content,
|
||||
sizeof(content),
|
||||
"%.16s %ld:%02ld:%02ld:%02ld",
|
||||
_("ETA"), eta / 86400, (eta / 3600) % 24, (eta / 60) % 60, eta % 60);
|
||||
} else {
|
||||
(void) pv_snprintf(content,
|
||||
sizeof(content),
|
||||
"%.16s %ld:%02ld:%02ld", _("ETA"), eta / 3600, (eta / 60) % 60, eta % 60);
|
||||
}
|
||||
/*@+mustfreefresh@ *//* splint: see above. */
|
||||
|
||||
/*
|
||||
* If this is the final update, show a blank space where the ETA
|
||||
* used to be.
|
||||
*/
|
||||
if (args->display->final_update) {
|
||||
size_t erase_idx;
|
||||
for (erase_idx = 0; erase_idx < sizeof(content) && content[erase_idx] != '\0'; erase_idx++) {
|
||||
content[erase_idx] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Formatter function for the local time at which the transfer is expected
|
||||
* to complete.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
|
||||
/*
|
||||
* Estimated local time of completion.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_fineta(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
time_t now, then;
|
||||
struct tm *time_ptr;
|
||||
long eta;
|
||||
const char *time_format;
|
||||
bool show_fineta;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
/*
|
||||
* Don't try to calculate this if the size is not known.
|
||||
*/
|
||||
if (args->control->size < 1)
|
||||
return 0;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
now = time(NULL);
|
||||
show_fineta = true;
|
||||
time_format = NULL;
|
||||
|
||||
/*
|
||||
* The completion clock time may be hidden by a failed localtime
|
||||
* lookup.
|
||||
*/
|
||||
|
||||
eta = pv_seconds_remaining(args->transfer->transferred - args->display->initial_offset,
|
||||
args->control->size - args->display->initial_offset, args->calc->current_avg_rate);
|
||||
|
||||
/* Bounds check - see pv_formatter_eta(). */
|
||||
eta = pv_bound_long(eta, 0, (long) 360000000L);
|
||||
|
||||
/*
|
||||
* Only include the date if the ETA is more than 6 hours
|
||||
* away.
|
||||
*/
|
||||
if (eta > (long) (6 * 3600)) {
|
||||
time_format = "%Y-%m-%d %H:%M:%S";
|
||||
} else {
|
||||
time_format = "%H:%M:%S";
|
||||
}
|
||||
|
||||
then = now + eta;
|
||||
time_ptr = localtime(&then);
|
||||
|
||||
if (NULL == time_ptr) {
|
||||
show_fineta = false;
|
||||
} else {
|
||||
/*
|
||||
* The localtime() function keeps data stored in a static
|
||||
* buffer that gets overwritten by time functions.
|
||||
*/
|
||||
struct tm time = *time_ptr;
|
||||
size_t content_bytes;
|
||||
|
||||
/*@-mustfreefresh@ */
|
||||
(void) pv_snprintf(content, sizeof(content), "%.16s ", _("FIN"));
|
||||
/*@+mustfreefresh@ *//* splint: see above. */
|
||||
content_bytes = strlen(content); /* flawfinder: ignore */
|
||||
/* flawfinder: always bounded with \0 by pv_snprintf(). */
|
||||
(void) strftime(content + content_bytes, sizeof(content) - 1 - content_bytes, time_format, &time);
|
||||
}
|
||||
|
||||
if (!show_fineta) {
|
||||
size_t erase_idx;
|
||||
for (erase_idx = 0; erase_idx < sizeof(content) && content[erase_idx] != '\0'; erase_idx++) {
|
||||
content[erase_idx] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Formatter function for showing the last bytes written.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Display the last few bytes written.
|
||||
*
|
||||
* As a side effect, this sets args->display->lastwritten_bytes to
|
||||
* the segment's chosen_size, if it was previously smaller than that.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_last_written(pvformatter_args_t args)
|
||||
{
|
||||
pvdisplay_bytecount_t bytes_to_show, read_offset, write_offset, remaining;
|
||||
|
||||
args->display->showing_last_written = true;
|
||||
|
||||
bytes_to_show = args->segment->chosen_size;
|
||||
if (0 == bytes_to_show)
|
||||
bytes_to_show = args->segment->width;
|
||||
if (0 == bytes_to_show)
|
||||
return 0;
|
||||
|
||||
if (bytes_to_show > PV_SIZEOF_LASTWRITTEN_BUFFER)
|
||||
bytes_to_show = PV_SIZEOF_LASTWRITTEN_BUFFER;
|
||||
if (bytes_to_show > args->display->lastwritten_bytes)
|
||||
args->display->lastwritten_bytes = bytes_to_show;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
if (args->offset + bytes_to_show >= args->buffer_size)
|
||||
return 0;
|
||||
|
||||
args->segment->offset = args->offset;
|
||||
args->segment->bytes = bytes_to_show;
|
||||
|
||||
read_offset = args->display->lastwritten_bytes - bytes_to_show;
|
||||
write_offset = args->offset;
|
||||
for (remaining = bytes_to_show; remaining > 0; remaining--) {
|
||||
char display_char = args->display->lastwritten_buffer[read_offset++];
|
||||
args->buffer[write_offset++] = pv_isprint(display_char) ? display_char : '.';
|
||||
}
|
||||
|
||||
return bytes_to_show;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Formatter function for showing the name of the transfer.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/*
|
||||
* Display the transfer's name.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_name(pvformatter_args_t args)
|
||||
{
|
||||
char string_format[32]; /* flawfinder: ignore - always bounded */
|
||||
char content[512]; /* flawfinder: ignore - always bounded */
|
||||
pvdisplay_bytecount_t field_width;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
field_width = args->segment->chosen_size;
|
||||
if (field_width < 1)
|
||||
field_width = 9;
|
||||
if (field_width > 500)
|
||||
field_width = 500;
|
||||
|
||||
memset(string_format, 0, sizeof(string_format));
|
||||
(void) pv_snprintf(string_format, sizeof(string_format), "%%%d.500s:", field_width);
|
||||
|
||||
content[0] = '\0';
|
||||
if (NULL != args->control->name) {
|
||||
(void) pv_snprintf(content, sizeof(content), string_format, args->control->name);
|
||||
}
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Formatter function for the most recently written line.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Display the previously written line.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_previous_line(pvformatter_args_t args)
|
||||
{
|
||||
pvdisplay_bytecount_t bytes_to_show, read_offset, write_offset, remaining;
|
||||
|
||||
args->display->showing_previous_line = true;
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
bytes_to_show = args->segment->chosen_size;
|
||||
if (0 == bytes_to_show)
|
||||
bytes_to_show = args->segment->width;
|
||||
if (0 == bytes_to_show)
|
||||
return 0;
|
||||
|
||||
if (bytes_to_show > PV_SIZEOF_PREVLINE_BUFFER)
|
||||
bytes_to_show = PV_SIZEOF_PREVLINE_BUFFER;
|
||||
|
||||
if (args->offset + bytes_to_show >= args->buffer_size)
|
||||
return 0;
|
||||
|
||||
args->segment->offset = args->offset;
|
||||
args->segment->bytes = bytes_to_show;
|
||||
|
||||
read_offset = 0;
|
||||
write_offset = args->offset;
|
||||
for (remaining = bytes_to_show; remaining > 0; remaining--) {
|
||||
char display_char = args->display->previous_line[read_offset++];
|
||||
args->buffer[write_offset++] = pv_isprint(display_char) ? display_char : ' ';
|
||||
}
|
||||
|
||||
return bytes_to_show;
|
||||
}
|
||||
@@ -0,0 +1,410 @@
|
||||
/*
|
||||
* Formatter functions for progress bars.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_MATH_H
|
||||
#include <math.h>
|
||||
#endif
|
||||
|
||||
/* Convenience macro for appending a string to the buffer. */
|
||||
#define append_to_buffer(x) { \
|
||||
if (buffer_offset < (buffer_size - x.bytes)) { \
|
||||
memcpy(&(buffer[buffer_offset]), x.string, x.bytes); /* flawfinder: ignore */ \
|
||||
buffer_offset += x.bytes; \
|
||||
} \
|
||||
}
|
||||
/*
|
||||
* flawfinder - we are checking that there is room in the destination
|
||||
* buffer, given its size and our current offset.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Write a progress bar to a buffer, in known-size or rate-gauge mode - a
|
||||
* bar, and a percentage (size) or max rate (gauge). The total width of the
|
||||
* content is bounded to the given width. Returns the number of bytes
|
||||
* written to the buffer.
|
||||
*
|
||||
* If "bar_sides" is false, only the bar itself is rendered, not the opening
|
||||
* and closing characters.
|
||||
*
|
||||
* If "include_bar" is false, the bar is omitted entirely.
|
||||
*
|
||||
* If "include_amount" is false, the percentage or rate after the bar is
|
||||
* omitted.
|
||||
*
|
||||
* This is only called by pv_formatter_progress().
|
||||
*/
|
||||
static pvdisplay_bytecount_t pv_formatter_progress_knownsize(pvformatter_args_t args, char *buffer,
|
||||
pvdisplay_bytecount_t buffer_size, bool bar_sides,
|
||||
bool include_bar, bool include_amount)
|
||||
{
|
||||
char after_bar[32]; /* flawfinder: ignore - only populated by pv_snprintf(). */
|
||||
pvdisplay_bytecount_t after_bar_bytes, buffer_offset;
|
||||
pvdisplay_width_t after_bar_width;
|
||||
pvdisplay_width_t bar_area_width, filled_bar_width, pad_count;
|
||||
double bar_percentage;
|
||||
pvbarstyle_t style;
|
||||
pvdisplay_bytecount_t full_cell_index;
|
||||
bool has_tip = false;
|
||||
|
||||
buffer[0] = '\0';
|
||||
|
||||
if (args->segment->parameter > 0 && args->segment->parameter <= PV_BARSTYLE_MAX) {
|
||||
style = &(args->display->barstyle[args->segment->parameter - 1]);
|
||||
} else {
|
||||
style = &(args->display->barstyle[0]);
|
||||
}
|
||||
|
||||
full_cell_index = style->filler_entries;
|
||||
if (full_cell_index > 0)
|
||||
full_cell_index--;
|
||||
if (1 == full_cell_index && style->tip.width > 0)
|
||||
has_tip = true;
|
||||
|
||||
memset(after_bar, 0, sizeof(after_bar));
|
||||
|
||||
if (args->control->size > 0) {
|
||||
/* Percentage of data transferred. */
|
||||
bar_percentage = (double) (args->calc->percentage);
|
||||
(void) pv_snprintf(after_bar, sizeof(after_bar), " %3ld%%", (int) bar_percentage);
|
||||
} else {
|
||||
/* Current rate vs max rate. */
|
||||
bar_percentage = 0.0;
|
||||
if (args->calc->rate_max > 0) {
|
||||
bar_percentage = (double) (100.0 * args->calc->transfer_rate / args->calc->rate_max);
|
||||
}
|
||||
|
||||
/*@-mustfreefresh@ */
|
||||
if (args->control->bits && !args->control->linemode) {
|
||||
/* bits per second */
|
||||
pv_describe_amount(after_bar, sizeof(after_bar), "/%s",
|
||||
8.0 * args->calc->rate_max, "", _("b/s"), args->display->count_type);
|
||||
} else {
|
||||
/* bytes or lines per second */
|
||||
pv_describe_amount(after_bar, sizeof(after_bar),
|
||||
"/%s", args->calc->rate_max, _("/s"), _("B/s"), args->display->count_type);
|
||||
}
|
||||
/*@+mustfreefresh@ *//* splint: see above about gettext(). */
|
||||
}
|
||||
|
||||
if (!include_amount)
|
||||
after_bar[0] = '\0';
|
||||
|
||||
after_bar_bytes = strlen(after_bar); /* flawfinder: ignore */
|
||||
/* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */
|
||||
after_bar_width = pv_strwidth(after_bar, after_bar_bytes);
|
||||
|
||||
if (!include_bar) {
|
||||
/*
|
||||
* Only returning the "after bar" portion - the amount
|
||||
* (progress or max rate).
|
||||
*/
|
||||
if (buffer_size < after_bar_bytes)
|
||||
return 0;
|
||||
if (after_bar_bytes > 1) {
|
||||
/* NB we skip the leading space. */
|
||||
memmove(buffer, after_bar + 1, after_bar_bytes - 1);
|
||||
buffer[after_bar_bytes - 1] = '\0';
|
||||
return after_bar_bytes - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (bar_sides) {
|
||||
if (args->segment->width < (after_bar_width + 2))
|
||||
return 0;
|
||||
bar_area_width = args->segment->width - after_bar_width - 2;
|
||||
} else {
|
||||
if (args->segment->width < after_bar_width)
|
||||
return 0;
|
||||
bar_area_width = args->segment->width - after_bar_width;
|
||||
}
|
||||
|
||||
filled_bar_width = (pvdisplay_width_t) ((bar_area_width * bar_percentage) / 100);
|
||||
/* Leave room for the tip of the bar. */
|
||||
if (has_tip && filled_bar_width > 0)
|
||||
filled_bar_width -= style->tip.width;
|
||||
|
||||
debug("percentage=%.2f width=%d bar_area_width=%d filled_bar_width=%d after_bar_width=%d", bar_percentage,
|
||||
args->segment->width, bar_area_width, filled_bar_width, after_bar_width);
|
||||
|
||||
buffer_offset = 0;
|
||||
|
||||
if (bar_sides) {
|
||||
/* The opening of the bar area. */
|
||||
buffer[buffer_offset++] = '[';
|
||||
}
|
||||
|
||||
/* The bar portion. */
|
||||
pad_count = 0;
|
||||
while (pad_count < filled_bar_width && pad_count < bar_area_width) {
|
||||
append_to_buffer(style->filler[full_cell_index]);
|
||||
pad_count += style->filler[full_cell_index].width;
|
||||
if (0 == style->filler[full_cell_index].width)
|
||||
pad_count++;
|
||||
}
|
||||
|
||||
/* The tip of the bar, if not at 100%. */
|
||||
if (has_tip && pad_count < bar_area_width) {
|
||||
append_to_buffer(style->tip);
|
||||
pad_count += style->tip.width;
|
||||
}
|
||||
|
||||
/* A partial cell, if there are intermediates and we're not at 100%. */
|
||||
if (pad_count < bar_area_width && full_cell_index > 1 && !has_tip) {
|
||||
double exact_width = (((double) bar_area_width) * bar_percentage) / 100.0;
|
||||
double cell_portion = exact_width - (double) filled_bar_width;
|
||||
double cell_index_double = ((double) full_cell_index) * cell_portion;
|
||||
size_t cell_index = (size_t) cell_index_double;
|
||||
|
||||
if (cell_index > full_cell_index)
|
||||
cell_index = full_cell_index;
|
||||
|
||||
append_to_buffer(style->filler[cell_index]);
|
||||
pad_count += style->filler[cell_index].width;
|
||||
if (0 == style->filler[cell_index].width)
|
||||
pad_count++;
|
||||
}
|
||||
|
||||
/* The spaces after the bar. */
|
||||
while (pad_count < bar_area_width) {
|
||||
append_to_buffer(style->filler[0]);
|
||||
pad_count += style->filler[0].width;
|
||||
if (0 == style->filler[0].width)
|
||||
pad_count++;
|
||||
}
|
||||
|
||||
if (bar_sides) {
|
||||
/* The closure of the bar area. */
|
||||
if (buffer_offset < buffer_size - 1)
|
||||
buffer[buffer_offset++] = ']';
|
||||
}
|
||||
|
||||
/* The percentage. */
|
||||
if (after_bar_bytes > 0 && after_bar_bytes < (buffer_size - 1 - buffer_offset)) {
|
||||
memmove(buffer + buffer_offset, after_bar, after_bar_bytes);
|
||||
buffer_offset += after_bar_bytes;
|
||||
}
|
||||
|
||||
buffer[buffer_offset] = '\0';
|
||||
|
||||
return buffer_offset;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Write a progress bar to a buffer, in unknown-size mode - just a moving
|
||||
* indicator. The total width of the content is bounded to the given width.
|
||||
* Returns the number of bytes written to the buffer.
|
||||
*
|
||||
* If "bar_sides" is false, only the bar itself is rendered, not the opening
|
||||
* and closing characters.
|
||||
*
|
||||
* This is only called by pv_formatter_progress().
|
||||
*/
|
||||
static pvdisplay_bytecount_t pv_formatter_progress_unknownsize(pvformatter_args_t args, char *buffer,
|
||||
pvdisplay_bytecount_t buffer_size, bool bar_sides)
|
||||
{
|
||||
pvdisplay_bytecount_t buffer_offset;
|
||||
pvdisplay_width_t bar_area_width, pad_count;
|
||||
double indicator_position, padding_width;
|
||||
pvbarstyle_t style;
|
||||
|
||||
buffer[0] = '\0';
|
||||
|
||||
if (args->segment->parameter > 0 && args->segment->parameter <= PV_BARSTYLE_MAX) {
|
||||
style = &(args->display->barstyle[args->segment->parameter - 1]);
|
||||
} else {
|
||||
style = &(args->display->barstyle[0]);
|
||||
}
|
||||
|
||||
if (bar_sides) {
|
||||
if (args->segment->width < (style->indicator.width + 3))
|
||||
return 0;
|
||||
bar_area_width = args->segment->width - (style->indicator.width + 2);
|
||||
} else {
|
||||
if (args->segment->width < (style->indicator.width + 2))
|
||||
return 0;
|
||||
bar_area_width = args->segment->width - style->indicator.width;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that pv_calculate_transfer_rate() sets the percentage when
|
||||
* the size is unknown to a value that goes 0 - 200 and resets, so
|
||||
* here we make values above 100 send the indicator back down again,
|
||||
* so it moves back and forth.
|
||||
*/
|
||||
indicator_position = args->calc->percentage;
|
||||
if (indicator_position > 200.0)
|
||||
#if HAVE_FMOD
|
||||
indicator_position = fmod(indicator_position, 200.0);
|
||||
#else
|
||||
{
|
||||
while (indicator_position > 200.0)
|
||||
indicator_position -= 200.0;
|
||||
}
|
||||
#endif
|
||||
if (indicator_position > 100.0)
|
||||
indicator_position = 200.0 - indicator_position;
|
||||
if (indicator_position < 0.0)
|
||||
indicator_position = 0.0;
|
||||
|
||||
buffer_offset = 0;
|
||||
|
||||
if (bar_sides) {
|
||||
/* The opening of the bar area. */
|
||||
buffer[buffer_offset++] = '[';
|
||||
}
|
||||
|
||||
/* The spaces before the indicator. */
|
||||
pad_count = 0;
|
||||
padding_width = (((double) bar_area_width) * indicator_position) / 100.0;
|
||||
while (pad_count < bar_area_width && pad_count < (pvdisplay_width_t) padding_width) {
|
||||
append_to_buffer(style->filler[0]);
|
||||
pad_count += style->filler[0].width;
|
||||
if (0 == style->filler[0].width)
|
||||
pad_count++;
|
||||
}
|
||||
|
||||
/* The indicator. */
|
||||
if (buffer_offset < buffer_size - style->indicator.bytes) {
|
||||
append_to_buffer(style->indicator);
|
||||
}
|
||||
|
||||
/* The spaces after the indicator. */
|
||||
while (pad_count < bar_area_width) {
|
||||
append_to_buffer(style->filler[0]);
|
||||
pad_count += style->filler[0].width;
|
||||
if (0 == style->filler[0].width)
|
||||
pad_count++;
|
||||
}
|
||||
|
||||
if (bar_sides) {
|
||||
/* The closure of the bar area. */
|
||||
if (buffer_offset < buffer_size - 1)
|
||||
buffer[buffer_offset++] = ']';
|
||||
}
|
||||
|
||||
buffer[buffer_offset] = '\0';
|
||||
|
||||
return buffer_offset;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Progress bar.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_progress(pvformatter_args_t args)
|
||||
{
|
||||
char content[4096]; /* flawfinder: ignore - always bounded */
|
||||
pvdisplay_bytecount_t bytes;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->segment->parameter) {
|
||||
const char *default_name;
|
||||
default_name = args->control->default_bar_style;
|
||||
/*@-branchstate@ */
|
||||
if (NULL == default_name)
|
||||
default_name = "plain";
|
||||
/*@+branchstate@ */
|
||||
/* splint - it doesn't matter that default_name may be static */
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name);
|
||||
}
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
if (args->control->size > 0 || args->control->rate_gauge) {
|
||||
/* Known size or rate gauge - bar with percentage. */
|
||||
bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), true, true, true);
|
||||
} else {
|
||||
/* Unknown size - back-and-forth moving indicator. */
|
||||
bytes = pv_formatter_progress_unknownsize(args, content, sizeof(content), true);
|
||||
}
|
||||
|
||||
content[bytes] = '\0';
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Progress bar, without sides and without a number afterwards.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_progress_bar_only(pvformatter_args_t args)
|
||||
{
|
||||
char content[4096]; /* flawfinder: ignore - always bounded */
|
||||
pvdisplay_bytecount_t bytes;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->segment->parameter) {
|
||||
const char *default_name;
|
||||
default_name = args->control->default_bar_style;
|
||||
/*@-branchstate@ */
|
||||
if (NULL == default_name)
|
||||
default_name = "plain";
|
||||
/*@+branchstate@ */
|
||||
/* splint - it doesn't matter that default_name may be static */
|
||||
args->segment->parameter = 1 + pv_display_barstyle_index(args, default_name);
|
||||
}
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
if (args->control->size > 0 || args->control->rate_gauge) {
|
||||
/* Known size or rate gauge - bar with percentage. */
|
||||
bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), false, true, false);
|
||||
} else {
|
||||
/* Unknown size - back-and-forth moving indicator. */
|
||||
bytes = pv_formatter_progress_unknownsize(args, content, sizeof(content), false);
|
||||
}
|
||||
|
||||
content[bytes] = '\0';
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* The number after the progress bar.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t args)
|
||||
{
|
||||
char content[256]; /* flawfinder: ignore - always bounded */
|
||||
pvdisplay_bytecount_t bytes;
|
||||
|
||||
memset(content, 0, sizeof(content));
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
if (args->control->numeric) {
|
||||
/* Numeric mode - percentage as a rounded integer with no suffix. */
|
||||
(void) pv_snprintf(content, sizeof(content), "%.0f", args->calc->percentage);
|
||||
bytes = strlen(content); /* flawfinder: ignore */
|
||||
/* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */
|
||||
} else if (args->control->size > 0 || args->control->rate_gauge) {
|
||||
/* Known size or rate gauge - percentage or rate. */
|
||||
bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), false, false, true);
|
||||
} else {
|
||||
/* Unknown size - no number. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
content[bytes] = '\0';
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Formatter function for the current rate of transfer.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Transfer rate.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_rate(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
|
||||
args->display->showing_rate = true;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
/*@-mustfreefresh@ */
|
||||
if (args->control->numeric) {
|
||||
/* numeric - raw value without suffix. */
|
||||
(void) pv_snprintf(content, sizeof(content),
|
||||
"%.4Lf", ((args->control->bits ? 8.0 : 1.0) * args->calc->transfer_rate));
|
||||
} else if (args->control->bits && !args->control->linemode) {
|
||||
/* bits per second */
|
||||
pv_describe_amount(content, sizeof(content), "[%s]",
|
||||
8 * args->calc->transfer_rate, "", _("b/s"), args->display->count_type);
|
||||
} else {
|
||||
/* bytes or lines per second */
|
||||
pv_describe_amount(content, sizeof(content),
|
||||
"[%s]", args->calc->transfer_rate, _("/s"), _("B/s"), args->display->count_type);
|
||||
}
|
||||
/*@+mustfreefresh@ *//* splint: see above. */
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* Formatter function for ECMA-48 SGR codes.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct sgr_keyword_map_s {
|
||||
/*@null@ */ const char *keyword;
|
||||
uint8_t bytes;
|
||||
uint8_t code;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Return an array mapping keywords to ECMA-48 SGR code numbers.
|
||||
*/
|
||||
/*@keep@ */ static struct sgr_keyword_map_s *sgr_keywords(void)
|
||||
{
|
||||
/*@keep@ */ static struct sgr_keyword_map_s keywords[] = {
|
||||
{ "reset", 0, 0 },
|
||||
{ "none", 0, 0 },
|
||||
{ "bold", 0, 1 },
|
||||
{ "dim", 0, 2 },
|
||||
{ "italic", 0, 3 },
|
||||
{ "underscore", 0, 4 },
|
||||
{ "underline", 0, 4 },
|
||||
{ "blink", 0, 5 },
|
||||
{ "reverse", 0, 7 },
|
||||
{ "no-bold", 0, 22 }, /* same as no-dim */
|
||||
{ "no-dim", 0, 22 },
|
||||
{ "no-italic", 0, 23 },
|
||||
{ "no-underscore", 0, 24 },
|
||||
{ "no-underline", 0, 24 },
|
||||
{ "no-blink", 0, 25 },
|
||||
{ "no-reverse", 0, 27 },
|
||||
{ "black", 0, 30 },
|
||||
{ "red", 0, 31 },
|
||||
{ "green", 0, 32 },
|
||||
{ "brown", 0, 33 },
|
||||
{ "yellow", 0, 33 },
|
||||
{ "blue", 0, 34 },
|
||||
{ "magenta", 0, 35 },
|
||||
{ "cyan", 0, 36 },
|
||||
{ "white", 0, 37 },
|
||||
{ "fg-black", 0, 30 },
|
||||
{ "fg-red", 0, 31 },
|
||||
{ "fg-green", 0, 32 },
|
||||
{ "fg-brown", 0, 33 },
|
||||
{ "fg-yellow", 0, 33 },
|
||||
{ "fg-blue", 0, 34 },
|
||||
{ "fg-magenta", 0, 35 },
|
||||
{ "fg-cyan", 0, 36 },
|
||||
{ "fg-white", 0, 37 },
|
||||
{ "fg-default", 0, 39 },
|
||||
{ "bg-black", 0, 40 },
|
||||
{ "bg-red", 0, 41 },
|
||||
{ "bg-green", 0, 42 },
|
||||
{ "bg-brown", 0, 43 },
|
||||
{ "bg-yellow", 0, 43 },
|
||||
{ "bg-blue", 0, 44 },
|
||||
{ "bg-magenta", 0, 45 },
|
||||
{ "bg-cyan", 0, 46 },
|
||||
{ "bg-white", 0, 47 },
|
||||
{ "bg-default", 0, 49 },
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
int keyword_index;
|
||||
|
||||
/* Calculate the lengths of each keyword on the first call. */
|
||||
if (0 == keywords[0].bytes) {
|
||||
for (keyword_index = 0; NULL != keywords[keyword_index].keyword; keyword_index++) {
|
||||
keywords[keyword_index].bytes = strlen(keywords[keyword_index].keyword); /* flawfinder: ignore */
|
||||
/* flawfinder - strlen() on a static null-terminated string is OK. */
|
||||
}
|
||||
}
|
||||
|
||||
/*@-compmempass@ */
|
||||
return keywords;
|
||||
/*@+compmempass@ */
|
||||
/*
|
||||
* splint - found no other way to pass static back without a false
|
||||
* positive warning about a memory leak.
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Display SGR codes if colour output is supported.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_sgr(pvformatter_args_t args)
|
||||
{
|
||||
/*@keep@ */ static struct sgr_keyword_map_s *keywords;
|
||||
char content[1024]; /* flawfinder: ignore */
|
||||
pvdisplay_bytecount_t write_position, read_position, keyword_start, keyword_length;
|
||||
int numeric_value, code_count, most_recent_code;
|
||||
|
||||
/* flawfinder - null-terminated and bounded with pv_snprintf(). */
|
||||
|
||||
if (!args->display->colour_permitted)
|
||||
return 0;
|
||||
|
||||
args->display->format_uses_colour = true;
|
||||
|
||||
if (!args->status->terminal_supports_colour)
|
||||
return 0;
|
||||
if (NULL == args->segment->string_parameter)
|
||||
return 0;
|
||||
if (0 == args->segment->string_parameter_bytes)
|
||||
return 0;
|
||||
|
||||
keywords = sgr_keywords();
|
||||
|
||||
write_position = 0;
|
||||
content[0] = '\0';
|
||||
|
||||
debug("%p+%d [%.*s]", args->segment->string_parameter, args->segment->string_parameter_bytes,
|
||||
args->segment->string_parameter_bytes, args->segment->string_parameter);
|
||||
|
||||
read_position = 0;
|
||||
keyword_start = 0;
|
||||
keyword_length = 0;
|
||||
numeric_value = -1;
|
||||
code_count = 0;
|
||||
most_recent_code = -1;
|
||||
|
||||
while (read_position < args->segment->string_parameter_bytes) {
|
||||
char read_char = args->segment->string_parameter[read_position++];
|
||||
if ((',' == read_char) || (';' == read_char)) {
|
||||
keyword_length = read_position - keyword_start;
|
||||
if (keyword_length > 0)
|
||||
keyword_length--;
|
||||
} else {
|
||||
if ((read_char >= '0' && read_char <= '9')
|
||||
&& (numeric_value >= 0 || keyword_start == read_position - 1)) {
|
||||
if (keyword_start == read_position - 1)
|
||||
numeric_value = 0;
|
||||
numeric_value = numeric_value * 10 + (int) (read_char - '0');
|
||||
} else {
|
||||
numeric_value = -1;
|
||||
}
|
||||
if (read_position >= args->segment->string_parameter_bytes) {
|
||||
keyword_length = read_position - keyword_start;
|
||||
}
|
||||
}
|
||||
if (keyword_length > 0) {
|
||||
int code = -1;
|
||||
|
||||
debug("keyword@%d+%d: [%.*s]; numeric=%d", keyword_start, keyword_length, keyword_length,
|
||||
&(args->segment->string_parameter[keyword_start]), numeric_value);
|
||||
|
||||
if (numeric_value >= 0 && numeric_value < 255) {
|
||||
code = numeric_value;
|
||||
} else {
|
||||
int keyword_index;
|
||||
for (keyword_index = 0; -1 == code && NULL != keywords[keyword_index].keyword;
|
||||
keyword_index++) {
|
||||
if (keyword_length != keywords[keyword_index].bytes)
|
||||
continue;
|
||||
if (0 !=
|
||||
strncmp(keywords[keyword_index].keyword,
|
||||
&(args->segment->string_parameter[keyword_start]), keyword_length))
|
||||
continue;
|
||||
code = (int) (keywords[keyword_index].code);
|
||||
}
|
||||
}
|
||||
|
||||
debug("code=%d", code);
|
||||
|
||||
if (code >= 0) {
|
||||
if (code_count > 15) {
|
||||
write_position +=
|
||||
pv_snprintf(content + write_position, sizeof(content) - write_position,
|
||||
"%s", "m");
|
||||
code_count = 0;
|
||||
}
|
||||
if (0 == code_count) {
|
||||
write_position +=
|
||||
pv_snprintf(content + write_position, sizeof(content) - write_position,
|
||||
"%s", "\033[");
|
||||
} else {
|
||||
write_position +=
|
||||
pv_snprintf(content + write_position, sizeof(content) - write_position,
|
||||
"%s", ";");
|
||||
}
|
||||
write_position +=
|
||||
pv_snprintf(content + write_position, sizeof(content) - write_position, "%d", code);
|
||||
code_count++;
|
||||
most_recent_code = code;
|
||||
}
|
||||
|
||||
keyword_length = 0;
|
||||
keyword_start = read_position;
|
||||
}
|
||||
}
|
||||
|
||||
if (code_count > 0)
|
||||
write_position += pv_snprintf(content + write_position, sizeof(content) - write_position, "%s", "m");
|
||||
|
||||
if (most_recent_code > 0) {
|
||||
args->display->sgr_code_active = true;
|
||||
} else if (0 == most_recent_code) {
|
||||
args->display->sgr_code_active = false;
|
||||
}
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Formatter function for the elapsed transfer time.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
|
||||
/*
|
||||
* Elapsed time.
|
||||
*/
|
||||
pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t args)
|
||||
{
|
||||
char content[128]; /* flawfinder: ignore - always bounded */
|
||||
long double elapsed_seconds;
|
||||
|
||||
args->display->showing_timer = true;
|
||||
|
||||
content[0] = '\0';
|
||||
|
||||
if (0 == args->buffer_size)
|
||||
return 0;
|
||||
|
||||
elapsed_seconds = args->transfer->elapsed_seconds;
|
||||
|
||||
/*
|
||||
* Bounds check, so we don't overrun the prefix buffer. This does
|
||||
* mean that the timer will stop at a 100,000 hours, but since
|
||||
* that's 11 years, it shouldn't be a problem.
|
||||
*/
|
||||
if (elapsed_seconds > (long double) 360000000.0L)
|
||||
elapsed_seconds = (long double) 360000000.0L;
|
||||
|
||||
/* Also check it's not negative. */
|
||||
if (elapsed_seconds < 0.0)
|
||||
elapsed_seconds = 0.0;
|
||||
|
||||
if (args->control->numeric) {
|
||||
/* Numeric mode - show the number of seconds, unformatted. */
|
||||
(void) pv_snprintf(content, sizeof(content), "%.4Lf", elapsed_seconds);
|
||||
} else if (elapsed_seconds > (long double) 86400.0L) {
|
||||
/*
|
||||
* If the elapsed time is more than a day, include a day count as
|
||||
* well as hours, minutes, and seconds.
|
||||
*/
|
||||
(void) pv_snprintf(content,
|
||||
sizeof(content),
|
||||
"%ld:%02ld:%02ld:%02ld",
|
||||
((long) (elapsed_seconds)) / 86400,
|
||||
(((long) (elapsed_seconds)) / 3600) %
|
||||
24, (((long) (elapsed_seconds)) / 60) % 60, ((long) (elapsed_seconds)) % 60);
|
||||
} else {
|
||||
(void) pv_snprintf(content,
|
||||
sizeof(content),
|
||||
"%ld:%02ld:%02ld",
|
||||
((long) (elapsed_seconds)) / 3600,
|
||||
(((long) (elapsed_seconds)) / 60) % 60, ((long) (elapsed_seconds)) % 60);
|
||||
}
|
||||
|
||||
return pv_formatter_segmentcontent(content, args);
|
||||
}
|
||||
+781
-392
File diff suppressed because it is too large
Load Diff
+46
-25
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions for converting strings to numbers.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -17,7 +17,7 @@
|
||||
* including <ctype.h> causes weird versioned glibc dependencies on certain
|
||||
* Red Hat systems, complicating package management.
|
||||
*/
|
||||
static bool pv__isdigit(char c)
|
||||
bool pv_isdigit(char c)
|
||||
{
|
||||
return ((c >= '0') && (c <= '9')) ? true : false;
|
||||
}
|
||||
@@ -37,21 +37,22 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
|
||||
unsigned int fractional_divisor = 1;
|
||||
unsigned int binary_shift = 0;
|
||||
off_t decimal_multiplier = 0;
|
||||
size_t readpos = 0;
|
||||
|
||||
if (NULL == str)
|
||||
return (off_t) 0;
|
||||
|
||||
/* Skip any non-numeric leading characters. */
|
||||
while (str[0] != '\0' && (!pv__isdigit(str[0])))
|
||||
str++;
|
||||
while (str[readpos] != '\0' && (!pv_isdigit(str[readpos])))
|
||||
readpos++;
|
||||
|
||||
/*
|
||||
* Parse the integral part of the number - the digits before the
|
||||
* decimal mark or units.
|
||||
*/
|
||||
for (; pv__isdigit(str[0]); str++) {
|
||||
for (; pv_isdigit(str[readpos]); readpos++) {
|
||||
integral_part = integral_part * 10;
|
||||
integral_part += (off_t) (str[0] - '0');
|
||||
integral_part += (off_t) (str[readpos] - '0');
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -62,13 +63,13 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
|
||||
* will fail if there are any locales whose decimal mark is not one
|
||||
* of those two characters.
|
||||
*/
|
||||
if (('.' == str[0]) || (',' == str[0])) {
|
||||
str++;
|
||||
for (; pv__isdigit(str[0]); str++) {
|
||||
if (('.' == str[readpos]) || (',' == str[readpos])) {
|
||||
readpos++;
|
||||
for (; pv_isdigit(str[readpos]); readpos++) {
|
||||
/* Stop counting below 0.0001. */
|
||||
if (fractional_divisor < 10000) {
|
||||
fractional_part = fractional_part * 10;
|
||||
fractional_part += (off_t) (str[0] - '0');
|
||||
fractional_part += (off_t) (str[readpos] - '0');
|
||||
fractional_divisor = fractional_divisor * 10;
|
||||
}
|
||||
}
|
||||
@@ -78,11 +79,11 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
|
||||
* Parse any units given (K=KiB=*1024, M=MiB=1024KiB, G=GiB=1024MiB,
|
||||
* T=TiB=1024GiB; replace 1024 with 1000 if decimal_units is true).
|
||||
*/
|
||||
if (str[0] != '\0') {
|
||||
if (str[readpos] != '\0') {
|
||||
/* Skip any spaces or tabs after the digits. */
|
||||
while ((' ' == str[0]) || ('\t' == str[0]))
|
||||
str++;
|
||||
switch (str[0]) {
|
||||
while ((' ' == str[readpos]) || ('\t' == str[readpos]))
|
||||
readpos++;
|
||||
switch (str[readpos]) {
|
||||
case 'k':
|
||||
case 'K':
|
||||
binary_shift = 10;
|
||||
@@ -159,6 +160,8 @@ off_t pv_getnum_size(const char *str, bool decimal_units)
|
||||
fractional_part = fractional_part / fractional_divisor;
|
||||
integral_part += fractional_part;
|
||||
|
||||
debug("%s [%s] = %lld", str, decimal_units ? "decimal" : "binary", (long long) integral_part);
|
||||
|
||||
return integral_part;
|
||||
}
|
||||
|
||||
@@ -176,11 +179,11 @@ double pv_getnum_interval(const char *str)
|
||||
return 0.0;
|
||||
|
||||
/* Skip any non-digit characters at the start. */
|
||||
while (str[0] != '\0' && (!pv__isdigit(str[0])))
|
||||
while (str[0] != '\0' && (!pv_isdigit(str[0])))
|
||||
str++;
|
||||
|
||||
/* Parse the digits before the decimal mark. */
|
||||
for (; pv__isdigit(str[0]); str++) {
|
||||
for (; pv_isdigit(str[0]); str++) {
|
||||
result = result * 10;
|
||||
result += (double) (str[0] - '0');
|
||||
}
|
||||
@@ -193,7 +196,7 @@ double pv_getnum_interval(const char *str)
|
||||
str++;
|
||||
|
||||
/* Parse the digits after the decimal mark, up to 0.0000001. */
|
||||
for (; pv__isdigit(str[0]) && step < 1000000; str++) {
|
||||
for (; pv_isdigit(str[0]) && step < 1000000; str++) {
|
||||
step = step * 10;
|
||||
result += ((double) (str[0] - '0')) / step;
|
||||
}
|
||||
@@ -226,31 +229,31 @@ bool pv_getnum_check(const char *str, pv_numtype type)
|
||||
str++;
|
||||
|
||||
/* If the next character isn't a digit, this isn't a number. */
|
||||
if (!pv__isdigit(str[0]))
|
||||
if (!pv_isdigit(str[0]))
|
||||
return false;
|
||||
|
||||
/* Skip over the digits. */
|
||||
for (; pv__isdigit(str[0]); str++);
|
||||
for (; pv_isdigit(str[0]); str++);
|
||||
|
||||
/*
|
||||
* If there's a decimal mark (see note in pv_getnum_size() above),
|
||||
* check that too.
|
||||
*/
|
||||
if (('.' == str[0]) || (',' == str[0])) {
|
||||
/* Integers should have no decimal mark. */
|
||||
if (type == PV_NUMTYPE_INTEGER)
|
||||
/* Bare integers should have no decimal mark. */
|
||||
if (type == PV_NUMTYPE_BARE_INTEGER)
|
||||
return false;
|
||||
/* Skip the decimal mark, then all digits. */
|
||||
str++;
|
||||
for (; pv__isdigit(str[0]); str++);
|
||||
for (; pv_isdigit(str[0]); str++);
|
||||
}
|
||||
|
||||
/* If the string ends here, this is a valid number. */
|
||||
if ('\0' == str[0])
|
||||
return true;
|
||||
|
||||
/* A units suffix is not allowed for doubles, only for integers. */
|
||||
if (type == PV_NUMTYPE_DOUBLE)
|
||||
/* A units suffix is only allowed for ANY_WITH_SUFFIX. */
|
||||
if (type != PV_NUMTYPE_ANY_WITH_SUFFIX)
|
||||
return false;
|
||||
|
||||
/* Skip trailing spaces or tabs. */
|
||||
@@ -280,4 +283,22 @@ bool pv_getnum_check(const char *str, pv_numtype type)
|
||||
return true;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
/*
|
||||
* Return a value representing "amount" as a percentage of "total", i.e.
|
||||
* 100*amount/total. If "total" is zero or less, return 0.
|
||||
*/
|
||||
double pv_percentage(off_t amount, const off_t total)
|
||||
{
|
||||
double amount_as_double;
|
||||
|
||||
if (total < 1)
|
||||
return 0.0;
|
||||
|
||||
amount_as_double = (double) amount;
|
||||
|
||||
amount_as_double *= 100.0;
|
||||
amount_as_double /= (double) total;
|
||||
|
||||
return amount_as_double;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* Functions for setting the process title.
|
||||
*
|
||||
* Copyright 2024-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "pv.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if ! HAVE_SETPROCTITLE
|
||||
extern char **environ;
|
||||
|
||||
/*@null@*/ static char **base_argv = NULL;
|
||||
static size_t space_available = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Assuming the environment comes after the command line arguments, we make
|
||||
* a duplicate of the environment array and all its values, so we can use
|
||||
* the space the environment used to occupy for the process title.
|
||||
*
|
||||
* The logic for this was derived from util-linux-ng.
|
||||
*/
|
||||
/*@-mustfreefresh@ */
|
||||
/*@-nullstate@ */
|
||||
void initproctitle(int argc, char **argv)
|
||||
{
|
||||
char **original_environment = environ;
|
||||
char **new_environment;
|
||||
size_t env_array_size, env_index;
|
||||
|
||||
/* Find the number of entries in the environment array. */
|
||||
for (env_array_size = 0; environ[env_array_size] != NULL; env_array_size++)
|
||||
continue;
|
||||
|
||||
/* Allocate a new environment array. */
|
||||
new_environment = (char **) malloc(sizeof(char *) * (env_array_size + 1));
|
||||
if (NULL == new_environment)
|
||||
return;
|
||||
|
||||
/* Duplicate the strings in the environment. */
|
||||
for (env_index = 0; original_environment[env_index] != NULL; env_index++) {
|
||||
new_environment[env_index] = pv_strdup(original_environment[env_index]);
|
||||
if (NULL == new_environment[env_index])
|
||||
return;
|
||||
}
|
||||
new_environment[env_index] = NULL;
|
||||
|
||||
base_argv = argv;
|
||||
|
||||
/* Work out how much room we have. */
|
||||
if (env_index > 0) {
|
||||
/* From argv[0] to the end of the last environment value. */
|
||||
space_available = (size_t)
|
||||
(original_environment[env_index - 1] + strlen(original_environment[env_index - 1]) - argv[0]); /* flawfinder: ignore */
|
||||
} else if (argc > 0) {
|
||||
/* No environment; from argv[0] to the end of the last argument. */
|
||||
space_available = (size_t) (argv[argc - 1] + strlen(argv[argc - 1]) - argv[0]); /* flawfinder: ignore */
|
||||
}
|
||||
|
||||
/*
|
||||
* flawfinder - we have to trust that the environment and argument
|
||||
* strings are null-terminated, since that's what the OS is supposed
|
||||
* to guarantee.
|
||||
*/
|
||||
|
||||
environ = new_environment;
|
||||
}
|
||||
|
||||
/*@+nullstate@ */
|
||||
/*@+mustfreefresh@ */
|
||||
|
||||
|
||||
/*
|
||||
* Set the process title visible to ps(1), by overwriting argv[0] with the
|
||||
* given printf() format string.
|
||||
*/
|
||||
void setproctitle(const char *format, ...)
|
||||
{
|
||||
char title[1024]; /* flawfinder: ignore */
|
||||
size_t length;
|
||||
va_list ap;
|
||||
|
||||
/* flawfinder - buffer is zeroed and users of it are bounded. */
|
||||
|
||||
if (NULL == base_argv)
|
||||
return;
|
||||
|
||||
memset(title, 0, sizeof(title));
|
||||
|
||||
va_start(ap, format);
|
||||
(void) vsnprintf(title, sizeof(title) - 1, format, ap); /* flawfinder: ignore */
|
||||
va_end(ap);
|
||||
|
||||
/*
|
||||
* flawfinder - the format is explicitly caller-supplied. Callers
|
||||
* of this function are all passing fixed format strings and not
|
||||
* user-supplied formats.
|
||||
*/
|
||||
|
||||
length = strlen(title); /* flawfinder: ignore */
|
||||
/* flawfinder - we left a byte at the end to force null-termination. */
|
||||
|
||||
if (length > space_available - 2)
|
||||
length = space_available - 2;
|
||||
|
||||
(void) pv_snprintf(base_argv[0], space_available, "%s -- %s", PACKAGE_NAME, title);
|
||||
if (space_available > length)
|
||||
memset(base_argv[0] + length, 0, space_available - length);
|
||||
}
|
||||
|
||||
#endif
|
||||
+116
-107
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Signal handling functions.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef HAVE_IPC
|
||||
void pv_crs_needreinit(pvstate_t);
|
||||
void pv_crs_needreinit(pvcursorstate_t);
|
||||
#endif
|
||||
|
||||
/*@null@*/ static pvstate_t pv_sig_state = NULL;
|
||||
@@ -27,8 +27,13 @@ void pv_crs_needreinit(pvstate_t);
|
||||
|
||||
/*
|
||||
* Ensure that terminal attribute TOSTOP is set. If we have to set it,
|
||||
* record that fact by setting the state boolean "pv_tty_tostop_added" to
|
||||
* true, so that in pv_sig_fini() we can turn it back off again.
|
||||
* record that fact by setting "clear_tty_tostop_on_exit" to 1, so that in
|
||||
* pv_sig_fini() we can turn it back off again.
|
||||
*
|
||||
* In "-c" mode with IPC, then if we have to set TOSTOP, we also tell the
|
||||
* other PV instances about it via the shared "tty_tostop_added" flag, so
|
||||
* those instances can set their own on-exit flag, meaning that if any of
|
||||
* the PV instances set it, the last one to exit will clear it.
|
||||
*/
|
||||
static void pv_sig_ensure_tty_tostop()
|
||||
{
|
||||
@@ -37,71 +42,72 @@ static void pv_sig_ensure_tty_tostop()
|
||||
if (NULL == pv_sig_state)
|
||||
return;
|
||||
|
||||
/* Can't look at terminal flags if backgrounded. */
|
||||
if (1 == pv_sig_state->flags.suspend_stderr)
|
||||
return;
|
||||
|
||||
if (0 != tcgetattr(STDERR_FILENO, &terminal_attributes)) {
|
||||
debug("%s: %s", "failed to read terminal attributes", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Can't set terminal flags if backgrounded. */
|
||||
if (1 == pv_sig_state->flags.suspend_stderr)
|
||||
return;
|
||||
|
||||
if (0 == (terminal_attributes.c_lflag & TOSTOP)) {
|
||||
terminal_attributes.c_lflag |= TOSTOP;
|
||||
if (0 == tcsetattr(STDERR_FILENO, TCSANOW, &terminal_attributes)) {
|
||||
pv_sig_state->signal.pv_tty_tostop_added = true;
|
||||
pv_sig_state->flags.clear_tty_tostop_on_exit = 1;
|
||||
debug("%s", "set terminal TOSTOP attribute");
|
||||
#if HAVE_IPC
|
||||
/*
|
||||
* In "-c" mode with IPC, make all "pv -c" instances
|
||||
* aware that we set TOSTOP, so the last one can
|
||||
* clear it on exit.
|
||||
*/
|
||||
if (pv_sig_state->control.cursor && (NULL != pv_sig_state->cursor.shared)
|
||||
&& (!pv_sig_state->cursor.noipc)) {
|
||||
pv_sig_state->cursor.shared->tty_tostop_added = true;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
debug("%s: %s", "failed to set terminal TOSTOP attribute", strerror(errno));
|
||||
}
|
||||
#if HAVE_IPC
|
||||
/*
|
||||
* In "-c" mode with IPC, make all "pv -c" instances aware
|
||||
* that we set TOSTOP, so the last one can clear it on exit.
|
||||
*/
|
||||
if (pv_sig_state->control.cursor && (NULL != pv_sig_state->cursor.shared)
|
||||
&& (!pv_sig_state->cursor.noipc)) {
|
||||
pv_sig_state->cursor.shared->tty_tostop_added = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle SIGTTOU (tty output for background process) by redirecting stderr
|
||||
* to /dev/null, so that we can be stopped and backgrounded without messing
|
||||
* up the terminal. We store the old stderr file descriptor so that on a
|
||||
* subsequent SIGCONT we can try writing to the terminal again, in case we
|
||||
* get backgrounded and later get foregrounded again.
|
||||
* Handle SIGTTOU (tty output for background process) by setting the flag to
|
||||
* suspend writes to stderr, so that we can be stopped and backgrounded
|
||||
* without messing up the terminal. On a subsequent SIGCONT we will try
|
||||
* writing to the terminal again, in case we get backgrounded and later get
|
||||
* foregrounded again.
|
||||
*
|
||||
* When we get backgrounded and cause a SIGTTOU, the rest of the pipeline
|
||||
* gets stopped too, so transfers involving pipelines need us to send a
|
||||
* SIGCONT to the rest of the process group here, otherwise backgrounding
|
||||
* stops transfers involving pipes.
|
||||
*/
|
||||
static void pv_sig_ttou( /*@unused@ */ __attribute__((unused))
|
||||
int s)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (NULL == pv_sig_state)
|
||||
return;
|
||||
|
||||
fd = open("/dev/null", O_RDWR); /* flawfinder: ignore */
|
||||
if (fd < 0) {
|
||||
debug("%s: %s", "failed to open /dev/null", strerror(errno));
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* flawfinder rationale: not checking for symlinks because this is
|
||||
* explicitly a device file under /dev so we assume it is safe to
|
||||
* open.
|
||||
*
|
||||
* TODO: look at just preventing stderr output instead of writing to
|
||||
* stderr while backgrounded.
|
||||
*/
|
||||
|
||||
if (-1 == pv_sig_state->signal.old_stderr)
|
||||
pv_sig_state->signal.old_stderr = dup(STDERR_FILENO);
|
||||
|
||||
if (dup2(fd, STDERR_FILENO) < 0) {
|
||||
debug("%s: %s", "failed to replace stderr", strerror(errno));
|
||||
}
|
||||
|
||||
if (0 != close(fd)) {
|
||||
debug("%s: %s", "failed to close /dev/null", strerror(errno));
|
||||
if (1 != pv_sig_state->flags.suspend_stderr) {
|
||||
debug("%s", "SIGTTOU - suspending stderr");
|
||||
pv_sig_state->flags.suspend_stderr = 1;
|
||||
/* Also tell the SIGCONT handler to do nothing next time. */
|
||||
pv_sig_state->flags.skip_next_sigcont++;
|
||||
/* Raise an immediate SIGCONT to bring the rest of the pipeline back up. */
|
||||
/*@-unrecog@ *//* splint doesn't know about killpg() */
|
||||
if (0 != killpg(getpgrp(), SIGCONT)) {
|
||||
debug("%s: %s", "killpg", strerror(errno));
|
||||
}
|
||||
/*@+unrecog@ */
|
||||
} else {
|
||||
debug("%s", "SIGTTOU - but stderr was already suspended");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +131,7 @@ static void pv_sig_tstp( /*@unused@ */ __attribute__((unused))
|
||||
/*
|
||||
* Handle SIGCONT (continue if stopped) by adding the elapsed time since the
|
||||
* last SIGTSTP to the elapsed time offset, and by trying to write to the
|
||||
* terminal again (by replacing the /dev/null stderr with the old stderr).
|
||||
* terminal again.
|
||||
*/
|
||||
static void pv_sig_cont( /*@unused@ */ __attribute__((unused))
|
||||
int s)
|
||||
@@ -136,7 +142,19 @@ static void pv_sig_cont( /*@unused@ */ __attribute__((unused))
|
||||
if (NULL == pv_sig_state)
|
||||
return;
|
||||
|
||||
pv_sig_state->flag.terminal_resized = 1;
|
||||
if (pv_sig_state->flags.skip_next_sigcont > 0) {
|
||||
debug("%s: %d", "SIGCONT received but ignored - current value of skip_next_sigcont",
|
||||
pv_sig_state->flags.skip_next_sigcont);
|
||||
pv_sig_state->flags.skip_next_sigcont--;
|
||||
return;
|
||||
} else if (pv_sig_state->flags.skip_next_sigcont < 0) {
|
||||
pv_sig_state->flags.skip_next_sigcont = 0;
|
||||
debug("%s", "skip_next_sigcont underrun cleared");
|
||||
}
|
||||
|
||||
debug("%s: %d", "SIGCONT received - current value of suspend_stderr", pv_sig_state->flags.suspend_stderr);
|
||||
|
||||
pv_sig_state->flags.terminal_resized = 1;
|
||||
|
||||
/*
|
||||
* We can only make the time adjustments if this SIGCONT followed a
|
||||
@@ -161,23 +179,24 @@ static void pv_sig_cont( /*@unused@ */ __attribute__((unused))
|
||||
}
|
||||
|
||||
/*
|
||||
* Restore the old stderr, if we had replaced it.
|
||||
* Try resuming our use of stderr, if we had suspended it, but only
|
||||
* if we're now in the foreground.
|
||||
*/
|
||||
if (pv_sig_state->signal.old_stderr != -1) {
|
||||
if (dup2(pv_sig_state->signal.old_stderr, STDERR_FILENO) < 0) {
|
||||
debug("%s: %s", "failed to restore old stderr", strerror(errno));
|
||||
if (1 == pv_sig_state->flags.suspend_stderr) {
|
||||
if (pv_in_foreground()) {
|
||||
debug("%s", "SIGCONT - resuming stderr");
|
||||
pv_sig_state->flags.suspend_stderr = 0;
|
||||
} else {
|
||||
debug("%s", "SIGCONT but still in background - not resuming stderr");
|
||||
}
|
||||
if (0 != close(pv_sig_state->signal.old_stderr)) {
|
||||
debug("%s: %s", "failed to close duplicate old stderr", strerror(errno));
|
||||
}
|
||||
pv_sig_state->signal.old_stderr = -1;
|
||||
}
|
||||
|
||||
pv_sig_ensure_tty_tostop();
|
||||
|
||||
if (0 == pv_sig_state->flags.suspend_stderr) {
|
||||
pv_sig_ensure_tty_tostop();
|
||||
#ifdef HAVE_IPC
|
||||
pv_crs_needreinit(pv_sig_state);
|
||||
pv_crs_needreinit(&(pv_sig_state->cursor));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -190,7 +209,7 @@ static void pv_sig_winch( /*@unused@ */ __attribute__((unused))
|
||||
{
|
||||
if (NULL == pv_sig_state)
|
||||
return;
|
||||
pv_sig_state->flag.terminal_resized = 1;
|
||||
pv_sig_state->flags.terminal_resized = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -203,11 +222,11 @@ static void pv_sig_term( /*@unused@ */ __attribute__((unused))
|
||||
{
|
||||
if (NULL == pv_sig_state)
|
||||
return;
|
||||
pv_sig_state->flag.trigger_exit = 1;
|
||||
pv_sig_state->flags.trigger_exit = 1;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SA_SIGINFO
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
/*
|
||||
* Handle a SIGUSR2 by setting a flag to say we received it, after recording
|
||||
* the sending PID.
|
||||
@@ -220,8 +239,8 @@ static void pv_sig_usr2( /*@unused@ */ __attribute__((unused))
|
||||
return;
|
||||
if (NULL == info)
|
||||
return;
|
||||
pv_sig_state->signal.rxusr2 = 1;
|
||||
pv_sig_state->signal.sender = info->si_pid;
|
||||
pv_sig_state->signal.rxusr2 = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -272,13 +291,13 @@ void pv_sig_init(pvstate_t state)
|
||||
/*
|
||||
* Note that wherever we use a "struct sigaction", we declare it
|
||||
* static and explicitly zero it before use, because it may contain
|
||||
* deeper structures (e.g. "sigset_t") which trigger splint
|
||||
* deeper structures (e.g. "sigset_t") which trigger splint
|
||||
* warnings about potential memory leaks.
|
||||
*/
|
||||
|
||||
pv_sig_state = state;
|
||||
|
||||
pv_sig_state->signal.old_stderr = -1;
|
||||
pv_sig_state->flags.suspend_stderr = 0;
|
||||
pv_elapsedtime_zero(&(pv_sig_state->signal.tstp_time));
|
||||
pv_elapsedtime_zero(&(pv_sig_state->signal.toffset));
|
||||
|
||||
@@ -289,8 +308,8 @@ void pv_sig_init(pvstate_t state)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Ignore SIGPIPE, so we don't die if stdout is a pipe and the other
|
||||
* end closes unexpectedly.
|
||||
* Ignore SIGPIPE, so we don't die if the output is a pipe and the
|
||||
* other end closes unexpectedly.
|
||||
*/
|
||||
sa.sa_handler = SIG_IGN;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
@@ -301,6 +320,7 @@ void pv_sig_init(pvstate_t state)
|
||||
* Handle SIGTTOU by continuing with output switched off, so that we
|
||||
* can be stopped and backgrounded without messing up the terminal.
|
||||
*/
|
||||
pv_sig_state->flags.skip_next_sigcont = 0;
|
||||
sa.sa_handler = pv_sig_ttou;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
@@ -355,7 +375,7 @@ void pv_sig_init(pvstate_t state)
|
||||
sa.sa_flags = 0;
|
||||
(void) sigaction(SIGTERM, &sa, &(pv_sig_state->signal.old_sigterm));
|
||||
|
||||
#ifdef SA_SIGINFO
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
/*
|
||||
* Handle SIGUSR2 by setting a flag to say the signal has been
|
||||
* received, and storing the sending process's PID.
|
||||
@@ -411,12 +431,12 @@ void pv_sig_fini( /*@unused@ */ __attribute__((unused)) pvstate_t state)
|
||||
(void) sigaction(SIGINT, &(pv_sig_state->signal.old_sigint), NULL);
|
||||
(void) sigaction(SIGHUP, &(pv_sig_state->signal.old_sighup), NULL);
|
||||
(void) sigaction(SIGTERM, &(pv_sig_state->signal.old_sigterm), NULL);
|
||||
#ifdef SA_SIGINFO
|
||||
#ifdef PV_REMOTE_CONTROL
|
||||
(void) sigaction(SIGUSR2, &(pv_sig_state->signal.old_sigusr2), NULL);
|
||||
#endif
|
||||
(void) sigaction(SIGALRM, &(pv_sig_state->signal.old_sigalrm), NULL);
|
||||
|
||||
need_to_clear_tostop = pv_sig_state->signal.pv_tty_tostop_added;
|
||||
need_to_clear_tostop = (1 == pv_sig_state->flags.clear_tty_tostop_on_exit) ? true : false;
|
||||
|
||||
if (pv_sig_state->control.cursor) {
|
||||
#ifdef HAVE_IPC
|
||||
@@ -457,7 +477,7 @@ void pv_sig_fini( /*@unused@ */ __attribute__((unused)) pvstate_t state)
|
||||
}
|
||||
}
|
||||
|
||||
pv_sig_state->signal.pv_tty_tostop_added = false;
|
||||
pv_sig_state->flags.clear_tty_tostop_on_exit = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,19 +487,17 @@ void pv_sig_fini( /*@unused@ */ __attribute__((unused)) pvstate_t state)
|
||||
*/
|
||||
void pv_sig_nopause(void)
|
||||
{
|
||||
static struct sigaction sa;
|
||||
sigset_t signal_set, signal_oldset;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
debug("%s", "blocking SIGTSTP, SIGCONT");
|
||||
|
||||
sa.sa_handler = SIG_IGN;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
(void) sigaction(SIGTSTP, &sa, NULL);
|
||||
(void) sigemptyset(&signal_set);
|
||||
(void) sigaddset(&signal_set, SIGTSTP);
|
||||
(void) sigaddset(&signal_set, SIGCONT);
|
||||
|
||||
sa.sa_handler = SIG_DFL;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
(void) sigaction(SIGCONT, &sa, NULL);
|
||||
if (0 != sigprocmask(SIG_BLOCK, &signal_set, &signal_oldset)) {
|
||||
debug("%s: %s", "failed to set signal mask", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -488,27 +506,24 @@ void pv_sig_nopause(void)
|
||||
*/
|
||||
void pv_sig_allowpause(void)
|
||||
{
|
||||
static struct sigaction sa;
|
||||
sigset_t signal_set, signal_oldset;
|
||||
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
debug("%s", "unblocking SIGTSTP, SIGCONT");
|
||||
|
||||
sa.sa_handler = pv_sig_tstp;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
(void) sigaction(SIGTSTP, &sa, NULL);
|
||||
(void) sigemptyset(&signal_set);
|
||||
(void) sigaddset(&signal_set, SIGTSTP);
|
||||
(void) sigaddset(&signal_set, SIGCONT);
|
||||
|
||||
sa.sa_handler = pv_sig_cont;
|
||||
(void) sigemptyset(&(sa.sa_mask));
|
||||
sa.sa_flags = 0;
|
||||
(void) sigaction(SIGCONT, &sa, NULL);
|
||||
if (0 != sigprocmask(SIG_UNBLOCK, &signal_set, &signal_oldset)) {
|
||||
debug("%s: %s", "failed to set signal mask", strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* If we have redirected stderr to /dev/null, check every second or so to
|
||||
* see whether we can write to the terminal again - this is so that if we
|
||||
* get backgrounded, then foregrounded again, we start writing to the
|
||||
* terminal again.
|
||||
* If we have suspended stderr, check every second or so to see whether we
|
||||
* can write to the terminal again - this is so that if we get backgrounded,
|
||||
* then foregrounded again, we start writing to the terminal again.
|
||||
*/
|
||||
void pv_sig_checkbg(void)
|
||||
{
|
||||
@@ -522,23 +537,17 @@ void pv_sig_checkbg(void)
|
||||
|
||||
next_check = time(NULL) + 1;
|
||||
|
||||
if (-1 == pv_sig_state->signal.old_stderr)
|
||||
if (0 == pv_sig_state->flags.suspend_stderr)
|
||||
return;
|
||||
|
||||
if (dup2(pv_sig_state->signal.old_stderr, STDERR_FILENO) < 0) {
|
||||
debug("%s: %s", "failed to restore old stderr", strerror(errno));
|
||||
}
|
||||
if (!pv_in_foreground())
|
||||
return;
|
||||
|
||||
if (0 != close(pv_sig_state->signal.old_stderr)) {
|
||||
debug("%s: %s", "failed to close duplicate old stderr", strerror(errno));
|
||||
}
|
||||
|
||||
pv_sig_state->signal.old_stderr = -1;
|
||||
debug("%s: %s", "pv_sig_checkbg", "attempting to resume stderr");
|
||||
pv_sig_state->flags.suspend_stderr = 0;
|
||||
|
||||
pv_sig_ensure_tty_tostop();
|
||||
#ifdef HAVE_IPC
|
||||
pv_crs_needreinit(pv_sig_state);
|
||||
pv_crs_needreinit(&(pv_sig_state->cursor));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+496
-97
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* State management functions.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -10,42 +10,177 @@
|
||||
#include "pv.h"
|
||||
#include "pv-internal.h"
|
||||
|
||||
/* We do not set this because it breaks "dd" - see below. */
|
||||
/* #undef MAKE_OUTPUT_NONBLOCKING */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
||||
/* alloc / realloc history buffer */
|
||||
static void pv_alloc_history(pvstate_t state)
|
||||
/*
|
||||
* Allocate or reallocate the history buffer for calculating average
|
||||
* transfer rate.
|
||||
*/
|
||||
static void pv_alloc_calc_history(pvtransfercalc_t calc)
|
||||
{
|
||||
if (NULL != state->display.history)
|
||||
free(state->display.history);
|
||||
state->display.history = NULL;
|
||||
if (NULL != calc->history)
|
||||
free(calc->history);
|
||||
calc->history = NULL;
|
||||
|
||||
state->display.history = calloc((size_t) (state->display.history_len), sizeof(state->display.history[0]));
|
||||
if (NULL == state->display.history) {
|
||||
calc->history = calloc((size_t) (calc->history_len), sizeof(calc->history[0]));
|
||||
if (NULL == calc->history) {
|
||||
/*@-mustfreefresh@ */
|
||||
/*
|
||||
* splint note: the gettext calls made by _() cause memory
|
||||
* leak warnings, but in this case it's unavoidable, and
|
||||
* mitigated by the fact we only translate each string once.
|
||||
*/
|
||||
fprintf(stderr, "%s: %s: %s\n", state->status.program_name,
|
||||
_("history structure allocation failed"), strerror(errno));
|
||||
pv_error("%s: %s", _("history structure allocation failed"), strerror(errno));
|
||||
/*@+mustfreefresh@ */
|
||||
return;
|
||||
}
|
||||
|
||||
state->display.history_first = state->display.history_last = 0;
|
||||
state->display.history[0].elapsed_sec = 0.0; /* to be safe, memset() not recommended for doubles */
|
||||
calc->history_first = calc->history_last = 0;
|
||||
calc->history[0].elapsed_sec = 0.0; /* to be safe, memset() not recommended for doubles */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the "calc" state sub-structure's history length appropriately for the
|
||||
* given average rate window setting, allocate an appropriate history, and
|
||||
* return the appropriate history interval to use.
|
||||
*/
|
||||
unsigned int pv_update_calc_average_rate_window(pvtransfercalc_t calc, unsigned int val)
|
||||
{
|
||||
unsigned int history_interval;
|
||||
|
||||
if (val < 1)
|
||||
val = 1;
|
||||
|
||||
if (val >= 20) {
|
||||
calc->history_len = (size_t) (val / 5 + 1);
|
||||
history_interval = 5;
|
||||
} else {
|
||||
calc->history_len = (size_t) (val + 1);
|
||||
history_interval = 1;
|
||||
}
|
||||
|
||||
pv_alloc_calc_history(calc);
|
||||
|
||||
return history_interval;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clear the "calc" part of a state structure.
|
||||
*/
|
||||
void pv_reset_calc(pvtransfercalc_t calc)
|
||||
{
|
||||
if (NULL == calc)
|
||||
return;
|
||||
/*
|
||||
* Explicitly set important floating point values to 0, as memset()
|
||||
* is not recommended for this.
|
||||
*/
|
||||
calc->transfer_rate = 0.0;
|
||||
calc->average_rate = 0.0;
|
||||
calc->prev_elapsed_sec = 0.0;
|
||||
calc->prev_rate = 0.0;
|
||||
calc->prev_trans = 0.0;
|
||||
calc->current_avg_rate = 0.0;
|
||||
calc->rate_min = 0.0;
|
||||
calc->rate_max = 0.0;
|
||||
calc->rate_sum = 0.0;
|
||||
calc->ratesquared_sum = 0.0;
|
||||
calc->measurements_taken = 0;
|
||||
calc->prev_transferred = 0;
|
||||
calc->percentage = 0.0;
|
||||
calc->history_first = calc->history_last = 0;
|
||||
if (NULL != calc->history) {
|
||||
calc->history[0].elapsed_sec = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clear the "transfer" part of a state structure.
|
||||
*/
|
||||
void pv_reset_transfer(pvtransferstate_t transfer)
|
||||
{
|
||||
if (NULL == transfer)
|
||||
return;
|
||||
|
||||
transfer->elapsed_seconds = 0.0;
|
||||
transfer->read_position = 0;
|
||||
transfer->write_position = 0;
|
||||
transfer->to_write = 0;
|
||||
transfer->written = 0;
|
||||
transfer->total_bytes_read = 0;
|
||||
transfer->total_written = 0;
|
||||
transfer->written_but_not_consumed = 0;
|
||||
transfer->read_errors_in_a_row = 0;
|
||||
transfer->last_read_skip_fd = 0;
|
||||
#ifdef HAVE_SPLICE
|
||||
transfer->splice_failed_fd = -1;
|
||||
#endif /* HAVE_SPLICE */
|
||||
|
||||
transfer->line_positions_length = 0;
|
||||
transfer->line_positions_head = 0;
|
||||
transfer->last_output_position = 0;
|
||||
transfer->output_not_seekable = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Reset the calculated parts of the "flags" state structure.
|
||||
*/
|
||||
void pv_reset_flags(pvtransientflags_t flags)
|
||||
{
|
||||
if (NULL == flags)
|
||||
return;
|
||||
flags->reparse_display = 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Reset the calculated parts of a "display" state structure.
|
||||
*/
|
||||
void pv_reset_display(pvdisplay_t display)
|
||||
{
|
||||
if (NULL == display)
|
||||
return;
|
||||
display->initial_offset = 0;
|
||||
display->output_produced = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Clear the calculated parts of a state structure.
|
||||
*/
|
||||
void pv_state_reset(pvstate_t state)
|
||||
{
|
||||
if (NULL == state)
|
||||
return;
|
||||
|
||||
pv_reset_flags(&(state->flags));
|
||||
state->status.current_input_file = -1;
|
||||
|
||||
pv_reset_display(&(state->display));
|
||||
pv_reset_display(&(state->extra_display));
|
||||
|
||||
pv_reset_calc(&(state->calc));
|
||||
pv_reset_transfer(&(state->transfer));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Create a new state structure, and return it, or 0 (NULL) on error.
|
||||
*/
|
||||
pvstate_t pv_state_alloc(const char *program_name)
|
||||
pvstate_t pv_state_alloc(void)
|
||||
{
|
||||
pvstate_t state;
|
||||
|
||||
@@ -54,31 +189,15 @@ pvstate_t pv_state_alloc(const char *program_name)
|
||||
return NULL;
|
||||
memset(state, 0, sizeof(*state));
|
||||
|
||||
/* splint 3.1.2 thinks this is required for some reason. */
|
||||
if (NULL != state->status.program_name) {
|
||||
free(state->status.program_name);
|
||||
}
|
||||
|
||||
state->status.program_name = pv_strdup(program_name);
|
||||
if (NULL == state->status.program_name) {
|
||||
free(state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
state->control.watch_pid = 0;
|
||||
state->control.watch_fd = -1;
|
||||
state->watchfd.count = 0;
|
||||
state->control.output_fd = -1;
|
||||
#ifdef HAVE_IPC
|
||||
state->cursor.shmid = -1;
|
||||
state->cursor.pvcount = 1;
|
||||
#endif /* HAVE_IPC */
|
||||
state->cursor.lock_fd = -1;
|
||||
|
||||
state->flag.reparse_display = 1;
|
||||
state->status.current_input_file = -1;
|
||||
#ifdef HAVE_SPLICE
|
||||
state->transfer.splice_failed_fd = -1;
|
||||
#endif /* HAVE_SPLICE */
|
||||
state->display.display_visible = false;
|
||||
pv_state_reset(state);
|
||||
|
||||
/*
|
||||
* Get the current working directory, if possible, as a base for
|
||||
@@ -98,6 +217,78 @@ pvstate_t pv_state_alloc(const char *program_name)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free dynamic contents of a display structure.
|
||||
*/
|
||||
void pv_freecontents_display(pvdisplay_t display)
|
||||
{
|
||||
if (NULL != display->display_buffer)
|
||||
free(display->display_buffer);
|
||||
display->display_buffer = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free dynamic contents of a transfer state structure.
|
||||
*/
|
||||
void pv_freecontents_transfer(pvtransferstate_t transfer)
|
||||
{
|
||||
/*@-keeptrans@ */
|
||||
if (NULL != transfer->transfer_buffer)
|
||||
free(transfer->transfer_buffer);
|
||||
transfer->transfer_buffer = NULL;
|
||||
/*@+keeptrans@ */
|
||||
/* splint - explicitly freeing this structure, so free() here is OK. */
|
||||
|
||||
if (NULL != transfer->line_positions)
|
||||
free(transfer->line_positions);
|
||||
transfer->line_positions = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free dynamic contents of a calculated transfer state structure.
|
||||
*/
|
||||
void pv_freecontents_calc(pvtransfercalc_t calc)
|
||||
{
|
||||
if (NULL != calc->history)
|
||||
free(calc->history);
|
||||
calc->history = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Truncate the output file descriptor to its current position, if it's a
|
||||
* valid fd, we're in sparse output mode, and no lseek() failed.
|
||||
*/
|
||||
static void pv_truncate_output(pvstate_t state)
|
||||
{
|
||||
off_t current_offset;
|
||||
|
||||
if (!state->control.sparse_output)
|
||||
return;
|
||||
if (state->transfer.output_not_seekable)
|
||||
return;
|
||||
if (state->control.output_fd < 0)
|
||||
return;
|
||||
|
||||
current_offset = (off_t) lseek(state->control.output_fd, (off_t) 0, SEEK_CUR);
|
||||
if (current_offset == (off_t) - 1)
|
||||
return;
|
||||
|
||||
debug("%s: %ld", "truncating to current offset", (long) current_offset);
|
||||
|
||||
/*@+longintegral@ */
|
||||
/*
|
||||
* splint has trouble with off_t / __off_t.
|
||||
*/
|
||||
if (0 != ftruncate(state->control.output_fd, current_offset)) {
|
||||
debug("%s: %s", "output ftruncate() failed", strerror(errno));
|
||||
}
|
||||
/*@-longintegral@ */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free a state structure, after which it can no longer be used.
|
||||
*/
|
||||
@@ -106,34 +297,53 @@ void pv_state_free(pvstate_t state)
|
||||
if (0 == state)
|
||||
return;
|
||||
|
||||
if (NULL != state->status.program_name)
|
||||
free(state->status.program_name);
|
||||
state->status.program_name = NULL;
|
||||
/*
|
||||
* Close the output file first, so we can report any errors while we
|
||||
* still know the program name and output filename.
|
||||
*/
|
||||
if (state->control.output_fd >= 0) {
|
||||
pv_truncate_output(state);
|
||||
if (STDOUT_FILENO != state->control.output_fd) {
|
||||
if (close(state->control.output_fd) < 0) {
|
||||
pv_error("%s: %s",
|
||||
NULL == state->control.output_name ? "(null)" : state->control.output_name,
|
||||
strerror(errno));
|
||||
}
|
||||
}
|
||||
state->control.output_fd = -1;
|
||||
}
|
||||
|
||||
if (NULL != state->display.display_buffer)
|
||||
free(state->display.display_buffer);
|
||||
state->display.display_buffer = NULL;
|
||||
if (NULL != state->control.output_name) {
|
||||
free(state->control.output_name);
|
||||
state->control.output_name = NULL;
|
||||
}
|
||||
|
||||
pv_freecontents_display(&(state->display));
|
||||
pv_freecontents_display(&(state->extra_display));
|
||||
|
||||
if (NULL != state->control.name) {
|
||||
free(state->control.name);
|
||||
state->control.name = NULL;
|
||||
}
|
||||
|
||||
if (NULL != state->control.default_bar_style) {
|
||||
free(state->control.default_bar_style);
|
||||
state->control.default_bar_style = NULL;
|
||||
}
|
||||
|
||||
if (NULL != state->control.format_string) {
|
||||
free(state->control.format_string);
|
||||
state->control.format_string = NULL;
|
||||
}
|
||||
|
||||
/*@-keeptrans@ */
|
||||
if (NULL != state->transfer.transfer_buffer)
|
||||
free(state->transfer.transfer_buffer);
|
||||
state->transfer.transfer_buffer = NULL;
|
||||
/*@+keeptrans@ */
|
||||
/* splint - explicitly freeing this structure, so free() here is OK. */
|
||||
if (NULL != state->control.extra_format_string) {
|
||||
free(state->control.extra_format_string);
|
||||
state->control.extra_format_string = NULL;
|
||||
}
|
||||
|
||||
if (NULL != state->display.history)
|
||||
free(state->display.history);
|
||||
state->display.history = NULL;
|
||||
pv_freecontents_transfer(&(state->transfer));
|
||||
|
||||
pv_freecontents_calc(&(state->calc));
|
||||
|
||||
if (NULL != state->files.filename) {
|
||||
unsigned int file_idx;
|
||||
@@ -147,6 +357,15 @@ void pv_state_free(pvstate_t state)
|
||||
state->files.filename = NULL;
|
||||
}
|
||||
|
||||
if (NULL != state->watchfd.pid) {
|
||||
free(state->watchfd.pid);
|
||||
state->watchfd.pid = NULL;
|
||||
}
|
||||
if (NULL != state->watchfd.fd) {
|
||||
free(state->watchfd.fd);
|
||||
state->watchfd.fd = NULL;
|
||||
}
|
||||
|
||||
free(state);
|
||||
|
||||
return;
|
||||
@@ -166,36 +385,60 @@ void pv_state_set_format(pvstate_t state, bool progress, bool timer, bool eta, b
|
||||
}
|
||||
|
||||
state->control.default_format[0] = '\0';
|
||||
PV_ADDFORMAT(name, "%N");
|
||||
PV_ADDFORMAT(bytes, "%b");
|
||||
PV_ADDFORMAT(bufpercent, "%T");
|
||||
PV_ADDFORMAT(timer, "%t");
|
||||
PV_ADDFORMAT(rate, "%r");
|
||||
PV_ADDFORMAT(average_rate, "%a");
|
||||
PV_ADDFORMAT(progress, "%p");
|
||||
PV_ADDFORMAT(eta, "%e");
|
||||
PV_ADDFORMAT(fineta, "%I");
|
||||
if (lastwritten > 0) {
|
||||
char buf[16]; /* flawfinder: ignore */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
(void) pv_snprintf(buf, sizeof(buf), "%%%uA", (unsigned int) lastwritten);
|
||||
PV_ADDFORMAT(lastwritten > 0, buf);
|
||||
|
||||
if (false == state->control.numeric) {
|
||||
/* Standard progress display mode (without "--numeric"). */
|
||||
|
||||
/*
|
||||
* flawfinder rationale: large enough for string, zeroed
|
||||
* before use, only written to by pv_snprintf() with the
|
||||
* right buffer length.
|
||||
* Add the format strings for the enabled options in a
|
||||
* standard order.
|
||||
*/
|
||||
PV_ADDFORMAT(name, "%N");
|
||||
PV_ADDFORMAT(bytes, "%b");
|
||||
PV_ADDFORMAT(bufpercent, "%T");
|
||||
PV_ADDFORMAT(timer, "%t");
|
||||
PV_ADDFORMAT(rate, "%r");
|
||||
PV_ADDFORMAT(average_rate, "%a");
|
||||
PV_ADDFORMAT(progress, "%p");
|
||||
PV_ADDFORMAT(eta, "%e");
|
||||
PV_ADDFORMAT(fineta, "%I");
|
||||
|
||||
if (lastwritten > 0) {
|
||||
char buf[16]; /* flawfinder: ignore */
|
||||
memset(buf, 0, sizeof(buf));
|
||||
(void) pv_snprintf(buf, sizeof(buf), "%%%uA", (unsigned int) lastwritten);
|
||||
PV_ADDFORMAT(lastwritten > 0, buf);
|
||||
/*
|
||||
* flawfinder rationale: large enough for string,
|
||||
* zeroed before use, only written to by
|
||||
* pv_snprintf() with the right buffer length.
|
||||
*/
|
||||
}
|
||||
|
||||
} else {
|
||||
/* Numeric mode has different behaviour. */
|
||||
|
||||
PV_ADDFORMAT(timer, "%t");
|
||||
PV_ADDFORMAT(bytes, "%b");
|
||||
PV_ADDFORMAT(rate, "%r");
|
||||
PV_ADDFORMAT(!(bytes || rate), "%{progress-amount-only}");
|
||||
|
||||
}
|
||||
|
||||
debug("%s: [%s]", "default format set", state->control.default_format);
|
||||
|
||||
/* Free any previously set name. */
|
||||
if (NULL != state->control.name) {
|
||||
free(state->control.name);
|
||||
state->control.name = NULL;
|
||||
}
|
||||
|
||||
/* Set a new name if one was given. */
|
||||
if (NULL != name)
|
||||
state->control.name = pv_strdup(name);
|
||||
|
||||
state->flag.reparse_display = 1;
|
||||
/* Tell pv_format() that the format has changed. */
|
||||
state->flags.reparse_display = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,6 +452,11 @@ void pv_state_cursor_set(pvstate_t state, bool val)
|
||||
state->control.cursor = val;
|
||||
}
|
||||
|
||||
void pv_state_show_stats_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.show_stats = val;
|
||||
}
|
||||
|
||||
void pv_state_numeric_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.numeric = val;
|
||||
@@ -224,6 +472,11 @@ void pv_state_delay_start_set(pvstate_t state, double val)
|
||||
state->control.delay_start = val;
|
||||
}
|
||||
|
||||
void pv_state_rate_gauge_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.rate_gauge = val;
|
||||
}
|
||||
|
||||
void pv_state_linemode_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.linemode = val;
|
||||
@@ -275,6 +528,11 @@ void pv_state_direct_io_set(pvstate_t state, bool val)
|
||||
state->control.direct_io_changed = true;
|
||||
}
|
||||
|
||||
void pv_state_sparse_output_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.sparse_output = val;
|
||||
}
|
||||
|
||||
void pv_state_discard_input_set(pvstate_t state, bool val)
|
||||
{
|
||||
state->control.discard_input = val;
|
||||
@@ -307,7 +565,9 @@ void pv_state_interval_set(pvstate_t state, double val)
|
||||
|
||||
void pv_state_width_set(pvstate_t state, unsigned int val, bool was_set_manually)
|
||||
{
|
||||
state->control.width = val;
|
||||
if (val > PVDISPLAY_WIDTH_MAX)
|
||||
val = PVDISPLAY_WIDTH_MAX;
|
||||
state->control.width = (pvdisplay_width_t) val;
|
||||
state->control.width_set_manually = was_set_manually;
|
||||
}
|
||||
|
||||
@@ -327,6 +587,16 @@ void pv_state_name_set(pvstate_t state, /*@null@ */ const char *val)
|
||||
state->control.name = pv_strdup(val);
|
||||
}
|
||||
|
||||
void pv_state_default_bar_style_set(pvstate_t state, /*@null@ */ const char *val)
|
||||
{
|
||||
if (NULL != state->control.default_bar_style) {
|
||||
free(state->control.default_bar_style);
|
||||
state->control.default_bar_style = NULL;
|
||||
}
|
||||
if (NULL != val)
|
||||
state->control.default_bar_style = pv_strdup(val);
|
||||
}
|
||||
|
||||
void pv_state_format_string_set(pvstate_t state, /*@null@ */ const char *val)
|
||||
{
|
||||
if (NULL != state->control.format_string) {
|
||||
@@ -337,14 +607,100 @@ void pv_state_format_string_set(pvstate_t state, /*@null@ */ const char *val)
|
||||
state->control.format_string = pv_strdup(val);
|
||||
}
|
||||
|
||||
void pv_state_watch_pid_set(pvstate_t state, pid_t val)
|
||||
void pv_state_extra_display_set(pvstate_t state, /*@null@ */ const char *val)
|
||||
{
|
||||
state->control.watch_pid = val;
|
||||
const char *word_start;
|
||||
size_t offset;
|
||||
|
||||
if (NULL != state->control.extra_format_string) {
|
||||
free(state->control.extra_format_string);
|
||||
state->control.extra_format_string = NULL;
|
||||
}
|
||||
|
||||
state->control.extra_displays = 0;
|
||||
if (NULL == val)
|
||||
return;
|
||||
|
||||
word_start = val;
|
||||
while (NULL != word_start && '\0' != word_start[0]) {
|
||||
offset = 0;
|
||||
while ('\0' != word_start[offset] && ',' != word_start[offset] && ':' != word_start[offset])
|
||||
offset++;
|
||||
if (((11 == offset) && (0 == strncmp(word_start, "windowtitle", 11)))
|
||||
|| ((6 == offset) && (0 == strncmp(word_start, "window", 6)))
|
||||
) {
|
||||
debug("%s", "enabling windowtitle");
|
||||
state->control.extra_displays |= PV_DISPLAY_WINDOWTITLE;
|
||||
} else if (((12 == offset) && (0 == strncmp(word_start, "processtitle", 12)))
|
||||
|| ((9 == offset) && (0 == strncmp(word_start, "proctitle", 9)))
|
||||
|| ((7 == offset) && (0 == strncmp(word_start, "process", 7)))
|
||||
|| ((4 == offset) && (0 == strncmp(word_start, "proc", 4)))
|
||||
) {
|
||||
debug("%s", "enabling processtitle");
|
||||
state->control.extra_displays |= PV_DISPLAY_PROCESSTITLE;
|
||||
}
|
||||
switch (word_start[offset]) {
|
||||
case ',':
|
||||
offset++;
|
||||
break;
|
||||
case ':':
|
||||
offset++;
|
||||
debug("%s: [%s]", "setting extra_format_string", word_start + offset);
|
||||
state->control.extra_format_string = pv_strdup(word_start + offset);
|
||||
word_start = NULL;
|
||||
break;
|
||||
default:
|
||||
word_start = NULL;
|
||||
break;
|
||||
}
|
||||
if (NULL != word_start)
|
||||
word_start += offset;
|
||||
}
|
||||
}
|
||||
|
||||
void pv_state_watch_fd_set(pvstate_t state, int val)
|
||||
void pv_state_output_set(pvstate_t state, int fd, const char *name)
|
||||
{
|
||||
state->control.watch_fd = val;
|
||||
/*
|
||||
* Close any previous output file first, so we can report any errors
|
||||
* before we store the new output filename.
|
||||
*/
|
||||
pv_truncate_output(state);
|
||||
if (state->control.output_fd >= 0 && state->control.output_fd != STDOUT_FILENO) {
|
||||
if (close(state->control.output_fd) < 0) {
|
||||
pv_error("%s: %s",
|
||||
NULL == state->control.output_name ? "(null)" : state->control.output_name,
|
||||
strerror(errno));
|
||||
}
|
||||
}
|
||||
if (NULL != state->control.output_name)
|
||||
free(state->control.output_name);
|
||||
state->control.output_fd = fd;
|
||||
state->control.output_name = pv_strdup(name);
|
||||
#ifdef MAKE_OUTPUT_NONBLOCKING
|
||||
/*
|
||||
* Try and make the output use non-blocking I/O.
|
||||
*
|
||||
* Note that this can cause problems with (broken) applications
|
||||
* such as dd when used in a pipeline.
|
||||
*/
|
||||
fcntl(state->control.output_fd, F_SETFL, O_NONBLOCK | fcntl(state->control.output_fd, F_GETFL));
|
||||
#endif /* MAKE_OUTPUT_NONBLOCKING */
|
||||
|
||||
/*
|
||||
* In sparse output mode, if the output is in append mode (>>),
|
||||
* explicitly lseek() to the end of the file. Otherwise, the file
|
||||
* offset is not set until the first write(), which means that if
|
||||
* the input starts with null bytes, when we lseek() past them
|
||||
* relative to the current position, the "current position" is 0
|
||||
* rather than the end of the file, and the file gets truncated on
|
||||
* exit to the wrong size.
|
||||
*/
|
||||
if (state->control.sparse_output && 0 != (fcntl(fd, F_GETFL) & O_APPEND)) {
|
||||
debug("%s", "sparse output mode, and appending - seeking output to the end");
|
||||
if ((off_t) lseek(fd, 0, SEEK_END) == (off_t) - 1) {
|
||||
debug("%s: %s", "lseek failed", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pv_state_average_rate_window_set(pvstate_t state, unsigned int val)
|
||||
@@ -352,16 +708,13 @@ void pv_state_average_rate_window_set(pvstate_t state, unsigned int val)
|
||||
if (val < 1)
|
||||
val = 1;
|
||||
state->control.average_rate_window = val;
|
||||
if (val >= 20) {
|
||||
state->display.history_len = (size_t) (val / 5 + 1);
|
||||
state->display.history_interval = 5;
|
||||
} else {
|
||||
state->display.history_len = (size_t) (val + 1);
|
||||
state->display.history_interval = 1;
|
||||
}
|
||||
pv_alloc_history(state);
|
||||
state->control.history_interval = pv_update_calc_average_rate_window(&(state->calc), val);
|
||||
}
|
||||
|
||||
void pv_state_set_terminal_supports_utf8(pvstate_t state, bool val)
|
||||
{
|
||||
state->status.terminal_supports_utf8 = val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the array of input files.
|
||||
@@ -369,45 +722,91 @@ void pv_state_average_rate_window_set(pvstate_t state, unsigned int val)
|
||||
void pv_state_inputfiles(pvstate_t state, unsigned int input_file_count, const char **input_files)
|
||||
{
|
||||
unsigned int file_idx;
|
||||
/*@only@ */ nullable_string_t *new_array;
|
||||
|
||||
/* Free the old array and its contents, if there was one. */
|
||||
if (NULL != state->files.filename) {
|
||||
for (file_idx = 0; file_idx < state->files.file_count; file_idx++) {
|
||||
/*@-unqualifiedtrans@ */
|
||||
free(state->files.filename[file_idx]);
|
||||
/*@+unqualifiedtrans@ */
|
||||
/*
|
||||
* TODO: find a way to tell splint the array
|
||||
* contents are "only" and "null" as well as the
|
||||
* array itself.
|
||||
*/
|
||||
}
|
||||
free(state->files.filename);
|
||||
state->files.filename = NULL;
|
||||
state->files.file_count = 0;
|
||||
}
|
||||
state->files.filename = calloc((size_t) (input_file_count + 1), sizeof(char *));
|
||||
if (NULL == state->files.filename) {
|
||||
|
||||
/* Allocate an empty new array of the right size. */
|
||||
new_array = calloc((size_t) (input_file_count + 1), sizeof(char *));
|
||||
if (NULL == new_array) {
|
||||
/*@-mustfreefresh@ *//* see similar _() issue above */
|
||||
fprintf(stderr, "%s: %s: %s\n", state->status.program_name, _("file list allocation failed"),
|
||||
strerror(errno));
|
||||
pv_error("%s: %s", _("file list allocation failed"), strerror(errno));
|
||||
/*@+mustfreefresh@ */
|
||||
return;
|
||||
}
|
||||
state->files.filename = new_array;
|
||||
|
||||
/* Populate the new array with copies of the filenames. */
|
||||
for (file_idx = 0; file_idx < input_file_count; file_idx++) {
|
||||
/*@-nullstate@ */
|
||||
state->files.filename[file_idx] = pv_strdup(input_files[file_idx]);
|
||||
if (NULL == state->files.filename[file_idx]) {
|
||||
/*@only@ */ char *new_string;
|
||||
new_string = pv_strdup(input_files[file_idx]);
|
||||
if (NULL == new_string) {
|
||||
/*@-mustfreefresh@ *//* see similar _() issue above */
|
||||
fprintf(stderr, "%s: %s: %s\n", state->status.program_name,
|
||||
_("file list allocation failed"), strerror(errno));
|
||||
pv_error("%s: %s", _("file list allocation failed"), strerror(errno));
|
||||
/*@+mustfreefresh@ */
|
||||
return;
|
||||
}
|
||||
state->files.filename[file_idx] = new_string;
|
||||
}
|
||||
state->files.file_count = input_file_count;
|
||||
}
|
||||
|
||||
/*@+nullstate@*/
|
||||
/* splint: see unqualifiedtrans note by free() above. */
|
||||
/*
|
||||
* Set the arrays of watchfd process IDs and file descriptors.
|
||||
*/
|
||||
void pv_state_watchfds(pvstate_t state, unsigned int watchfd_count, const pid_t * pids, const int *fds)
|
||||
{
|
||||
unsigned int item_idx;
|
||||
/*@only@ */ pid_t *new_pid_array = NULL;
|
||||
/*@only@ */ int *new_fd_array = NULL;
|
||||
|
||||
/* EOF */
|
||||
/* Free the old arrays, if there were any. */
|
||||
if (NULL != state->watchfd.pid) {
|
||||
free(state->watchfd.pid);
|
||||
state->watchfd.pid = NULL;
|
||||
}
|
||||
if (NULL != state->watchfd.fd) {
|
||||
free(state->watchfd.fd);
|
||||
state->watchfd.fd = NULL;
|
||||
}
|
||||
state->watchfd.count = 0;
|
||||
state->watchfd.multiple_pids = false;
|
||||
|
||||
/* Allocate empty new arrays of the right size. */
|
||||
new_pid_array = calloc((size_t) (watchfd_count + 1), sizeof(pid_t));
|
||||
if (NULL == new_pid_array) {
|
||||
/*@-mustfreefresh@ *//* see similar _() issue above */
|
||||
pv_error("%s: %s", _("process list allocation failed"), strerror(errno));
|
||||
/*@+mustfreefresh@ */
|
||||
return;
|
||||
}
|
||||
state->watchfd.pid = new_pid_array;
|
||||
new_fd_array = calloc((size_t) (watchfd_count + 1), sizeof(int));
|
||||
if (NULL == new_fd_array) {
|
||||
/*@-mustfreefresh@ *//* see similar _() issue above */
|
||||
pv_error("%s: %s", _("file descriptor list allocation failed"), strerror(errno));
|
||||
/*@+mustfreefresh@ */
|
||||
return;
|
||||
}
|
||||
state->watchfd.fd = new_fd_array;
|
||||
|
||||
/* Populate the new arrays with the values supplied. */
|
||||
for (item_idx = 0; item_idx < watchfd_count; item_idx++) {
|
||||
state->watchfd.pid[item_idx] = pids[item_idx];
|
||||
state->watchfd.fd[item_idx] = fds[item_idx];
|
||||
if ((item_idx > 0) && (pids[item_idx] != pids[item_idx - 1]))
|
||||
state->watchfd.multiple_pids = true;
|
||||
}
|
||||
state->watchfd.count = watchfd_count;
|
||||
|
||||
debug("%s=%d, %s=%s", "watchfd.count", state->watchfd.count, "multiple_pids",
|
||||
state->watchfd.multiple_pids ? "true" : "false");
|
||||
}
|
||||
|
||||
+138
-4
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions for portably managing strings.
|
||||
*
|
||||
* Copyright 2023-2024 Andrew Wood
|
||||
* Copyright 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -13,6 +13,12 @@
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H)
|
||||
#include <wchar.h>
|
||||
#if defined(HAVE_WCTYPE_H)
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -151,6 +157,7 @@ char *pv_strdup(const char *original)
|
||||
return duplicate;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return a pointer to the last matching character in the buffer, or NULL if
|
||||
* not found.
|
||||
@@ -160,9 +167,9 @@ char *pv_strdup(const char *original)
|
||||
void *pv_memrchr(const void *buffer, int match, size_t length)
|
||||
{
|
||||
#ifdef HAVE_MEMRCHR
|
||||
/*@-unrecog @ *//* splint doesn't know of memrchr() */
|
||||
/*@-unrecog@ *//* splint doesn't know of memrchr() */
|
||||
return memrchr(buffer, match, length);
|
||||
/*@+unrecog @ */
|
||||
/*@+unrecog@ */
|
||||
#else
|
||||
unsigned char *ptr;
|
||||
|
||||
@@ -180,4 +187,131 @@ void *pv_memrchr(const void *buffer, int match, size_t length)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
/*
|
||||
* Return the number of display columns needed to show the
|
||||
* non-null-terminated string "string" whose length in bytes is "bytes".
|
||||
*
|
||||
* Skips ECMA-48 CSI (ESC [ ...) sequences, but any other control characters
|
||||
* are treated as printable.
|
||||
*
|
||||
* To do this, we convert it to a wide character string, and use the wide
|
||||
* character display width function "wcswidth()" on it.
|
||||
*
|
||||
* If NLS is disabled, or the string cannot be converted, this just returns
|
||||
* the value of "bytes".
|
||||
*
|
||||
* Note that this function uses internal buffers if the string is short
|
||||
* enough, otherwise it has to call malloc() and free(), so it becomes less
|
||||
* efficient with larger strings.
|
||||
*/
|
||||
size_t pv_strwidth(const char *string, size_t bytes)
|
||||
{
|
||||
char *allocated_raw = NULL;
|
||||
static char internal_raw[256]; /* flawfinder: ignore - bounded */
|
||||
char *raw_string = NULL;
|
||||
size_t read_pos, write_pos;
|
||||
size_t raw_bytes, width;
|
||||
#if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H)
|
||||
size_t wide_char_count;
|
||||
size_t wide_string_buffer_size;
|
||||
wchar_t *allocated_wide = NULL;
|
||||
static wchar_t internal_wide[256]; /* flawfinder: ignore - bounded */
|
||||
wchar_t *wide_string = NULL;
|
||||
#endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */
|
||||
|
||||
if (NULL == string)
|
||||
return 0;
|
||||
if (0 == bytes)
|
||||
return 0;
|
||||
|
||||
if (bytes < sizeof(internal_raw) - 1) {
|
||||
raw_string = internal_raw;
|
||||
} else {
|
||||
allocated_raw = calloc(1, 1 + bytes);
|
||||
if (NULL == allocated_raw)
|
||||
return bytes;
|
||||
raw_string = allocated_raw;
|
||||
}
|
||||
|
||||
/* Copy the original string, skipping ECMA-48 CSI sequences. */
|
||||
for (read_pos = 0, write_pos = 0; read_pos < bytes; read_pos++) {
|
||||
if ((string[read_pos] != '\033') || (read_pos >= bytes - 1) || (string[read_pos + 1] != '[')) {
|
||||
raw_string[write_pos++] = string[read_pos];
|
||||
continue;
|
||||
}
|
||||
read_pos += 2;
|
||||
while ((read_pos < bytes - 1)
|
||||
&& ((string[read_pos] >= '0' && string[read_pos] <= '9')
|
||||
|| (';' == string[read_pos])
|
||||
)
|
||||
) {
|
||||
read_pos++;
|
||||
}
|
||||
}
|
||||
raw_string[write_pos] = '\0';
|
||||
raw_bytes = write_pos;
|
||||
|
||||
width = raw_bytes;
|
||||
|
||||
#if defined(ENABLE_NLS) && defined(HAVE_WCHAR_H)
|
||||
/*@-nullpass@ */
|
||||
/*
|
||||
* splint note: mbstowcs() manual page on Linux explicitly says it
|
||||
* takes NULL.
|
||||
*/
|
||||
wide_char_count = mbstowcs(NULL, raw_string, 0);
|
||||
/*@+nullpass@ */
|
||||
if (wide_char_count == (size_t) -1) {
|
||||
debug("%s: %s: %s", "mbstowcs", raw_string, strerror(errno));
|
||||
if (NULL != allocated_raw)
|
||||
free(allocated_raw);
|
||||
return raw_bytes;
|
||||
}
|
||||
|
||||
wide_string_buffer_size = sizeof(*wide_string) * (1 + wide_char_count);
|
||||
|
||||
if (wide_string_buffer_size < sizeof(internal_wide)) {
|
||||
wide_string = internal_wide;
|
||||
} else {
|
||||
allocated_wide = malloc(wide_string_buffer_size);
|
||||
if (NULL == allocated_wide) {
|
||||
perror("malloc");
|
||||
if (NULL != allocated_raw)
|
||||
free(allocated_raw);
|
||||
return raw_bytes;
|
||||
}
|
||||
wide_string = allocated_wide;
|
||||
}
|
||||
memset(wide_string, 0, wide_string_buffer_size);
|
||||
|
||||
if (mbstowcs(wide_string, raw_string, 1 + wide_char_count) == (size_t) -1) {
|
||||
debug("%s: %s: %s", "mbstowcs", raw_string, strerror(errno));
|
||||
} else if (NULL != wide_string) {
|
||||
/*@-unrecog@ *//* splint seems unable to see the prototype. */
|
||||
width = wcswidth(wide_string, wide_char_count);
|
||||
/*@+unrecog@ */
|
||||
} else {
|
||||
width = 0;
|
||||
}
|
||||
|
||||
if (NULL != allocated_wide)
|
||||
free(allocated_wide);
|
||||
#endif /* defined(ENABLE_NLS) && defined(HAVE_WCHAR_H) */
|
||||
|
||||
if (NULL != allocated_raw)
|
||||
free(allocated_raw);
|
||||
|
||||
return width;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return true if the character is printable. This function is used instead
|
||||
* of the macro from <ctype.h> to avoid causing versioned glibc dependencies
|
||||
* on some systems.
|
||||
*/
|
||||
bool pv_isprint(char c)
|
||||
{
|
||||
return ((c >= (char) 32) && (c <= (char) 126)) ? true : false;
|
||||
}
|
||||
|
||||
+303
-108
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions for transferring data between file descriptors.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -113,7 +113,7 @@ static int is_data_ready(int fd_in, /*@null@ */ bool *fd_in_ready, int fd_out, /
|
||||
* We stop retrying if the time elapsed since this function was entered
|
||||
* reaches TRANSFER_READ_TIMEOUT seconds.
|
||||
*/
|
||||
static ssize_t pv__transfer_read_repeated(int fd, void *buf, size_t count)
|
||||
static ssize_t pv__transfer_read_repeated(int fd, char *buf, size_t count)
|
||||
{
|
||||
struct timespec start_time;
|
||||
ssize_t total_read;
|
||||
@@ -181,13 +181,19 @@ static ssize_t pv__transfer_read_repeated(int fd, void *buf, size_t count)
|
||||
* see if we can write any more, and keep trying, to make sure we empty the
|
||||
* buffer as much as we can.
|
||||
*
|
||||
* While this is called after a successful write-possible select(), write() is
|
||||
* not guaranteed to succeed for _all_ sizes; we may end up returning 0 if this
|
||||
* occurs. (The first write() may return -1 / EINTR if the consumer doesn't
|
||||
* read any data before our timeout and the buffer of whatever stdout is is
|
||||
* near-full.) (see https://codeberg.org/ivarch/pv/pulls/93)
|
||||
*
|
||||
* If "sync_after_write" is true, we call fdatasync() after each write() (or
|
||||
* fsync() if _POSIX_SYNCHRONIZED_IO is not > 0).
|
||||
*
|
||||
* We stop retrying if the time elapsed since this function was entered
|
||||
* reaches TRANSFER_WRITE_TIMEOUT seconds.
|
||||
*/
|
||||
static ssize_t pv__transfer_write_repeated(int fd, void *buf, size_t count, bool sync_after_write)
|
||||
static ssize_t pv__transfer_write_repeated(int fd, char *buf, size_t count, bool sync_after_write)
|
||||
{
|
||||
struct timespec start_time;
|
||||
ssize_t total_written;
|
||||
@@ -294,41 +300,63 @@ static ssize_t pv__transfer_write_repeated(int fd, void *buf, size_t count, bool
|
||||
* returns 1.
|
||||
*
|
||||
* At most, the number of bytes read will be the number of bytes remaining
|
||||
* in the input buffer. If state->control.rate_limit is >0, and/or "allowed" is >0,
|
||||
* then the maximum number of bytes read will be the number remaining unused
|
||||
* in the input buffer or the value of "allowed", whichever is smaller.
|
||||
* in the input buffer, capped to the number of bytes left until
|
||||
* state->control.size is reached if state->control.stop_at_size is true.
|
||||
* If state->control.rate_limit is >0, and/or "max_to_write" is >0, and
|
||||
* splice() is used, then the maximum number of bytes read will be further
|
||||
* capped to the value of "max_to_write", since splice() writes as well as
|
||||
* reads.
|
||||
*
|
||||
* If splice() was successfully used, sets state->transfer.splice_used to true; if it
|
||||
* failed, then state->transfer.splice_failed_fd is updated to the current fd so
|
||||
* splice() won't be tried again until the next input file.
|
||||
* If splice() was successfully used, sets state->transfer.splice_used to
|
||||
* true; if it failed, then state->transfer.splice_failed_fd is updated to
|
||||
* the current fd so splice() won't be tried again until the next input
|
||||
* file.
|
||||
*
|
||||
* Updates state->transfer.read_position by the number of bytes read, unless splice()
|
||||
* was used, in which case it does not since there's nothing in the buffer
|
||||
* (and it also adds the bytes to state->transfer.written since they've been written
|
||||
* to the output).
|
||||
* Updates state->transfer.read_position by the number of bytes read, unless
|
||||
* splice() was used, in which case it does not since there's nothing in the
|
||||
* buffer (and it also adds the bytes to state->transfer.written since
|
||||
* they've been written to the output).
|
||||
*
|
||||
* On read error, updates state->status.exit_status, and if allowed by
|
||||
* Also increases state->transfer.total_bytes_read by the number of bytes
|
||||
* read, regardless of whether splice() was used, since total_bytes_read is
|
||||
* what it says it is, rather than being a buffer indicator.
|
||||
*
|
||||
* On read error, updates state->status.exit_status, and if max_to_write by
|
||||
* state->control.skip_errors, tries to skip past the problem.
|
||||
*
|
||||
* If the end of the input file is reached or the error is unrecoverable,
|
||||
* sets *eof_in to true. If all data in the buffer has been written at this
|
||||
* point, then also sets *eof_out to true.
|
||||
*/
|
||||
static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t allowed)
|
||||
static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t max_to_write)
|
||||
{
|
||||
bool do_not_skip_errors;
|
||||
size_t bytes_can_read;
|
||||
off_t amount_to_skip, amount_skipped, orig_offset, skip_offset;
|
||||
ssize_t nread;
|
||||
#ifdef HAVE_SPLICE
|
||||
size_t bytes_to_splice;
|
||||
#endif /* HAVE_SPLICE */
|
||||
|
||||
do_not_skip_errors = false;
|
||||
if (0 == state->control.skip_errors)
|
||||
do_not_skip_errors = true;
|
||||
|
||||
bytes_can_read = state->transfer.buffer_size - state->transfer.read_position;
|
||||
|
||||
/*
|
||||
* Don't read past control.size if stop_at_size is true (issue
|
||||
* #166).
|
||||
*
|
||||
* This isn't workable in line mode.
|
||||
*/
|
||||
if (state->control.stop_at_size && !state->control.linemode) {
|
||||
off_t bytes_remaining_to_read = state->control.size - state->transfer.total_bytes_read;
|
||||
if ((long long) bytes_can_read > (long long) bytes_remaining_to_read) {
|
||||
debug("%lld > (%lld-%lld=%lld): %s", (long long) bytes_can_read,
|
||||
(long long) (state->control.size), (long long) state->transfer.total_bytes_read,
|
||||
(long long) bytes_remaining_to_read, "truncating for stop-at-size");
|
||||
bytes_can_read = (size_t) bytes_remaining_to_read;
|
||||
}
|
||||
}
|
||||
|
||||
nread = 0;
|
||||
|
||||
#ifdef HAVE_SPLICE
|
||||
@@ -336,8 +364,10 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
if ((!state->control.linemode) && (!state->control.no_splice)
|
||||
&& (fd != state->transfer.splice_failed_fd)
|
||||
&& (0 == state->transfer.to_write)) {
|
||||
if (state->control.rate_limit > 0 || allowed != 0) {
|
||||
bytes_to_splice = (size_t) allowed;
|
||||
size_t bytes_to_splice;
|
||||
|
||||
if (state->control.rate_limit > 0 || max_to_write != 0) {
|
||||
bytes_to_splice = (size_t) max_to_write;
|
||||
} else {
|
||||
bytes_to_splice = bytes_can_read;
|
||||
}
|
||||
@@ -345,7 +375,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
/*@-nullpass@ */
|
||||
/*@-type@ */
|
||||
/* splint doesn't know about splice */
|
||||
nread = splice(fd, NULL, STDOUT_FILENO, NULL, bytes_to_splice, SPLICE_F_MORE);
|
||||
nread = splice(fd, NULL, state->control.output_fd, NULL, bytes_to_splice, SPLICE_F_MORE);
|
||||
/*@+type@ */
|
||||
/*@+nullpass@ */
|
||||
|
||||
@@ -359,6 +389,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
*/
|
||||
} else if (nread > 0) {
|
||||
state->transfer.written = nread;
|
||||
state->transfer.total_bytes_read += nread;
|
||||
#ifdef HAVE_FDATASYNC
|
||||
if (state->control.sync_after_write) {
|
||||
/*
|
||||
@@ -370,7 +401,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
* error, we cannot skip it, so set
|
||||
* "do_not_skip_errors".
|
||||
*/
|
||||
if ((fdatasync(STDOUT_FILENO) < 0)
|
||||
if ((fdatasync(state->control.output_fd) < 0)
|
||||
&& (EIO == errno)) {
|
||||
nread = -1;
|
||||
do_not_skip_errors = true;
|
||||
@@ -424,6 +455,8 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
#else
|
||||
state->transfer.read_position += nread;
|
||||
#endif /* HAVE_SPLICE */
|
||||
/* Update the counter of all bytes read so far. */
|
||||
state->transfer.total_bytes_read += nread;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -446,7 +479,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
* exit status, regardless of whether we're skipping errors, and
|
||||
* increment the error counter.
|
||||
*/
|
||||
state->status.exit_status |= 16;
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSFER;
|
||||
state->transfer.read_errors_in_a_row++;
|
||||
|
||||
/*
|
||||
@@ -454,15 +487,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
* reached the end of this file.
|
||||
*/
|
||||
if (do_not_skip_errors) {
|
||||
/*@-compdef@ */
|
||||
pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("read failed"), strerror(errno));
|
||||
/*@+compdef@ */
|
||||
/*
|
||||
* splint says the storage pointed to by the result of
|
||||
* pv_current_file_name() is not fully defined.
|
||||
*
|
||||
* TODO: investigate and fix the reason for this.
|
||||
*/
|
||||
pv_error("%s: %s: %s", pv_current_file_name(state), _("read failed"), strerror(errno));
|
||||
*eof_in = true;
|
||||
if (state->transfer.write_position >= state->transfer.read_position) {
|
||||
*eof_out = true;
|
||||
@@ -478,7 +503,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
|
||||
if (!state->transfer.read_error_warning_shown) {
|
||||
/*@-compdef@ */
|
||||
pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("warning: read errors detected"),
|
||||
pv_error("%s: %s: %s", pv_current_file_name(state), _("warning: read errors detected"),
|
||||
strerror(errno));
|
||||
/*@+compdef@ */
|
||||
/* splint - see previous pv_current_file_name() call. */
|
||||
@@ -494,7 +519,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
*/
|
||||
if (0 > orig_offset) {
|
||||
/*@-compdef@ */
|
||||
pv_error(state, "%s: %s: %s", pv_current_file_name(state), _("file is not seekable"), strerror(errno));
|
||||
pv_error("%s: %s: %s", pv_current_file_name(state), _("file is not seekable"), strerror(errno));
|
||||
/*@+compdef@ */
|
||||
/* splint - see previous pv_current_file_name() calls. */
|
||||
*eof_in = true;
|
||||
@@ -571,8 +596,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
*/
|
||||
if (EINVAL != errno) {
|
||||
/*@-compdef@ */
|
||||
pv_error(state,
|
||||
"%s: %s: %s", pv_current_file_name(state), _("failed to seek past error"),
|
||||
pv_error("%s: %s: %s", pv_current_file_name(state), _("failed to seek past error"),
|
||||
strerror(errno));
|
||||
/*@+compdef@ */
|
||||
/* splint - see previous pv_current_file_name() calls. */
|
||||
@@ -590,7 +614,7 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
state->transfer.read_position += amount_skipped;
|
||||
if (state->control.skip_errors < 2) {
|
||||
/*@-compdef@ */
|
||||
pv_error(state, "%s: %s: %ld - %ld (%ld %s)",
|
||||
pv_error("%s: %s: %ld - %ld (%ld %s)",
|
||||
pv_current_file_name(state),
|
||||
_("skipped past read error"), (long) orig_offset, (long) skip_offset,
|
||||
(long) amount_skipped, _("B"));
|
||||
@@ -612,13 +636,13 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
|
||||
|
||||
/*
|
||||
* Write state->transfer.to_write bytes of data from the transfer buffer to stdout.
|
||||
* Write state->transfer.to_write bytes of data from the transfer buffer to the output.
|
||||
* Returns zero if there was a transient error and we need to return 0 from
|
||||
* pv_transfer, otherwise returns 1.
|
||||
*
|
||||
* Updates state->transfer.write_position by moving it on by the number of bytes
|
||||
* written; adds the number of bytes written to state->transfer.written; sets
|
||||
* *eof_out to true, on stdout EOF, or when the write position catches up
|
||||
* *eof_out to true, on output EOF, or when the write position catches up
|
||||
* with the read position AND *eof_in is true (meaning we've reached the end
|
||||
* of data).
|
||||
*
|
||||
@@ -630,21 +654,72 @@ static int pv__transfer_read(pvstate_t state, int fd, bool *eof_in, bool *eof_ou
|
||||
static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long *lineswritten)
|
||||
{
|
||||
ssize_t nwritten;
|
||||
int write_errno;
|
||||
bool all_nulls;
|
||||
off_t output_offset;
|
||||
size_t write_check_position, write_end_position;
|
||||
|
||||
if (NULL == state->transfer.transfer_buffer) {
|
||||
pv_error(state, "%s", _("no transfer buffer allocated"));
|
||||
state->status.exit_status |= 64;
|
||||
pv_error("%s", _("no transfer buffer allocated"));
|
||||
state->status.exit_status |= PV_ERROREXIT_MEMORY;
|
||||
*eof_out = true;
|
||||
state->transfer.written = -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
nwritten = 0;
|
||||
write_errno = 0;
|
||||
|
||||
if (state->control.discard_input) {
|
||||
nwritten = state->transfer.to_write;
|
||||
} else if (state->transfer.to_write > 0) {
|
||||
|
||||
/*
|
||||
* In sparse output mode, check whether all of the bytes to
|
||||
* be written are null, and if so, try to seek the output
|
||||
* instead of writing the null bytes.
|
||||
*/
|
||||
if (state->control.sparse_output && !state->transfer.output_not_seekable) {
|
||||
write_check_position = state->transfer.write_position;
|
||||
write_end_position = write_check_position + (size_t) (state->transfer.to_write);
|
||||
all_nulls = true;
|
||||
while (all_nulls && write_check_position < write_end_position) {
|
||||
if ('\0' == state->transfer.transfer_buffer[write_check_position]) {
|
||||
write_check_position++;
|
||||
} else {
|
||||
all_nulls = false;
|
||||
}
|
||||
}
|
||||
if (all_nulls) {
|
||||
|
||||
/*
|
||||
* Use lseek() to move forward in the file,
|
||||
* and then ftruncate() it to its new size.
|
||||
*
|
||||
* If any step fails, mark the output not
|
||||
* seekable so we stop trying.
|
||||
*/
|
||||
|
||||
/*@+longintegral@ */
|
||||
/*
|
||||
* splint has trouble with off_t / __off_t, in the lseek() call.
|
||||
*/
|
||||
output_offset =
|
||||
lseek(state->control.output_fd, (off_t) (state->transfer.to_write), SEEK_CUR);
|
||||
if (output_offset == (off_t) - 1) {
|
||||
debug("%s: %s", "output lseek() failed", strerror(errno));
|
||||
state->transfer.output_not_seekable = true;
|
||||
} else {
|
||||
/* Seek successful - skip write. */
|
||||
debug("%s (%ld) -> %s: %ld", "skipped null writes",
|
||||
(long) (state->transfer.to_write), "new position", (long) output_offset);
|
||||
nwritten = state->transfer.to_write;
|
||||
goto pv__transfer_write_completed;
|
||||
}
|
||||
/*@-longintegral@ */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set an interval timer or an alarm to interrupt the write
|
||||
* with a signal if the write takes too long, so we can
|
||||
@@ -673,17 +748,25 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
(long) (new_timer.it_value.tv_usec));
|
||||
|
||||
if (0 != setitimer(ITIMER_REAL, &new_timer, NULL)) {
|
||||
pv_error(state, "%s: %s", _("failed to set interval timer"), strerror(errno));
|
||||
pv_error("%s: %s", _("failed to set interval timer"), strerror(errno));
|
||||
}
|
||||
|
||||
#else /* ! HAVE_SETITIMER */
|
||||
(void) alarm(1);
|
||||
debug("%s", "setting alarm");
|
||||
#endif /* HAVE_SETITIMER */
|
||||
nwritten = pv__transfer_write_repeated(STDOUT_FILENO,
|
||||
debug("%s: %ld %s", "beginning write attempt", (long) (state->transfer.to_write), "bytes");
|
||||
nwritten = pv__transfer_write_repeated(state->control.output_fd,
|
||||
state->transfer.transfer_buffer +
|
||||
state->transfer.write_position,
|
||||
(size_t) (state->transfer.to_write),
|
||||
state->control.sync_after_write);
|
||||
if (nwritten < 0) {
|
||||
write_errno = (int) errno;
|
||||
debug("%s: %ld: %s", "bytes written", (long) nwritten, strerror(errno));
|
||||
} else {
|
||||
debug("%s: %ld", "bytes written", (long) nwritten);
|
||||
}
|
||||
#if HAVE_SETITIMER
|
||||
memset(&new_timer, 0, sizeof(new_timer));
|
||||
new_timer.it_interval.tv_sec = 0;
|
||||
@@ -691,30 +774,58 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
new_timer.it_value.tv_sec = 0;
|
||||
new_timer.it_value.tv_usec = 0;
|
||||
if (0 != setitimer(ITIMER_REAL, &new_timer, NULL)) {
|
||||
pv_error(state, "%s: %s", _("failed to clear interval timer"), strerror(errno));
|
||||
pv_error("%s: %s", _("failed to clear interval timer"), strerror(errno));
|
||||
}
|
||||
|
||||
/*@+unrecog@ */
|
||||
#else /* ! HAVE_SETITIMER */
|
||||
debug("%s", "cancelling alarm");
|
||||
(void) alarm(0);
|
||||
#endif /* HAVE_SETITIMER */
|
||||
}
|
||||
|
||||
if (0 == nwritten) {
|
||||
/*
|
||||
* Write returned 0 - EOF on stdout.
|
||||
*/
|
||||
*eof_out = true;
|
||||
return 1;
|
||||
} else if (nwritten > 0) {
|
||||
pv__transfer_write_completed:
|
||||
/* If lseek() worked for sparse output, it jumps down here. */
|
||||
|
||||
if (nwritten > 0) {
|
||||
bool tracking_lines = false;
|
||||
|
||||
if ((state->control.linemode) && (lineswritten != NULL))
|
||||
tracking_lines = true;
|
||||
else if (state->display.showing_previous_line)
|
||||
tracking_lines = true;
|
||||
|
||||
/*
|
||||
* Write returned >0 - data successfully written.
|
||||
*/
|
||||
if ((state->control.linemode) && (lineswritten != NULL)) {
|
||||
if (tracking_lines) {
|
||||
char separator;
|
||||
char *ptr;
|
||||
long lines = 0;
|
||||
|
||||
/*
|
||||
* Tracking lines - either line mode, or we're
|
||||
* showing the last line in the display, or both.
|
||||
* So we need to look through what we've just
|
||||
* written to either count how many lines there
|
||||
* were, or get the content of the most recent
|
||||
* complete line, or both.
|
||||
*/
|
||||
|
||||
/* Allocate buffer to remember line positions. */
|
||||
if (NULL == state->transfer.line_positions && NULL != lineswritten) {
|
||||
state->transfer.line_positions_capacity = MAX_LINE_POSITIONS;
|
||||
/*@-mustfreeonly@ */
|
||||
state->transfer.line_positions =
|
||||
calloc((size_t) (state->transfer.line_positions_capacity), sizeof(off_t));
|
||||
if (NULL == state->transfer.line_positions) {
|
||||
pv_error("%s: %s", _("line position buffer allocation failed"),
|
||||
strerror(errno));
|
||||
}
|
||||
/*@+mustfreeonly@ */
|
||||
/* splint doesn't see we only call calloc() when line_positions is NULL. */
|
||||
}
|
||||
|
||||
if (state->control.null_terminated_lines) {
|
||||
separator = '\0';
|
||||
} else {
|
||||
@@ -724,12 +835,72 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
ptr = (char *) (state->transfer.transfer_buffer + state->transfer.write_position - 1);
|
||||
for (ptr++;
|
||||
ptr - (char *) state->transfer.transfer_buffer - state->transfer.write_position <
|
||||
(size_t) nwritten; ptr++) {
|
||||
if (*ptr == separator)
|
||||
++lines;
|
||||
(size_t) nwritten; ptr++, state->transfer.last_output_position++) {
|
||||
if (*ptr != separator) {
|
||||
/*
|
||||
* If we're displaying the previous
|
||||
* line ("%L"), add to our line
|
||||
* buffer.
|
||||
*/
|
||||
if (state->display.showing_previous_line
|
||||
&& state->display.next_line_len < PV_SIZEOF_PREVLINE_BUFFER - 1) {
|
||||
state->display.next_line[state->display.next_line_len] = *ptr;
|
||||
state->display.next_line_len++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Separator found - increment line count. */
|
||||
++lines;
|
||||
|
||||
/*
|
||||
* If we're displaying the previous line
|
||||
* ("%L"), update the previous-line buffer
|
||||
* with the line we just completed, and
|
||||
* start a new one.
|
||||
*/
|
||||
if (state->display.showing_previous_line) {
|
||||
memset(state->display.previous_line, 0, PV_SIZEOF_PREVLINE_BUFFER);
|
||||
if (state->display.next_line_len > PV_SIZEOF_PREVLINE_BUFFER - 1)
|
||||
state->display.next_line_len = PV_SIZEOF_PREVLINE_BUFFER - 1;
|
||||
if (state->display.next_line_len > 0) {
|
||||
memcpy(state->display.previous_line, state->display.next_line, /* flawfinder: ignore */
|
||||
state->display.next_line_len);
|
||||
debug("%s: [%s]", "updated previous_line",
|
||||
state->display.previous_line);
|
||||
}
|
||||
state->display.next_line_len = 0;
|
||||
/*
|
||||
* flawfinder - next_line_len is
|
||||
* guaranteed to be less than the
|
||||
* size of the previous_line buffer
|
||||
* since we check it just before
|
||||
* memcpy(), and we ensure that the
|
||||
* last byte in the buffer is \0.
|
||||
*/
|
||||
}
|
||||
|
||||
if (NULL == state->transfer.line_positions)
|
||||
continue;
|
||||
|
||||
/* Store the position of the separator. */
|
||||
state->transfer.line_positions[state->transfer.line_positions_head] =
|
||||
state->transfer.last_output_position;
|
||||
state->transfer.line_positions_head++;
|
||||
|
||||
/* Circular buffer - wrap around. */
|
||||
if (state->transfer.line_positions_head >= state->transfer.line_positions_capacity) {
|
||||
state->transfer.line_positions_head = 0;
|
||||
}
|
||||
|
||||
/* Increment count of line positions, if below capacity. */
|
||||
if (state->transfer.line_positions_length < state->transfer.line_positions_capacity) {
|
||||
state->transfer.line_positions_length++;
|
||||
}
|
||||
}
|
||||
|
||||
*lineswritten += lines;
|
||||
if (NULL != lineswritten)
|
||||
*lineswritten += lines;
|
||||
}
|
||||
|
||||
state->transfer.write_position += nwritten;
|
||||
@@ -739,39 +910,39 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
* If we're monitoring the output, update our copy of the
|
||||
* last few bytes we've written.
|
||||
*/
|
||||
if (state->display.component[PV_COMPONENT_OUTPUTBUF].required && (nwritten > 0)) {
|
||||
size_t new_portion_length, old_portion_length;
|
||||
if (state->display.showing_last_written && (nwritten > 0)) {
|
||||
size_t new_portion_size, old_portion_size;
|
||||
|
||||
new_portion_length = (size_t) nwritten;
|
||||
if (new_portion_length > state->display.lastoutput_length)
|
||||
new_portion_length = state->display.lastoutput_length;
|
||||
new_portion_size = (size_t) nwritten;
|
||||
if (new_portion_size > state->display.lastwritten_bytes)
|
||||
new_portion_size = state->display.lastwritten_bytes;
|
||||
|
||||
old_portion_length = state->display.lastoutput_length - new_portion_length;
|
||||
old_portion_size = state->display.lastwritten_bytes - new_portion_size;
|
||||
|
||||
/*
|
||||
* Make room for the new portion.
|
||||
*/
|
||||
if (old_portion_length > 0) {
|
||||
memmove(state->display.lastoutput_buffer,
|
||||
state->display.lastoutput_buffer + new_portion_length, old_portion_length);
|
||||
if (old_portion_size > 0) {
|
||||
memmove(state->display.lastwritten_buffer,
|
||||
state->display.lastwritten_buffer + new_portion_size, old_portion_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the new data in.
|
||||
*/
|
||||
memcpy(state->display.lastoutput_buffer + /* flawfinder: ignore */
|
||||
old_portion_length,
|
||||
state->transfer.transfer_buffer + state->transfer.write_position - new_portion_length,
|
||||
new_portion_length);
|
||||
memcpy(state->display.lastwritten_buffer + /* flawfinder: ignore */
|
||||
old_portion_size,
|
||||
state->transfer.transfer_buffer + state->transfer.write_position - new_portion_size,
|
||||
new_portion_size);
|
||||
/*
|
||||
* flawfinder rationale: calculations above ensure
|
||||
* that old_portion_length + new_portion_length is
|
||||
* always <= lastoutput_length, and
|
||||
* lastoutput_length is guaranteed by
|
||||
* that old_portion_size + new_portion_size is
|
||||
* always <= lastwritten_bytes, and
|
||||
* lastwritten_bytes is guaranteed by
|
||||
* pv__format_init() to be no more than
|
||||
* PV_SIZEOF_LASTOUTPUT_BUFFER, which is the size of
|
||||
* lastoutput_buffer, so the memcpy() will always
|
||||
* fit into the buffer.
|
||||
* PV_SIZEOF_LASTWRITTEN_BUFFER, which is the size
|
||||
* of lastwritten_buffer, so the memcpy() will
|
||||
* always fit into the buffer.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -792,15 +963,20 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
}
|
||||
|
||||
/*
|
||||
* If we reach this point, nwritten<0, so there was an error.
|
||||
* If we reach this point, nwritten<=0, so there may be an error.
|
||||
*/
|
||||
|
||||
/*
|
||||
* If a write error occurred but it was EINTR or EAGAIN, just wait a
|
||||
* bit and then return zero, since this was a transient error.
|
||||
* If a write error occurred but it was EINTR or EAGAIN, or write(2)
|
||||
* blocked on first write such that nwritten == 0, just wait a bit and
|
||||
* then return zero, since this was a transient error.
|
||||
*/
|
||||
if ((EINTR == errno) || (EAGAIN == errno)) {
|
||||
debug("%s: %s", "transient write error - waiting briefly", strerror(errno));
|
||||
if ((0 == nwritten) || (EINTR == write_errno) || (EAGAIN == write_errno)) {
|
||||
if (0 == nwritten) {
|
||||
debug("%s", "attempted write blocked - waiting briefly");
|
||||
} else {
|
||||
debug("%s: %s", "transient write error - waiting briefly", strerror(write_errno));
|
||||
}
|
||||
(void) is_data_ready(-1, NULL, -1, NULL, 10000);
|
||||
return 0;
|
||||
}
|
||||
@@ -809,14 +985,16 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
* SIGPIPE means we've finished. Don't output an error because it's
|
||||
* not really our error to report.
|
||||
*/
|
||||
if (EPIPE == errno) {
|
||||
if (EPIPE == write_errno) {
|
||||
*eof_in = true;
|
||||
*eof_out = true;
|
||||
state->flags.pipe_closed = 1;
|
||||
debug("%s", "SIGPIPE received - setting pipe_closed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
pv_error(state, "%s: %s", _("write failed"), strerror(errno));
|
||||
state->status.exit_status |= 16;
|
||||
pv_error("%s: %s", _("write failed"), strerror(write_errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSFER;
|
||||
*eof_out = true;
|
||||
state->transfer.written = -1;
|
||||
|
||||
@@ -838,16 +1016,16 @@ static int pv__transfer_write(pvstate_t state, bool *eof_in, bool *eof_out, long
|
||||
*/
|
||||
/*@null@*/
|
||||
/*@only@*/
|
||||
static char *pv__allocate_aligned_buffer(int fd, size_t target_size)
|
||||
static char *pv__allocate_aligned_buffer(int outfd, int infd, size_t target_size)
|
||||
{
|
||||
char *newptr;
|
||||
void *newptr;
|
||||
|
||||
#if defined(HAVE_FPATHCONF) && defined(HAVE_POSIX_MEMALIGN) && defined(_PC_REC_XFER_ALIGN)
|
||||
long input_alignment, output_alignment, min_alignment;
|
||||
long required_alignment;
|
||||
|
||||
input_alignment = fd >= 0 ? fpathconf(fd, _PC_REC_XFER_ALIGN) : -1;
|
||||
output_alignment = fpathconf(STDOUT_FILENO, _PC_REC_XFER_ALIGN);
|
||||
input_alignment = infd >= 0 ? fpathconf(infd, _PC_REC_XFER_ALIGN) : -1;
|
||||
output_alignment = fpathconf(outfd, _PC_REC_XFER_ALIGN);
|
||||
#if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE)
|
||||
min_alignment = sysconf(_SC_PAGESIZE);
|
||||
#else /* ! defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) */
|
||||
@@ -924,9 +1102,12 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
}
|
||||
}
|
||||
if (!(*eof_out)) {
|
||||
if (0 != fcntl(STDOUT_FILENO, F_SETFL,
|
||||
(state->control.direct_io ? O_DIRECT : 0) | fcntl(STDOUT_FILENO, F_GETFL))) {
|
||||
debug("%s: %s: %s", "(stdout)", "fcntl", strerror(errno));
|
||||
if (0 != fcntl(state->control.output_fd, F_SETFL,
|
||||
(state->control.direct_io ? O_DIRECT : 0) |
|
||||
fcntl(state->control.output_fd, F_GETFL))) {
|
||||
debug("%s: %s: %s",
|
||||
NULL == state->control.output_name ? "(null)" : state->control.output_name,
|
||||
"fcntl", strerror(errno));
|
||||
}
|
||||
}
|
||||
state->control.direct_io_changed = false;
|
||||
@@ -949,10 +1130,10 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
*/
|
||||
if (NULL == state->transfer.transfer_buffer) {
|
||||
state->transfer.transfer_buffer =
|
||||
pv__allocate_aligned_buffer(fd, state->control.target_buffer_size + 32);
|
||||
pv__allocate_aligned_buffer(state->control.output_fd, fd, state->control.target_buffer_size + 32);
|
||||
if (NULL == state->transfer.transfer_buffer) {
|
||||
pv_error(state, "%s: %s", _("buffer allocation failed"), strerror(errno));
|
||||
state->status.exit_status |= 64;
|
||||
pv_error("%s: %s", _("buffer allocation failed"), strerror(errno));
|
||||
state->status.exit_status |= PV_ERROREXIT_MEMORY;
|
||||
return -1;
|
||||
}
|
||||
state->transfer.buffer_size = state->control.target_buffer_size;
|
||||
@@ -967,7 +1148,8 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
*/
|
||||
if (state->transfer.buffer_size < state->control.target_buffer_size) {
|
||||
char *newptr;
|
||||
newptr = pv__allocate_aligned_buffer(fd, state->control.target_buffer_size + 32);
|
||||
newptr =
|
||||
pv__allocate_aligned_buffer(state->control.output_fd, fd, state->control.target_buffer_size + 32);
|
||||
if (NULL == newptr) {
|
||||
/*
|
||||
* Reset target if realloc failed so we don't keep
|
||||
@@ -998,8 +1180,10 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
if ((state->control.linemode) && (lineswritten != NULL))
|
||||
*lineswritten = 0;
|
||||
|
||||
if ((*eof_in) && (*eof_out))
|
||||
if ((*eof_in) && (*eof_out)) {
|
||||
debug("%s %d: %s", "fd", fd, "early return 0 - EOF in and out");
|
||||
return 0;
|
||||
}
|
||||
|
||||
check_read_fd = -1;
|
||||
check_write_fd = -1;
|
||||
@@ -1027,10 +1211,10 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
|
||||
/*
|
||||
* If we don't think we've finished writing and there's anything
|
||||
* we're allowed to write, look for the stdout becoming writable.
|
||||
* we're allowed to write, look for the output becoming writable.
|
||||
*/
|
||||
if ((!(*eof_out)) && (state->transfer.to_write > 0)) {
|
||||
check_write_fd = STDOUT_FILENO;
|
||||
check_write_fd = state->control.output_fd;
|
||||
}
|
||||
|
||||
ready_to_read = false;
|
||||
@@ -1041,19 +1225,20 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
/*
|
||||
* Ignore transient errors by returning 0 immediately.
|
||||
*/
|
||||
if (EINTR == errno)
|
||||
if (EINTR == errno) {
|
||||
debug("%s %d: %s", "fd", fd, "early return 0 - is_data_ready < 0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Any other error is a problem and we must report back.
|
||||
*/
|
||||
/*@-compdef@ */
|
||||
pv_error(state, "%s: %s: %d: %s", pv_current_file_name(state), _("select call failed"), n,
|
||||
strerror(errno));
|
||||
pv_error("%s: %s: %d: %s", pv_current_file_name(state), _("select call failed"), n, strerror(errno));
|
||||
/*@+compdef@ */
|
||||
/* splint - see previous pv_current_file_name() calls. */
|
||||
|
||||
state->status.exit_status |= 16;
|
||||
state->status.exit_status |= PV_ERROREXIT_TRANSFER;
|
||||
|
||||
return -1;
|
||||
}
|
||||
@@ -1067,8 +1252,12 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
* NB this can update state->transfer.written because of splice().
|
||||
*/
|
||||
if (ready_to_read) {
|
||||
if (pv__transfer_read(state, fd, eof_in, eof_out, allowed) == 0)
|
||||
if (pv__transfer_read(state, fd, eof_in, eof_out, allowed) == 0) {
|
||||
debug("%s %d: %s (%s=%s, %s=%s, %s=%lu)", "fd", fd,
|
||||
"early return 0 - pv__transfer_read returned 0", "eof_in", eof_in ? "true" : "false",
|
||||
"eof_out", eof_out ? "true" : "false", "allowed", (unsigned long) allowed);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1088,9 +1277,9 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is data to write, and stdout is ready to receive it, and
|
||||
* we didn't use splice() this time, write some data. Return early
|
||||
* if there was a transient write error.
|
||||
* If there is data to write, and the output is ready to receive it,
|
||||
* and we didn't use splice() this time, write some data.
|
||||
* Return early if there was a transient write error.
|
||||
*/
|
||||
if (ready_to_write
|
||||
#ifdef HAVE_SPLICE
|
||||
@@ -1099,8 +1288,12 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
&& (state->transfer.read_position > state->transfer.write_position)
|
||||
&& (state->transfer.to_write > 0)
|
||||
&& (NULL != lineswritten)) {
|
||||
if (pv__transfer_write(state, eof_in, eof_out, lineswritten) == 0)
|
||||
if (pv__transfer_write(state, eof_in, eof_out, lineswritten) == 0) {
|
||||
debug("%s %d: %s (%s=%s, %s=%s, %s=%lu)", "fd", fd,
|
||||
"early return 0 - pv__transfer_write returned 0", "eof_in", eof_in ? "true" : "false",
|
||||
"eof_out", eof_out ? "true" : "false", "lineswritten", (unsigned long) lineswritten);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#ifdef MAXIMISE_BUFFER_FILL
|
||||
/*
|
||||
@@ -1122,7 +1315,9 @@ ssize_t pv_transfer(pvstate_t state, int fd, bool *eof_in, bool *eof_out, off_t
|
||||
}
|
||||
#endif /* MAXIMISE_BUFFER_FILL */
|
||||
|
||||
if (0 == state->transfer.written) {
|
||||
debug("%s %d: %s", "fd", fd, "end-of-function return 0 - transfer.written is zero");
|
||||
}
|
||||
|
||||
return state->transfer.written;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
+168
-127
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Functions for watching file descriptors in other processes.
|
||||
*
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2024 Andrew Wood
|
||||
* Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023-2025 Andrew Wood
|
||||
*
|
||||
* License GPLv3+: GNU GPL version 3 or later; see `docs/COPYING'.
|
||||
*/
|
||||
@@ -96,7 +96,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
|
||||
if (kill(info->watch_pid, 0) != 0) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno));
|
||||
pv_error("%s %u: %s", _("pid"), info->watch_pid, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -105,8 +105,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
PROC_PIDFDVNODEPATHINFO, &vnodeInfo,
|
||||
PROC_PIDFDVNODEPATHINFO_SIZE);
|
||||
if (size != PROC_PIDFDVNODEPATHINFO_SIZE) {
|
||||
pv_error(state, "%s %u: %s %d: %s",
|
||||
_("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno));
|
||||
pv_error("%s %u: %s %d: %s", _("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno));
|
||||
return 3;
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
|
||||
if (!(0 == stat(info->file_fdpath, &(info->sb_fd)))) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
pv_error("%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno));
|
||||
return 3;
|
||||
@@ -124,7 +123,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
|
||||
if (!filesize(info)) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
pv_error("%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
info->watch_pid,
|
||||
_("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device"));
|
||||
@@ -162,7 +161,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
|
||||
if (kill(info->watch_pid, 0) != 0) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s", _("pid"), info->watch_pid, strerror(errno));
|
||||
pv_error("%s %u: %s", _("pid"), info->watch_pid, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
(void) pv_snprintf(info->file_fdinfo, PV_SIZEOF_FILE_FDINFO,
|
||||
@@ -180,7 +179,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
* and then only if it's a block device - see filesize().
|
||||
*/
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s",
|
||||
pv_error("%s %u: %s %d: %s",
|
||||
_("pid"), info->watch_pid, _("fd"), info->watch_fd, strerror(errno));
|
||||
return 2;
|
||||
}
|
||||
@@ -188,7 +187,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
if (!((0 == stat(info->file_fd, &(info->sb_fd)))
|
||||
&& (0 == lstat(info->file_fd, &(info->sb_fd_link))))) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
pv_error("%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
info->watch_pid, _("fd"), info->watch_fd, info->file_fdpath, strerror(errno));
|
||||
return 3;
|
||||
@@ -198,7 +197,7 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, bool automatic)
|
||||
|
||||
if (!filesize(info)) {
|
||||
if (!automatic)
|
||||
pv_error(state, "%s %u: %s %d: %s: %s",
|
||||
pv_error("%s %u: %s %d: %s: %s",
|
||||
_("pid"),
|
||||
info->watch_pid,
|
||||
_("fd"), info->watch_fd, info->file_fdpath, _("not a regular file or block device"));
|
||||
@@ -281,6 +280,13 @@ off_t pv_watchfd_position(pvwatchfd_t info)
|
||||
(void) fclose(fptr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This debugging line can be quite noisy - turned off for now,
|
||||
* uncomment if needed.
|
||||
*
|
||||
* debug("pid:%d fd:%d position:%lld", (int) (info->watch_pid), info->watch_fd, position);
|
||||
*/
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
@@ -290,7 +296,7 @@ static int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, i
|
||||
{
|
||||
int size_needed = proc_pidinfo(pid, PROC_PIDLISTFDS, 0, 0, 0);
|
||||
if (size_needed == -1) {
|
||||
pv_error(state, "%s: unable to list pid fds: %s", _("pid"), strerror(errno));
|
||||
pv_error("%s: unable to list pid fds: %s", _("pid"), strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -298,9 +304,10 @@ static int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, i
|
||||
|
||||
*fds = (struct proc_fdinfo *) malloc(size_needed);
|
||||
if (*fds == NULL) {
|
||||
pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno));
|
||||
pv_error("%s: alloc failed: %s", _("pid"), strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
memset(*fds, 0, size_needed);
|
||||
|
||||
proc_pidinfo(pid, PROC_PIDLISTFDS, 0, *fds, size_needed);
|
||||
|
||||
@@ -346,6 +353,10 @@ static bool extend_info_array(int *array_length_ptr, pvwatchfd_t * info_array_pt
|
||||
return false;
|
||||
}
|
||||
|
||||
new_info_array[array_length - 1].unused = true;
|
||||
|
||||
debug("%s", "extended info array");
|
||||
|
||||
*info_array_ptr = new_info_array;
|
||||
*array_length_ptr = array_length;
|
||||
return true;
|
||||
@@ -356,25 +367,76 @@ static bool extend_info_array(int *array_length_ptr, pvwatchfd_t * info_array_pt
|
||||
/*@+compdef @ */
|
||||
|
||||
|
||||
/*
|
||||
* Reset calculated values in the given watchfd info structure.
|
||||
*/
|
||||
void pv_reset_watchfd(pvwatchfd_t info)
|
||||
{
|
||||
if (NULL == info)
|
||||
return;
|
||||
pv_reset_calc(&(info->calc));
|
||||
pv_reset_transfer(&(info->transfer));
|
||||
pv_reset_flags(&(info->flags));
|
||||
pv_reset_display(&(info->display));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Free dynamically allocated areas in the given watchfd info structure.
|
||||
*/
|
||||
void pv_freecontents_watchfd(pvwatchfd_t info)
|
||||
{
|
||||
if (NULL == info)
|
||||
return;
|
||||
pv_freecontents_calc(&(info->calc));
|
||||
pv_freecontents_transfer(&(info->transfer));
|
||||
pv_freecontents_display(&(info->display));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Comparison function for qsort, to compare two pvwatchfd_s structures.
|
||||
*/
|
||||
static int pv_compare_watchfd(const void *a, const void *b)
|
||||
{
|
||||
int fd_a, fd_b;
|
||||
|
||||
fd_a = 0;
|
||||
fd_b = 0;
|
||||
if (NULL != a)
|
||||
fd_a = ((pvwatchfd_t) a)->watch_fd;
|
||||
if (NULL != b)
|
||||
fd_b = ((pvwatchfd_t) b)->watch_fd;
|
||||
|
||||
if (fd_a < fd_b)
|
||||
return -1;
|
||||
if (fd_a > fd_b)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Scan the given process and update the arrays with any new file
|
||||
* descriptors.
|
||||
* descriptors. If "watch_fd" is not -1, then all other file descriptor
|
||||
* numbers will be ignored,
|
||||
*
|
||||
* Returns 0 on success, 1 if the process no longer exists or could not be
|
||||
* read, or 2 for a memory allocation error.
|
||||
*/
|
||||
int pv_watchpid_scanfds(pvstate_t state,
|
||||
pid_t watch_pid, int *array_length_ptr, pvwatchfd_t * info_array_ptr, int *fd_to_idx)
|
||||
int pv_watchpid_scanfds(pvstate_t state, pid_t watch_pid, int watch_fd, int *array_length_ptr,
|
||||
pvwatchfd_t * info_array_ptr)
|
||||
{
|
||||
int array_length = 0;
|
||||
struct pvwatchfd_s *info_array = NULL;
|
||||
bool changes_made;
|
||||
|
||||
#ifdef __APPLE__
|
||||
struct proc_fdinfo *fd_infos = NULL;
|
||||
int fd_infos_count = 0;
|
||||
|
||||
if (pidfds(state, watch_pid, &fd_infos, &fd_infos_count) != 0) {
|
||||
pv_error(state, "%s: pidfds failed", _("pid"));
|
||||
pv_error("%s: pidfds failed", _("pid"));
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
@@ -393,18 +455,19 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
array_length = *array_length_ptr;
|
||||
info_array = *info_array_ptr;
|
||||
|
||||
changes_made = false;
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (fd_infos_count < 1) {
|
||||
pv_error(state, "%s: no fds found", _("pid"));
|
||||
pv_error("%s: no fds found", _("pid"));
|
||||
return -1;
|
||||
}
|
||||
for (int i = 0; i < fd_infos_count; i++) {
|
||||
#else
|
||||
while ((d = readdir(dptr)) != NULL) {
|
||||
#endif
|
||||
int fd, check_idx, use_idx, rc;
|
||||
int fd, check_idx, found_idx, use_idx, rc;
|
||||
off_t position_now;
|
||||
const char *use_format_string;
|
||||
|
||||
fd = -1;
|
||||
#ifdef __APPLE__
|
||||
@@ -412,23 +475,47 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
#else
|
||||
if (sscanf(d->d_name, "%d", &fd) != 1)
|
||||
continue;
|
||||
if ((fd < 0) || (fd >= FD_SETSIZE))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
/* Skip if the fd is negative. */
|
||||
if (fd < 0)
|
||||
continue;
|
||||
|
||||
/* If a watch_fd was specified, skip if this isn't it. */
|
||||
if (watch_fd >= 0 && watch_fd != fd)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Skip if this fd is already known to us.
|
||||
*/
|
||||
if (fd_to_idx[fd] != -1) {
|
||||
continue;
|
||||
found_idx = -1;
|
||||
for (check_idx = 0; check_idx < array_length; check_idx++) {
|
||||
if (info_array[check_idx].unused)
|
||||
continue;
|
||||
if (info_array[check_idx].watch_fd != fd)
|
||||
continue;
|
||||
if (info_array[check_idx].closed) {
|
||||
/*
|
||||
* If the fd is known but closed,
|
||||
* immediately free it for re-use.
|
||||
*/
|
||||
info_array[check_idx].unused = true;
|
||||
info_array[check_idx].displayable = false;
|
||||
pv_freecontents_watchfd(&(info_array[check_idx]));
|
||||
continue;
|
||||
}
|
||||
found_idx = check_idx;
|
||||
break;
|
||||
}
|
||||
if (found_idx >= 0)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* See if there's an empty slot we can re-use. An empty slot
|
||||
* has a watch_pid of 0.
|
||||
* See if there's an empty slot we can re-use.
|
||||
*/
|
||||
use_idx = -1;
|
||||
for (check_idx = 0; check_idx < array_length; check_idx++) {
|
||||
if (info_array[check_idx].watch_pid == 0) {
|
||||
if (info_array[check_idx].unused) {
|
||||
use_idx = check_idx;
|
||||
break;
|
||||
}
|
||||
@@ -447,60 +534,26 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
|
||||
debug("%s: %d => index %d", "found new fd", fd, use_idx);
|
||||
|
||||
changes_made = true;
|
||||
|
||||
/*
|
||||
* Initialise the details of this new entry.
|
||||
*/
|
||||
memset(&(info_array[use_idx]), 0, sizeof(info_array[use_idx]));
|
||||
|
||||
pv_reset_watchfd(&(info_array[use_idx]));
|
||||
info_array[use_idx].watch_pid = watch_pid;
|
||||
info_array[use_idx].watch_fd = fd;
|
||||
|
||||
/* Allocate new display state. */
|
||||
/*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */
|
||||
info_array[use_idx].state = pv_state_alloc(state->status.program_name);
|
||||
/*@+mustfreeonly@ */
|
||||
if (NULL == info_array[use_idx].state)
|
||||
return 2;
|
||||
|
||||
/* Copy the main status.cwd value to the new state. */
|
||||
memcpy(&(info_array[use_idx].state->status.cwd), &(state->status.cwd), sizeof(state->status.cwd)); /* flawfinder: ignore */
|
||||
/* flawfinder: bounded to destination object size. */
|
||||
info_array[use_idx].closed = false;
|
||||
info_array[use_idx].unused = false;
|
||||
info_array[use_idx].displayable = true;
|
||||
|
||||
/*
|
||||
* Copy over all the control values, blanking out the
|
||||
* dynamically allocated strings, and setting the default
|
||||
* format (fixed buffer) to the required format string
|
||||
* instead of allocating a new dynamic format string for the
|
||||
* copy (so there's less dynamic allocation going on).
|
||||
* Set the average rate window so that a new history buffer
|
||||
* is allocated for this state.
|
||||
*/
|
||||
memcpy(&(info_array[use_idx].state->control), &(state->control), sizeof(state->control)); /* flawfinder: ignore */
|
||||
/* flawfinder: bounded to destination object size. */
|
||||
/*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */
|
||||
info_array[use_idx].state->control.name = NULL;
|
||||
info_array[use_idx].state->control.format_string = NULL;
|
||||
/*@+mustfreeonly@ */
|
||||
info_array[use_idx].state->control.default_format[0] = '\0';
|
||||
use_format_string =
|
||||
NULL != state->control.format_string ? state->control.format_string : state->control.default_format;
|
||||
if (NULL != use_format_string)
|
||||
(void) pv_snprintf(info_array[use_idx].state->control.default_format, PV_SIZEOF_DEFAULT_FORMAT,
|
||||
"%.510s", use_format_string);
|
||||
|
||||
/*
|
||||
* Copy over all the display values, blanking out the
|
||||
* dynamically allocated parts as above; then set the
|
||||
* average rate window so that a new history buffer is
|
||||
* allocated for this state.
|
||||
*/
|
||||
memcpy(&(info_array[use_idx].state->display), &(state->display), sizeof(state->display)); /* flawfinder: ignore */
|
||||
/* flawfinder: bounded to destination object size. */
|
||||
/*@-mustfreeonly@ *//* splint - this is not a leak, this is a new entry. */
|
||||
info_array[use_idx].state->display.display_buffer = NULL;
|
||||
info_array[use_idx].state->display.display_buffer_size = 0;
|
||||
info_array[use_idx].state->display.history = NULL;
|
||||
info_array[use_idx].state->display.history_len = 0;
|
||||
/*@+mustfreeonly@ */
|
||||
pv_state_average_rate_window_set(info_array[use_idx].state, state->control.average_rate_window);
|
||||
(void) pv_update_calc_average_rate_window(&(info_array[use_idx].calc),
|
||||
state->control.average_rate_window);
|
||||
|
||||
#ifdef __APPLE__
|
||||
if (fd_infos[i].proc_fdtype != PROX_FDTYPE_VNODE) {
|
||||
@@ -508,70 +561,33 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
}
|
||||
#endif
|
||||
/* Retrieve the details of this file descriptor. */
|
||||
rc = pv_watchfd_info(state, &(info_array[use_idx]), true);
|
||||
rc = pv_watchfd_info(state, &(info_array[use_idx]), -1 == watch_fd ? true : false);
|
||||
|
||||
/*
|
||||
* Lookup failed - mark this slot as being free for re-use.
|
||||
*/
|
||||
if ((rc != 0) && (rc != 4)) {
|
||||
debug("%s %d: %s: %d", "fd", fd, "lookup failed - marking slot for re-use", use_idx);
|
||||
info_array[use_idx].watch_pid = 0;
|
||||
if (NULL != info_array[use_idx].state)
|
||||
pv_state_free(info_array[use_idx].state);
|
||||
/*@-mustfreeonly@ *//* not a leak - we've just free()d it. */
|
||||
info_array[use_idx].state = NULL;
|
||||
/*@+mustfreeonly@ */
|
||||
pv_freecontents_watchfd(&(info_array[use_idx]));
|
||||
info_array[use_idx].unused = true;
|
||||
info_array[use_idx].displayable = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
fd_to_idx[fd] = use_idx;
|
||||
|
||||
/*
|
||||
* Not displayable - set fd to -1 so the main loop doesn't
|
||||
* show it.
|
||||
* Not displayable - mark it as such so the main loop
|
||||
* doesn't show it.
|
||||
*/
|
||||
if (rc != 0) {
|
||||
debug("%s %d: %s", "fd", fd, "marking as not displayable");
|
||||
info_array[use_idx].watch_fd = -1;
|
||||
}
|
||||
|
||||
/* NULL check on the state - skip if not usable. */
|
||||
if (NULL == info_array[use_idx].state) {
|
||||
debug("%s %d: %s", "fd", fd, "state is NULL - marking as not displayable");
|
||||
info_array[use_idx].watch_fd = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the displayed size appropriately; if the size is 0,
|
||||
* or not known, remove %e and %I from the state's default
|
||||
* format string so that neither estimated time remaining
|
||||
* nor estimated time of completion are displayed.
|
||||
*/
|
||||
info_array[use_idx].state->control.size = info_array[use_idx].size;
|
||||
if (info_array[use_idx].state->control.size < 1) {
|
||||
char *fmt;
|
||||
while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%e"))) {
|
||||
debug("%s", "zero size - removing estimated time remaining");
|
||||
/* strlen-1 here to include trailing \0 */
|
||||
memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */
|
||||
info_array[use_idx].state->flag.reparse_display = 1;
|
||||
}
|
||||
while (NULL != (fmt = strstr(info_array[use_idx].state->control.default_format, "%I"))) {
|
||||
debug("%s", "zero size - removing estimated completion time");
|
||||
/* strlen-1 here to include trailing \0 */
|
||||
memmove(fmt, fmt + 2, strlen(fmt) - 1); /* flawfinder: ignore */
|
||||
info_array[use_idx].state->flag.reparse_display = 1;
|
||||
}
|
||||
/* flawfinder: default_format is always \0-terminated. */
|
||||
info_array[use_idx].displayable = false;
|
||||
}
|
||||
|
||||
/* Set the info display_name appropriately. */
|
||||
pv_watchpid_setname(state, &(info_array[use_idx]));
|
||||
|
||||
/* Carry the display_name through to the display state, and reparse. */
|
||||
pv_state_name_set(info_array[use_idx].state, info_array[use_idx].display_name);
|
||||
info_array[use_idx].state->flag.reparse_display = 1;
|
||||
/* Force the display to be re-parsed. */
|
||||
info_array[use_idx].flags.reparse_display = 1;
|
||||
|
||||
pv_elapsedtime_read(&(info_array[use_idx].start_time));
|
||||
|
||||
@@ -580,11 +596,11 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
* display), if known, so that ETA and so on are calculated
|
||||
* correctly.
|
||||
*/
|
||||
info_array[use_idx].state->display.initial_offset = 0;
|
||||
info_array[use_idx].display.initial_offset = 0;
|
||||
info_array[use_idx].position = 0;
|
||||
position_now = pv_watchfd_position(&(info_array[use_idx]));
|
||||
if (position_now >= 0) {
|
||||
info_array[use_idx].state->display.initial_offset = position_now;
|
||||
info_array[use_idx].display.initial_offset = position_now;
|
||||
info_array[use_idx].position = position_now;
|
||||
}
|
||||
}
|
||||
@@ -596,6 +612,14 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
(void) closedir(dptr);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If any changes were made (i.e. new file descriptors were found),
|
||||
* sort the array so that file descriptors are always displayed in
|
||||
* ascending numerical order.
|
||||
*/
|
||||
if (changes_made && NULL != info_array && array_length > 1)
|
||||
qsort(info_array, (size_t) array_length, sizeof(info_array[0]), pv_compare_watchfd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -604,6 +628,9 @@ int pv_watchpid_scanfds(pvstate_t state,
|
||||
* Set the display name for the given watched file descriptor, truncating at
|
||||
* the relevant places according to the current screen width.
|
||||
*
|
||||
* If more than one distinct PID is being watched, include the PID in the
|
||||
* name as well as the file descriptor number.
|
||||
*
|
||||
* If the file descriptor is pointing to a file under the current working
|
||||
* directory, show its relative path, not the full path.
|
||||
*/
|
||||
@@ -626,23 +653,37 @@ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info)
|
||||
}
|
||||
|
||||
max_display_length = (int) (state->control.width / 2) - 6;
|
||||
if (state->watchfd.multiple_pids)
|
||||
max_display_length -= 9;
|
||||
if (max_display_length >= (int) path_length) {
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME, "%4d:%.498s", info->watch_fd, file_fdpath);
|
||||
if (state->watchfd.multiple_pids) {
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME, "%8d:%4d:%.498s", (int) (info->watch_pid),
|
||||
info->watch_fd, file_fdpath);
|
||||
} else {
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME, "%4d:%.498s", info->watch_fd, file_fdpath);
|
||||
}
|
||||
} else {
|
||||
int prefix_length, suffix_length;
|
||||
|
||||
prefix_length = max_display_length / 4;
|
||||
suffix_length = max_display_length - prefix_length - 3;
|
||||
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME,
|
||||
"%4d:%.*s...%.*s",
|
||||
info->watch_fd, prefix_length,
|
||||
file_fdpath, suffix_length, file_fdpath + path_length - suffix_length);
|
||||
if (state->watchfd.multiple_pids) {
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME,
|
||||
"%8d:%4d:%.*s...%.*s",
|
||||
(int) (info->watch_pid), info->watch_fd, prefix_length,
|
||||
file_fdpath, suffix_length, file_fdpath + path_length - suffix_length);
|
||||
} else {
|
||||
(void) pv_snprintf(info->display_name,
|
||||
PV_SIZEOF_DISPLAY_NAME,
|
||||
"%4d:%.*s...%.*s",
|
||||
info->watch_fd, prefix_length,
|
||||
file_fdpath, suffix_length, file_fdpath + path_length - suffix_length);
|
||||
}
|
||||
}
|
||||
|
||||
debug("%s: %d: [%s]", "set name for fd", info->watch_fd, info->display_name);
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
# 1MiB, described here:
|
||||
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586763
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Transfer 1500kB of data in a bursty fashion.
|
||||
#
|
||||
@@ -28,5 +31,3 @@ test "${lineLengthCount}" = "1" && exit 0
|
||||
echo "variable line lengths detected"
|
||||
tr '\r' '\n' < "${workFile1}"
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
# This is the same as the other display length at magnitude boundary check,
|
||||
# but for rate, not bytes transferred.
|
||||
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Transfer 1500kB of data in a bursty fashion.
|
||||
#
|
||||
@@ -29,5 +33,3 @@ test "${lineLengthCount}" = "1" && exit 0
|
||||
echo "variable line lengths detected"
|
||||
tr '\r' '\n' < "${workFile1}"
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,16 @@
|
||||
#
|
||||
# Test that "make install" installs the expected minimum set of files.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
if test "${XCTEST}" = "1"; then
|
||||
echo "cross-compile flag set - skipping as local make will not run"
|
||||
exit 77
|
||||
fi
|
||||
|
||||
makeDir="${testSubject%/*}"
|
||||
if ! test -d "${makeDir}"; then
|
||||
@@ -21,8 +29,20 @@ if ! test -n "${testInstallDir}"; then
|
||||
fi
|
||||
|
||||
export DESTDIR="${testInstallDir}"
|
||||
if ! ${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >"${workFile1}" 2>&1; then
|
||||
echo "\`make install' exited $?"
|
||||
${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >"${workFile1}" 2>&1
|
||||
rc=$?
|
||||
if ! test "${rc}" -eq 0; then
|
||||
if ! test "${makeCommand}" = "make"; then
|
||||
# Retry with plain "make".
|
||||
makeCommand="make"
|
||||
${makeCommand} -C "${makeDir}" install DESTDIR="${testInstallDir}" >>"${workFile1}" 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
fi
|
||||
if ! test ${rc} -eq 0; then
|
||||
echo "\`make install' exited ${rc}"
|
||||
echo "command: ${makeCommand} -C '${makeDir}' install DESTDIR='${testInstallDir}'"
|
||||
cat "${workFile1}"
|
||||
rm -rf "${testInstallDir}"
|
||||
exit 1
|
||||
fi
|
||||
@@ -39,5 +59,3 @@ fi
|
||||
|
||||
rm -rf "${testInstallDir}"
|
||||
exit "${exitStatus}"
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
# Check that the average transfer rate counter changes, but not more than it
|
||||
# should.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Transfer 210 bytes as 100 bytes, a 1 second gap, 110 bytes, and another 1
|
||||
# second gap.
|
||||
@@ -27,5 +30,3 @@ test "${lineCount}" -lt 2 && exit 0
|
||||
echo "average rate varied more than expected"
|
||||
tr '\r' '\n' < "${workFile1}"
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the byte counter counts in bits when --bits is selected.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -b -8 >/dev/null 2>"${workFile1}"
|
||||
@@ -13,5 +16,3 @@ test "${counterValue}" = "800b" && exit 0
|
||||
|
||||
echo "unexpected bit counter value: ${counterValue}"
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that "--buffer-percent" displays correctly.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# The output should show 100% and 0% as the buffer initially fills up due to
|
||||
# there being nowhere to write it to, and then empties.
|
||||
@@ -17,5 +20,3 @@ test "${differentLines}" -gt 1 && exit 0
|
||||
echo "expected output changes not seen"
|
||||
tr '\r' '\n' < "${workFile1}" | sed 's/^ *$/d' | sort | uniq
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the byte counter counts.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -b >/dev/null 2>"${workFile1}"
|
||||
@@ -13,5 +16,3 @@ test "${counterValue}" = "100B" && exit 0
|
||||
|
||||
echo "unexpected byte counter value: ${counterValue}"
|
||||
exit 1
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the estimated time counter counts.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -e -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}"
|
||||
@@ -29,5 +32,3 @@ if ! test "${valueCount}" -lt 12; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the estimated time counter can show the end time of day.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -I -s 100 -i 0.1 -L 25 >/dev/null 2>"${workFile1}"
|
||||
@@ -28,5 +31,3 @@ if ! test "${valueCount}" -lt 8; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that "--last-written" works.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Slowly write a sequence of numbers (rate-limited by another `pv' instance)
|
||||
# and watch the "--last-written" output of a second `pv' instance to make
|
||||
@@ -15,8 +18,11 @@ seq -w 3 1 100 \
|
||||
differentLines=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq | wc -l | tr -dc '0-9')
|
||||
lastLine=$(tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sed -n '$p')
|
||||
|
||||
if ! test "${differentLines}" -gt 5; then
|
||||
echo "fewer than 6 different outputs seen"
|
||||
# Even on very slow hosts, we should see at least 3 different output lines -
|
||||
# nothing at the start, something in the middle, and the last few numbers at
|
||||
# the end.
|
||||
if ! test "${differentLines}" -gt 2; then
|
||||
echo "fewer than 3 different outputs seen"
|
||||
tr '\r' '\n' < "${workFile1}" | sed '/^ *$/d' | sort | uniq
|
||||
exit 1
|
||||
fi
|
||||
@@ -30,5 +36,3 @@ if ! test "${lastLine}" = "${expectedLastLine}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that numeric output outputs some percentages.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for
|
||||
# around 10 output lines.
|
||||
@@ -31,5 +34,3 @@ if ! test "${finalLine}" = "100"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
# Check that numeric output gives a byte count instead of a percentage when
|
||||
# used with -b.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Process 500 bytes at 500 bytes per second, updating every 0.1 seconds for
|
||||
# around 10 output lines.
|
||||
@@ -15,20 +18,21 @@ dd if=/dev/zero bs=500 count=1 2>/dev/null \
|
||||
lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9')
|
||||
finalLine=$(sed -n '$p' < "${workFile1}")
|
||||
|
||||
# The number of output lines should be >8 and <13, and the final byte count
|
||||
# The number of output lines should be >6 and <13, and the final byte count
|
||||
# should be 500.
|
||||
#
|
||||
if ! test "${lineCount}" -gt 8; then
|
||||
echo "fewer than 9 output lines (${lineCount})"
|
||||
if ! test "${lineCount}" -gt 6; then
|
||||
echo "fewer than 7 output lines (${lineCount}):"
|
||||
cat "${workFile1}"
|
||||
exit 1
|
||||
fi
|
||||
if ! test "${lineCount}" -lt 13; then
|
||||
echo "more than 12 output lines (${lineCount})"
|
||||
echo "more than 12 output lines (${lineCount}):"
|
||||
cat "${workFile1}"
|
||||
exit 1
|
||||
fi
|
||||
if ! test "${finalLine}" = "500"; then
|
||||
echo "final byte count was not 500 (${finalLine})"
|
||||
echo "final byte count was not 500 (${finalLine}):"
|
||||
cat "${workFile1}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
# Check that numeric output shows line counts instead of percentages, when
|
||||
# used in line mode together with bytes mode.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# Pass through 100 lines.
|
||||
#
|
||||
@@ -33,5 +37,3 @@ if ! test "${finalStdoutLine}" = "100"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that numeric output gives a timer when used with -t.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for
|
||||
# around 10 output lines.
|
||||
@@ -15,20 +18,20 @@ lineCount=$(wc -l < "${workFile1}" | tr -dc '0-9')
|
||||
timesCount=$(tr ',' '.' < "${workFile1}" | awk '{print int(10*$1)}' | sort -n | uniq | wc -l | tr -dc '0-9')
|
||||
finalPercentage=$(sed -n '$p' < "${workFile1}" | awk '{print $2}')
|
||||
|
||||
# The number of output lines should be >8 and <13, and the number of
|
||||
# different elapsed times should be at least 7. The last percentage should
|
||||
# The number of output lines should be >7 and <13, and the number of
|
||||
# different elapsed times should be at least 6. The last percentage should
|
||||
# be 100.
|
||||
#
|
||||
if ! test "${lineCount}" -gt 8; then
|
||||
echo "fewer than 9 output lines (${lineCount})"
|
||||
if ! test "${lineCount}" -gt 7; then
|
||||
echo "fewer than 8 output lines (${lineCount})"
|
||||
exit 1
|
||||
fi
|
||||
if ! test "${lineCount}" -lt 13; then
|
||||
echo "more than 12 output lines (${lineCount})"
|
||||
exit 1
|
||||
fi
|
||||
if ! test "${timesCount}" -gt 7; then
|
||||
echo "fewer than 8 different elapsed times (${timesCount})"
|
||||
if ! test "${timesCount}" -gt 5; then
|
||||
echo "fewer than 6 different elapsed times (${timesCount})"
|
||||
exit 1
|
||||
fi
|
||||
if ! test "${finalPercentage}" = "100"; then
|
||||
@@ -37,5 +40,3 @@ if ! test "${finalPercentage}" = "100"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the progress bar moves when data is coming in.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -p -i 0.1 -L 500 >/dev/null 2>"${workFile1}"
|
||||
@@ -18,5 +21,3 @@ if ! test "${lineCount}" -gt 2; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the progress bar increases in size when data is coming in.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -p -i 0.1 -L 50 -s 100 >/dev/null 2>"${workFile1}"
|
||||
@@ -28,5 +31,3 @@ if ! test "${differentBarLengthsCount}" -gt 5; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the -q option shuts everything up.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=1000 count=5 2>/dev/null \
|
||||
| "${testSubject}" -f -q -i 0.1 -L 5000 >/dev/null 2>"${workFile1}"
|
||||
@@ -15,5 +18,3 @@ if test -s "${workFile1}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the transfer rate counter changes.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Transfer 200 bytes as two 100-byte blocks with a 2-second gap between.
|
||||
#
|
||||
@@ -27,5 +30,3 @@ if ! test "${rateCount}" -gt 2; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the elapsed time counter does count up.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Transfer a zero amount of data, but take 3 seconds to do it.
|
||||
#
|
||||
@@ -18,5 +21,3 @@ if ! test "${valueCount}" -gt 1; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
# Check that the process ID can be written to a file as described in the
|
||||
# manual.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Check we can run "kill -s 0".
|
||||
if ! kill -s 0 $$ >/dev/null 2>&1; then
|
||||
@@ -46,5 +49,3 @@ if ! test "${pidValid}" = "1"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
#
|
||||
# Check that size arguments are processed correctly.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
|
||||
# Pass size argument $1 and check that the last reported number is $2.
|
||||
checkSizeArgument () {
|
||||
@@ -20,5 +22,3 @@ checkSizeArgument 1M 1048576
|
||||
checkSizeArgument 8G 8589934592
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
#
|
||||
# Check that data can be just passed straight through.
|
||||
|
||||
# Dummy assignment for "shellcheck".
|
||||
testSubject="${testSubject:-false}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
|
||||
inputString="TESTING"
|
||||
outputString=$(printf "%s" "${inputString}" | "${testSubject}" 2>/dev/null) || { echo "unexpected failure code"; exit 1; }
|
||||
@@ -23,5 +25,3 @@ if ! test "${inputString}" = "${outputString}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
# Transfer a large chunk of data through pv and check data correctness
|
||||
# afterwards.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# generate some data
|
||||
dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null
|
||||
@@ -19,5 +23,3 @@ outputChecksum=$(cksum "${workFile2}" | awk '{print $1}')
|
||||
test "${inputChecksum}" = "${outputChecksum}" || exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
# Transfer a large chunk of data through pv using pipes, sending it in a
|
||||
# bursty fashion, and check data correctness afterwards.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# generate some data
|
||||
dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null
|
||||
@@ -52,5 +56,3 @@ if ! test "${inputChecksum}" = "${outputChecksum}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,12 @@
|
||||
#
|
||||
# Make sure that files larger than 2GB are supported.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# Check there is enough free space for this test.
|
||||
workFile1Dir="${workFile1%/*}"
|
||||
@@ -76,5 +80,3 @@ if ! test "${bytesReported}" -eq "${fileSize}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
#
|
||||
# Check that there is no SIGPIPE or dropped data on bigger data transfers.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
|
||||
# We nead GNU head. On some platforms it is named ghead instead of head.
|
||||
HEAD="head"
|
||||
@@ -36,5 +38,3 @@ if ! test "${stopAtByteCount}" = "${bytesTransferred}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,14 @@
|
||||
# Try repeatedly messaging a transfer process, and make sure the data stays
|
||||
# intact.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Do nothing if it is not supported.
|
||||
if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then
|
||||
@@ -12,14 +18,17 @@ if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then
|
||||
exit 77
|
||||
fi
|
||||
|
||||
# Generate some data.
|
||||
# Generate 10MiB of data.
|
||||
dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null
|
||||
|
||||
# Run a few remote control commands in the background.
|
||||
#
|
||||
echo FAIL > "${workFile3}"
|
||||
true > "${workFile4}"
|
||||
(
|
||||
set +e
|
||||
# Don't start doing anything until the main transfer process, started below, has begun.
|
||||
while test -e "${workFile4}" && ! test -s "${workFile4}"; do sleep 0.1; done
|
||||
sleep 2
|
||||
for loopCount in 1 2 3; do
|
||||
"${testSubject}" -R "$(cat "${workFile4}")" -apterb || exit 1
|
||||
@@ -30,6 +39,8 @@ for loopCount in 1 2 3; do
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile4}")" -F "%e" || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile4}")" -x "window:%b" || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile4}")" -N "." || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
echo "${loopCount}" >/dev/null # dummy for shellcheck
|
||||
@@ -57,5 +68,3 @@ if ! test "${inputChecksum}" = "${outputChecksum}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,15 @@
|
||||
# Run valgrind's memory checker against a process using various different
|
||||
# transfer options.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${sourcePath:?not set - call this from 'make check'}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Load the valgrind function.
|
||||
. "${sourcePath}/tests/run-valgrind.sh"
|
||||
@@ -34,5 +41,3 @@ seq -w 3 1 100 \
|
||||
| { runWithValgrind -bnl -i 0.2 -f -L 100 2>"${workFile1}" > "${workFile2}"; } 4>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run valgrind's memory checker against a process that sets is process
|
||||
# title.
|
||||
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${sourcePath:?not set - call this from 'make check'}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Load the valgrind function.
|
||||
. "${sourcePath}/tests/run-valgrind.sh"
|
||||
|
||||
# Without an extra format string.
|
||||
(dd if=/dev/zero bs=100 count=1 2>/dev/null;
|
||||
sleep 1;
|
||||
dd if=/dev/zero bs=110 count=1 2>/dev/null;
|
||||
sleep 1;
|
||||
) | { runWithValgrind -f -i 0.5 -a -x processtitle >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1
|
||||
|
||||
# With an extra format string.
|
||||
(dd if=/dev/zero bs=100 count=1 2>/dev/null;
|
||||
sleep 1;
|
||||
dd if=/dev/zero bs=110 count=1 2>/dev/null;
|
||||
sleep 1;
|
||||
) | { runWithValgrind -f -i 0.5 -a -x 'processtitle:%t %b' >/dev/null 2>"${workFile1}"; } 4>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
@@ -2,8 +2,15 @@
|
||||
#
|
||||
# Run valgrind's memory checker while receiving remote control commands.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${sourcePath:?not set - call this from 'make check'}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Do nothing if it is not supported.
|
||||
if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then
|
||||
@@ -20,7 +27,7 @@ dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null
|
||||
true > "${workFile3}"
|
||||
(
|
||||
set +e
|
||||
while ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done
|
||||
while test -e "${workFile3}" && ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done
|
||||
for loopCount in 1 2 3; do
|
||||
"${testSubject}" -R "$(cat "${workFile3}")" -apterb || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
@@ -30,6 +37,8 @@ for loopCount in 1 2 3; do
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile3}")" -F "%e" || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile3}")" -x "window:%b" || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
"${testSubject}" -R "$(cat "${workFile3}")" -N "." || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
echo "${loopCount}" >/dev/null # dummy for shellcheck
|
||||
@@ -39,5 +48,3 @@ done
|
||||
{ runWithValgrind -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null; } 4>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,15 @@
|
||||
# Run valgrind's memory checker while using remote control to control
|
||||
# another process.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
sourcePath="${sourcePath:-.}"; testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"; workFile3="${workFile3:-.tmp3}"; workFile4="${workFile4:-.tmp4}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${sourcePath:?not set - call this from 'make check'}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Do nothing if it is not supported.
|
||||
if ! "${testSubject}" -h 2>/dev/null | grep -Eq "^ -R,"; then
|
||||
@@ -20,7 +27,7 @@ dd if=/dev/urandom of="${workFile1}" bs=1024 count=10240 2>/dev/null
|
||||
# Check from the POV of the process sending a control command.
|
||||
true > "${workFile3}"
|
||||
"${testSubject}" -L 100k -i 0.1 -f -P "${workFile3}" "${workFile1}" > "${workFile2}" 2>/dev/null &
|
||||
while ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done
|
||||
while test -e "${workFile3}" && ! test -s "${workFile3}"; do usleep 200000 2>/dev/null || sleep 1; done
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -apterb 4>&1 || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -p 4>&1 || exit 1
|
||||
@@ -29,11 +36,11 @@ runWithValgrind -R "$(cat "${workFile3}")" -N "test" 4>&1 || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -F "%e" 4>&1 || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -x "window:%b" 4>&1 || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -N "." 4>&1 || exit 1
|
||||
(usleep 200000 || sleep 1) 2>/dev/null
|
||||
runWithValgrind -R "$(cat "${workFile3}")" -L 10M 4>&1 || exit 1
|
||||
wait
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Run valgrind's memory checker against a process using the --watchfd
|
||||
# option.
|
||||
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${sourcePath:?not set - call this from 'make check'}"
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
true "${workFile3:?not set - call this from 'make check'}"
|
||||
true "${workFile4:?not set - call this from 'make check'}"
|
||||
|
||||
# Load the valgrind function.
|
||||
. "${sourcePath}/tests/run-valgrind.sh"
|
||||
|
||||
# Skip the test if "-d" is not available.
|
||||
if ! "${testSubject}" -h | grep -Fq ' -d'; then
|
||||
echo "no \`--watchfd' / \`-d' option on this platform"
|
||||
exit 77
|
||||
fi
|
||||
|
||||
# Skip the test if "-d" does not work.
|
||||
sleep 2 &
|
||||
pid=$!
|
||||
sleep 0.1
|
||||
"${testSubject}" -d "${pid}" -f -i 0.5 >/dev/null 2>"${workFile1}"
|
||||
if grep -Fq ' -d: not available' "${workFile1}"; then
|
||||
echo "no \`--watchfd' / \`-d' option on this platform"
|
||||
exit 77
|
||||
fi
|
||||
|
||||
# Check "--watchfd PID:FD".
|
||||
# See the "Watchfd" tests for more detail.
|
||||
seq 1 100 > "${workFile1}"
|
||||
true > "${workFile3}"
|
||||
# shellcheck disable=SC2030
|
||||
(while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done; sleep 1; read -r line; sleep 1; read -r line; sleep 1) <"${workFile1}" &
|
||||
pid=$!
|
||||
sleep 0.1
|
||||
{ runWithValgrind -P "${workFile3}" -d "${pid}:0" -f -i 0.5 >/dev/null 2>&1; } 4>&1 || exit 1
|
||||
|
||||
# Check "--watchfd PID".
|
||||
seq 1 100 > "${workFile1}"
|
||||
seq 1 300 > "${workFile2}"
|
||||
true > "${workFile3}"
|
||||
# shellcheck disable=SC2030
|
||||
(
|
||||
while test -e "${workFile3}" && ! test -s "${workFile3}"; do sleep 0.1; done
|
||||
sleep 1
|
||||
read -r line
|
||||
exec 9<"${workFile2}"
|
||||
sleep 1
|
||||
exec 8<"${workFile1}"
|
||||
exec 7</dev/null
|
||||
sleep 1
|
||||
exec 9<&-
|
||||
# shellcheck disable=SC2034
|
||||
read -r line
|
||||
sleep 1
|
||||
) <"${workFile1}" &
|
||||
pid=$!
|
||||
sleep 0.1
|
||||
{ runWithValgrind -P "${workFile3}" -d "${pid}" -f -i 0.5 >/dev/null 2>&1; } 4>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
@@ -5,8 +5,12 @@
|
||||
# doesn't check that O_DIRECT is actually being used, it just checks that
|
||||
# data is not being corrupted.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# generate some data
|
||||
dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null
|
||||
@@ -51,5 +55,3 @@ if ! test "${doubleInputChecksum}" = "${outputChecksum}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,11 @@
|
||||
# Check that the progress bar is produced when "--force" is used, and is not
|
||||
# when it is not, providing stderr is a file.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}";
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
dd if=/dev/zero bs=100 count=1 2>/dev/null \
|
||||
| "${testSubject}" -f -p -i 0.1 -L 100 >/dev/null 2>"${workFile1}"
|
||||
@@ -32,5 +35,3 @@ if test -s "${workFile1}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that the update interval can be set.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
sleep 1 | "${testSubject}" -f -i 0.1 >/dev/null 2>"${workFile1}"
|
||||
|
||||
@@ -17,5 +20,3 @@ if ! test "${lineCount}" -gt 6; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that line mode counts lines instead of bytes.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Pass through 100 lines.
|
||||
#
|
||||
@@ -28,5 +31,3 @@ if ! test "${lineCount}" -gt 3; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -2,8 +2,11 @@
|
||||
#
|
||||
# Check that "--size" affects the percentage shown.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
|
||||
# Process 100 bytes at 100 bytes per second, updating every 0.1 seconds for
|
||||
# around 10 output lines, but set the size to 200.
|
||||
@@ -52,5 +55,3 @@ if ! test "${finalLine}" = "200"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
# Similar to the "--size" check but, instead, using another file's size with
|
||||
# "--size @".
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# Process 100 bytes at 100 bytes per second, interval 0.1 seconds, with the
|
||||
# size set from a file of $1 bytes and expecting a percentage of $2 at the
|
||||
@@ -45,5 +49,3 @@ sizeCheck 200 50
|
||||
sizeCheck 50 200
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
# check that fdatasync() is actually being called, it just checks that data
|
||||
# is not being corrupted.
|
||||
|
||||
# Dummy assignments for "shellcheck".
|
||||
testSubject="${testSubject:-false}"; workFile1="${workFile1:-.tmp1}"; workFile2="${workFile2:-.tmp2}"
|
||||
# Allow all tests to be skipped, e.g. during a release build
|
||||
test "${SKIP_ALL_TESTS}" = "1" && exit 77
|
||||
|
||||
true "${testSubject:?not set - call this from 'make check'}"
|
||||
true "${workFile1:?not set - call this from 'make check'}"
|
||||
true "${workFile2:?not set - call this from 'make check'}"
|
||||
|
||||
# generate some data
|
||||
dd if=/dev/urandom of="${workFile1}" bs=1024 count=2560 2>/dev/null
|
||||
@@ -41,5 +45,3 @@ if ! test "${inputChecksum}" = "${outputChecksum}"; then
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
# EOF
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user