Index | Thread | Search

From:
Klemens Nanni <kn@openbsd.org>
Subject:
bsd.port.mk: make PROGRESS_METER=No disable ftp(1) progress
To:
ports <ports@openbsd.org>
Date:
Sun, 20 Oct 2024 01:39:36 +0000

Download raw body.

Thread
Our default 'Yes' means -m/always and '' aka. "let ftp decide" is the same,
unless I run all of make without tty or overwrite FETCH_CMD to set -M and
thus shut ftp up:


bsd.port.mk(5)
     PROGRESS_METER
             User settings.  Defaults to ‘Yes’.  Forces commands like ftp(1)
             and pkg_create(1) to use their progress-meter even in the absence
             of a terminal.

ftp(1)
     -M      Causes ftp to never display the progress meter in cases where it
             would do so by default.

     -m      Causes ftp to always display the progress meter in cases where it
             would not do so by default.


I'd like 'No' to mean -M/never so things my default 'make fetch' is less noisy
and 'make -j8 fetch' looks the same;  you'd only get interleaved progress bars.

Split the internal variable to avoid passing -M to pkg_*(1);  pkg_create -M is
something else and pkg_add(1)/pkg_delete(1) don't have -M at all.

Feedback? OK?

PS:  Diff below contains both ports .mk and base .5 files.

Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
diff -u -p -r1.1640 bsd.port.mk
--- bsd.port.mk	18 Oct 2024 22:39:30 -0000	1.1640
+++ bsd.port.mk	20 Oct 2024 01:33:55 -0000
@@ -163,12 +163,17 @@ PKG_DBDIR ?= /var/db/pkg
 
 PROGRESS_METER ?= Yes
 .if ${PROGRESS_METER:L} == "yes"
-_PROGRESS = -m
+_PKG_PROGRESS = -m
+_FETCH_PROGRESS = -m
+.elif ${PROGRESS_METER:L} == "no"
+_PKG_PROGRESS =
+_FETCH_PROGRESS = -M
 .else
-_PROGRESS =
+_PKG_PROGRESS =
+_FETCH_PROGRESS =
 .endif
 
-FETCH_CMD ?= /usr/bin/ftp -V ${_PROGRESS} -C
+FETCH_CMD ?= /usr/bin/ftp -V ${_FETCH_PROGRESS} -C
 
 # switch for fetching each distfile: avoid warnings for missing
 # distinfo and wrong size when running makesum
@@ -181,13 +186,13 @@ PKG_INFO ?= /usr/sbin/pkg_info
 PKG_CREATE ?= /usr/sbin/pkg_create
 PKG_DELETE ?= /usr/sbin/pkg_delete
 
-_PKG_ADD = ${PKG_ADD} ${_PROGRESS} -I
-_PKG_CREATE = ${PKG_CREATE} ${_PROGRESS}
+_PKG_ADD = ${PKG_ADD} ${_PKG_PROGRESS} -I
+_PKG_CREATE = ${PKG_CREATE} ${_PKG_PROGRESS}
 _SUDO_PKG_ADD_LOCAL = TRUSTED_PKG_PATH=${_PKG_REPO} ${SUDO} ${_PKG_ADD}
 .if ${INSTALL_DEBUG_PACKAGES:L} == "yes"
 _SUDO_PKG_ADD_LOCAL += -d
 .endif
-_PKG_DELETE = ${PKG_DELETE} ${_PROGRESS}
+_PKG_DELETE = ${PKG_DELETE} ${_PKG_PROGRESS}
 
 .if defined(PKG_PATH)
 _PKG_PATH = ${PKG_PATH}
Index: bsd.port.mk.5
===================================================================
RCS file: /cvs/src/share/man/man5/bsd.port.mk.5,v
diff -u -p -r1.648 bsd.port.mk.5
--- bsd.port.mk.5	6 Oct 2024 10:24:52 -0000	1.648
+++ bsd.port.mk.5	20 Oct 2024 01:34:45 -0000
@@ -3053,6 +3053,10 @@ Forces commands like
 and
 .Xr pkg_create 1
 to use their progress-meter even in the absence of a terminal.
+.Sq No
+Forces
+.Xr ftp 1
+to never show progress.
 .It Ev PROPERTIES
 List of properties specific to a given machine architecture,
 obtained through the inclusion of