lsof: upgrade to 4.99.0

This commit is contained in:
Subhaditya Nath 2023-11-14 01:06:46 +05:30 committed by Duncan Overbruck
parent 99ee9490be
commit 4e2d6eef06
3 changed files with 12 additions and 106 deletions

View File

@ -1,12 +0,0 @@
gethostbyaddr() fails on the hostname of GitHub CI containers
--- a/tests/LTsock.c
+++ b/tests/LTsock.c
@@ -262,6 +262,3 @@
- if (gethostname(hnm, sizeof(hnm) - 1)) {
- cem = "ERROR!!! can't get this host's name";
- goto print_errno;
- }
+ strncpy(hnm, "localhost", sizeof(hnm) - 1);
hnm[sizeof(hnm) - 1] = '\0';
if (!(hp = gethostbyname(hnm))) {

View File

@ -1,86 +0,0 @@
This patch has been upstreamed already, and should be
unnecessary in the next release.
https://github.com/lsof-org/lsof/commit/5ca335ff9ae6510cba0a94a62fbaa46709f7cb16
--- a/dialects/linux/tests/case-20-epoll.bash
+++ b/dialects/linux/tests/case-20-epoll.bash
@@ -8,9 +8,9 @@
fi
$TARGET 2>> $report | {
- read pid epfd
- if [[ -z "$pid" || -z "$epfd" ]]; then
- echo "unexpected output form target ( $TARGET )" >> $report
+ read pid epfd evp0 evp1
+ if [[ -z "$pid" || -z "$epfd" || -z "$evp0" || -z "$evp1" ]]; then
+ echo "unexpected output from target ( $TARGET )" >> $report
exit 1
fi
if ! [ -e "/proc/$pid" ]; then
@@ -25,7 +25,7 @@
echo done
} >> $report
if $lsof -p $pid -a -d $epfd |
- grep -q "epoll *[0-9]* *.* *${epfd}u *a_inode *[0-9]*,[0-9]* *[0-9]* *[0-9]* *\[eventpoll:5,6\]"; then
+ grep -q "epoll *[0-9]* *.* *${epfd}u *a_inode *[0-9]*,[0-9]* *[0-9]* *[0-9]* *\[eventpoll:${evp0},${evp1}\]"; then
kill $pid
exit 0
else
--- a/dialects/linux/tests/epoll.c
+++ b/dialects/linux/tests/epoll.c
@@ -14,42 +14,42 @@
return 1;
}
- struct epoll_event ev;
- int fd[2];
- if (pipe(fd) < 0)
- if (fd < 0)
+ int pipefd[2];
+ if (pipe(pipefd) < 0)
{
perror ("pipe");
return 1;
}
- if (dup2(fd[0], 5) < 0)
+ int evfd[2];
+ if ((evfd[0] = dup(pipefd[0])) < 0)
{
- perror ("dup2(fd[0], 5)");
+ perror ("dup(pipefd[0])");
return 1;
}
- if (dup2(fd[1], 6) < 0)
+ if ((evfd[1] = dup(pipefd[1])) < 0)
{
- perror ("dup2(fd[1], 6)");
+ perror ("dup(pipefd[1])");
return 1;
}
+ struct epoll_event ev;
ev.events = EPOLLOUT;
- ev.data.fd = 6;
+ ev.data.fd = evfd[1];
if (epoll_ctl (epfd, EPOLL_CTL_ADD, ev.data.fd, &ev) < 0)
{
- perror ("epoll_ctl<6>");
+ perror ("epoll_ctl<evfd[1]>");
return 1;
}
ev.events = EPOLLIN;
- ev.data.fd = 5;
+ ev.data.fd = evfd[0];
if (epoll_ctl (epfd, EPOLL_CTL_ADD, ev.data.fd, &ev) < 0)
{
- perror ("epoll_ctl<5>");
+ perror ("epoll_ctl<evfd[0]>");
return 1;
}
- printf ("%d %d\n", getpid(), epfd);
+ printf ("%d %d %d %d\n", getpid(), epfd, evfd[0], evfd[1]);
fflush (stdout);
pause ();
return 0;

View File

@ -1,10 +1,10 @@
# Template file for 'lsof'
pkgname=lsof
version=4.98.0
version=4.99.0
revision=1
build_style=gnu-configure
configure_args="--enable-security"
hostmakedepends=groff
hostmakedepends="automake groff"
checkdepends="util-linux procps-ng"
short_desc="LiSt Open Files"
maintainer="Subhaditya Nath <sn03.general@gmail.com>"
@ -12,16 +12,20 @@ license="lsof"
homepage="https://github.com/lsof-org/lsof"
changelog="https://raw.githubusercontent.com/lsof-org/lsof/master/00DIST"
distfiles="https://github.com/lsof-org/lsof/releases/download/${version}/lsof-${version}.tar.gz"
checksum=2f8efa62cdf8715348b8f76bf32abf59f109a1441df35c686d23dccdeed34d99
checksum=180e6284aff184d94d273e34f7264edc2af849c07b1c5d6a4183d4d402734245
post_extract() {
# Fix GitHub CI quirks
if [ $XBPS_BUILD_ENVIRONMENT = void-packages-ci ]; then
patch -Np1 <"$FILESDIR/fix-github-ci.patch"
fi
# Ensure tests always run
ln -sf /bin/true tests/CkTestDB
# Skip tests/LTsock on GitHub CI
# hostname/IP resolution fails in CI container
if [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then
vsed -i Makefile.am -e '/^TESTS +=/s:tests/LTsock::g'
fi
# liblsof is still in alpha. Don't include it in the package.
vsed -i Makefile.am -e '/^lib_LTLIBRARIES/s/^lib_/noinst_/; /^include_HEADERS/d'
}
post_install() {