pv: upgrade 1.6.20 -> 1.9.31

License changed to GPL-3.0-or-later in: ??? is this right???
   e5cc71b Switched licensing to GPLv3+.
and moved doc to docs directory in:
   86feafb Rename "doc" directory to "docs" to match Debian standards.
Change the tarball suffix since the project now only provides .gz files.
Added 'inherit gettext' to fix:
   QA Issue: AM_GNU_GETTEXT used but no inherit gettext [configure-gettext]

Drop:
   0001-pv-display-handle-error-of-tcgetpgrp-in-pv_in_foregr.patch
which is covered by:
   c5cd932 pv/display: handle error of tcgetpgrp() in pv_in_foreground()

Re-write the run-ptest wrapper since upstream switched to using 'make check'.

Skip some of the tests to get the recipe update merged.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Randy MacLeod 2025-03-27 16:49:29 -04:00 committed by Khem Raj
parent 3b448edbf3
commit 5756aa17e8
No known key found for this signature in database
GPG Key ID: BB053355919D3314
5 changed files with 79 additions and 73 deletions

View File

@ -1,40 +0,0 @@
From c5cd932fb08e7ce90cdbf9ae6c5cc7e65ac0738e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20Wei=C3=9F?= <michael.weiss@aisec.fraunhofer.de>
Date: Tue, 9 May 2023 20:00:26 +0200
Subject: [PATCH] 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ß <michael.weiss@aisec.fraunhofer.de>
---
Upstream-Status: Pending
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;
--
2.30.2

View File

@ -0,0 +1,18 @@
Use the version of pv installed on the system rather than the ./pv from
the development tree as is done when running 'make check'.
Upstream-Status: Inappropriate [x-compile specific]
---
diff -Naur pv-1.9.31.orig/tests/test-env.sh pv-1.9.31/tests/test-env.sh
--- pv-1.9.31.orig/tests/test-env.sh 2024-12-07 08:59:43.000000000 -0500
+++ pv-1.9.31/tests/test-env.sh 2025-03-26 14:11:30.987123378 -0400
@@ -9,7 +9,7 @@
true "${srcdir:?not set - call this from 'make check'}"
# Parameters.
-testSubject="./pv"
+testSubject="pv"
sourcePath="${srcdir}"
# Set everything to the "C" locale.

View File

@ -1,7 +1,22 @@
#!/bin/sh
rm -rf tests.log
sh -e run-test.sh pv . > tests.log 2>&1
sed -e 's|\(.*\):.*OK|PASS: \1|' \
-e 's|\(.*\):.*FAILED|FAIL: \1|' \
tests.log
srcdir=/usr/lib/pv/ptest
export srcdir
source tests/test-env.sh
num_fail=0
# all pv tests are capitalized
for test in tests/[A-Z]*
do
./"$test" \
&& echo "PASS: $test" \
|| {
echo "FAIL: $test"
num_fail=$(( ${num_fail} + 1))
}
done
exit $num_fail

View File

@ -1,28 +0,0 @@
SUMMARY = "Terminal-based tool for monitoring the progress of data through a pipeline"
HOMEPAGE = "http://www.ivarch.com/programs/pv.shtml"
LICENSE = "Artistic-2.0"
LIC_FILES_CHKSUM = "file://doc/COPYING;md5=9c50db2589ee3ef10a9b7b2e50ce1d02"
SRC_URI = "https://www.ivarch.com/programs/sources/${BP}.tar.bz2 \
file://0001-pv-display-handle-error-of-tcgetpgrp-in-pv_in_foregr.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "e831951eff0718fba9b1ef286128773b9d0e723e1fbfae88d5a3188814fdc603"
UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml"
UPSTREAM_CHECK_REGEX = "pv-(?P<pver>\d+(\.\d+)+).tar"
inherit autotools ptest
LDEMULATION:mipsarchn32 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'elf32btsmipn32', 'elf32ltsmipn32', d)}"
export LDEMULATION
RDEPENDS:${PN}-ptest += "coreutils ${PN}"
do_install_ptest() {
install -d ${D}${PTEST_PATH}/tests
cp -r ${S}/tests/* ${D}${PTEST_PATH}/tests
cp -r ${S}/autoconf/scripts/run-test.sh ${D}${PTEST_PATH}
# sed -i -e 's@\$SRCDIR/@./@g' ${D}${PTEST_PATH}/run-ptest
}

View File

@ -0,0 +1,41 @@
SUMMARY = "Terminal-based tool for monitoring the progress of data through a pipeline"
HOMEPAGE = "http://www.ivarch.com/programs/pv.shtml"
LICENSE = "GPL-3.0-or-later"
LIC_FILES_CHKSUM = "file://docs/COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
SRC_URI = "https://www.ivarch.com/programs/sources/${BP}.tar.gz \
file://pv-test-system-version.patch \
file://run-ptest \
"
SRC_URI[sha256sum] = "a35e92ec4ac0e8f380e8e840088167ae01014bfa008a3a9d6506b848079daedf"
UPSTREAM_CHECK_URI = "http://www.ivarch.com/programs/pv.shtml"
UPSTREAM_CHECK_REGEX = "pv-(?P<pver>\d+(\.\d+)+).tar"
inherit autotools gettext ptest
LDEMULATION:mipsarchn32 = "${@bb.utils.contains('TUNE_FEATURES', 'bigendian', 'elf32btsmipn32', 'elf32ltsmipn32', d)}"
export LDEMULATION
RDEPENDS:${PN}-ptest += "bash coreutils tmux valgrind"
RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-binary-localedata-c"
do_install_ptest() {
testsdir=${D}${PTEST_PATH}/tests
install -d ${testsdir}
cp -r ${S}/tests/* ${testsdir}
#
# remove self-hosted install test
rm -f ${testsdir}/Bug_-_Install_all_files.test
# skip the failing valgrind tests for now (March 2025).
# See: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15817
rm -f ${testsdir}/Memory*
# test requires at least 3GB free on /tmp
rm -f ${testsdir}/Integrity_-_Large_file_support.test
# fails due to our prompt:
rm -f ${testsdir}/Terminal_-_Detect_width.test
#
# sed -i -e 's@\$SRCDIR/@./@g' ${D}${PTEST_PATH}/run-ptest
}