856da09741
Add a circular buffer of line positions so that in line mode we can work out how many lines are in the unconsumed portion of the output pipe buffer.
Andrew Wood2024-10-05 23:04:18 +01:00
0994dd4070
Note the new MANIFEST file in releases.
Andrew Wood2024-10-05 20:32:15 +01:00
6cddce9f15
Adjust dist-hook rule so that a failure to sign, when MAINTAINER is set, will be detected - and to add a note to the top of the manifest.
Andrew Wood2024-10-05 20:31:25 +01:00
ac44fd59e3
Added a hook to write a signed MANIFEST file listing the SHA-512 hashes of all included files.
Andrew Wood2024-10-05 17:41:40 +01:00
bfe301ae1c
Preserve errno after the output write, and if the output pipe is closed, propagate this to the main loop so it does not wait forever for the pipe buffer to empty.
Andrew Wood2024-10-05 17:05:14 +01:00
d9a0041870
New --store-and-forward option (#100), including refactoring several areas to allow PV to run in two passes, and the ability to look at the output pipe buffer utilisation to more accurately reflect the total data transferred to the receiving end, rather than just the total amount written to the output buffer.
Andrew Wood2024-10-05 16:21:59 +01:00
ea3787e393
Call posix_fadvise() each time we open a new file, not just on the first one.
Andrew Wood2024-10-05 15:00:08 +01:00
de2fe7f6be
Correct the O_DIRECT flag setting to use the output file descriptor rather than assuming stdout.
Andrew Wood2024-10-05 14:17:15 +01:00
c548d1f2d8
Add a "--gauge" option which alters the progress bar to show the current rate as a percentage of the max rate seen, if the size is unknown (#46).
Andrew Wood2024-10-04 22:15:14 +01:00
fbe726e4c4
Add missing three dots to [OPTION] since there can be more than one.
Andrew Wood2024-10-04 21:05:06 +01:00
208ac286f8
Calculate rate_min, rate_max, etc, regardless of whether show_stats is true, since the overhead is minimal and it will allow us to use that information for other options later.
Andrew Wood2024-10-04 20:15:15 +01:00
9aef419c4c
Surround the "--average-rate" average rate with brackets rather than square brackets, to differentiate it from the "--rate" current rate.
Andrew Wood2024-10-04 19:59:21 +01:00
a2c6490d31
Prefix the estimated completion time of "--fineta" with "FIN" rather than "ETA" to differentiate it from the "ETA" provided by "--eta" (#43).
Andrew Wood2024-10-04 19:45:08 +01:00
877bb1f91f
Move calculation code into its own file, to make display.c smaller and keep it focused purely on display.
Andrew Wood2024-10-04 17:22:43 +01:00
cd696e60ab
Make pv__calc_percentage() into pv_percentage() in number.c instead of a static function in display.c, so it can be used in multiple places in future.
Andrew Wood2024-10-04 17:15:18 +01:00
9bd5a518ea
New option "--stats", to show a line of statistics about the transfer once it has ended (issue #49).
Andrew Wood2024-10-04 15:12:22 +01:00
65d568c283
Refactor display and calculation functions to separate them out more cleanly, move more information into the state structure instead of repeating it as function parameters, and fix a memory leak in the whole-PID mode of --watchfd.
Andrew Wood2024-10-04 13:27:17 +01:00
a118f110fa
Use verbose variable names for readability.
Andrew Wood2024-10-04 11:58:57 +01:00
f803f29158
Move transfer rate calculations into their own function, and make pv__format stand alone, to maintain separation of concerns.
Andrew Wood2024-10-04 11:54:47 +01:00
954c2d32c1
Move calculated values out of state.display into a new structure, state.calc, to separate out the display portion from the calculation portion; and move history_interval into state.control, as it is a control parameter set at the start.
Andrew Wood2024-10-04 11:08:01 +01:00
545769885d
Raise a SIGCONT to the whole process group after receiving a SIGTTOU, so that pipelines can be resumed in the background (for example "pv /dev/zero | cat > /dev/null" can now be suspended and put into the background - if we do not send that signal then "cat" remains stopped, as mentioned in issue #56).
Andrew Wood2024-10-04 10:24:08 +01:00
a6c978573f
Move pv_write_retry() and pv_tty_write() from cursor.c to display.c so they sit with all the other display functions.
Andrew Wood2024-10-04 09:06:24 +01:00
9a639b40b7
Use gmtime() instead of localtime() in debugging output to avoid lockups in signal handlers due to time zone lookups.
Andrew Wood2024-10-04 08:53:14 +01:00
e84f47abc8
Refactor handling of TTOU so that instead of shuffling stderr to another file descriptor and using /dev/null when backgrounded, we set a flag to suspend terminal output, and perform all terminal writes through a new pv_tty_write function which checks that flag.
Andrew Wood2024-10-03 23:03:31 +01:00
52a720ec33
Improve the readability of the code that handles SIGTTOU.
Andrew Wood2024-10-03 22:08:11 +01:00
416c61a663
Re-order structure members to minimise padding / holes, after analysis with "pahole" on a 64-bit system.
Andrew Wood2024-10-03 22:07:03 +01:00
23bd296aeb
Re-order structure members to minimise padding / holes, after analysis with "pahole" on a 64-bit system.
Andrew Wood2024-10-03 21:25:41 +01:00
2c8843fc86
Expand the list of places to check for patches and bug reports.
Andrew Wood2024-10-03 12:09:09 +01:00
aa07373c4e
Removed TODO.md, since it is just an outdated copy of the issue tracker.
Andrew Wood2024-10-03 11:52:30 +01:00
ef5d703682
Merge pull request 'Translations update from Codeberg Translate' (#99) from translate/pv:weblate-pv-pv into main
Andrew Wood2024-09-29 11:09:37 +00:00
575854c8b9
Merge pull request 'Translations update from Codeberg Translate' (#98) from translate/pv:weblate-pv-pv into main
Andrew Wood2024-09-29 10:56:36 +00:00
c67248ffc7
Update to add the new strings in the options parser.
Andrew Wood2024-08-06 23:35:55 +01:00
60936080da
Move the "--size @FILE" file size reading into its own function for clarity; standardise its error message format to "program: file: message: detail"; uniquely name variables; refuse to accept a directory as a file; and with this option, try reading the size of a block device from sysfs if we can, to avoid requiring read permissions on the device.
Andrew Wood2024-08-06 23:17:15 +01:00
4db04564a9
Merge pull request 'Support block devices in @-syntax' (#94) from alexanderperlis/pv:support-block-device-size into main
Andrew Wood2024-08-06 20:26:43 +00:00
86016d41d7
Merge pull request 'Improve description and comments for blocking-write() after select()' (#93) from eborisch/pv:update-block-after-select into main
Andrew Wood2024-07-17 06:36:50 +00:00
3fdfd07443
Improve description and comments for blocking-write() after select()
Eric A. Borisch2024-07-16 23:39:15 -05:00
d801cdd722
Remove spurious strerror() call from debug report.
Andrew Wood2024-07-16 22:44:10 +01:00
72e5078ce9
Move the MAKE_OUTPUT_NONBLOCKING code to state.c, as it can no longer work in main.c due to accessing internal structures; but still leave it switched off by default for now.
Andrew Wood2024-07-16 22:41:31 +01:00
a7c3f3dd35
Write the error from write() to the debugging output if nwritten is <0.
Andrew Wood2024-07-16 22:23:51 +01:00
729fc10674
News item and acknowledgement for zero write bug fix (#92).
Andrew Wood2024-07-16 22:03:56 +01:00
12f0312b00
Move the "stop at size" option setting to before the size calculation, otherwise if the size calculation tries to override that setting, it cannot do so (#91).
Andrew Wood2024-07-16 21:58:47 +01:00
8c0e3e9dad
When checking how many bytes were written, place the constant to the left of the equality check to match the rest of the code (this avoids accidental assignment if one equals sign is accidentally written instead of two), and write the appropriate debug message depending on whether the write was interrupted or it was empty.
Andrew Wood2024-07-16 21:54:13 +01:00
c7104f0c0d
Merge pull request 'src/pv/transfer.c: timer going off returns with total_written==0; which is not an error.' (#92) from eborisch/pv:write-can-return-0 into main
Andrew Wood2024-07-16 20:47:32 +00:00
f8fc5844b1
Re-order the output file descriptor setting and the size detection to correct the problem with output block device size detection that was broken in 1.8.10 (#91).
Andrew Wood2024-07-16 21:39:29 +01:00
21e65b8742
Relax the strictness of this check a little, to avoid false failures on heavily loaded systems.
Andrew Wood2024-06-15 23:11:53 +01:00
c6ac4d11be
Added an example of how to list untranslated strings.
Andrew Wood2024-06-15 23:00:12 +01:00
2d48e07139
Updated the instructions for testing translations, now that a method has been found that actually works.
Andrew Wood2024-06-15 22:47:53 +01:00
3fee341ac2
Update the line numbers etc in the language files (from "make -C po update-po") - no actual translation changes included.
Andrew Wood2024-06-08 22:06:08 +01:00
578c1613d1
Merge pull request 'Add '-o' option to write to a file other than stdout' (#90) from xmort/pv:add-output-file-option into main
Andrew Wood2024-06-08 19:22:14 +00:00
6073445551
document the --output in the man page and help text
Martin Dørum2024-06-08 13:49:21 +02:00
8992e98c8d
Line number adjustments from "make update-po".
Andrew Wood2024-04-21 14:18:48 +01:00
205245f269
Issue #6 had only one outstanding action which was a duplicate of #34, so it is now removed.
Andrew Wood2024-04-21 14:00:31 +01:00
b375041790
Correct issues #34, #86, #87 - progress output stopping when writing output data blocks - by adding a SIGALRM handler, since ignoring the signal prevents it from interrupting writes; and use setitimer() where available, instead of alarm(), to provide sufficient granularity to handle the case where the --interval is not a whole number of seconds.
Andrew Wood2024-04-21 13:54:01 +01:00