2 ms·
Port of NetBSD-release-9 progress(1) to other systems
Tested on Void Linux with musl
NetBSD's progress(1) has different aesthetics and, IMO, at least one unique advantange compared to other progress meters: it detects whether it is in the running foreground and allows the user to background and foreground the program more "cleanly".
- 1vuio0pswjnm7 5y agowget https://ftp.netbsd.org/pub/NetBSD/misc/tnftp/tnftp-20210827.tar.gz tar xzf tnftp-20210827.tar.gz cd tnftp-20210827 cd src wget https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/usr.bin/progress/progress.c cd - cd libnetbsd wget https://ftp.netbsd.org/pub/NetBSD/NetBSD-release-9/src/lib/libc/stdlib/strsuftoll.c cd - set -x ed src/Makefile << eof1 916 s/ruserpass/progress/ 917,918d . 908,914d 860 s/ruserpass/progress/ 861,862d . 852,858d 642,675d 640 s/ruserpass/progress/g . 635,638 s/ruserpass/progress/g . 523,619d 492 s/ruserpass/progress/ 493,494d . 484,490d 366a progress.c \\ . 288d . 272d . 253d . 154,160c am__depfiles_remade = ./\$(DEPDIR)/tnftp-progressbar.Po ./\$(DEPDIR)/tnftp-progress.Po . 124,128c am_tnftp_OBJECTS = tnftp-progressbar.\$(OBJEXT) tnftp-progress.\$(OBJEXT) . 98d . wq eof1 ed libnetbsd/Makefile << eof2 245d . 233 s/$/ \${LIBOBJDIR}strsuftoll\$U.lo/ . 228 s/$/ \${LIBOBJDIR}strsuftoll\$U.o/ 229d . 189,193c setprogname.c \\ strsuftoll.c . 130,141c am__depfiles_remade = \\ \$(DEPDIR)/setprogname.Plo \\ \$(DEPDIR)/strsuftoll.Plo \\ . wq eof2 ed Makefile << eof3 269d . 253d . 246d . 166 s/libedit// . wq eof3 ed libedit/Makefile << eof4 262d . 246d . wq eof4 ed src/progress.c << eof5 206a #endif . 202a #ifndef TIOCGSIZE ttywidth = 80; #endif #ifdef TIOCGSIZE . 92c #endif . 90a #ifdef TIOCGSIZE . 78a long long strsuftoll(const char *desc, const char *val, long long min, long long max); . 52a #ifdef HAVE_TERMCAP_H #include <termcap.h> #endif #ifdef HAVE_CURSES_H #include <curses.h> #elif HAVE_NCURSES_H #include <ncurses.h> #endif #endif/* tnftp */ . 31a #include <stdlib.h> #include <sys/ioctl.h> #include "tnftp.h" #if 0/* tnftp */ . wq eof5 ed libnetbsd/strsuftoll.c << eof6 114,126m248 . 113a #ifndef _DIAGASSERT #define _DIAGASSERT(a) #endif . 72a #endif . 68a #if 0 #include <sys/cdefs.h> . 67d 62a #include "tnftp.h" . wq eof6 cd src exec gcc -static -g -O2 -o progress tnftp-progressbar.o tnftp-progress.o ../libnetbsd/.libs/libnetbsd.a
- 1vuio0pswjnm7 5y agoRevised first section ftp ftp://199.233.217.201 <<eof cd /pub/NetBSD/misc/tnftp/ get tnftp-20210827.tar.gz cd /pub/NetBSD/NetBSD-release-9/src/usr.bin/progress/ get progress.c cd /pub/NetBSD/NetBSD-release-9/src/lib/libc/stdlib/ get strsuftoll.c close quit eof set -xe tar xzf tnftp-20210827.tar.gz mv progress.c tnftp-20210827/src mv strsuftoll.c tnftp-20210827/libnetbsd cd tnftp-20210827 ./configure Revised final section make cd src gcc -static -g -O2 -o progress tnftp-progressbar.o tnftp-progress.o ../libnetbsd/.libs/libnetbsd.a readelf -d progress strip progress exec ./progress
- 1vuio0pswjnm7 5y agos/-current/release-9/