21 Commits
Author SHA1 Message Date
Andrew Wood 3f597e59e0 Adjust the installer test to retry with both "gmake" and "make", to work around strange behaviour on NetBSD. 2025-01-28 22:10:49 +00:00
Andrew Wood a62051e5ff Adjust the sensitivity of the test. 2025-01-28 21:35:42 +00:00
Andrew Wood 5483ddf024 Version bump. 2025-01-28 21:22:12 +00:00
Andrew Wood 62ef4b91fc Timestamp update. 2025-01-28 21:21:56 +00:00
Andrew Wood 8664521f08 Reformat with indent; update translation string line numbers. 2025-01-26 20:08:17 +00:00
Andrew Wood 6ef23916f0 Adjust formatting of indented paragraphs. 2025-01-25 21:38:26 +00:00
Andrew Wood 73f8a2fb02 Acknowledge #127. 2025-01-25 21:34:21 +00:00
Andrew Wood a552fc5329 Document the use of "--numeric" with "--format". 2025-01-25 21:28:33 +00:00
Andrew Wood 505a91a6ed In --numeric mode, still call the same formatting functions, only with a different default string, and end with a newline rather than a carriage return (#127). 2025-01-25 21:15:05 +00:00
Andrew Wood 0d3b678800 Format the average rate, byte/line count, percentage completion, transfer rate, and elapsed time as just a number on its own in numeric mode. 2025-01-24 23:10:59 +00:00
Andrew Wood efb115c2aa Remove the TODO since buffer utilisation may not be useful with --numeric, as it is not always a number. 2025-01-24 23:07:05 +00:00
Andrew Wood 8721d285ce Add TODO markers at possible touch points for "--numeric --format" implementation (#127). 2025-01-23 21:56:57 +00:00
Andrew Wood f421f9979d Acknowledge updated Polish and Russian translations. 2025-01-15 21:20:37 +00:00
Andrew Wood d5ad641102 Merge pull request 'Translations update from Codeberg Translate' (#126) from translate/pv:weblate-pv-pv into main
Reviewed-on: https://codeberg.org/a-j-wood/pv/pulls/126
2025-01-15 21:17:23 +00:00
0koandCodeberg Translate ec6199c973 Translated using Weblate (Russian)
Currently translated at 90.1% (119 of 132 strings)

Translation: pv/pv
Translate-URL: https://translate.codeberg.org/projects/pv/pv/ru/
2025-01-15 19:08:24 +00:00
coralpinkandCodeberg Translate 0eb09d097e Translated using Weblate (Polish)
Currently translated at 100.0% (132 of 132 strings)

Translation: pv/pv
Translate-URL: https://translate.codeberg.org/projects/pv/pv/pl/
2025-01-15 19:08:24 +00:00
Andrew Wood 13265b3d6b Note the translation update. 2025-01-14 21:19:53 +00:00
Andrew Wood dbc7cd7bac Update the translation acknowledgements. 2025-01-14 20:54:46 +00:00
Andrew Wood 4c1f36cda4 Merge pull request 'Translations update from Codeberg Translate' (#125) from translate/pv:weblate-pv-pv into main
Reviewed-on: https://codeberg.org/a-j-wood/pv/pulls/125
2025-01-14 20:42:58 +00:00
BennyandCodeberg Translate 987af6ba16 Translated using Weblate (German)
Currently translated at 100.0% (132 of 132 strings)

Translation: pv/pv
Translate-URL: https://translate.codeberg.org/projects/pv/pv/de/
2025-01-14 20:39:46 +00:00
m0yellowandCodeberg Translate 58451ae18b Translated using Weblate (German)
Currently translated at 100.0% (132 of 132 strings)

Translation: pv/pv
Translate-URL: https://translate.codeberg.org/projects/pv/pv/de/
2025-01-14 17:19:02 +00:00
22 changed files with 267 additions and 270 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ 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.9.27], [pv@ivarch.com], [pv], [https://www.ivarch.com/programs/pv.shtml])
AC_INIT([pv], [1.9.31], [pv@ivarch.com], [pv], [https://www.ivarch.com/programs/pv.shtml])
AC_CONFIG_SRCDIR([src/include/config.h.in])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([src/include/config.h])
+5 -3
View File
@@ -106,6 +106,7 @@ is acknowledged and greatly appreciated:
* [heitbaum](https://codeberg.org/heitbaum) - assisted with cross-compilation fault introduced in 1.9.7 ([#120](https://codeberg.org/a-j-wood/pv/issues/120))
* [meego](https://codeberg.org/meego) - suggested "**%nL**", the last line preview ([#121](https://codeberg.org/a-j-wood/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/a-j-wood/pv/issues/15))
* [jmealo](https://codeberg.org/jmealo) - suggested JSON progress output ([#127](https://codeberg.org/a-j-wood/pv/issues/127))
Translations provided through [Codeberg Weblate](https://translate.codeberg.org/projects/pv/):
@@ -115,13 +116,14 @@ Translations provided through [Codeberg Weblate](https://translate.codeberg.org/
* anonymous suggestions (7)
* **German**
* [Hartmut Goebel](https://translate.codeberg.org/user/htgoebel/) (77)
* [Benny](https://translate.codeberg.org/user/Benny/) (6)
* [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/) (100)
* [coralpink](https://translate.codeberg.org/user/coralpink/) (106)
* **Russian**
* [0ko](https://translate.codeberg.org/user/0ko/) (151)
* [0ko](https://translate.codeberg.org/user/0ko/) (157)
* **Turkish**
* [omerdduran](https://translate.codeberg.org/user/omerdduran/) (129)
+7
View File
@@ -1,3 +1,10 @@
### 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/a-j-wood/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
+26 -23
View File
@@ -1,4 +1,4 @@
.TH PV 1 2025-01-12 pv-1.9.27 "User Commands"
.TH PV 1 2025-01-28 pv-1.9.31 "User Commands"
.\"
.SH NAME
pv \- monitor the progress of data through a pipe
@@ -97,8 +97,7 @@ percentage, one per line, on standard error, suitable for passing to a tool
such as \fBdialog\fR(1).
Note that \*(lq\fB\-\-force\fR\*(rq is not required if
\*(lq\fB\-\-numeric\fR\*(rq is being used.
.TP
.B ""
.IP
Combining \*(lq\fB\-\-numeric\fR\*(rq with \*(lq\fB\-\-bytes\fR\*(rq will
cause the number of bytes processed so far to be output instead of a
percentage.
@@ -109,6 +108,13 @@ Adding \*(lq\fB\-\-rate\fR\*(rq adds the transfer rate to each output line
byte/line count).
Adding \*(lq\fB\-\-timer\fR\*(rq prefixes each output line with the elapsed
time so far, as a decimal number of seconds.
.IP
Combining \*(lq\fB\-\-numeric\fR\*(rq with \*(lq\fB\-\-format\fR\*(rq allows
for custom output. The default format string components for
\*(lq\fB\-\-numeric\fR\*(rq are
\*(lq\fB%t\~%b\~%r\~%{progress\-amount\-only}\fR\*(rq in that order, each
item being active or inactive according to the rules above (so the default
with no other options is \*(lq\fB%{progress\-amount\-only}\fR\*(rq.
.TP
.B \-q, \-\-quiet
No output.
@@ -147,13 +153,10 @@ A suffix of \*(lqK\*(rq, \*(lqM\*(rq, \*(lqG\*(rq, or \*(lqT\*(rq can be
added to denote kibibytes (*1024), mebibytes, gibibytes, tebibytes.
If \*(lq\fB\-\-si\fR\*(rq appears before this option, suffixes will denote
kilobytes (*1000), megabytes, and so on instead.
.TP
.B ""
.IP
If \fISIZE\fR starts with \*(lq\fB@\fR\*(rq, the size of file whose name
follows the @ will be used.
.TP
.B ""
.TP
.B \-g, \-\-gauge
If the progress bar is shown but the size is not known, then instead of
moving the bar left and right to show progress, show the current transfer
@@ -163,8 +166,7 @@ rate as a percentage of the maximum rate seen so far.
Instead of counting bytes, count lines (newline characters).
The progress bar will only move when a new line is found, and the value
passed to \*(lq\fB\-\-size\fR\*(rq will be interpreted as a line count.
.TP
.B ""
.IP
If this option is used without \*(lq\fB\-\-size\fR\*(rq, the "total size"
(in this case, total line count) is calculated by reading through all input
files once before transfer starts.
@@ -282,8 +284,7 @@ The corresponding parts of the output will be null bytes.
At first only a few bytes will be skipped, but if there are many errors in a
row then the skips will move up to chunks of 512.
This is intended to be similar to \*(lq\fIdd\~conv=sync,noerror\fR\*(rq.
.TP
.B ""
.IP
Specify \*(lq\fB\-\-skip\-errors\fR\*(rq twice to only report a read error
once per file, instead of reporting each byte range skipped.
.TP
@@ -295,8 +296,7 @@ block of \fIBYTES\fR bytes as soon as an error occurs.
There may still be some shorter skips where the block being skipped
coincides with the end of the transfer buffer.
The same suffixes as \*(lq\fB\-\-size\fR\*(rq can be used.
.TP
.B ""
.IP
This option can only be used with \*(lq\fB\-\-skip\-errors\fR\*(rq
and is intended for use when reading from a block device, such as
\*(lq\fB\-\-skip\-errors\~\-\-error\-skip\-block\~4K\fR\*(rq
@@ -337,8 +337,7 @@ exhausted, read all of \fIFILE\fR and write it to the output.
\fIFILE\fR remains in place afterwards, unless it is
\*(lq\fB-\fR\*(rq, in which case \fBpv\fR creates a temporary file for this
purpose, and automatically removes it afterwards.
.TP
.B ""
.IP
This can be useful if you have a pipeline which generates data (your
input) quickly but you don't know the size, and you wish to pass it to some
slower process, once all of the input has been generated and you know its
@@ -356,8 +355,7 @@ Instead of transferring data, watch file descriptor \fIFD\fR of process
The \fBpv\fR process will exit when \fIFD\fR either changes to a different
file, changes read/write mode, or is closed; other data transfer modifiers -
and remote control - may not be used with this option.
.TP
.B ""
.IP
If only a \fIPID\fR is specified, then that process will be watched, and all
regular files and block devices it opens will be shown with a progress bar.
The \fBpv\fR process will exit when process \fIPID\fR exits.
@@ -489,8 +487,7 @@ Emit ECMA-48 SGR (Select Graphic Rendition) codes if the terminal supports
colours, where \fIcolour,...\fR is a comma-separated list of any of the
keywords below, or the numeric values from \fBconsole_codes\fR(4). If
colour support is not available, nothing is emitted.
.TP
.B ""
.IP
Supported keywords are:
\fBreset\fR or \fBnone\fR,
\fBblack\fR,
@@ -530,12 +527,10 @@ Supported keywords are:
\fBno\-underscore\fR or \fBno\-underline\fR,
\fBno\-blink\fR,
\fBno\-reverse\fR.
.TP
.B ""
.IP
With colours, the optional "fg-" prefix indicates foreground; a prefix of
"bg-" indicates background.
.TP
.B ""
.IP
For example, \*(lq\fB%{sgr:green,bold}TEXT%{sgr:reset}\fR\*(lq will make
\fITEXT\fR bold green on supported terminals.
.TP
@@ -666,6 +661,14 @@ the progress display:
pv \-\-format '%a %p : %L' big.log | processing-script
.EE
.in
.PP
Showing progress as lines of JSON data:
.PP
.in +4
.EX
pv \-\-numeric \-\-format '{"elapsed":%t,"bytes":%b,"rate":%r,"percentage":%{progress-amount-only}}' big.log | processing-script
.EE
.in
.\"
.SH EXIT STATUS
An exit status of 1 indicates a problem with the \*(lq\fB\-\-remote\fR\*(rq
+20 -12
View File
@@ -100,7 +100,7 @@ are explicitly switched on will be shown.
suitable for passing to a tool such as **dialog**(1). Note that
"**\--force**" is not required if "**\--numeric**" is being used.
: Combining "**\--numeric**" with "**\--bytes**" will cause the number
Combining "**\--numeric**" with "**\--bytes**" will cause the number
of bytes processed so far to be output instead of a percentage.
Adding "**\--line-mode**" as well as "**\--bytes**" writes the
number of lines instead of bytes or a percentage. Adding
@@ -109,6 +109,12 @@ are explicitly switched on will be shown.
count). Adding "**\--timer**" prefixes each output line with the
elapsed time so far, as a decimal number of seconds.
Combining "**\--numeric**" with "**\--format**" allows for custom
output. The default format string components for "**\--numeric**"
are "**%t %b %r %{progress-amount-only}**" in that order, each item
being active or inactive according to the rules above (so the
default with no other options is "**%{progress-amount-only}**".
**-q, \--quiet**
: No output. Useful if the "**\--rate-limit**" option is being used on
@@ -150,11 +156,9 @@ are explicitly switched on will be shown.
tebibytes. If "**\--si**" appears before this option, suffixes will
denote kilobytes (\*1000), megabytes, and so on instead.
: If *SIZE* starts with "**@**", the size of file whose name follows
If *SIZE* starts with "**@**", the size of file whose name follows
the @ will be used.
:
**-g, \--gauge**
: If the progress bar is shown but the size is not known, then instead
@@ -167,7 +171,7 @@ are explicitly switched on will be shown.
progress bar will only move when a new line is found, and the value
passed to "**\--size**" will be interpreted as a line count.
: If this option is used without "**\--size**", the \"total size\" (in
If this option is used without "**\--size**", the \"total size\" (in
this case, total line count) is calculated by reading through all
input files once before transfer starts. If any inputs are pipes or
non-regular files, or are unreadable, the total size will not be
@@ -290,7 +294,7 @@ are explicitly switched on will be shown.
errors in a row then the skips will move up to chunks of 512. This
is intended to be similar to "*dd conv=sync,noerror*".
: Specify "**\--skip-errors**" twice to only report a read error once
Specify "**\--skip-errors**" twice to only report a read error once
per file, instead of reporting each byte range skipped.
**-Z BYTES, \--error-skip-block BYTES**
@@ -303,7 +307,7 @@ are explicitly switched on will be shown.
coincides with the end of the transfer buffer. The same suffixes as
"**\--size**" can be used.
: This option can only be used with "**\--skip-errors**" and is
This option can only be used with "**\--skip-errors**" and is
intended for use when reading from a block device, such as
"**\--skip-errors \--error-skip-block 4K**" to skip in 4 kibibyte
blocks. This will speed up reads from faulty media, at the expense
@@ -347,7 +351,7 @@ are explicitly switched on will be shown.
**pv** creates a temporary file for this purpose, and automatically
removes it afterwards.
: This can be useful if you have a pipeline which generates data (your
This can be useful if you have a pipeline which generates data (your
input) quickly but you don\'t know the size, and you wish to pass it
to some slower process, once all of the input has been generated and
you know its size, so you can see its progress. Note that when doing
@@ -365,7 +369,7 @@ are explicitly switched on will be shown.
closed; other data transfer modifiers - and remote control - may not
be used with this option.
: If only a *PID* is specified, then that process will be watched, and
If only a *PID* is specified, then that process will be watched, and
all regular files and block devices it opens will be shown with a
progress bar. The **pv** process will exit when process *PID* exits.
@@ -515,7 +519,7 @@ contain the following sequences:
**console_codes**(4). If colour support is not available, nothing is
emitted.
: Supported keywords are: **reset** or **none**, **black**, **red**,
Supported keywords are: **reset** or **none**, **black**, **red**,
**green**, **brown** or **yellow**, **blue**, **magenta**, **cyan**,
**white**, **fg-black**, **fg-red**, **fg-green**, **fg-brown** or
**fg-yellow**, **fg-blue**, **fg-magenta**, **fg-cyan**,
@@ -526,10 +530,10 @@ contain the following sequences:
**reverse**, **no-bold** or **no-dim**, **no-italic**,
**no-underscore** or **no-underline**, **no-blink**, **no-reverse**.
: With colours, the optional \"fg-\" prefix indicates foreground; a
With colours, the optional \"fg-\" prefix indicates foreground; a
prefix of \"bg-\" indicates background.
: For example, "**%{sgr:green,bold}TEXT%{sgr:reset}**" will make
For example, "**%{sgr:green,bold}TEXT%{sgr:reset}**" will make
*TEXT* bold green on supported terminals.
**%%**
@@ -629,6 +633,10 @@ part of the progress display:
pv --format '%a %p : %L' big.log | processing-script
Showing progress as lines of JSON data:
pv --numeric --format '{"elapsed":%t,"bytes":%b,"rate":%r,"percentage":%{progress-amount-only}}' big.log | processing-script
# EXIT STATUS
An exit status of 1 indicates a problem with the "**\--remote**" or
+11 -11
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\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"
@@ -419,7 +419,7 @@ msgstr "yzafpnum kMGTPEZY"
msgid "yzafpnum KMGTPEZY"
msgstr "yzafpnum KMGTPEZY"
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "selhala alokace vyrovnávací paměti"
@@ -451,26 +451,26 @@ msgstr "(žádný)"
msgid "(stdin)"
msgstr "(stdin)"
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr "b/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "B/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr "b"
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "B"
@@ -502,7 +502,7 @@ msgstr "pid"
msgid "history structure allocation failed"
msgstr "selhala alokace struktury historie"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "selhala alokace seznamu souborů"
+21 -22
View File
@@ -1,15 +1,15 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"PO-Revision-Date: 2024-10-13 20:43+0000\n"
"Last-Translator: fnetX <otto@codeberg.org>\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\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.7.2\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-"
@@ -158,19 +158,19 @@ msgstr "setze den NAMEn für visuelle Darstellung"
#: src/main/help.c:311
msgid "STYLE"
msgstr ""
msgstr "Stil"
#: src/main/help.c:312
msgid "set default bar style to NAME"
msgstr ""
msgstr "setze die voreingestellte Darstellung auf NAME"
#: src/main/help.c:314
msgid "SPEC"
msgstr ""
msgstr "STIL"
#: src/main/help.c:315
msgid "also send progress to SPEC"
msgstr ""
msgstr "Fortschritt auch an SPEC senden"
#: src/main/help.c:318
msgid "output transfer statistics at the end"
@@ -288,7 +288,7 @@ msgstr ""
#: src/main/help.c:555
msgid "Supported format sequences:"
msgstr ""
msgstr "unterstützte Formate:"
#: src/main/help.c:569
#, c-format
@@ -337,7 +337,7 @@ msgstr "Speicherzuweisung für `argv' der Option fehlgeschlagen"
#: src/main/options.c:417
msgid "numeric value not understood"
msgstr ""
msgstr "numerischen Wert nicht verstanden"
#: src/main/options.c:435
msgid "integer argument expected"
@@ -442,7 +442,7 @@ msgstr "yzafpnµm kMGTPEZY"
msgid "yzafpnum KMGTPEZY"
msgstr "yzafpnµm KMGTPEZY"
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "Speicherzuweisung für den Puffer fehlgeschlagen"
@@ -474,26 +474,26 @@ msgstr "(keine)"
msgid "(stdin)"
msgstr "(stdin)"
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr "b/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "B/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr "b"
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "B"
@@ -506,9 +506,8 @@ msgid "FIN"
msgstr "Endzeit"
#: src/pv/loop.c:550
#, fuzzy
msgid "rate min/avg/max/mdev"
msgstr "Rate min/mittel/max/mdev"
msgstr "Rate min/mittel/max/abweichung"
#: src/pv/loop.c:562
msgid "rate not measured"
@@ -526,7 +525,7 @@ msgstr "pid"
msgid "history structure allocation failed"
msgstr "Speicherzuweisung für `history' fehlgeschlagen"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "Speicherzuweisung für die Dateiliste fehlgeschlagen"
+11 -11
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -411,7 +411,7 @@ msgstr ""
msgid "yzafpnum KMGTPEZY"
msgstr ""
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr ""
@@ -443,26 +443,26 @@ msgstr ""
msgid "(stdin)"
msgstr ""
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr ""
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr ""
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr ""
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr ""
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr ""
@@ -494,7 +494,7 @@ msgstr ""
msgid "history structure allocation failed"
msgstr ""
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr ""
+11 -11
View File
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\n"
"PO-Revision-Date: 2024-10-12 11:13+0000\n"
"Last-Translator: a-j-wood <a-j-wood@users.noreply.translate.codeberg.org>\n"
"Language-Team: French <https://translate.codeberg.org/projects/pv/pv/fr/>\n"
@@ -446,7 +446,7 @@ msgstr ""
msgid "yzafpnum KMGTPEZY"
msgstr ""
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "échec de l'allocation de mémoire tampon"
@@ -478,26 +478,26 @@ msgstr "(aucun)"
msgid "(stdin)"
msgstr ""
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr ""
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "O/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr ""
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "O"
@@ -529,7 +529,7 @@ msgstr ""
msgid "history structure allocation failed"
msgstr "l'allocation de la structure de l'historique a échoué"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "échec de l'allocation de la liste de fichiers"
+19 -19
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"PO-Revision-Date: 2024-10-20 14:07+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\n"
"PO-Revision-Date: 2025-01-15 19:08+0000\n"
"Last-Translator: coralpink <coralpink@users.noreply.translate.codeberg.org>\n"
"Language-Team: Polish <https://translate.codeberg.org/projects/pv/pv/pl/>\n"
"Language: pl\n"
@@ -16,7 +16,7 @@ msgstr ""
"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.7.2\n"
"X-Generator: Weblate 5.9.2\n"
#: src/main/help.c:236
msgid "show progress bar"
@@ -152,19 +152,19 @@ msgstr "poprzedź informacje prefiksem NAZWA"
#: src/main/help.c:311
msgid "STYLE"
msgstr ""
msgstr "STYL"
#: src/main/help.c:312
msgid "set default bar style to NAME"
msgstr ""
msgstr "ustaw domyślny styl paska postępu na STYL"
#: src/main/help.c:314
msgid "SPEC"
msgstr ""
msgstr "SPEC"
#: src/main/help.c:315
msgid "also send progress to SPEC"
msgstr ""
msgstr "wysyłaj postęp również do SPEC"
#: src/main/help.c:318
msgid "output transfer statistics at the end"
@@ -283,7 +283,7 @@ msgstr ""
#: src/main/help.c:555
msgid "Supported format sequences:"
msgstr ""
msgstr "Wspierane sekwencje formatowania:"
#: src/main/help.c:569
#, c-format
@@ -332,7 +332,7 @@ msgstr "nie udało się zaalokować struktur opcji argv"
#: src/main/options.c:417
msgid "numeric value not understood"
msgstr ""
msgstr "wartość liczbowa niezrozumiana"
#: src/main/options.c:435
msgid "integer argument expected"
@@ -437,7 +437,7 @@ msgstr "yzafpnum kMGTPEZY"
msgid "yzafpnum KMGTPEZY"
msgstr "yzafpnum KMGTPEZY"
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "nie udało się zaalokować bufora"
@@ -470,26 +470,26 @@ msgstr "(brak)"
msgid "(stdin)"
msgstr "(stdin)"
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr "b/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "B/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr "b"
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "B"
@@ -521,7 +521,7 @@ msgstr "pid"
msgid "history structure allocation failed"
msgstr "nie udało się zaalokować struktury historii"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "nie udało się zaalokować listy plików"
+11 -11
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\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"
@@ -425,7 +425,7 @@ msgstr ""
msgid "yzafpnum KMGTPEZY"
msgstr ""
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "erro alocando o buffer"
@@ -457,26 +457,26 @@ msgstr ""
msgid "(stdin)"
msgstr ""
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr ""
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr ""
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "B/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr ""
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr ""
@@ -508,7 +508,7 @@ msgstr ""
msgid "history structure allocation failed"
msgstr ""
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr ""
+17 -17
View File
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"PO-Revision-Date: 2024-10-22 18:07+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\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"
@@ -11,7 +11,7 @@ msgstr ""
"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.8.1\n"
"X-Generator: Weblate 5.9.2\n"
#: src/main/help.c:236
msgid "show progress bar"
@@ -143,11 +143,11 @@ msgstr "писать ИМЯ до визуальной информации"
#: src/main/help.c:311
msgid "STYLE"
msgstr ""
msgstr "СТИЛЬ"
#: src/main/help.c:312
msgid "set default bar style to NAME"
msgstr ""
msgstr "задать стиль полоски по умолчанию как НАЗВАНИЕ"
#: src/main/help.c:314
msgid "SPEC"
@@ -271,7 +271,7 @@ msgstr ""
#: src/main/help.c:555
msgid "Supported format sequences:"
msgstr ""
msgstr "Поддерживаемые последовательности:"
#: src/main/help.c:569
#, c-format
@@ -320,7 +320,7 @@ msgstr "не удалось выделить память для структу
#: src/main/options.c:417
msgid "numeric value not understood"
msgstr ""
msgstr "число не распознано"
#: src/main/options.c:435
msgid "integer argument expected"
@@ -420,7 +420,7 @@ msgstr ""
msgid "yzafpnum KMGTPEZY"
msgstr ""
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "не удалось выделить память для буфера"
@@ -452,26 +452,26 @@ msgstr "(нет)"
msgid "(stdin)"
msgstr "(стд. ввод)"
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr "бит/с"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/с"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "байт/с"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr "бит"
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "байт"
@@ -503,7 +503,7 @@ msgstr "ИДпр"
msgid "history structure allocation failed"
msgstr "не удалось выделить память для структуры истории"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "не удалось выделить память для списка файлов"
+11 -11
View File
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pv 1.8.14\n"
"Report-Msgid-Bugs-To: pv@ivarch.com\n"
"POT-Creation-Date: 2025-01-11 20:59+0000\n"
"POT-Creation-Date: 2025-01-28 21:21+0000\n"
"PO-Revision-Date: 2024-10-12 23:51+0000\n"
"Last-Translator: a-j-wood <a-j-wood@users.noreply.translate.codeberg.org>\n"
"Language-Team: Turkish <https://translate.codeberg.org/projects/pv/pv/tr/>\n"
@@ -421,7 +421,7 @@ msgstr "yzafpnum kMGTPEZY"
msgid "yzafpnum KMGTPEZY"
msgstr "yzafpnum KMGTPEZY"
#: src/pv/display.c:1067 src/pv/transfer.c:1056
#: src/pv/display.c:989 src/pv/transfer.c:1056
msgid "buffer allocation failed"
msgstr "arabellek tahsisi başarısız oldu"
@@ -453,26 +453,26 @@ msgstr "(yok)"
msgid "(stdin)"
msgstr "(stdin)"
#: src/pv/format/averagerate.c:30 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:32 src/pv/loop.c:551
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:93
#: src/pv/format/rate.c:37 src/pv/loop.c:551
msgid "b/s"
msgstr "b/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41
msgid "/s"
msgstr "/s"
#: src/pv/format/averagerate.c:34 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:36 src/pv/loop.c:551
#: src/pv/format/averagerate.c:38 src/pv/format/progressbar.c:97
#: src/pv/format/rate.c:41 src/pv/loop.c:551
msgid "B/s"
msgstr "B/s"
#: src/pv/format/bytes.c:31
#: src/pv/format/bytes.c:37
msgid "b"
msgstr "b"
#: src/pv/format/bytes.c:35 src/pv/transfer.c:594
#: src/pv/format/bytes.c:41 src/pv/transfer.c:594
msgid "B"
msgstr "B"
@@ -504,7 +504,7 @@ msgstr "pid"
msgid "history structure allocation failed"
msgstr "geçmiş yapısı tahsisi başarısız oldu"
#: src/pv/state.c:593 src/pv/state.c:604
#: src/pv/state.c:617 src/pv/state.c:628
msgid "file list allocation failed"
msgstr "dosya listesi tahsisi başarısız oldu"
+1 -85
View File
@@ -470,84 +470,6 @@ pvdisplay_bytecount_t pv_formatter_segmentcontent(char *content, pvformatter_arg
}
/*
* Populate the display buffer for numeric-output mode.
*
* Called by pv_format() and has the same semantics.
*
* In numeric output mode, our output is just the percentage completion, as
* a number by itself.
*
* With --timer, we prefix the output with the elapsed time.
*
* With --bytes, we output the bytes transferred so far instead of the
* percentage (or we output the number lines transferred, if --lines was
* given with --bytes).
*
* If --rate was given, we output the current transfer rate instead of the
* percentage. With --bytes as well, the rate is given after the
* bytes/lines.
*/
static bool pv__format_numeric(pvstate_t state, pvdisplay_t display)
{
char msg_timer[128]; /* flawfinder: ignore */
char msg_bytes[128]; /* flawfinder: ignore */
char msg_rate[128]; /* flawfinder: ignore */
char msg_percent[128]; /* flawfinder: ignore */
bool first_item, show_percentage;
/* flawfinder: each buffer is kept safe by pv_snprintf(). */
if (NULL == display->display_buffer)
return false;
first_item = true;
show_percentage = true;
msg_timer[0] = '\0';
if (display->showing_timer) {
(void) pv_snprintf(msg_timer, sizeof(msg_timer), "%s%.4Lf", first_item ? "" : " ",
state->transfer.elapsed_seconds);
first_item = false;
}
msg_bytes[0] = '\0';
if (display->showing_bytes) {
(void) pv_snprintf(msg_bytes, sizeof(msg_bytes),
"%s%lld", first_item ? "" : " ",
(long long) ((state->control.bits ? 8 : 1) * state->transfer.transferred));
first_item = false;
show_percentage = false;
}
msg_rate[0] = '\0';
if (display->showing_rate) {
(void) pv_snprintf(msg_rate, sizeof(msg_rate),
"%s%.4Lf", first_item ? "" : " ",
((state->control.bits ? 8.0 : 1.0) * state->calc.transfer_rate));
first_item = false;
show_percentage = false;
}
msg_percent[0] = '\0';
if (show_percentage) {
(void) pv_snprintf(msg_percent, sizeof(msg_percent),
"%s%.0f", first_item ? "" : " ", state->calc.percentage);
first_item = false;
}
(void) pv_snprintf(display->display_buffer,
display->display_buffer_size, "%.39s%.39s%.39s%.39s\n", msg_timer, msg_bytes,
msg_rate, msg_percent);
display->display_string_bytes = strlen(display->display_buffer); /* flawfinder: ignore */
/* flawfinder: always \0 terminated by pv_snprintf(). */
display->display_string_width = display->display_string_bytes;
return true;
}
/*
* Format sequence lookup table.
*/
@@ -1075,13 +997,6 @@ bool pv_format(pvstate_t state, /*@null@ */ const char *format_supplied, pvdispl
display->display_buffer[0] = '\0';
}
/*
* Use the numeric mode function if we're in numeric mode.
*/
if (state->control.numeric) {
return pv__format_numeric(state, display);
}
/* Clear the SGR active codes flag, for the SGR formatter. */
display->sgr_code_active = false;
@@ -1310,6 +1225,7 @@ void pv_display(pvstate_t state, bool final)
if (state->control.numeric) {
pv_tty_write(state, state->display.display_buffer, state->display.display_string_bytes);
pv_tty_write(state, "\n", 1);
} else if (state->control.cursor) {
if (state->control.force || pv_in_foreground()) {
pv_crs_update(state, state->display.display_buffer);
+5 -1
View File
@@ -24,7 +24,11 @@ pvdisplay_bytecount_t pv_formatter_average_rate(pvformatter_args_t args)
return 0;
/*@-mustfreefresh@ */
if (args->state->control.bits && !args->state->control.linemode) {
if (args->state->control.numeric) {
/* numeric - raw value without suffix. */
(void) pv_snprintf(content, sizeof(content),
"%.4Lf", ((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.average_rate));
} else if (args->state->control.bits && !args->state->control.linemode) {
/* bits per second */
pv_describe_amount(content, sizeof(content),
"(%s)", 8 * args->state->calc.average_rate, "", _("b/s"), args->display->count_type);
+9 -3
View File
@@ -20,13 +20,19 @@ pvdisplay_bytecount_t pv_formatter_bytes(pvformatter_args_t args)
args->display->showing_bytes = true;
content[0] = '\0';
if (0 == args->buffer_size)
return 0;
content[0] = '\0';
/*@-mustfreefresh@ */
if (args->state->control.bits && !args->state->control.linemode) {
if (args->state->control.numeric) {
/* Numeric mode - raw values only, no suffix. */
(void) pv_snprintf(content, sizeof(content),
"%lld",
(long long) ((args->state->control.bits ? 8 : 1) *
args->state->transfer.transferred));
} else if (args->state->control.bits && !args->state->control.linemode) {
pv_describe_amount(content, sizeof(content), "%s",
(long double) (args->state->transfer.transferred * 8), "", _("b"),
args->display->count_type);
+7 -2
View File
@@ -388,12 +388,17 @@ pvdisplay_bytecount_t pv_formatter_progress_amount_only(pvformatter_args_t args)
char content[256]; /* flawfinder: ignore - always bounded */
pvdisplay_bytecount_t bytes;
content[0] = '\0';
memset(content, 0, sizeof(content));
if (0 == args->buffer_size)
return 0;
if (args->state->control.size > 0 || args->state->control.rate_gauge) {
if (args->state->control.numeric) {
/* Numeric mode - percentage as a rounded integer with no suffix. */
(void) pv_snprintf(content, sizeof(content), "%.0f", args->state->calc.percentage);
bytes = strlen(content); /* flawfinder: ignore */
/* flawfinder: always \0-terminated by pv_snprintf() and the earlier memset(). */
} else if (args->state->control.size > 0 || args->state->control.rate_gauge) {
/* Known size or rate gauge - percentage or rate. */
bytes = pv_formatter_progress_knownsize(args, content, sizeof(content), false, false, true);
} else {
+6 -1
View File
@@ -26,7 +26,12 @@ pvdisplay_bytecount_t pv_formatter_rate(pvformatter_args_t args)
return 0;
/*@-mustfreefresh@ */
if (args->state->control.bits && !args->state->control.linemode) {
if (args->state->control.numeric) {
/* numeric - raw value without suffix. */
(void) pv_snprintf(content, sizeof(content),
"%.4Lf",
((args->state->control.bits ? 8.0 : 1.0) * args->state->calc.transfer_rate));
} else if (args->state->control.bits && !args->state->control.linemode) {
/* bits per second */
pv_describe_amount(content, sizeof(content), "[%s]",
8 * args->state->calc.transfer_rate, "", _("b/s"), args->display->count_type);
+8 -5
View File
@@ -37,11 +37,14 @@ pvdisplay_bytecount_t pv_formatter_timer(pvformatter_args_t args)
if (args->state->transfer.elapsed_seconds < 0.0)
args->state->transfer.elapsed_seconds = 0.0;
/*
* If the elapsed time is more than a day, include a day count as
* well as hours, minutes, and seconds.
*/
if (args->state->transfer.elapsed_seconds > (long double) 86400.0L) {
if (args->state->control.numeric) {
/* Numeric mode - show the number of seconds, unformatted. */
(void) pv_snprintf(content, sizeof(content), "%.4Lf", args->state->transfer.elapsed_seconds);
} else if (args->state->transfer.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",
+41 -17
View File
@@ -263,35 +263,59 @@ 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);
/* Tell pv_format() that the format has changed. */
state->flag.reparse_display = 1;
}
+14 -2
View File
@@ -29,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
+5 -2
View File
@@ -18,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