From b0cad6d3e37417b4fcc20b4095997888984affd6 Mon Sep 17 00:00:00 2001 From: Christoph Ostarek Date: Sun, 12 Feb 2023 20:35:29 +0100 Subject: [PATCH 01/21] implement fd watching for OS X --- src/include/pv-internal.h | 3 + src/main/options.c | 2 + src/pv/watchpid.c | 202 +++++++++++++++++++++++++++++++++----- 3 files changed, 183 insertions(+), 24 deletions(-) diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index db65eaa..3d1869f 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -212,8 +212,11 @@ struct pvstate_s { struct pvwatchfd_s { unsigned int watch_pid; /* PID to watch */ int watch_fd; /* fd to watch, -1 = not displayed */ +#ifdef __APPLE__ +#else char file_fdinfo[4096]; /* path to /proc fdinfo file */ char file_fd[4096]; /* path to /proc fd symlink */ +#endif char file_fdpath[4096]; /* path to file that was opened */ char display_name[512]; /* name to show on progress bar */ struct stat64 sb_fd; /* stat of fd symlink */ diff --git a/src/main/options.c b/src/main/options.c index 0d370ed..9a369f9 100644 --- a/src/main/options.c +++ b/src/main/options.c @@ -362,6 +362,7 @@ opts_t opts_parse(int argc, char **argv) return NULL; } +#ifndef __APPLE__ if (0 != access("/proc/self/fdinfo", X_OK)) { fprintf(stderr, "%s: -d: %s\n", opts->program_name, _ @@ -369,6 +370,7 @@ opts_t opts_parse(int argc, char **argv) opts_free(opts); return NULL; } +#endif } /* diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index 3fccde9..06fc099 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -20,6 +20,97 @@ #include #include +#ifdef __APPLE__ +#include +#include +#endif + +int filesize(pvwatchfd_t info) +{ + if (S_ISBLK(info->sb_fd.st_mode)) { + int fd; + + /* + * Get the size of block devices by opening + * them and seeking to the end. + */ + fd = open64(info->file_fdpath, O_RDONLY); + if (fd >= 0) { + info->size = lseek64(fd, 0, SEEK_END); + close(fd); + } else { + info->size = 0; + } + } else if (S_ISREG(info->sb_fd.st_mode)) { + if ((info->sb_fd_link.st_mode & S_IWUSR) == 0) { + info->size = info->sb_fd.st_size; + } + } else { + return 4; + } + + return 0; +} + +#ifdef __APPLE__ +int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) +{ + struct vnode_fdinfowithpath vnodeInfo = {}; + + if (NULL == state) + return -1; + if (NULL == info) + return -1; + + if (kill(info->watch_pid, 0) != 0) { + if (!automatic) + pv_error(state, "%s %u: %s", + _("pid"), + info->watch_pid, strerror(errno)); + return 1; + } + + int32_t proc_fd = (int32_t)info->watch_fd; + int size = proc_pidfdinfo(info->watch_pid, proc_fd, 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)); + return 3; + } + + strlcpy(info->file_fdpath, vnodeInfo.pvip.vip_path, sizeof(info->file_fdpath)); + + info->size = 0; + + if (!(0 == stat64(info->file_fdpath, &(info->sb_fd)))) { + if (!automatic) + pv_error(state, "%s %u: %s %d: %s: %s", + _("pid"), + info->watch_pid, + _("fd"), + info->watch_fd, info->file_fdpath, + strerror(errno)); + return 3; + } + + if (filesize(info) != 0) { + if (!automatic) + pv_error(state, "%s %u: %s %d: %s: %s", + _("pid"), + info->watch_pid, + _("fd"), + info->watch_fd, + info->file_fdpath, + _("not a regular file or block device")); + return 4; + } + + return 0; +} + +#else /* * Fill in the given information structure with the file paths and stat @@ -91,25 +182,8 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) info->size = 0; - if (S_ISBLK(info->sb_fd.st_mode)) { - int fd; - - /* - * Get the size of block devices by opening - * them and seeking to the end. - */ - fd = open64(info->file_fdpath, O_RDONLY); - if (fd >= 0) { - info->size = lseek64(fd, 0, SEEK_END); - close(fd); - } else { - info->size = 0; - } - } else if (S_ISREG(info->sb_fd.st_mode)) { - if ((info->sb_fd_link.st_mode & S_IWUSR) == 0) { - info->size = info->sb_fd.st_size; - } - } else { + int ret = filesize(info); + if (ret != 0) { if (!automatic) pv_error(state, "%s %u: %s %d: %s: %s", _("pid"), @@ -118,13 +192,19 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) info->watch_fd, info->file_fdpath, _("not a regular file or block device")); - return 4; + return ret; } return 0; } +#endif - +#ifdef __APPLE__ +int pv_watchfd_changed(pvwatchfd_t info) +{ + return 1; +} +#else /* * Return nonzero if the given file descriptor has changed in some way since * we started looking at it (i.e. changed destination or permissions). @@ -147,8 +227,26 @@ int pv_watchfd_changed(pvwatchfd_t info) return 0; } +#endif +#ifdef __APPLE__ +long long pv_watchfd_position(pvwatchfd_t info) +{ + long long position; + struct vnode_fdinfowithpath vnodeInfo = {}; + int32_t proc_fd = (int32_t)info->watch_fd; + int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); + if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { + return -1; + } + + position = (long long)vnodeInfo.pfi.fi_offset; + + return position; +} + +#else /* * Return the current file position of the given file descriptor, or -1 if * the fd has closed or has changed in some way. @@ -170,8 +268,32 @@ long long pv_watchfd_position(pvwatchfd_t info) return position; } +#endif +#ifdef __APPLE__ +int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, int *count) +{ + 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)); + return -1; + } + + *count = size_needed / PROC_PIDLISTFD_SIZE; + + *fds = (struct proc_fdinfo *)malloc(size_needed); + if (*fds == NULL) { + pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno)); + return -1; + } + + proc_pidinfo(pid, PROC_PIDLISTFDS, 0, *fds, size_needed); + + return 0; +} +#endif + /* * Scan the given process and update the arrays with any new file * descriptors. @@ -185,8 +307,6 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, pvstate_t * state_array_ptr, int *fd_to_idx) { char fd_dir[512] = { 0, }; - DIR *dptr; - struct dirent *d; int array_length = 0; struct pvwatchfd_s *info_array = NULL; struct pvstate_s *state_array = NULL; @@ -196,24 +316,48 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, #else sprintf(fd_dir, "/proc/%u/fd", watch_pid); #endif +#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")); + return -1; + } + +#else + DIR *dptr; + struct dirent *d; dptr = opendir(fd_dir); if (NULL == dptr) return 1; +#endif array_length = *array_length_ptr; info_array = *info_array_ptr; state_array = *state_array_ptr; +#ifdef __APPLE__ + if (fd_infos_count < 1) { + pv_error(state, "%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; long long position_now; fd = -1; +#ifdef __APPLE__ + fd = fd_infos[i].proc_fd; +#else if (sscanf(d->d_name, "%d", &fd) != 1) continue; if ((fd < 0) || (fd >= FD_SETSIZE)) continue; - +#endif /* * Skip if this fd is already known to us. */ @@ -296,6 +440,11 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, info_array[use_idx].watch_pid = watch_pid; info_array[use_idx].watch_fd = fd; +#ifdef __APPLE__ + if (fd_infos[i].proc_fdtype != PROX_FDTYPE_VNODE) { + continue; + } +#endif rc = pv_watchfd_info(state, &(info_array[use_idx]), 1); /* @@ -354,7 +503,12 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, } } + +#ifdef __APPLE__ + free(fd_infos); +#else closedir(dptr); +#endif return 0; } From a6ecf60ad1aba076e2aa889740212a2c8fde5f9e Mon Sep 17 00:00:00 2001 From: Volodymyr Bychkovyak Date: Wed, 22 Mar 2023 02:49:46 -0700 Subject: [PATCH 02/21] fix rate limiting issues --- src/include/pv-internal.h | 1 + src/pv/loop.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index db65eaa..244cbe2 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -34,6 +34,7 @@ extern "C" { #define PV_DISPLAY_FINETA 512 #define RATE_GRANULARITY 100000 /* usec between -L rate chunks */ +#define RATE_BURST_WINDOW 5 /* rate burst window (multiples of rate) */ #define REMOTE_INTERVAL 100000 /* usec between checks for -R */ #define BUFFER_SIZE 409600 /* default transfer buffer size */ #define BUFFER_SIZE_MAX 524288 /* max auto transfer buffer size */ diff --git a/src/pv/loop.c b/src/pv/loop.c index f1c5989..949ba5f 100644 --- a/src/pv/loop.c +++ b/src/pv/loop.c @@ -151,10 +151,15 @@ int pv_main_loop(pvstate_t state) || (cur_time.tv_sec == next_ratecheck.tv_sec && cur_time.tv_usec >= next_ratecheck.tv_usec)) { + target += ((long double) (state->rate_limit)) / (long double) (1000000 / RATE_GRANULARITY); + long double burstMax = ((long double) (state->rate_limit * RATE_BURST_WINDOW)); + if (target > burstMax) { + target = burstMax; + } pv_timeval_add_usec(&next_ratecheck, RATE_GRANULARITY); } From c5cd932fb08e7ce90cdbf9ae6c5cc7e65ac0738e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Wei=C3=9F?= Date: Tue, 9 May 2023 20:00:26 +0200 Subject: [PATCH 03/21] pv/display: handle error of tcgetpgrp() in pv_in_foreground() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show pv progress bar even if no terminal is set, e.g., in a busybox init script. The description of pv_in_forground() states it will return true "if we aren't outputting to a terminal". However, this is not the case since tcgetpgrg() will return an error and set ERRNO to ENOTTY if the output fd is not an tty. We now handle this error correctly and pv_in_foreground() returns also true in that case. Signed-off-by: Michael Weiß --- src/pv/display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pv/display.c b/src/pv/display.c index aff643b..8d1f4c9 100644 --- a/src/pv/display.c +++ b/src/pv/display.c @@ -48,6 +48,10 @@ bool pv_in_foreground(void) our_process_group = getpgrp(); tty_process_group = tcgetpgrp(STDERR_FILENO); + + if (tty_process_group == -1 && errno == ENOTTY) + return true; + if (our_process_group == tty_process_group) return true; From 57681664603c269c8964662a432baab839ab4ee3 Mon Sep 17 00:00:00 2001 From: Kang Daeyoun Date: Fri, 26 May 2023 18:28:18 +0900 Subject: [PATCH 04/21] Use relative filepath in watchpid if possible --- src/include/pv-internal.h | 1 + src/pv/state.c | 11 +++++++++++ src/pv/watchpid.c | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/include/pv-internal.h b/src/include/pv-internal.h index db65eaa..eb13826 100644 --- a/src/include/pv-internal.h +++ b/src/include/pv-internal.h @@ -85,6 +85,7 @@ struct pvstate_s { * Program status * ******************/ const char *program_name; /* program name for error reporting */ + char cwd[4096]; /* current working directory for relative path */ const char *current_file; /* current file being read */ int exit_status; /* exit status to give (0=OK) */ diff --git a/src/pv/state.c b/src/pv/state.c index be41fa2..7be9dd1 100644 --- a/src/pv/state.c +++ b/src/pv/state.c @@ -7,6 +7,7 @@ #include #include #include +#include /* @@ -36,6 +37,16 @@ pvstate_t pv_state_alloc(const char *program_name) #endif /* HAVE_SPLICE */ state->display_visible = false; + //get cwd from system and set to state + if (NULL == getcwd(state->cwd, sizeof(state->cwd))) { + // ignore error, using full path + state->cwd[0] = '\0'; + } + if ('\0' == state->cwd[1]) { + // ignore when current working directory is root directory + state->cwd[0] = '\0'; + } + return state; } diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index 3fccde9..abd04dd 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -366,11 +366,19 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, */ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) { - int path_length, max_display_length; + int path_length, cwd_length, max_display_length; + char *file_fdpath = info->file_fdpath; memset(info->display_name, 0, sizeof(info->display_name)); path_length = strlen(info->file_fdpath); + cwd_length = strlen(state->cwd); + if (cwd_length > 0 && path_length > cwd_length) { + if (0 == strncmp(info->file_fdpath, state->cwd, cwd_length)) { + file_fdpath += cwd_length + 1; + path_length -= cwd_length + 1; + } + } max_display_length = (state->width / 2) - 6; if (max_display_length >= path_length) { @@ -380,7 +388,7 @@ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) #else sprintf(info->display_name, #endif - "%4d:%.498s", info->watch_fd, info->file_fdpath); + "%4d:%.498s", info->watch_fd, file_fdpath); } else { int prefix_length, suffix_length; @@ -394,9 +402,9 @@ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) sprintf(info->display_name, #endif "%4d:%.*s...%.*s", - info->watch_fd, prefix_length, info->file_fdpath, + info->watch_fd, prefix_length, file_fdpath, suffix_length, - info->file_fdpath + path_length - suffix_length); + file_fdpath + path_length - suffix_length); } debug("%s: %d: [%s]", "set name for fd", info->watch_fd, From 5c8e2707a42ab687c437a1e43358dc17a9e953cd Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sat, 15 Jul 2023 23:41:27 +0100 Subject: [PATCH 05/21] Removed support for Red Hat Enterprise Linux package builds --- autoconf/configure.in | 1 - autoconf/make/unreal.mk | 26 +--- doc/NEWS | 2 + doc/release-checklist | 1 - doc/spec.in | 266 ---------------------------------------- 5 files changed, 6 insertions(+), 290 deletions(-) delete mode 100644 doc/spec.in diff --git a/autoconf/configure.in b/autoconf/configure.in index f6515e7..d14d831 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -189,7 +189,6 @@ dnl Output files (and create build directory structure too). dnl AC_OUTPUT(Makefile:$mk_segments doc/lsm:doc/lsm.in doc/quickref.1:doc/quickref.1.in - doc/$PACKAGE.spec:doc/spec.in src/.dummy:doc/NEWS, rm -f src/.dummy for i in $subdirs; do diff --git a/autoconf/make/unreal.mk b/autoconf/make/unreal.mk index 24793cf..fb0cef1 100644 --- a/autoconf/make/unreal.mk +++ b/autoconf/make/unreal.mk @@ -6,8 +6,7 @@ clean depclean indentclean distclean cvsclean svnclean \ index manhtml indent update-po \ doc dist release \ - install uninstall \ - rpm srpm + install uninstall all: $(alltarg) $(CATALOGS) @@ -35,9 +34,7 @@ help: @echo ' update-po update the .po files' @echo @echo ' dist create a source tarball for distribution' - @echo ' rpm build a binary RPM (passes $$RPMFLAGS to RPM)' - @echo ' srpm build a source RPM (passes $$RPMFLAGS to RPM)' - @echo ' release dist+rpm+srpm' + @echo ' release create and sign tar.gz and tar.bz2' @echo make: @@ -83,13 +80,12 @@ update-po: $(srcdir)/src/nls/$(PACKAGE).pot distclean: clean depclean rm -f $(alltarg) src/include/config.h - rm -rf $(package)-$(version).tar* $(package)-$(version) $(package)-$(version)-*.rpm + rm -rf $(package)-$(version).tar* $(package)-$(version) rm -f *.html config.* rm Makefile cvsclean svnclean: distclean rm -f doc/lsm - rm -f doc/$(package).spec rm -f doc/quickref.1 rm -f configure rm -f src/nls/*.gmo src/nls/*.mo @@ -123,7 +119,6 @@ dist: doc update-po cp -dprf Makefile $(distfiles) $(package)-$(version) cd $(package)-$(version); $(MAKE) distclean cp -dpf doc/lsm $(package)-$(version)/doc/ - cp -dpf doc/$(package).spec $(package)-$(version)/doc/ chmod 644 `find $(package)-$(version) -type f -print` chmod 755 `find $(package)-$(version) -type d -print` chmod 755 `find $(package)-$(version)/autoconf/scripts` @@ -181,21 +176,8 @@ uninstall: done; \ fi -rpm: - test -e $(package)-$(version).tar.gz || $(MAKE) dist - rpmbuild $(RPMFLAGS) --define="%_topdir `pwd`/rpm" -tb $(package)-$(version).tar.gz - mv rpm/RPMS/*/$(package)-*.rpm . - rm -rf rpm - -srpm: - test -e $(package)-$(version).tar.gz || $(MAKE) dist - rpmbuild $(RPMFLAGS) --define="%_topdir `pwd`/rpm" -ts $(package)-$(version).tar.gz - mv rpm/SRPMS/*$(package)-*.rpm . - rm -rf rpm - -release: dist rpm srpm +release: dist zcat $(package)-$(version).tar.gz | bzip2 > $(package)-$(version).tar.bz2 - -grep -Fq '%_gpg_name' ~/.rpmmacros 2>/dev/null && rpm --addsign *.rpm -gpg --list-secret-keys 2>&1 | grep -Fq 'uid' && gpg -ab *.tar.gz && rename .asc .txt *.tar.gz.asc -gpg --list-secret-keys 2>&1 | grep -Fq 'uid' && gpg -ab *.tar.bz2 && rename .asc .txt *.tar.bz2.asc chmod 644 $(package)-$(version)* diff --git a/doc/NEWS b/doc/NEWS index 1193299..95980ec 100644 --- a/doc/NEWS +++ b/doc/NEWS @@ -1,4 +1,6 @@ UNRELEASED + - support for Red Hat Enterprise Linux and its derivatives has been + dropped; removed the RPM spec file, and will no longer build binaries - 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 diff --git a/doc/release-checklist b/doc/release-checklist index dbaa429..2ac5431 100644 --- a/doc/release-checklist +++ b/doc/release-checklist @@ -4,7 +4,6 @@ Before releasing a new version, go through this checklist: - bump doc/VERSION - bump doc/lsm.in - check doc/NEWS is up to date - - check doc/spec.in is up to date (changelog) - check manual is up to date - make indent indentclean - make update-po diff --git a/doc/spec.in b/doc/spec.in deleted file mode 100644 index 2f8ace6..0000000 --- a/doc/spec.in +++ /dev/null @@ -1,266 +0,0 @@ -Summary: Monitor the progress of data through a pipe -Name: @PACKAGE@ -Version: @VERSION@ -Release: 1%{?dist} -License: Artistic 2.0 -Group: Development/Tools -Source: http://www.ivarch.com/programs/sources/@PACKAGE@-@VERSION@.tar.gz -Url: http://www.ivarch.com/programs/pv.shtml -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: gettext - -%description -PV ("Pipe Viewer") is a 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. - -%prep -%setup -q - -%build -%configure -make %{?_smp_mflags} - -%install -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT" -mkdir -p "$RPM_BUILD_ROOT"%{_bindir} -mkdir -p "$RPM_BUILD_ROOT"%{_mandir}/man1 -mkdir -p "$RPM_BUILD_ROOT"/usr/share/locale - -make DESTDIR="$RPM_BUILD_ROOT" install -%find_lang %{name} - -%check -make test - -%clean -[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT" - -%files -f %{name}.lang -%defattr(-, root, root) -%{_bindir}/%{name} -%{_mandir}/man1/%{name}.1.gz - -%doc README.md doc/ACKNOWLEDGEMENTS.md doc/NEWS doc/TODO doc/COPYING - -%changelog -* Sun Sep 12 2021 Andrew Wood 1.6.20-1 -- fix: add missing stddef.h include to number.c (Sam James) - -* Sun Sep 5 2021 Andrew Wood 1.6.19-1 -- 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 - -* Fri Jun 30 2017 Andrew Wood 1.6.6-1 -- (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é) -- (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) - -* Sun Mar 15 2015 Andrew Wood 1.6.0-1 -- 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) -- (#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 -- output errors on a new line to avoid overwriting transfer bar - -* Tue Aug 26 2014 Andrew Wood 1.5.7-1 -- show KiB instead of incorrect kiB (Debian bug #706175) -- (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) -- work around "awk" bug in tests/016-numeric-timer in decimal "," locales -- fix "make rpm" and "make srpm", extend "make release" to sign releases - -* Sun May 4 2014 Andrew Wood 1.5.3-1 -- remove SPLICE_F_NONBLOCK to fix problem with slow splice() (Jan Seda) - -* Mon Feb 10 2014 Andrew Wood 1.5.2-1 -- 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) - -* Thu Jan 23 2014 Andrew Wood 1.5.1-1 -- 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" -- fix for minor bug which dropped display elements after one empty one -- fix for single fd leak on exit (Cristian Ciupitu, Josh Stone) - -* Mon Aug 5 2013 Andrew Wood 1.4.12-1 -- 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 -- 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 - -* Tue Jan 22 2013 Andrew Wood 1.4.6-1 -- added patch from Pawel Piatek to omit O_NOFOLLOW in AIX - -* Thu Jan 10 2013 Andrew Wood 1.4.5-1 -- updated manual page to show known problem with "-R" on Cygwin - -* Tue Dec 11 2012 Andrew Wood 1.4.4-1 -- added debugging, see `pv -h' when configure 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 - -* Thu Dec 6 2012 Andrew Wood 1.4.0-1 -- 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 -- 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 - -* Mon Nov 5 2012 Andrew Wood 1.3.9-1 -- allow "--format" parameters to be sent with "--remote" -- configure option "--disable-ipc" -- added tests for --numeric with --timer and --bytes -- added tests for --remote - -* Mon Oct 29 2012 Andrew Wood 1.3.8-1 -- 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) - -* Wed Jun 27 2012 Andrew Wood 1.3.4-1 -- new "--disable-splice" configure script option -- fixed line mode size count with multiple files (Moritz Barsnick) -- fixes for AIX core dumps (Pawel Piatek) - -* Sat Jun 9 2012 Andrew Wood 1.3.1-1 -- do not use splice() if the write buffer is not empty (Thomas Rachel) -- added test 15 (pipe transfers), and new test script - -* Tue Jun 5 2012 Andrew Wood 1.3.0-1 -- added Tiger build patch from Olle Jonsson. -- fix 1024-boundary display garble (Debian bug #586763). -- use splice(2) where available (Debian bug #601683). -- added known bugs section of the manual page. -- fixed average rate test, 12 (Andrew Macheret). -- use IEEE1541 units (Thomas Rachel). -- bug with rate limit under 10 fixed (Henry Precheur). -- speed up PV line mode (patch: Guillaume Marcais). -- remove LD=ld from vars.mk to fix cross-compilation (paintitgray/PV#1291). - -* Tue Dec 14 2010 Andrew Wood 1.2.0-1 -- 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). -- Refactored pv_display. -- We now have a coherent, documented, exit status. -- Modified pipe test and new cksum test from Sebastian Kayser. -- Default CFLAGS to just "-O" for non-GCC (Kjetil Torgrim Homme). -- LFS compile fix for OS X 10.4 (Alexandre de Verteuil). -- Remove DESTDIR / suffix (Sam Nelson, Daniel Pape). -- Fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang). - -* Thu Mar 6 2008 Andrew Wood 1.1.4-1 -- 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). -- Compilation fixes for Darwin 9 and OS X. - -* Thu Aug 30 2007 Andrew Wood 1.1.0-1 -- New option "-R" to remotely control another @PACKAGE@ process. -- New option "-l" to count lines instead of bytes. -- Performance improvement for "-L" (rate) option. -- Some Mac OS X fixes, and packaging cleanups. - -* Sat Aug 4 2007 Andrew Wood 1.0.1-1 -- Changed license from Artistic to Artistic 2.0. -- Removed "--license" option. - -* Thu Aug 2 2007 Andrew Wood 1.0.0-1 -- We now act more like "cat" - just skip unreadable files, don't abort. -- Various code cleanups were done. - -* Mon Feb 5 2007 Andrew Wood 0.9.9-1 -- New option "-B" to set the buffer size, and a workaround for problems -- piping to dd(1). - -* Mon Feb 27 2006 Andrew Wood -- Minor bugfixes, and on the final update, blank out the now-zero ETA. - -* Thu Sep 1 2005 Andrew Wood -- Terminal locking now uses lockfiles if the terminal itself cannot be locked. - -* Thu Jun 16 2005 Andrew Wood -- A minor problem with the spec file was fixed. - -* Mon Nov 15 2004 Andrew Wood -- A minor bug in the NLS code was fixed. - -* Sat Nov 6 2004 Andrew Wood -- Code cleanups and minor usability fixes. - -* Tue Jun 29 2004 Andrew Wood -- A port of the terminal locking code to FreeBSD. - -* Sun May 2 2004 Andrew Wood -- Major reliability improvements to the cursor positioning. - -* Sat Apr 24 2004 Andrew Wood -- Rate and size parameters can now take suffixes such as "k", "m" etc. - -* Mon Apr 19 2004 Andrew Wood -- A bug in the cursor positioning was fixed. - -* Thu Feb 12 2004 Andrew Wood -- Code cleanups and portability fixes. - -* Sun Feb 8 2004 Andrew Wood -- The display buffer is now dynamically allocated, fixing an overflow bug. - -* Wed Jan 14 2004 Andrew Wood -- A minor bug triggered when installing the RPM was fixed. - -* Mon Dec 22 2003 Andrew Wood -- Fixed a minor bug that occasionally reported "resource unavailable". - -* Wed Aug 6 2003 Andrew Wood -- Block devices now have their size read correctly, so pv /dev/hda1 works -- Minor code cleanups (mainly removal of CVS "Id" tags) - -* Sun Aug 3 2003 Andrew Wood -- Doing ^Z then "bg" then "fg" now continues displaying - -* Tue Jul 16 2002 Andrew Wood -- First draft of spec file created. From 50c0b329c9d4d287ad05145503a0bd1bc66bf67d Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 00:00:19 +0100 Subject: [PATCH 06/21] Moved NEWS and TODO to UTF-8 Markdown format, and linked them in from the README. --- README.md | 4 +- doc/NEWS | 346 ---------------------------------------------------- doc/NEWS.md | 324 ++++++++++++++++++++++++++++++++++++++++++++++++ doc/TODO | 55 --------- doc/TODO.md | 57 +++++++++ 5 files changed, 384 insertions(+), 402 deletions(-) delete mode 100644 doc/NEWS create mode 100644 doc/NEWS.md delete mode 100644 doc/TODO create mode 100644 doc/TODO.md diff --git a/README.md b/README.md index 1421a92..065947f 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ Documentation A manual page is included in this distribution. See "`man ./doc/quickref.1`", or "`man pv`" after installation. +Changes are listed in "[doc/NEWS.md](./doc/NEWS.md)". The to-do list is "[doc/TODO.md](./doc/TODO.md)". + Compilation ----------- @@ -38,7 +40,7 @@ TODOs marked in the code. Author and acknowledgements --------------------------- -This package is copyright 2022 Andrew Wood, and is being distributed under +This package is copyright 2023 Andrew Wood, and is being distributed under the terms of the Artistic License 2.0. For more details of this license, see the file "[doc/COPYING](./doc/COPYING)". diff --git a/doc/NEWS b/doc/NEWS deleted file mode 100644 index 95980ec..0000000 --- a/doc/NEWS +++ /dev/null @@ -1,346 +0,0 @@ -UNRELEASED - - support for Red Hat Enterprise Linux and its derivatives has been - dropped; removed the RPM spec file, and will no longer build binaries - - 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 - -1.6.20 - 12 September 2021 - - 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 - - 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) fix AIX config check when the CWD contains "yes" (Peter Korsgaard) - - (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) - - (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 - -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é) - - (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) - -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) - - (#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 - - output errors on a new line to avoid overwriting transfer bar - -1.5.7 - 26 August 2014 - - show KiB instead of incorrect kiB (Debian bug #706175) - - (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) - - work around "awk" bug in tests/016-numeric-timer in decimal "," locales - - fix "make rpm" and "make srpm", extend "make release" to sign releases - -1.5.3 - 4 May 2014 - - remove SPLICE_F_NONBLOCK to fix problem with slow splice() (Jan Seda) - -1.5.2 - 10 February 2014 - - 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" - - 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" - - 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 - - AIX build fix (add "-lc128") - 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 - -1.4.6 - 22 January 2013 - - added patch from Pawel Piatek to omit O_NOFOLLOW in AIX - -1.4.5 - 10 January 2013 - - updated manual page to show known problem with "-R" on Cygwin - -1.4.4 - 11 December 2012 - - added debugging, see `pv -h' when configure 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 - - 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 - - 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 - -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) - -1.3.4 - 27 June 2012 - - new "--disable-splice" configure script option - - fixed line mode size count with multiple files (Moritz Barsnick) - - fixes for AIX core dumps (Pawel Piatek) - -1.3.1 - 9 June 2012 - - do not use splice() if the write buffer is not empty (Thomas Rachel) - - added test 15 (pipe transfers), and new test script - -1.3.0 - 5 June 2012 - - added Tiger build patch from Olle Jonsson - - fix 1024-boundary display garble (Debian bug #586763) - - use splice(2) where available (Debian bug #601683) - - added known bugs section of the manual page - - fixed average rate test, 12 (Andrew Macheret) - - use IEEE1541 units (Thomas Rachel) - - bug with rate limit under 10 fixed (Henry Precheur) - - speed up PV line mode (patch: Guillaume Marcais) - - remove LD=ld from vars.mk to fix cross-compilation (paintitgray/PV#1291) - -1.2.0 - 14 December 2010 - - 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) - - refactored pv_display - - we now have a coherent, documented, exit status - - modified pipe test and new cksum test from Sebastian Kayser - - default CFLAGS to just "-O" for non-GCC (Kjetil Torgrim Homme) - - LFS compile fix for OS X 10.4 (Alexandre de Verteuil) - - remove DESTDIR / suffix (Sam Nelson, Daniel Pape) - - fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang) - -1.1.4 - 6 March 2008 - - 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) - -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 - - fix for input/output equivalence check on Mac OS X - - fix for size calculation in pipelines on Mac OS X - - fixed "make uninstall" - - removed /debian directory at request of new Debian maintainer - -1.0.1 - 4 August 2007 - - licensing change from Artistic to Artistic 2.0 - - removed the "-l" / "--license" option - -1.0.0 - 2 August 2007 - - act more like "cat" - just skip unreadable files, don't abort - - removed text version of manual page, and obsolete Info file generation - - code cleanup and separation of PV internals from CLI front-end - -0.9.9 - 5 February 2007 - - 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) - - dropped support for the Texinfo manual - -0.9.6 - 27 February 2006 - - bugfix: key_t incompatibility with Cygwin - - 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 - -0.9.2 - 1 September 2005 - - Daniel Roethlisberger patch: use lockfiles if terminal locking fails - -0.9.1 - 16 June 2005 - - minor RPM spec file fix for Fedora Core 4 - -0.9.0 - 15 November 2004 - - minor NLS bugfix - -0.8.9 - 6 November 2004 - - decimal values now accepted for rate and size, eg "-L 1.23M" - - code cleanup - - developers: "make help" now lists Makefile targets - -0.8.6 - 29 June 2004 - - use uu_lock() for terminal locking on FreeBSD - -0.8.5 - 2 May 2004 - - cursor positioning (-c) reliability improved on systems with IPC - - minor fix: made test 005 more reliable - - new option --height (-H) - -0.8.2 - 24 April 2004 - - allow k,m,g,t suffixes on numbers - - added "srpm" and "release" Makefile targets - -0.8.1 - 19 April 2004 - - bugfix in cursor positioning (-c) - -0.8.0 - 12 February 2004 - - replaced GNU getopt with my library code - - replaced GNU gettext with my very minimal replacement - - use DESTDIR instead of RPM_BUILD_ROOT for optional installation prefix - - looked for flaws using RATS, cleaned up code - -0.7.0 - 8 February 2004 - - display buffer management fixes (thanks Cédric Delfosse) - - replaced --enable-debug with --enable-debugging and --enable-profiling - -0.6.4 - 14 January 2004 - - fixed minor bug in RPM installation - - bugfix in "make index" (only of interest to developers) - -0.6.3 - 22 December 2003 - - fixed transient bug that reported "resource unavailable" occasionally - -0.6.2 - 6 August 2003 - - block devices now have their size read correctly, so pv /dev/hda1 works - - minor code cleanups (mainly removal of CVS "Id" tags) - -0.6.0 - 3 August 2003 - - doing ^Z then "bg" then "fg" now continues displaying - -0.5.9 - 23 July 2003 - - fix for test 007 when not in C locale - - fix for build process to use CPPFLAGS - - fix for build process to use correct i18n libraries - - fix for build process - more portable sed in dependency generator - - fix for install process - remember to mkinstalldirs before installing - - fixes for building on Mac OS X - -0.5.3 - 4 May 2003 - - added Polish translation thanks to Bartosz Feñski - and Krystian Zubel - - moved doc/debian to ./debian at insistence of common sense - - minor Solaris 8 compatibility fixes - - seems to compile and test OK on Mac OS X - -0.5.0 - 15 April 2003 - - added French translation thanks to Stéphane Lacasse - - - added German translation thanks to Marcos Kreinacke - - - switched LGPL reference from "Library" to "Lesser" - -0.4.9 - 18 February 2003 - - support for >2GB files added where available (Debian bug #180986) - - added doc/debian dir (from Cédric Delfosse) - - added "make rpm" and "make deb" targets to build RPM and Debian packages - - added a "make pv-static" rule to build a statically linked version - -0.4.5 - 13 December 2002 - - added Portuguese (Brazilian) translation thanks to Eduardo Aguiar - -0.4.4 - 7 December 2002 - - pause/resume support - don't count time while stopped - - stop output when resumed in the background - - terminal size change support - - bugfix: <=> indicator no longer sticks at right hand edge - -0.4.0 - 27 November 2002 - - 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 - - more reliable non-blocking output to keep display updated - - no longer rely on atoll() - - don't output final blank line if --numeric - - use fcntl() instead of flock() for Solaris compatibility - -0.3.0 - 25 November 2002 - - handle broken output pipe gracefully - - continue updating display even when output pipe is blocking - -0.2.6 - 21 October 2002 - - 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 - - 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 - -0.2.5 - 23 July 2002 - - added [FILE]... arguments, like `cat' - - function separation in code - - some bug fixes related to numeric overflow - -0.2.3 - 19 July 2002 - - Texinfo manual written, man page updated - - byte counter added - -0.2.0 - 18 July 2002 - - ETA counter added - - screen width estimation added - - progress bar added - -0.1.0 - 17 July 2002 - - main loop created - - rate counter added - - elapsed time counter added - - percentage calculation added - -0.0.1 - 16 July 2002 - - package created - - first draft of man page written diff --git a/doc/NEWS.md b/doc/NEWS.md new file mode 100644 index 0000000..0c27379 --- /dev/null +++ b/doc/NEWS.md @@ -0,0 +1,324 @@ +UNRELEASED + * support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries + * 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) + +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 + + 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) fix AIX config check when the CWD contains "yes" (Peter Korsgaard) + * (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) + * (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 + +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é) + * (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) + +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) + * (#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 + * output errors on a new line to avoid overwriting transfer bar + +1.5.7 - 26 August 2014 + * show KiB instead of incorrect kiB (Debian bug #706175) + * (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) + * work around "awk" bug in tests/016-numeric-timer in decimal "," locales + * fix "make rpm" and "make srpm", extend "make release" to sign releases + +1.5.3 - 4 May 2014 + * remove SPLICE_F_NONBLOCK to fix problem with slow splice() (Jan Seda) + +1.5.2 - 10 February 2014 + * 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" + * 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" + * 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 + * AIX build fix (add "-lc128") - 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 + +1.4.6 - 22 January 2013 + * added patch from Pawel Piatek to omit O_NOFOLLOW in AIX + +1.4.5 - 10 January 2013 + * updated manual page to show known problem with "-R" on Cygwin + +1.4.4 - 11 December 2012 + * added debugging, see `pv -h' when configure 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 + * 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 + * 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 + +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) + +1.3.4 - 27 June 2012 + * new "--disable-splice" configure script option + * fixed line mode size count with multiple files (Moritz Barsnick) + * fixes for AIX core dumps (Pawel Piatek) + +1.3.1 - 9 June 2012 + * do not use splice() if the write buffer is not empty (Thomas Rachel) + * added test 15 (pipe transfers), and new test script + +1.3.0 - 5 June 2012 + * added Tiger build patch from Olle Jonsson + * fix 1024-boundary display garble (Debian bug #586763) + * use splice(2) where available (Debian bug #601683) + * added known bugs section of the manual page + * fixed average rate test, 12 (Andrew Macheret) + * use IEEE1541 units (Thomas Rachel) + * bug with rate limit under 10 fixed (Henry Precheur) + * speed up PV line mode (patch: Guillaume Marcais) + * remove LD=ld from vars.mk to fix cross-compilation (paintitgray/PV#1291) + +1.2.0 - 14 December 2010 + * 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) + * refactored pv_display + * we now have a coherent, documented, exit status + * modified pipe test and new cksum test from Sebastian Kayser + * default CFLAGS to just "-O" for non-GCC (Kjetil Torgrim Homme) + * LFS compile fix for OS X 10.4 (Alexandre de Verteuil) + * remove DESTDIR / suffix (Sam Nelson, Daniel Pape) + * fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang) + +1.1.4 - 6 March 2008 + * 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) + +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 + * fix for input/output equivalence check on Mac OS X + * fix for size calculation in pipelines on Mac OS X + * fixed "make uninstall" + * removed /debian directory at request of new Debian maintainer + +1.0.1 - 4 August 2007 + * licensing change from Artistic to Artistic 2.0 + * removed the "-l" / "--license" option + +1.0.0 - 2 August 2007 + * act more like "cat" - just skip unreadable files, don't abort + * removed text version of manual page, and obsolete Info file generation + * code cleanup and separation of PV internals from CLI front-end + +0.9.9 - 5 February 2007 + * 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) + * dropped support for the Texinfo manual + +0.9.6 - 27 February 2006 + * bugfix: key_t incompatibility with Cygwin + * 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 + +0.9.2 - 1 September 2005 + * Daniel Roethlisberger patch: use lockfiles if terminal locking fails + +0.9.1 - 16 June 2005 + * minor RPM spec file fix for Fedora Core 4 + +0.9.0 - 15 November 2004 + * minor NLS bugfix + +0.8.9 - 6 November 2004 + * decimal values now accepted for rate and size, eg "-L 1.23M" + * code cleanup + * developers: "make help" now lists Makefile targets + +0.8.6 - 29 June 2004 + * use uu_lock() for terminal locking on FreeBSD + +0.8.5 - 2 May 2004 + * cursor positioning (-c) reliability improved on systems with IPC + * minor fix: made test 005 more reliable + * new option --height (-H) + +0.8.2 - 24 April 2004 + * allow k,m,g,t suffixes on numbers + * added "srpm" and "release" Makefile targets + +0.8.1 - 19 April 2004 + * bugfix in cursor positioning (-c) + +0.8.0 - 12 February 2004 + * replaced GNU getopt with my library code + * replaced GNU gettext with my very minimal replacement + * use DESTDIR instead of RPM_BUILD_ROOT for optional installation prefix + * looked for flaws using RATS, cleaned up code + +0.7.0 - 8 February 2004 + * display buffer management fixes (thanks Cédric Delfosse) + * replaced --enable-debug with --enable-debugging and --enable-profiling + +0.6.4 - 14 January 2004 + * fixed minor bug in RPM installation + * bugfix in "make index" (only of interest to developers) + +0.6.3 - 22 December 2003 + * fixed transient bug that reported "resource unavailable" occasionally + +0.6.2 - 6 August 2003 + * block devices now have their size read correctly, so pv /dev/hda1 works + * minor code cleanups (mainly removal of CVS "Id" tags) + +0.6.0 - 3 August 2003 + * doing ^Z then "bg" then "fg" now continues displaying + +0.5.9 - 23 July 2003 + * fix for test 007 when not in C locale + * fix for build process to use CPPFLAGS + * fix for build process to use correct i18n libraries + * fix for build process - more portable sed in dependency generator + * fix for install process - remember to mkinstalldirs before installing + * fixes for building on Mac OS X + +0.5.3 - 4 May 2003 + * added Polish translation thanks to Bartosz FeÅ„ski and Krystian Zubel + * moved doc/debian to ./debian at insistence of common sense + * minor Solaris 8 compatibility fixes + * seems to compile and test OK on Mac OS X + +0.5.0 - 15 April 2003 + * added French translation thanks to Stéphane Lacasse + * added German translation thanks to Marcos Kreinacke + * switched LGPL reference from "Library" to "Lesser" + +0.4.9 - 18 February 2003 + * support for >2GB files added where available (Debian bug #180986) + * added doc/debian dir (from Cédric Delfosse) + * added "make rpm" and "make deb" targets to build RPM and Debian packages + * added a "make pv-static" rule to build a statically linked version + +0.4.5 - 13 December 2002 + * added Portuguese (Brazilian) translation thanks to Eduardo Aguiar + +0.4.4 - 7 December 2002 + * pause/resume support - don't count time while stopped + * stop output when resumed in the background + * terminal size change support + * bugfix: <=> indicator no longer sticks at right hand edge + +0.4.0 - 27 November 2002 + * 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 + * more reliable non-blocking output to keep display updated + * no longer rely on atoll() + * don't output final blank line if --numeric + * use fcntl() instead of flock() for Solaris compatibility + +0.3.0 - 25 November 2002 + * handle broken output pipe gracefully + * continue updating display even when output pipe is blocking + +0.2.6 - 21 October 2002 + * 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 + * 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 + +0.2.5 - 23 July 2002 + * added [FILE]... arguments, like `cat' + * function separation in code + * some bug fixes related to numeric overflow + +0.2.3 - 19 July 2002 + * Texinfo manual written, man page updated + * byte counter added + +0.2.0 - 18 July 2002 + * ETA counter added + * screen width estimation added + * progress bar added + +0.1.0 - 17 July 2002 + * main loop created + * rate counter added + * elapsed time counter added + * percentage calculation added + +0.0.1 - 16 July 2002 + * package created + * first draft of man page written diff --git a/doc/TODO b/doc/TODO deleted file mode 100644 index 70e2fa3..0000000 --- a/doc/TODO +++ /dev/null @@ -1,55 +0,0 @@ -Things still to do. (GH#n) indicates the Github issue tracker number. - -Bugs: - - - (GH#5) Transfer IPC leadership on exit of leader - - (GH#13) Use clock_gettime() in ETA calculation to cope with machine suspend/resume (Mateju Miroslav) - - (GH#16) Show days in same format in ETA as in elapsed time - - (GH#18) No output in Cygwin from 1.6.19 onwards (Jacek M. Holeczek) - - (GH#19) No output in Arch Linux initcpio after 1.6.6 (lacsaP) - - (GH#20) Terminal state is not restored correctly in all cases (VA) - - (GH#23) No output with -f when run in background after 1.6.6 (gray) - - (GH#24) Race condition with multiple "pv -c" leaves terminal state inconsistent (Lars Ellenberg, Viktor Ashirov) - - (GH#26) Correct "-n" behaviour when going past 100% of "-s" size (Marcel) - - (GH#27) Rate limit downgrade can take a long time to take effect (Stephen Kitt) - - (GH#31) No output written from inside zsh <() construct (Frederik Eaton - Dec 2015) - - (GH#32) Apply rate limits instantaneously, not averaged over the whole transfer (Jered Floyd - Dec 2018) - - (GH#33) Fix compilation problems due to stat64() on Apple Silicon (Filippo Valsorda - Jan 2021) - - (GH#34) Continue timer even if input or output is blocking (Martin Probst - Jun 2017) - -Feature requests: - - - (GH#3) Option (-x?) to use xterm title line for status (Joachim Haga) - - (GH#4) Option for process title (Martin Sarsale) as "pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s" - - (GH#6) Look at effect of O_SYNC or fsync on performance; update counters during buffer flush ( - - (GH#9) Option to switch rate to per minute if really slow - - (GH#10) Add watchfd tests - - (GH#11) Option "--progress-from FILE", read last number and use it as bytes read (Jacek Wielemborek) - - (GH#12) Allow multiple -d options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek) - - (GH#14) Momentary ETA option (Luc Gommans) - - (GH#15) Use Unicode for more granular progress bar (Alexander Petrossian) - - (GH#17) Allow -r with -l and -n to output lines/sec (Roland Kletzing) - - (GH#21) Options to change the units in the rate display (Jeffrey Paul, John W. O'Brien, David Henderson) - - (GH#22) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) - - (GH#25) Normalise progress to 100% on overrun (Andrej Gantvorg) - - (GH#28) Calculate ETA based on current average rate instead of global average (Matt, Christoph Biedl) - - (GH#29) Option to enable O_DIRECT (Romain Kang, Jacek Wielemborek) - - (GH#30) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) - - (GH#35) Allow decimal values for -s, -L, -B (Thomas Watson - Aug 2020) - - (GH#36) Ignore SIGWINCH (window size change) if -w / -H provided - - (GH#37) Allow -E to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) - - (GH#38) Reset ETA on SIGUSR1 (Jacek Wielemborek - Jan 2019) - - (GH#39) Use posix_fadvise() like cat(1) does (Jacek Wielemborek - Oct 2015) - - (GH#40) Permit -c with -d PID:FD, reject -N with -d PID (Norman Rasmussen - Nov 2020) - - (GH#41) Improve how backwards-moving reads are shown in --watchfd (Ryan Cooley - Dec 2017) - - (GH#42) Option to discard stdin so nothing is written to stdout (André Stapf - Apr 2017) - - (GH#43) Differentiate between "--eta" and "--fineta" in display (André Stapf - Apr 2017) - - (GH#44) Specify size for "-s" by pointing to a filename to use the size of - - (GH#45) Option --sparse (with block size option) to write sparse output (Andriy Galetski - Apr 2019) - - (GH#46) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) - - (GH#47) Analyse splice and buffer usage to improve performance - - (GH#48) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021) - - (GH#49) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) - - (GH#50) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) - -Any assistance would be appreciated. diff --git a/doc/TODO.md b/doc/TODO.md new file mode 100644 index 0000000..3ae471f --- /dev/null +++ b/doc/TODO.md @@ -0,0 +1,57 @@ +Things still to do. (GH#n) indicates the Github issue tracker number. + +Bugs +---- + + * (GH#5) Transfer IPC leadership on exit of leader + * (GH#13) Use `clock_gettime()` in ETA calculation to cope with machine suspend/resume (Mateju Miroslav) + * (GH#16) Show days in same format in ETA as in elapsed time + * (GH#18) No output in Cygwin from 1.6.19 onwards (Jacek M. Holeczek) + * (GH#19) No output in Arch Linux initcpio after 1.6.6 (lacsaP) + * (GH#20) Terminal state is not restored correctly in all cases (VA) + * (GH#23) No output with "`-f`" when run in background after 1.6.6 (gray) + * (GH#24) Race condition with multiple "`pv -c`" leaves terminal state inconsistent (Lars Ellenberg, Viktor Ashirov) + * (GH#26) Correct "`-n`" behaviour when going past 100% of "`-s`" size (Marcel) + * (GH#27) Rate limit downgrade can take a long time to take effect (Stephen Kitt) + * (GH#31) No output written from inside zsh `<()` construct (Frederik Eaton - Dec 2015) + * (GH#32) Apply rate limits instantaneously, not averaged over the whole transfer (Jered Floyd - Dec 2018) + * (GH#33) Fix compilation problems due to `stat64()` on Apple Silicon (Filippo Valsorda - Jan 2021) + * (GH#34) Continue timer even if input or output is blocking (Martin Probst - Jun 2017) + +Feature requests +---------------- + + * (GH#3) Option (-x?) to use xterm title line for status (Joachim Haga) + * (GH#4) Option for process title (Martin Sarsale) as "`pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s`" + * (GH#6) Look at effect of `O_SYNC` or `fsync` on performance; update counters during buffer flush + * (GH#9) Option to switch rate to per minute if really slow + * (GH#10) Add watchfd tests + * (GH#11) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek) + * (GH#12) Allow multiple "`-d`" options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek) + * (GH#14) Momentary ETA option (Luc Gommans) + * (GH#15) Use Unicode for more granular progress bar (Alexander Petrossian) + * (GH#17) Allow "`-r`" with "`-l`" and "`-n`" to output lines/sec (Roland Kletzing) + * (GH#21) Options to change the units in the rate display (Jeffrey Paul, John W. O'Brien, David Henderson) + * (GH#22) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) + * (GH#25) Normalise progress to 100% on overrun (Andrej Gantvorg) + * (GH#28) Calculate ETA based on current average rate instead of global average (Matt, Christoph Biedl) + * (GH#29) Option to enable O_DIRECT (Romain Kang, Jacek Wielemborek) + * (GH#30) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) + * (GH#35) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) + * (GH#36) Ignore SIGWINCH (window size change) if "`-w`" / "`-H`" provided + * (GH#37) Allow "`-E`" to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) + * (GH#38) Reset ETA on `SIGUSR1` (Jacek Wielemborek - Jan 2019) + * (GH#39) Use `posix_fadvise()` like `cat`(1) does (Jacek Wielemborek - Oct 2015) + * (GH#40) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020) + * (GH#41) Improve how backwards-moving reads are shown in "`--watchfd`" (Ryan Cooley - Dec 2017) + * (GH#42) Option to discard stdin so nothing is written to stdout (André Stapf - Apr 2017) + * (GH#43) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017) + * (GH#44) Specify size for "`-s`" by pointing to a filename to use the size of + * (GH#45) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019) + * (GH#46) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) + * (GH#47) Analyse splice and buffer usage to improve performance + * (GH#48) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021) + * (GH#49) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) + * (GH#50) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) + +Any assistance would be appreciated. From 685c91a1cb71f70005154dd20a0d289ad9cdd944 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 00:04:33 +0100 Subject: [PATCH 07/21] NEWS was renamed to NEWS.md. --- autoconf/configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoconf/configure.in b/autoconf/configure.in index d14d831..3b04066 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -189,7 +189,7 @@ dnl Output files (and create build directory structure too). dnl AC_OUTPUT(Makefile:$mk_segments doc/lsm:doc/lsm.in doc/quickref.1:doc/quickref.1.in - src/.dummy:doc/NEWS, + src/.dummy:doc/NEWS.md, rm -f src/.dummy for i in $subdirs; do test -d $i || mkdir $i From 8fb3aecde5b250f6c9b6dfd0d7eb43e4d5e2aabd Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 00:28:58 +0100 Subject: [PATCH 08/21] Finalise pull from ikasty to show relative filenames in --watchfd --- doc/NEWS.md | 1 + src/pv/state.c | 9 ++++++--- src/pv/watchpid.c | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/NEWS.md b/doc/NEWS.md index 0c27379..65f8803 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,4 +1,5 @@ UNRELEASED + * The "`--watchfd`" option will now show relative filenames, if they are under the current directory (patch supplied by [ikasty](https://github.com/ikasty)) * support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * docs: moved all open issues into GitHub and updated the TODO list * docs: renamed README to README.md and altered it to Markdown format diff --git a/src/pv/state.c b/src/pv/state.c index 7be9dd1..12236a7 100644 --- a/src/pv/state.c +++ b/src/pv/state.c @@ -37,13 +37,16 @@ pvstate_t pv_state_alloc(const char *program_name) #endif /* HAVE_SPLICE */ state->display_visible = false; - //get cwd from system and set to state + /* + * Get the current working directory, if possible, as a base for + * showing relative filenames with --watchfd. + */ if (NULL == getcwd(state->cwd, sizeof(state->cwd))) { - // ignore error, using full path + /* failed - will always show full path */ state->cwd[0] = '\0'; } if ('\0' == state->cwd[1]) { - // ignore when current working directory is root directory + /* CWD is root directory - always show full path */ state->cwd[0] = '\0'; } diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index abd04dd..9dda7cd 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -363,6 +363,9 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, /* * Set the display name for the given watched file descriptor, truncating at * the relevant places according to the current screen width. + * + * If the file descriptor is pointing to a file under the current working + * directory, show its relative path, not the full path. */ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) { From 4c84060940637f1b0362050e78109b52efe16c0c Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 00:44:21 +0100 Subject: [PATCH 09/21] Markdown formatting cleanups --- doc/NEWS.md | 202 ++++++++++++++++++++++++++-------------------------- doc/TODO.md | 8 +-- 2 files changed, 105 insertions(+), 105 deletions(-) diff --git a/doc/NEWS.md b/doc/NEWS.md index 65f8803..148ee0f 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -12,181 +12,181 @@ UNRELEASED 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: 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: 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) + * 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) + * (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 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é) - * (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 + * (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é) + * (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 * show KiB instead of incorrect kiB (Debian bug #706175) * (#1284) do not gzip man page, for non-Linux OSes (Bob Friesenhahn) - * work around "awk" bug in tests/016-numeric-timer in decimal "," locales - * fix "make rpm" and "make srpm", extend "make release" to sign releases + * work around "awk" bug in `tests/016-numeric-timer` in decimal "," locales + * fix "`make rpm`" and "`make srpm`", extend "`make release`" to sign releases 1.5.3 - 4 May 2014 - * remove SPLICE_F_NONBLOCK to fix problem with slow splice() (Jan Seda) + * remove *SPLICE_F_NONBLOCK* to fix problem with slow `splice()` (Jan Seda) 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" - * 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 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`" * 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 - * AIX build fix (add "-lc128") - with help from Pawel Piatek - * AIX "-c" fixes - with help from Pawel Piatek - * SCO build fix (po2table.sh) - reported by Wouter Pronk + * 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 + * 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 + * fix for `splice()` not using stdin - patch from Zev Weiss 1.4.6 - 22 January 2013 - * added patch from Pawel Piatek to omit O_NOFOLLOW in AIX + * added patch from Pawel Piatek to omit *O_NOFOLLOW* in AIX 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 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) 1.3.1 - 9 June 2012 - * do not use splice() if the write buffer is not empty (Thomas Rachel) + * do not use `splice()` if the write buffer is not empty (Thomas Rachel) * added test 15 (pipe transfers), and new test script 1.3.0 - 5 June 2012 * added Tiger build patch from Olle Jonsson * fix 1024-boundary display garble (Debian bug #586763) - * use splice(2) where available (Debian bug #601683) + * use `splice`(2) where available (Debian bug #601683) * added known bugs section of the manual page * fixed average rate test, 12 (Andrew Macheret) * use IEEE1541 units (Thomas Rachel) * bug with rate limit under 10 fixed (Henry Precheur) * speed up PV line mode (patch: Guillaume Marcais) - * remove LD=ld from vars.mk to fix cross-compilation (paintitgray/PV#1291) + * remove `LD=ld` from `vars.mk` to fix cross-compilation (paintitgray/PV#1291) 1.2.0 - 14 December 2010 - * integrated improved SI prefixes and --average-rate (Henry Gebhardt) - * return nonzero if exiting due to SIGTERM (Martin Baum) + * 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) - * refactored pv_display + * 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 - * default CFLAGS to just "-O" for non-GCC (Kjetil Torgrim Homme) + * default *CFLAGS* to just "`-O`" for non-GCC (Kjetil Torgrim Homme) * LFS compile fix for OS X 10.4 (Alexandre de Verteuil) - * remove DESTDIR / suffix (Sam Nelson, Daniel Pape) + * remove *DESTDIR* `/` suffix (Sam Nelson, Daniel Pape) * fixed potential NULL deref in transfer (Elias Pipping / LLVM/Clang) 1.1.4 - 6 March 2008 * 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) + * 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) 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" - * removed /debian directory at request of new Debian maintainer + * fixed "`make uninstall`" + * removed "`/debian`" directory at request of new Debian maintainer 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 - * act more like "cat" - just skip unreadable files, don't abort + * act more like "`cat`" - just skip unreadable files, don't abort * removed text version of manual page, and obsolete Info file generation * code cleanup and separation of PV internals from CLI front-end 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) + * workaround: "`pv /dev/zero | dd bs=1M count=1k`" bug (reported by Gert Menke) * dropped support for the Texinfo manual 0.9.6 - 27 February 2006 - * bugfix: key_t incompatibility with Cygwin - * bugfix: interval (-i) parameter parses numbers after decimal point - * build fix: use static NLS if msgfmt is unavailable + * bugfix: `key_t` incompatibility with Cygwin + * 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 0.9.2 - 1 September 2005 @@ -199,60 +199,60 @@ UNRELEASED * minor NLS bugfix 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 + * developers: "`make help`" now lists Makefile targets 0.8.6 - 29 June 2004 - * use uu_lock() for terminal locking on FreeBSD + * use `uu_lock()` for terminal locking on FreeBSD 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 * allow k,m,g,t suffixes on numbers - * added "srpm" and "release" Makefile targets + * added "`srpm`" and "`release`" Makefile targets 0.8.1 - 19 April 2004 - * bugfix in cursor positioning (-c) + * bugfix in cursor positioning ("`-c`") 0.8.0 - 12 February 2004 * replaced GNU getopt with my library code * replaced GNU gettext with my very minimal replacement - * use DESTDIR instead of RPM_BUILD_ROOT for optional installation prefix + * use *DESTDIR* instead of *RPM_BUILD_ROOT* for optional installation prefix * looked for flaws using RATS, cleaned up code 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 * fixed minor bug in RPM installation - * bugfix in "make index" (only of interest to developers) + * bugfix in "`make index`" (only of interest to developers) 0.6.3 - 22 December 2003 * fixed transient bug that reported "resource unavailable" occasionally 0.6.2 - 6 August 2003 - * block devices now have their size read correctly, so pv /dev/hda1 works + * block devices now have their size read correctly, so "`pv /dev/hda1`" works * minor code cleanups (mainly removal of CVS "Id" tags) 0.6.0 - 3 August 2003 - * doing ^Z then "bg" then "fg" now continues displaying + * doing *^Z* then "`bg`" then "`fg`" now continues displaying 0.5.9 - 23 July 2003 * fix for test 007 when not in C locale - * fix for build process to use CPPFLAGS + * fix for build process to use *CPPFLAGS* * fix for build process to use correct i18n libraries * fix for build process - more portable sed in dependency generator - * fix for install process - remember to mkinstalldirs before installing + * fix for install process - remember to `mkinstalldirs` before installing * fixes for building on Mac OS X 0.5.3 - 4 May 2003 * added Polish translation thanks to Bartosz FeÅ„ski and Krystian Zubel - * moved doc/debian to ./debian at insistence of common sense + * moved `doc/debian` to `./debian` at insistence of common sense * minor Solaris 8 compatibility fixes * seems to compile and test OK on Mac OS X @@ -263,9 +263,9 @@ UNRELEASED 0.4.9 - 18 February 2003 * support for >2GB files added where available (Debian bug #180986) - * added doc/debian dir (from Cédric Delfosse) - * added "make rpm" and "make deb" targets to build RPM and Debian packages - * added a "make pv-static" rule to build a statically linked version + * added `doc/debian` dir (from Cédric Delfosse) + * added "`make rpm`" and "`make deb`" targets to build RPM and Debian packages + * added a "`make pv-static`" rule to build a statically linked version 0.4.5 - 13 December 2002 * added Portuguese (Brazilian) translation thanks to Eduardo Aguiar @@ -274,34 +274,34 @@ UNRELEASED * pause/resume support - don't count time while stopped * stop output when resumed in the background * terminal size change support - * bugfix: <=> indicator no longer sticks at right hand edge + * bugfix: "`<=>`" indicator no longer sticks at right hand edge 0.4.0 - 27 November 2002 * 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 + * 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 * more reliable non-blocking output to keep display updated - * no longer rely on atoll() - * don't output final blank line if --numeric - * use fcntl() instead of flock() for Solaris compatibility + * no longer rely on `atoll()` + * don't output final blank line if "`--numeric`" + * use `fcntl()` instead of `flock()` for Solaris compatibility 0.3.0 - 25 November 2002 * handle broken output pipe gracefully * continue updating display even when output pipe is blocking 0.2.6 - 21 October 2002 - * we now ignore EINTR on select() + * 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 - * 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 + * 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`" 0.2.5 - 23 July 2002 - * added [FILE]... arguments, like `cat' + * added *[FILE]...* arguments, like "`cat`" * function separation in code * some bug fixes related to numeric overflow diff --git a/doc/TODO.md b/doc/TODO.md index 3ae471f..d8cae6e 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -21,9 +21,9 @@ Bugs Feature requests ---------------- - * (GH#3) Option (-x?) to use xterm title line for status (Joachim Haga) + * (GH#3) Option ("`-x`"?) to use xterm title line for status (Joachim Haga) * (GH#4) Option for process title (Martin Sarsale) as "`pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s`" - * (GH#6) Look at effect of `O_SYNC` or `fsync` on performance; update counters during buffer flush + * (GH#6) Look at effect of *O_SYNC* or `fsync` on performance; update counters during buffer flush * (GH#9) Option to switch rate to per minute if really slow * (GH#10) Add watchfd tests * (GH#11) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek) @@ -35,12 +35,12 @@ Feature requests * (GH#22) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) * (GH#25) Normalise progress to 100% on overrun (Andrej Gantvorg) * (GH#28) Calculate ETA based on current average rate instead of global average (Matt, Christoph Biedl) - * (GH#29) Option to enable O_DIRECT (Romain Kang, Jacek Wielemborek) + * (GH#29) Option to enable *O_DIRECT* (Romain Kang, Jacek Wielemborek) * (GH#30) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) * (GH#35) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) * (GH#36) Ignore SIGWINCH (window size change) if "`-w`" / "`-H`" provided * (GH#37) Allow "`-E`" to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) - * (GH#38) Reset ETA on `SIGUSR1` (Jacek Wielemborek - Jan 2019) + * (GH#38) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019) * (GH#39) Use `posix_fadvise()` like `cat`(1) does (Jacek Wielemborek - Oct 2015) * (GH#40) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020) * (GH#41) Improve how backwards-moving reads are shown in "`--watchfd`" (Ryan Cooley - Dec 2017) From 04ea58f786daa77a7fd4ad93614cf55cba8df0d2 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 00:56:24 +0100 Subject: [PATCH 10/21] Added details of latest pull request --- doc/NEWS.md | 5 +++-- doc/TODO.md | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/NEWS.md b/doc/NEWS.md index 148ee0f..504e388 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,6 +1,7 @@ UNRELEASED - * The "`--watchfd`" option will now show relative filenames, if they are under the current directory (patch supplied by [ikasty](https://github.com/ikasty)) - * support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries + * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries + * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/a-j-wood/pv/pull/64) supplied by [quitschbo](https://github.com/quitschbo)) + * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66]() supplied by [ikasty](https://github.com/ikasty)) * 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 diff --git a/doc/TODO.md b/doc/TODO.md index d8cae6e..62780b9 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -7,7 +7,6 @@ Bugs * (GH#13) Use `clock_gettime()` in ETA calculation to cope with machine suspend/resume (Mateju Miroslav) * (GH#16) Show days in same format in ETA as in elapsed time * (GH#18) No output in Cygwin from 1.6.19 onwards (Jacek M. Holeczek) - * (GH#19) No output in Arch Linux initcpio after 1.6.6 (lacsaP) * (GH#20) Terminal state is not restored correctly in all cases (VA) * (GH#23) No output with "`-f`" when run in background after 1.6.6 (gray) * (GH#24) Race condition with multiple "`pv -c`" leaves terminal state inconsistent (Lars Ellenberg, Viktor Ashirov) From 0d520172ac5fc87d2d339dfad5a8518a86f357c3 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:02:50 +0100 Subject: [PATCH 11/21] Added new contributors and cleaned up formatting --- doc/ACKNOWLEDGEMENTS.md | 67 +++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index f04fbac..897ecb2 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -1,10 +1,10 @@ The following people have contributed to this project, and their assistance is acknowledged and greatly appreciated: - * Jakub Hrozek - Fedora package maintainer * Antoine Beaupré - Debian package maintainer * Kevin Coyner - previous Debian package maintainer * Cédric Delfosse - previous Debian package maintainer + * Jakub Hrozek - Fedora package maintainer * Eduardo Aguiar - provided Portuguese (Brazilian) translation * Stéphane Lacasse - provided French translation * Marcos Kreinacke - provided German translation @@ -12,65 +12,66 @@ is acknowledged and greatly appreciated: * Joshua Jensen - reported RPM installation bug * Boris Folgmann - 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 - suggested -B option - * Gert Menke - reported bug when piping to dd with a large input buffer size + * 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 - suggested "`-B`" option + * Gert Menke - reported bug when piping to `dd` with a large input buffer size * Ville Herva - 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 - * Sebastian Kayser - supplied testing for SIGPIPE, demonstrated internationalisation problem - * Laszlo Ersek - reported shared memory leak on SIGINT with -c + * 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 - reported shared memory leak on *SIGINT* with "`-c`" * Phil Rutschman - provided a patch for fully restoring terminal state on exit - * Henry Precheur - reporting and suggestions for --rate-limit bug when rate is under 10 + * Henry Precheur - reporting and suggestions for "`--rate-limit`" bug when rate is under 10 * E. Rosten - supplied patch for block buffering in line mode - * Kjetil Torgrim Homme - reported compilation error with default CFLAGS on non-GCC compilers + * 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 * Martin Baum - supplied patch to return nonzero exit status if terminated by signal - * Sam Nelson - supplied patch to fix trailing slash on DESTDIR - * Daniel Pape - reported Cygwin installation problem due to DESTDIR + * Sam Nelson - 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 - supplied patches to improve SI prefixes and add --average-rate + * Henry Gebhard - 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 - submitted patch to calculate size if stdout is a block device * Miguel Diaz - much Cygwin help (and packaging), found narrow-terminal bug - * Jim Salter - commissioned work on the --skip-errors option + * Jim Salter - commissioned work on the "`--skip-errors`" option * Wouter Pronk - reported build problem on SCO * Bryan Dongray - provided patches for test scripts failing on older Red Hats - * Zev Weiss - provided patch to fix splice() not using stdin - * Zing Shishak - provided patch for --null / -0 (count null terminated lines) - * Jacek Wielemborek - implemented fdwatch in Python, suggested PV port; reported bug with "-l" and ETA / size; many other contributions + * Zev Weiss - provided patch to fix `splice()` not using stdin + * Zing Shishak - provided patch for "`--null`" / "`-0`" (count null terminated lines) + * Jacek Wielemborek - 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 , 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 - * Damon Harper - suggested "-D" / "--delay-start" option - * Ganaël Laplanche - provided patch for lstat64 on systems that do not support it - * Peter Korsgaard - provided similar patch for lstat64, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in -lc128 check + * 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`" + * Damon Harper - suggested "`-D`" / "`--delay-start`" option + * Ganaël Laplanche - provided patch for `lstat64()` on systems that do not support it + * Peter Korsgaard - provided similar patch for `lstat64()`, specifically for uClibc support; provided AIX cross-compilation patch to fix bug in "`-lc128`" check * Ralf Ramsauer - reported bug which dropped transfer rate on terminal resize - * Michiel Van Herwegen - reported and discussed bug with "-l" and ETA / size - * Erkki Seppälä - provided patch implementing "-I" - * Eric A. Borisch - provided details of compatibility fix for "%Lu" in watchpid code + * Michiel Van Herwegen - reported and discussed bug with "`-l`" and ETA / size + * Erkki Seppälä - 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 - provided "rate-window" patches for rate calculation * Filippo Valsorda - provided patch for stat64 issue on Apple Silicon * Matt Koscica, William Dillon - also reported stat64 issue on Apple Silicon - * 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 + * 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 - suggested that "-B" should enable "-C" + * Richard Fonfara - provided German translations for "`pv --help`" + * Johannes Gerer - suggested that "`-B`" should enable "`-C`" * Sam James - provided fix for number.c build issue caused by missing stddef.h * Jakub Wilk - corrected README encoding + * [ikasty](https://github.com/ikasty)) - added relative filename display to "`--watchfd`" --- From 0fdd9f0787e8f72ac3d7021da33fe13e770e59a7 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:03:47 +0100 Subject: [PATCH 12/21] Formatting fix --- doc/ACKNOWLEDGEMENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index 897ecb2..7e5f16c 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -72,6 +72,6 @@ is acknowledged and greatly appreciated: * Johannes Gerer - suggested that "`-B`" should enable "`-C`" * Sam James - provided fix for number.c build issue caused by missing stddef.h * Jakub Wilk - corrected README encoding - * [ikasty](https://github.com/ikasty)) - added relative filename display to "`--watchfd`" + * [ikasty](https://github.com/ikasty) - added relative filename display to "`--watchfd`" --- From cd6082238039837dc00036a841e8b8a762376adb Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:30:50 +0100 Subject: [PATCH 13/21] Convert issue numbers to links, and bring the feature request list up to date. --- doc/TODO.md | 92 +++++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/doc/TODO.md b/doc/TODO.md index 62780b9..107c15f 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -3,54 +3,56 @@ Things still to do. (GH#n) indicates the Github issue tracker number. Bugs ---- - * (GH#5) Transfer IPC leadership on exit of leader - * (GH#13) Use `clock_gettime()` in ETA calculation to cope with machine suspend/resume (Mateju Miroslav) - * (GH#16) Show days in same format in ETA as in elapsed time - * (GH#18) No output in Cygwin from 1.6.19 onwards (Jacek M. Holeczek) - * (GH#20) Terminal state is not restored correctly in all cases (VA) - * (GH#23) No output with "`-f`" when run in background after 1.6.6 (gray) - * (GH#24) Race condition with multiple "`pv -c`" leaves terminal state inconsistent (Lars Ellenberg, Viktor Ashirov) - * (GH#26) Correct "`-n`" behaviour when going past 100% of "`-s`" size (Marcel) - * (GH#27) Rate limit downgrade can take a long time to take effect (Stephen Kitt) - * (GH#31) No output written from inside zsh `<()` construct (Frederik Eaton - Dec 2015) - * (GH#32) Apply rate limits instantaneously, not averaged over the whole transfer (Jered Floyd - Dec 2018) - * (GH#33) Fix compilation problems due to `stat64()` on Apple Silicon (Filippo Valsorda - Jan 2021) - * (GH#34) Continue timer even if input or output is blocking (Martin Probst - Jun 2017) + * ([GH#5](https://github.com/a-j-wood/pv/issues/5)) Transfer IPC leadership on exit of leader + * ([GH#13](https://github.com/a-j-wood/pv/issues/13)) Use `clock_gettime()` in ETA calculation to cope with machine suspend/resume (Mateju Miroslav) + * ([GH#16](https://github.com/a-j-wood/pv/issues/16)) Show days in same format in ETA as in elapsed time + * ([GH#18](https://github.com/a-j-wood/pv/issues/18)) No output in Cygwin from 1.6.19 onwards (Jacek M. Holeczek) + * ([GH#20](https://github.com/a-j-wood/pv/issues/20)) Terminal state is not restored correctly in all cases (VA) + * ([GH#23](https://github.com/a-j-wood/pv/issues/23)) No output with "`-f`" when run in background after 1.6.6 (gray) + * ([GH#24](https://github.com/a-j-wood/pv/issues/24)) Race condition with multiple "`pv -c`" leaves terminal state inconsistent (Lars Ellenberg, Viktor Ashirov) + * ([GH#26](https://github.com/a-j-wood/pv/issues/26)) Correct "`-n`" behaviour when going past 100% of "`-s`" size (Marcel) + * ([GH#27](https://github.com/a-j-wood/pv/issues/27)) Rate limit downgrade can take a long time to take effect (Stephen Kitt) + * ([GH#31](https://github.com/a-j-wood/pv/issues/31)) No output written from inside zsh `<()` construct (Frederik Eaton - Dec 2015) + * ([GH#32](https://github.com/a-j-wood/pv/issues/32)) Apply rate limits instantaneously, not averaged over the whole transfer (Jered Floyd - Dec 2018) + * ([GH#33](https://github.com/a-j-wood/pv/issues/33)) Fix compilation problems due to `stat64()` on Apple Silicon (Filippo Valsorda - Jan 2021) + * ([GH#34](https://github.com/a-j-wood/pv/issues/34)) Continue timer even if input or output is blocking (Martin Probst - Jun 2017) Feature requests ---------------- - * (GH#3) Option ("`-x`"?) to use xterm title line for status (Joachim Haga) - * (GH#4) Option for process title (Martin Sarsale) as "`pv - name:FooProcess -xyz - transferred: 1.3GB - 500KB/s - running: 10:15:30s`" - * (GH#6) Look at effect of *O_SYNC* or `fsync` on performance; update counters during buffer flush - * (GH#9) Option to switch rate to per minute if really slow - * (GH#10) Add watchfd tests - * (GH#11) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek) - * (GH#12) Allow multiple "`-d`" options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek) - * (GH#14) Momentary ETA option (Luc Gommans) - * (GH#15) Use Unicode for more granular progress bar (Alexander Petrossian) - * (GH#17) Allow "`-r`" with "`-l`" and "`-n`" to output lines/sec (Roland Kletzing) - * (GH#21) Options to change the units in the rate display (Jeffrey Paul, John W. O'Brien, David Henderson) - * (GH#22) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) - * (GH#25) Normalise progress to 100% on overrun (Andrej Gantvorg) - * (GH#28) Calculate ETA based on current average rate instead of global average (Matt, Christoph Biedl) - * (GH#29) Option to enable *O_DIRECT* (Romain Kang, Jacek Wielemborek) - * (GH#30) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) - * (GH#35) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) - * (GH#36) Ignore SIGWINCH (window size change) if "`-w`" / "`-H`" provided - * (GH#37) Allow "`-E`" to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) - * (GH#38) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019) - * (GH#39) Use `posix_fadvise()` like `cat`(1) does (Jacek Wielemborek - Oct 2015) - * (GH#40) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020) - * (GH#41) Improve how backwards-moving reads are shown in "`--watchfd`" (Ryan Cooley - Dec 2017) - * (GH#42) Option to discard stdin so nothing is written to stdout (André Stapf - Apr 2017) - * (GH#43) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017) - * (GH#44) Specify size for "`-s`" by pointing to a filename to use the size of - * (GH#45) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019) - * (GH#46) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) - * (GH#47) Analyse splice and buffer usage to improve performance - * (GH#48) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021) - * (GH#49) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) - * (GH#50) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) + * ([GH#3](https://github.com/a-j-wood/pv/issues/3)) Option ("`-x`"?) to use xterm title line for status (Joachim Haga) + * ([GH#4](https://github.com/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`" + * ([GH#6](https://github.com/a-j-wood/pv/issues/6)) Look at effect of *O_SYNC* or `fsync` on performance; update counters during buffer flush + * ([GH#9](https://github.com/a-j-wood/pv/issues/9)) Option to switch rate to per minute if really slow + * ([GH#10](https://github.com/a-j-wood/pv/issues/10)) Add watchfd tests + * ([GH#11](https://github.com/a-j-wood/pv/issues/11)) Option "`--progress-from FILE`", read last number and use it as bytes read (Jacek Wielemborek) + * ([GH#12](https://github.com/a-j-wood/pv/issues/12)) Allow multiple "`-d`" options (Linus Heckemann for multiple PID:FD; Jacek Wielemborek) + * ([GH#14](https://github.com/a-j-wood/pv/issues/14)) Momentary ETA option (Luc Gommans) + * ([GH#15](https://github.com/a-j-wood/pv/issues/15)) Use Unicode for more granular progress bar (Alexander Petrossian) + * ([GH#17](https://github.com/a-j-wood/pv/issues/17)) Allow "`-r`" with "`-l`" and "`-n`" to output lines/sec (Roland Kletzing) + * ([GH#21](https://github.com/a-j-wood/pv/issues/21)) Options to change the units in the rate display (Jeffrey Paul, John W. O'Brien, David Henderson) + * ([GH#22](https://github.com/a-j-wood/pv/issues/22)) Options to skip input and seek on output (Jason A. Pfeil, Feb 2022) + * ([GH#25](https://github.com/a-j-wood/pv/issues/25)) Normalise progress to 100% on overrun (Andrej Gantvorg) + * ([GH#28](https://github.com/a-j-wood/pv/issues/28)) Calculate ETA based on current average rate instead of global average (Matt, Christoph Biedl) + * ([GH#29](https://github.com/a-j-wood/pv/issues/29)) Option to enable *O_DIRECT* (Romain Kang, Jacek Wielemborek) + * ([GH#30](https://github.com/a-j-wood/pv/issues/30)) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) + * ([GH#35](https://github.com/a-j-wood/pv/issues/35)) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) + * ([GH#36](https://github.com/a-j-wood/pv/issues/36)) Ignore SIGWINCH (window size change) if "`-w`" / "`-H`" provided + * ([GH#37](https://github.com/a-j-wood/pv/issues/37)) Allow "`-E`" to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) + * ([GH#38](https://github.com/a-j-wood/pv/issues/38)) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019) + * ([GH#39](https://github.com/a-j-wood/pv/issues/39)) Use `posix_fadvise()` like `cat`(1) does (Jacek Wielemborek - Oct 2015) + * ([GH#40](https://github.com/a-j-wood/pv/issues/40)) Permit "`-c`" with "`-d PID:FD`", reject "`-N`" with "`-d PID`" (Norman Rasmussen - Nov 2020) + * ([GH#41](https://github.com/a-j-wood/pv/issues/41)) Improve how backwards-moving reads are shown in "`--watchfd`" (Ryan Cooley - Dec 2017) + * ([GH#42](https://github.com/a-j-wood/pv/issues/42)) Option to discard stdin so nothing is written to stdout (André Stapf - Apr 2017) + * ([GH#43](https://github.com/a-j-wood/pv/issues/43)) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017) + * ([GH#44](https://github.com/a-j-wood/pv/issues/44)) Specify size for "`-s`" by pointing to a filename to use the size of + * ([GH#45](https://github.com/a-j-wood/pv/issues/45)) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019) + * ([GH#46](https://github.com/a-j-wood/pv/issues/46)) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) + * ([GH#47](https://github.com/a-j-wood/pv/issues/47)) Analyse splice and buffer usage to improve performance + * ([GH#48](https://github.com/a-j-wood/pv/issues/48)) Option to show multiple files with individual sizes and a cumulative total (Zach Riggle - Jul 2021) + * ([GH#49](https://github.com/a-j-wood/pv/issues/49)) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) + * ([GH#50](https://github.com/a-j-wood/pv/issues/50)) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) + * ([GH#54](https://github.com/a-j-wood/pv/issues/54)) Run command every n percent ([haarp](https://github.com/haarp)) + * ([GH#67](https://github.com/a-j-wood/pv/issues/67)) Wrap another process to monitor its stdin & stdout ([Alex Mason](https://github.com/axman6)) Any assistance would be appreciated. From 6ae07496d28a09a03d3eb49eee38cf94319cc560 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:35:58 +0100 Subject: [PATCH 14/21] Minor formatting fixes --- doc/NEWS.md | 2 +- doc/TODO.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/NEWS.md b/doc/NEWS.md index 504e388..8032234 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,6 +1,6 @@ UNRELEASED * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries - * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/a-j-wood/pv/pull/64) supplied by [quitschbo](https://github.com/quitschbo)) + * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo)) * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66]() supplied by [ikasty](https://github.com/ikasty)) * docs: moved all open issues into GitHub and updated the TODO list * docs: renamed README to README.md and altered it to Markdown format diff --git a/doc/TODO.md b/doc/TODO.md index 107c15f..76547ab 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -37,7 +37,7 @@ Feature requests * ([GH#29](https://github.com/a-j-wood/pv/issues/29)) Option to enable *O_DIRECT* (Romain Kang, Jacek Wielemborek) * ([GH#30](https://github.com/a-j-wood/pv/issues/30)) Option for dynamic interval to improve ETA predictions for long-running transfers (Christoph Biedl) * ([GH#35](https://github.com/a-j-wood/pv/issues/35)) Allow decimal values for "`-s`", "`-L`", "`-B`" (Thomas Watson - Aug 2020) - * ([GH#36](https://github.com/a-j-wood/pv/issues/36)) Ignore SIGWINCH (window size change) if "`-w`" / "`-H`" provided + * ([GH#36](https://github.com/a-j-wood/pv/issues/36)) Ignore *SIGWINCH* (window size change) if "`-w`" / "`-H`" provided * ([GH#37](https://github.com/a-j-wood/pv/issues/37)) Allow "`-E`" to take a block size argument so errors cause a skip to the next block (Anthony DeRobertis - Oct 2016) * ([GH#38](https://github.com/a-j-wood/pv/issues/38)) Reset ETA on *SIGUSR1* (Jacek Wielemborek - Jan 2019) * ([GH#39](https://github.com/a-j-wood/pv/issues/39)) Use `posix_fadvise()` like `cat`(1) does (Jacek Wielemborek - Oct 2015) From 81d008a32561b7aeebfd8c0a4c50e1b7862dcac9 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:43:07 +0100 Subject: [PATCH 15/21] Updated to include mention of latest pull request --- doc/ACKNOWLEDGEMENTS.md | 2 ++ doc/NEWS.md | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index 7e5f16c..12c2325 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -73,5 +73,7 @@ is acknowledged and greatly appreciated: * Sam James - provided fix for number.c build issue caused by missing stddef.h * Jakub Wilk - corrected README encoding * [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 suppot for "`--watchfd`" --- diff --git a/doc/NEWS.md b/doc/NEWS.md index 8032234..c8cf89a 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,7 +1,8 @@ UNRELEASED * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo)) - * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66]() supplied by [ikasty](https://github.com/ikasty)) + * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://github.com/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) + * feature: the "`--watchfd`" option is now available on OS X (pull request [#60](https://github.com/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) * 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 From ff5efbe3ebd9cb3c3c9131b2d46bdc13530f0a87 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 01:54:00 +0100 Subject: [PATCH 16/21] Added issue #56 --- doc/TODO.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/TODO.md b/doc/TODO.md index 76547ab..58d29c9 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -53,6 +53,7 @@ Feature requests * ([GH#49](https://github.com/a-j-wood/pv/issues/49)) Option to provide stats for avg/min/max/stddev throughput (Venky.N.Iyer) * ([GH#50](https://github.com/a-j-wood/pv/issues/50)) Allow pv to report on a whole pipeline at once (Will Entriken - Feb 2011) * ([GH#54](https://github.com/a-j-wood/pv/issues/54)) Run command every n percent ([haarp](https://github.com/haarp)) + * ([GH#56](https://github.com/a-j-wood/pv/issues/56)) Support for backgrounding pv, and allowing it to be monitored separately ([jimbobmcgee](https://github.com/jimbobmcgee)) * ([GH#67](https://github.com/a-j-wood/pv/issues/67)) Wrap another process to monitor its stdin & stdout ([Alex Mason](https://github.com/axman6)) Any assistance would be appreciated. From 0d1d5b77ec795db464f4045a5135bb159fa56bd5 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 11:07:06 +0100 Subject: [PATCH 17/21] Applied patch from Dave Beckett to support "@filename" as a "--size" argument. --- doc/ACKNOWLEDGEMENTS.md | 3 ++- doc/NEWS.md | 3 ++- doc/quickref.1.in | 13 ++++++++++++- src/main/options.c | 28 +++++++++++++++++++++++++++- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index 12c2325..776f232 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -74,6 +74,7 @@ is acknowledged and greatly appreciated: * Jakub Wilk - corrected README encoding * [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 suppot for "`--watchfd`" + * [christoph-zededa](https://github.com/christoph-zededa) - provided OS X support for "`--watchfd`" + * [Dave Beckett](https://github.com/dajobe)) - added "`@filename`" syntax to "`--size`" --- diff --git a/doc/NEWS.md b/doc/NEWS.md index c8cf89a..3acd2db 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,8 +1,9 @@ UNRELEASED * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/a-j-wood/pv/pull/64) supplied by [Michael Weiß](https://github.com/quitschbo)) - * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://github.com/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) + * feature: the "`--size`" option now accepts "`@filename`" to use the size of another file (pull request [#57](https://github.com/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://github.com/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) + * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://github.com/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) * 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 diff --git a/doc/quickref.1.in b/doc/quickref.1.in index a3131c9..588cf69 100644 --- a/doc/quickref.1.in +++ b/doc/quickref.1.in @@ -243,7 +243,18 @@ etc can be used as with .BR -L . .TP .B "" -Has no effect if used with +If +.B SIZE +starts with +.BR "@" , +the size of file whose name follows the +.B @ +will be used. +.TP +.B "" +Note that +.B \-\-size +has no effect if used with .B -d PID to watch all file descriptors of a process, but will work with .BR "-d PID:FD" . diff --git a/src/main/options.c b/src/main/options.c index 9a369f9..ff46c44 100644 --- a/src/main/options.c +++ b/src/main/options.c @@ -8,11 +8,13 @@ #include "options.h" #include "library/getopt.h" #include "pv.h" +#include "pv-internal.h" #include #include #include #include +#include #include @@ -138,6 +140,9 @@ opts_t opts_parse(int argc, char **argv) */ switch (c) { case 's': + /* "-s @" is valid, so allow it. */ + if ('@' == *optarg) + break; case 'A': case 'w': case 'H': @@ -257,7 +262,28 @@ opts_t opts_parse(int argc, char **argv) opts->delay_start = pv_getnum_d(optarg); break; case 's': - opts->size = pv_getnum_ull(optarg); + /* Permit "@" as well as just a number. */ + if ('@' == *optarg) { + const char *size_file = 1 + optarg; + struct stat64 sb; + int rc; + + rc = 0; + memset(&sb, 0, sizeof(sb)); + rc = stat64(size_file, &sb); + if (0 == rc) { + opts->size = sb.st_size; + } else { + fprintf(stderr, "%s: %s %s: %s\n", + opts->program_name, + _("failed to stat file"), + size_file, strerror(errno)); + opts_free(opts); + return NULL; + } + } else { + opts->size = pv_getnum_ull(optarg); + } break; case 'l': opts->linemode = true; From 456ab7cebbb2b9196d53e13f62d270708941194b Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 11:11:09 +0100 Subject: [PATCH 18/21] Applied OS X 11 stat64 configure.in patch from Dave Beckett --- autoconf/configure.in | 7 ++++++- doc/ACKNOWLEDGEMENTS.md | 2 +- doc/NEWS.md | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/autoconf/configure.in b/autoconf/configure.in index 3b04066..eb8dae9 100644 --- a/autoconf/configure.in +++ b/autoconf/configure.in @@ -156,7 +156,12 @@ dnl AC_DEFINE(HAVE_CONFIG_H) AC_HEADER_STDC AC_HEADER_STDBOOL -AC_CHECK_FUNCS(memcpy basename snprintf stat64) +AC_CHECK_FUNCS(memcpy basename snprintf) +dnl OSX 11 (apple silicon) lets you link stat64() but fails to compile +dnl so use a compile test for stat64() instead of a link test. +AC_COMPILE_IFELSE([AC_LANG_SOURCE([int main() { stat64(); }])], + [AC_DEFINE([HAVE_STAT64], [1], [Is stat64() available])], + []) AC_CHECK_HEADERS(limits.h) if test "$IPC_SUPPORT" = "yes"; then diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index 776f232..70c8952 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -75,6 +75,6 @@ is acknowledged and greatly appreciated: * [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`" + * [Dave Beckett](https://github.com/dajobe)) - added "`@filename`" syntax to "`--size`", and corrected an autoconf problem with stat64 on OS X --- diff --git a/doc/NEWS.md b/doc/NEWS.md index 3acd2db..49f6095 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -1,6 +1,7 @@ UNRELEASED * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/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://github.com/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) * feature: the "`--size`" option now accepts "`@filename`" to use the size of another file (pull request [#57](https://github.com/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://github.com/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://github.com/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) From 29908cff6c4fb0a96aa13ae4e1973b9bb81721c4 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 11:14:05 +0100 Subject: [PATCH 19/21] Remove "-s @" / issue 44 from TODO list --- doc/TODO.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/TODO.md b/doc/TODO.md index 58d29c9..e313609 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -45,7 +45,6 @@ Feature requests * ([GH#41](https://github.com/a-j-wood/pv/issues/41)) Improve how backwards-moving reads are shown in "`--watchfd`" (Ryan Cooley - Dec 2017) * ([GH#42](https://github.com/a-j-wood/pv/issues/42)) Option to discard stdin so nothing is written to stdout (André Stapf - Apr 2017) * ([GH#43](https://github.com/a-j-wood/pv/issues/43)) Differentiate between "`--eta`" and "`--fineta`" in display (André Stapf - Apr 2017) - * ([GH#44](https://github.com/a-j-wood/pv/issues/44)) Specify size for "`-s`" by pointing to a filename to use the size of * ([GH#45](https://github.com/a-j-wood/pv/issues/45)) Option "`--sparse`" (with block size option) to write sparse output (Andriy Galetski - Apr 2019) * ([GH#46](https://github.com/a-j-wood/pv/issues/46)) Option to show speed gauge (% max speed) if progress not known (Ryan Cooley - Jun 2019) * ([GH#47](https://github.com/a-j-wood/pv/issues/47)) Analyse splice and buffer usage to improve performance From bb0c5bdfca56fe5058ec0a12ada0afb00f9d1890 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 11:20:03 +0100 Subject: [PATCH 20/21] Applied standard indent(1) settings --- src/main/options.c | 4 ++-- src/pv/watchpid.c | 36 ++++++++++++++++++++++-------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/main/options.c b/src/main/options.c index ff46c44..4db851c 100644 --- a/src/main/options.c +++ b/src/main/options.c @@ -277,7 +277,8 @@ opts_t opts_parse(int argc, char **argv) fprintf(stderr, "%s: %s %s: %s\n", opts->program_name, _("failed to stat file"), - size_file, strerror(errno)); + size_file, + strerror(errno)); opts_free(opts); return NULL; } @@ -387,7 +388,6 @@ opts_t opts_parse(int argc, char **argv) opts_free(opts); return NULL; } - #ifndef __APPLE__ if (0 != access("/proc/self/fdinfo", X_OK)) { fprintf(stderr, "%s: -d: %s\n", opts->program_name, diff --git a/src/pv/watchpid.c b/src/pv/watchpid.c index bed053a..f8546e6 100644 --- a/src/pv/watchpid.c +++ b/src/pv/watchpid.c @@ -55,7 +55,7 @@ int filesize(pvwatchfd_t info) #ifdef __APPLE__ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) { - struct vnode_fdinfowithpath vnodeInfo = {}; + struct vnode_fdinfowithpath vnodeInfo = { }; if (NULL == state) return -1; @@ -70,8 +70,10 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) return 1; } - int32_t proc_fd = (int32_t)info->watch_fd; - int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); + int32_t proc_fd = (int32_t) info->watch_fd; + int size = proc_pidfdinfo(info->watch_pid, proc_fd, + PROC_PIDFDVNODEPATHINFO, &vnodeInfo, + PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { pv_error(state, "%s %u: %s %d: %s", _("pid"), @@ -80,7 +82,8 @@ int pv_watchfd_info(pvstate_t state, pvwatchfd_t info, int automatic) return 3; } - strlcpy(info->file_fdpath, vnodeInfo.pvip.vip_path, sizeof(info->file_fdpath)); + strlcpy(info->file_fdpath, vnodeInfo.pvip.vip_path, + sizeof(info->file_fdpath)); info->size = 0; @@ -233,15 +236,17 @@ int pv_watchfd_changed(pvwatchfd_t info) long long pv_watchfd_position(pvwatchfd_t info) { long long position; - struct vnode_fdinfowithpath vnodeInfo = {}; - int32_t proc_fd = (int32_t)info->watch_fd; + struct vnode_fdinfowithpath vnodeInfo = { }; + int32_t proc_fd = (int32_t) info->watch_fd; - int size = proc_pidfdinfo(info->watch_pid, proc_fd, PROC_PIDFDVNODEPATHINFO, &vnodeInfo, PROC_PIDFDVNODEPATHINFO_SIZE); + int size = proc_pidfdinfo(info->watch_pid, proc_fd, + PROC_PIDFDVNODEPATHINFO, &vnodeInfo, + PROC_PIDFDVNODEPATHINFO_SIZE); if (size != PROC_PIDFDVNODEPATHINFO_SIZE) { return -1; } - position = (long long)vnodeInfo.pfi.fi_offset; + position = (long long) vnodeInfo.pfi.fi_offset; return position; } @@ -272,19 +277,22 @@ long long pv_watchfd_position(pvwatchfd_t info) #ifdef __APPLE__ -int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, int *count) +int pidfds(pvstate_t state, unsigned int pid, struct proc_fdinfo **fds, + int *count) { 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(state, "%s: unable to list pid fds: %s", _("pid"), + strerror(errno)); return -1; } *count = size_needed / PROC_PIDLISTFD_SIZE; - *fds = (struct proc_fdinfo *)malloc(size_needed); + *fds = (struct proc_fdinfo *) malloc(size_needed); if (*fds == NULL) { - pv_error(state, "%s: alloc failed: %s", _("pid"), strerror(errno)); + pv_error(state, "%s: alloc failed: %s", _("pid"), + strerror(errno)); return -1; } @@ -324,7 +332,6 @@ int pv_watchpid_scanfds(pvstate_t state, pvstate_t pristine, pv_error(state, "%s: pidfds failed", _("pid")); return -1; } - #else DIR *dptr; struct dirent *d; @@ -531,7 +538,8 @@ void pv_watchpid_setname(pvstate_t state, pvwatchfd_t info) path_length = strlen(info->file_fdpath); cwd_length = strlen(state->cwd); if (cwd_length > 0 && path_length > cwd_length) { - if (0 == strncmp(info->file_fdpath, state->cwd, cwd_length)) { + if (0 == + strncmp(info->file_fdpath, state->cwd, cwd_length)) { file_fdpath += cwd_length + 1; path_length -= cwd_length + 1; } From 008ee74a98f10f49705f4a2ecb36985354a8b658 Mon Sep 17 00:00:00 2001 From: Andrew Wood Date: Sun, 16 Jul 2023 11:33:44 +0100 Subject: [PATCH 21/21] Update documentation to reflex bug fix GH#62, GH#32 --- doc/ACKNOWLEDGEMENTS.md | 3 ++- doc/NEWS.md | 1 + doc/TODO.md | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/ACKNOWLEDGEMENTS.md b/doc/ACKNOWLEDGEMENTS.md index 70c8952..d9688f5 100644 --- a/doc/ACKNOWLEDGEMENTS.md +++ b/doc/ACKNOWLEDGEMENTS.md @@ -75,6 +75,7 @@ is acknowledged and greatly appreciated: * [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 + * [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 --- diff --git a/doc/NEWS.md b/doc/NEWS.md index 49f6095..c6469c8 100644 --- a/doc/NEWS.md +++ b/doc/NEWS.md @@ -2,6 +2,7 @@ UNRELEASED * dropped: support for Red Hat Enterprise Linux and its derivatives has been dropped; removed the RPM spec file, and will no longer build binaries * fix: correction to `pv_in_foreground()` to behave as its comment block says it should, when not on a terminal - corrects [GH#19 "No output in Arch Linux initcpio after 1.6.6"](https://github.com/a-j-wood/pv/issues/19), [GH#55 "pv Stopped Working in the Background"](https://github.com/a-j-wood/pv/issues/55) (pull request [#64](https://github.com/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://github.com/a-j-wood/pv/pull/57) supplied by [Dave Beckett](https://github.com/dajobe)) + * fix: add burst rate limit to transfer, so rate limits are not broken by bursty traffic (pull request [#62](https://github.com/a-j-wood/pv/pull/62) supplied by [Volodymyr Bychkovyak](https://github.com/vbychkoviak)) * feature: the "`--size`" option now accepts "`@filename`" to use the size of another file (pull request [#57](https://github.com/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://github.com/a-j-wood/pv/pull/60) supplied by [christoph-zededa](https://github.com/christoph-zededa)) * feature: the "`--watchfd`" option will now show relative filenames, if they are under the current directory (pull request [#66](https://github.com/a-j-wood/pv/pull/66) supplied by [ikasty](https://github.com/ikasty)) diff --git a/doc/TODO.md b/doc/TODO.md index e313609..73d3626 100644 --- a/doc/TODO.md +++ b/doc/TODO.md @@ -13,7 +13,6 @@ Bugs * ([GH#26](https://github.com/a-j-wood/pv/issues/26)) Correct "`-n`" behaviour when going past 100% of "`-s`" size (Marcel) * ([GH#27](https://github.com/a-j-wood/pv/issues/27)) Rate limit downgrade can take a long time to take effect (Stephen Kitt) * ([GH#31](https://github.com/a-j-wood/pv/issues/31)) No output written from inside zsh `<()` construct (Frederik Eaton - Dec 2015) - * ([GH#32](https://github.com/a-j-wood/pv/issues/32)) Apply rate limits instantaneously, not averaged over the whole transfer (Jered Floyd - Dec 2018) * ([GH#33](https://github.com/a-j-wood/pv/issues/33)) Fix compilation problems due to `stat64()` on Apple Silicon (Filippo Valsorda - Jan 2021) * ([GH#34](https://github.com/a-j-wood/pv/issues/34)) Continue timer even if input or output is blocking (Martin Probst - Jun 2017)