sync code with last improvements from OpenBSD

This commit is contained in:
purplerain 2023-09-05 00:47:44 +00:00
parent 8ed89093e5
commit 30d14db1d3
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
5 changed files with 90 additions and 19 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tar.c,v 1.72 2023/08/19 04:21:05 guenther Exp $ */ /* $OpenBSD: tar.c,v 1.73 2023/09/04 17:05:34 jca Exp $ */
/* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */ /* $NetBSD: tar.c,v 1.5 1995/03/21 09:07:49 cgd Exp $ */
/*- /*-
@ -59,9 +59,7 @@ static u_long tar_chksm(char *, int);
static char *name_split(char *, int); static char *name_split(char *, int);
static int ul_oct(u_long, char *, int, int); static int ul_oct(u_long, char *, int, int);
static int ull_oct(unsigned long long, char *, int, int); static int ull_oct(unsigned long long, char *, int, int);
#ifndef SMALL
static int rd_xheader(ARCHD *arcn, int, off_t); static int rd_xheader(ARCHD *arcn, int, off_t);
#endif
static uid_t uid_nobody; static uid_t uid_nobody;
static uid_t uid_warn; static uid_t uid_warn;
@ -721,14 +719,11 @@ ustar_rd(ARCHD *arcn, char *buf)
if (ustar_id(buf, BLKMULT) < 0) if (ustar_id(buf, BLKMULT) < 0)
return(-1); return(-1);
#ifndef SMALL
reset: reset:
#endif
memset(arcn, 0, sizeof(*arcn)); memset(arcn, 0, sizeof(*arcn));
arcn->org_name = arcn->name; arcn->org_name = arcn->name;
arcn->sb.st_nlink = 1; arcn->sb.st_nlink = 1;
#ifndef SMALL
/* Process Extended headers. */ /* Process Extended headers. */
if (hd->typeflag == XHDRTYPE || hd->typeflag == GHDRTYPE) { if (hd->typeflag == XHDRTYPE || hd->typeflag == GHDRTYPE) {
if (rd_xheader(arcn, hd->typeflag == GHDRTYPE, if (rd_xheader(arcn, hd->typeflag == GHDRTYPE,
@ -745,7 +740,6 @@ reset:
if (hd->typeflag == XHDRTYPE || hd->typeflag == GHDRTYPE) if (hd->typeflag == XHDRTYPE || hd->typeflag == GHDRTYPE)
goto reset; goto reset;
} }
#endif
if (!arcn->nlen) { if (!arcn->nlen) {
/* /*
@ -1190,8 +1184,6 @@ expandname(char *buf, size_t len, char **gnu_name, const char *name,
return(nlen); return(nlen);
} }
#ifndef SMALL
/* shortest possible extended record: "5 a=\n" */ /* shortest possible extended record: "5 a=\n" */
#define MINXHDRSZ 5 #define MINXHDRSZ 5
@ -1331,4 +1323,3 @@ rd_xheader(ARCHD *arcn, int global, off_t size)
return (-1); return (-1);
return (ret); return (ret);
} }
#endif

View File

@ -1,7 +1,7 @@
# $OpenBSD: Makefile,v 1.2 2018/09/13 16:34:33 sthen Exp $ # $OpenBSD: Makefile,v 1.3 2023/09/04 17:08:03 jca Exp $
.PATH: ${.CURDIR}/../../../bin/pax .PATH: ${.CURDIR}/../../../bin/pax
CFLAGS+=-DNOCPIO -I${.CURDIR}/../../../bin/pax CFLAGS+=-DNOCPIO -DSMALL -I${.CURDIR}/../../../bin/pax
PROG= pax PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c file_subs.c ftree.c\ SRCS= ar_io.c ar_subs.c buf_subs.c file_subs.c ftree.c\

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: bsd.port.mk.5,v 1.586 2023/09/04 12:40:44 espie Exp $ .\" $OpenBSD: bsd.port.mk.5,v 1.587 2023/09/04 22:36:55 thfr Exp $
.\" .\"
.\" Copyright (c) 2000-2008 Marc Espie .\" Copyright (c) 2000-2008 Marc Espie
.\" .\"
@ -1574,6 +1574,40 @@ To be used in the rare cases where a port heeds DESTDIR in a few
directories and needs to be configured with directories and needs to be configured with
.Sq gnu dest , .Sq gnu dest ,
so that those few directories do not get in the way. so that those few directories do not get in the way.
.It Ev DIST_TUPLE
List of distfile templates to use, each consisting of five entries:
.Ar name account project tagname/commithash targetdir .
The template
.Ar name
should be one of
.Sq github ,
.Sq gitlab ,
or
.Sq srht
at the moment
.Po see
.Pa ${PORTSDIR}/db/dist-tuple.pattern ,
additional
.Ev TEMPLATE_DISTFILES.<name>
and
.Ev TEMPLATE_HOMEPAGE.<name>
entries can be added as needed
.Pc .
The components are used to build
.Ev MASTER_SITES.name
.Ev DISTFILES.name
and
.Ev HOMEPAGE .
.Pp
At the end of
.Cm post-extract ,
the files are moved to
.Pa ${WRKDIST}/<targetdir> .
Using
.Sq \&.
for
.Ar targetdir
will disable the move.
.It Ev DISTDIR .It Ev DISTDIR
User settings. User settings.
Directory where all ports distribution files and patchfiles are stashed. Directory where all ports distribution files and patchfiles are stashed.
@ -1802,6 +1836,11 @@ Note that
will only be set in the absence of will only be set in the absence of
.Ev DISTFILES.sufx .Ev DISTFILES.sufx
as well. as well.
.It Ev EXTRACT_SUFX.<name>
The
.Ev EXTRACT_SUFX
for a template defined with
.Ev DIST_TUPLE .
.It Ev EXTRACT_FILES .It Ev EXTRACT_FILES
Set to the list of files to actually extract from distfiles. Set to the list of files to actually extract from distfiles.
Its content is subject to shell evaluation as part of Its content is subject to shell evaluation as part of
@ -1982,7 +2021,7 @@ including flavors and subpackages.
See See
.Xr pkgpath 7 . .Xr pkgpath 7 .
.It Ev GH_* .It Ev GH_*
Support for GitHub-hosted projects. Simple support for GitHub-hosted projects.
Leave empty for non hosted projects. Leave empty for non hosted projects.
Yields a suitable default for Yields a suitable default for
.Ev MASTER_SITES_GITHUB .Ev MASTER_SITES_GITHUB
@ -3249,6 +3288,47 @@ Set to the list of special targets for a port
and module hooks and module hooks
.Pc . .Pc .
Used by introspection tools such as the sqlports package. Used by introspection tools such as the sqlports package.
.It Ev TEMPLATE_DISTFILES.<name>
Template used to construct
.Ev DISTFILES.name
based on a
.Ev DIST_TUPLE
entry by filling in placeholder strings.
For instance,
.Ev TEMPLATE_DISTFILES.github
defaults to
.Bd -literal
<account>-<project>-{<account>/<project>/archive/<subdir>}<id>.tar.gz
.Ed .
.Pp
with
.Li DIST_TUPLE += github foo bar baz qux.
We end up with the following
.Ev DISTFILES.github
entry:
.Bd -literal -offset indent
foo-bar-{foo/bar/archive/ref/tags}baz.tar.gz
.Ed
.Pp
Placeholders
.Sq account ,
.Sq project ,
.Sq id
are self-explanatory.
.Sq subdir
is set automatically by figuring out whether
.Ar id
is a
.Ar tagname
or a
.Ar hash .
.It Ev TEMPLATE_HOMEPAGE.<name>
Template for automatically generated
.Ev HOMEPAGE
when using
.Ev DIST_TUPLE .
Very similar to
.Ev TEMPLATE_DISTFILES.<name> .
.It Ev TEMPLATES .It Ev TEMPLATES
Base location for the templates used in the Base location for the templates used in the
.Cm readmes .Cm readmes

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tcp_var.h,v 1.170 2023/08/28 14:50:02 bluhm Exp $ */ /* $OpenBSD: tcp_var.h,v 1.171 2023/09/04 23:00:36 bluhm Exp $ */
/* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */ /* $NetBSD: tcp_var.h,v 1.17 1996/02/13 23:44:24 christos Exp $ */
/* /*
@ -288,9 +288,9 @@ struct syn_cache_head {
struct syn_cache_set { struct syn_cache_set {
struct syn_cache_head *scs_buckethead; struct syn_cache_head *scs_buckethead;
long scs_use;
int scs_size; int scs_size;
int scs_count; int scs_count;
int scs_use;
u_int32_t scs_random[5]; u_int32_t scs_random[5];
}; };
@ -430,7 +430,7 @@ struct tcpstat {
u_int64_t tcps_sc_entry_limit; /* limit of syn cache entries */ u_int64_t tcps_sc_entry_limit; /* limit of syn cache entries */
u_int64_t tcps_sc_bucket_maxlen;/* maximum # of entries in any bucket */ u_int64_t tcps_sc_bucket_maxlen;/* maximum # of entries in any bucket */
u_int64_t tcps_sc_bucket_limit; /* limit of syn cache bucket list */ u_int64_t tcps_sc_bucket_limit; /* limit of syn cache bucket list */
u_int64_t tcps_sc_uses_left; /* use counter of current syn cache */ int64_t tcps_sc_uses_left; /* use counter of current syn cache */
u_int64_t tcps_conndrained; /* # of connections drained */ u_int64_t tcps_conndrained; /* # of connections drained */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: inet.c,v 1.178 2023/07/07 09:15:13 yasuoka Exp $ */ /* $OpenBSD: inet.c,v 1.179 2023/09/04 23:00:36 bluhm Exp $ */
/* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */ /* $NetBSD: inet.c,v 1.14 1995/10/03 21:42:37 thorpej Exp $ */
/* /*
@ -498,7 +498,7 @@ tcp_stats(char *name)
"\t%llu entr%s in current SYN cache, limit is %llu\n"); "\t%llu entr%s in current SYN cache, limit is %llu\n");
p2b(tcps_sc_bucket_maxlen, tcps_sc_bucket_limit, p2b(tcps_sc_bucket_maxlen, tcps_sc_bucket_limit,
"\t%llu longest bucket length in current SYN cache, limit is %llu\n"); "\t%llu longest bucket length in current SYN cache, limit is %llu\n");
p(tcps_sc_uses_left, "\t%llu use%s of current SYN cache left\n"); p(tcps_sc_uses_left, "\t%lld use%s of current SYN cache left\n");
p(tcps_sack_recovery_episode, "\t%llu SACK recovery episode%s\n"); p(tcps_sack_recovery_episode, "\t%llu SACK recovery episode%s\n");
p(tcps_sack_rexmits, p(tcps_sack_rexmits,