From nobody Sat Dec 27 16:30:09 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ddnyV0Nshz6LXl6 for ; Sat, 27 Dec 2025 16:30:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ddnyT5y5Bz3F8c for ; Sat, 27 Dec 2025 16:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766853009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjkbcaB05ZKjTxi/82YFDoGFuZPTklRSRF20W+0hjF0=; b=YWBQKbSGtFCFX20N//FbYchqXKV+J9mj4RqD5XHKs7llrcgO57Vjt1SkrHf/9xdQp0eNJb tuC90X22t0Gw7viauJUy60C+LTfyU9FWgqc6LWlyCB/goKDLKgbxv8F+LyPfJGgQa2cdA+ OrihgqCpxREpMsaDcPAgjW2MygtRn6ewoyYCdZhHbk4Q9Aw2niPWgpdcNU5H748emVflDf EZ8eJOlUc9PlEC5gUGZNYZLdXnjDeW5OM17n7h7smasHxwbYO/jB0Pbt80k2OeQybvGNTb KqjQSKZOXOZdiXKRW+A/Q02OqTGRsQ5nednEOvLfMdBp+vzqJdccgstnD7AFAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766853009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cjkbcaB05ZKjTxi/82YFDoGFuZPTklRSRF20W+0hjF0=; b=dGNtb+No0pcuL5l6AQnBZpDjY83ZNOlxFVNHaFyJxpJAUIXwwq2amnpDs30AwgnSI5hKXp UO4RlKaLp36o68BbfZ1X7bo5+gynSxUnJzFPk62yV3+mjV7WmSrVB9xNnB9iSOuQEQLXJ6 zqniTVBLah0n5O2X6dz56/+iiKLW/i/rAuqcqTF0yyt9FdpKgg/aTM70pqH7qd1l8EXrlY yU2n6bCTFwIZ+ODabNmIyfgw4gv9c2gHbfCk7wZSpHzEUn995qZ7wAqdkUvBQcSQxBoBx7 Fgqlp+fXwrUZEO9cLxCSLKaZAbkcWE6ICrKhAO5I6Sxxx9zTXK5sGxAMn3lvTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766853009; a=rsa-sha256; cv=none; b=go2Ff2DNQ8HpFe6cB2hmBxASiOGm/IcrjC2dDvjVp6G0urNNat3CUMFNvvWbyrmQO1K01Q DmDY06Fbj+qJp08Mjd5rFbRbO997JmtdUsqcDN+PGCUHxDKlIoPpAcB4Q3utP+NUzFX9EB TFFuByHzgvc96uGAZQ8fNzl3OSy5dmPLHMasf8mMH2BXZuTMlwn8zpw/zm4zlrHq6en7Mf s5vTigLWq8JDIB2gn8VqMIXF9W+KB7i8dZNwRcK0SmBejFcBb2BMeuEQVteGxZBXZsiWXF Ia7OJ1RfE76ZOiRtVcpOqnqWIeZzJbEiSULCBDugp5UKJSDeCrgfMOSV1Sm77Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ddnyT5Xdsz16MS for ; Sat, 27 Dec 2025 16:30:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c3ef by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 27 Dec 2025 16:30:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 5ea3ad01e6f5 - stable/13 - Import latest mtree from NetBSD List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5ea3ad01e6f511ee573e993e89810c27a7cf4198 Auto-Submitted: auto-generated Date: Sat, 27 Dec 2025 16:30:09 +0000 Message-Id: <69500991.c3ef.7e39ddd7@gitrepo.freebsd.org> The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=5ea3ad01e6f511ee573e993e89810c27a7cf4198 commit 5ea3ad01e6f511ee573e993e89810c27a7cf4198 Author: Jose Luis Duran AuthorDate: 2025-12-19 20:14:35 +0000 Commit: Jose Luis Duran CommitDate: 2025-12-27 16:29:02 +0000 Import latest mtree from NetBSD Merge commit 'eb2ccba0c11b405ac613c3046997765317cc8b5c' PR: 192839 PR: 219467 MFC after: 1 week (cherry picked from commit f8cee1f2c2dfba6223385fd711cce9faeca76451) --- contrib/mtree/compare.c | 16 ++++++---------- contrib/mtree/create.c | 7 ++++--- contrib/mtree/mtree.c | 36 ++++++++++++++++++++++-------------- contrib/mtree/spec.c | 25 +++++++++++-------------- 4 files changed, 43 insertions(+), 41 deletions(-) diff --git a/contrib/mtree/compare.c b/contrib/mtree/compare.c index 3d8cf2335207..cc31ec365194 100644 --- a/contrib/mtree/compare.c +++ b/contrib/mtree/compare.c @@ -1,4 +1,4 @@ -/* $NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $ */ +/* $NetBSD: compare.c,v 1.63 2025/12/14 17:30:47 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)compare.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: compare.c,v 1.61 2024/12/05 17:17:43 christos Exp $"); +__RCSID("$NetBSD: compare.c,v 1.63 2025/12/14 17:30:47 christos Exp $"); #endif #endif /* not lint */ @@ -291,16 +291,12 @@ typeerr: LABEL; (u_long)p->fts_statp->st_mode & MBITS); if (uflag) { if (lchmod(p->fts_accpath, s->st_mode)) - printf(", not modified: %s%s\n", - strerror(errno), - flavor == F_FREEBSD9 ? "" : ")"); + printf(", not modified: %s", strerror(errno)); else - printf(", modified%s%s\n", - was_unlinked ? " by unlink" : "", - flavor == F_FREEBSD9 ? "" : ")"); + printf(", modified%s", + was_unlinked ? " by unlink" : ""); } - else - printf(")\n"); + printf("%s\n", flavor == F_FREEBSD9 ? "" : ")"); tab = "\t"; skip: ; } diff --git a/contrib/mtree/create.c b/contrib/mtree/create.c index e23004851f39..191d69c6a537 100644 --- a/contrib/mtree/create.c +++ b/contrib/mtree/create.c @@ -1,4 +1,4 @@ -/* $NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $ */ +/* $NetBSD: create.c,v 1.80 2025/12/18 18:16:48 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)create.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: create.c,v 1.79 2024/12/05 17:17:43 christos Exp $"); +__RCSID("$NetBSD: create.c,v 1.80 2025/12/18 18:16:48 christos Exp $"); #endif #endif /* not lint */ @@ -236,7 +236,8 @@ statf(FILE *fp, int indent, FTSENT *p) offset += fprintf(fp, "%*s", (INDENTNAMELEN + indent) - offset, ""); - if (!S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) + if (keys & F_TYPE && + !S_ISREG(p->fts_statp->st_mode) && (flavor == F_NETBSD6 || !dflag)) output(fp, indent, &offset, "type=%s", inotype(p->fts_statp->st_mode)); if (keys & (F_UID | F_UNAME) && p->fts_statp->st_uid != uid) { diff --git a/contrib/mtree/mtree.c b/contrib/mtree/mtree.c index 28f09fa32210..479f6acfca3a 100644 --- a/contrib/mtree/mtree.c +++ b/contrib/mtree/mtree.c @@ -1,4 +1,4 @@ -/* $NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $ */ +/* $NetBSD: mtree.c,v 1.52 2025/12/18 18:17:26 christos Exp $ */ /*- * Copyright (c) 1989, 1990, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)mtree.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: mtree.c,v 1.51 2024/12/05 17:17:15 christos Exp $"); +__RCSID("$NetBSD: mtree.c,v 1.52 2025/12/18 18:17:26 christos Exp $"); #endif #endif /* not lint */ @@ -73,19 +73,20 @@ static struct { }; __dead static void usage(void); +static int parsekeys(char **); int main(int argc, char **argv) { int ch, status; unsigned int i; - int cflag, Cflag, Dflag, Uflag, wflag; + int cflag, Cflag, Dflag, Uflag, wflag, rkeys; char *dir, *p; FILE *spec1, *spec2; setprogname(argv[0]); - cflag = Cflag = Dflag = Uflag = wflag = 0; + cflag = Cflag = Dflag = Uflag = wflag = rkeys = 0; dir = NULL; init_excludes(); spec1 = stdin; @@ -150,14 +151,9 @@ main(int argc, char **argv) break; case 'k': keys = F_TYPE; - while ((p = strsep(&optarg, " \t,")) != NULL) - if (*p != '\0') - keys |= parsekey(p, NULL); - break; + /*FALLTHROUGH*/ case 'K': - while ((p = strsep(&optarg, " \t,")) != NULL) - if (*p != '\0') - keys |= parsekey(p, NULL); + keys |= parsekeys(&optarg); break; case 'l': lflag = 1; @@ -198,9 +194,7 @@ main(int argc, char **argv) rflag++; break; case 'R': - while ((p = strsep(&optarg, " \t,")) != NULL) - if (*p != '\0') - keys &= ~parsekey(p, NULL); + rkeys |= parsekeys(&optarg); break; case 's': sflag = 1; @@ -243,6 +237,8 @@ main(int argc, char **argv) if (argc) usage(); + keys &= ~rkeys; + switch (flavor) { case F_FREEBSD9: if (cflag && iflag) { @@ -312,6 +308,18 @@ main(int argc, char **argv) exit(status); } +static int +parsekeys(char **arg) +{ + const char *p; + int k = 0; + + while ((p = strsep(arg, " \t,")) != NULL) + if (*p != '\0') + k |= parsekey(p, NULL); + return k; +} + static void usage(void) { diff --git a/contrib/mtree/spec.c b/contrib/mtree/spec.c index 24e15f33fa8a..af5248be1596 100644 --- a/contrib/mtree/spec.c +++ b/contrib/mtree/spec.c @@ -1,4 +1,4 @@ -/* $NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $ */ +/* $NetBSD: spec.c,v 1.94 2025/12/18 14:05:41 christos Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -67,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)spec.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: spec.c,v 1.92 2024/12/05 17:17:43 christos Exp $"); +__RCSID("$NetBSD: spec.c,v 1.94 2025/12/18 14:05:41 christos Exp $"); #endif #endif /* not lint */ @@ -100,7 +100,7 @@ static dev_t parsedev(char *); static void replacenode(NODE *, NODE *); static void set(char *, NODE *); static void unset(char *, NODE *); -static void addchild(NODE *, NODE *); +static NODE *addchild(NODE *, NODE *); static int nodecmp(const NODE *, const NODE *); static int appendfield(FILE *, int, const char *, ...) __printflike(3, 4); @@ -239,8 +239,7 @@ noparent: mtree_err("no parent node"); * full path entry; add or replace */ centry->parent = pathparent; - addchild(pathparent, centry); - last = centry; + last = addchild(pathparent, centry); } else if (strcmp(centry->name, ".") == 0) { /* * duplicate "." entry; always replace @@ -252,8 +251,7 @@ noparent: mtree_err("no parent node"); * add or replace */ centry->parent = last; - addchild(last, centry); - last = centry; + last = addchild(last, centry); } else { /* * new relative child in parent dir @@ -261,8 +259,7 @@ noparent: mtree_err("no parent node"); * add or replace */ centry->parent = last->parent; - addchild(last->parent, centry); - last = centry; + last = addchild(last->parent, centry); } } return (root); @@ -721,7 +718,7 @@ unset(char *t, NODE *ip) * a duplicate, insert it into the linked list referenced by * pathparent->child. Keep the list sorted if Sflag is set. */ -static void +static NODE * addchild(NODE *pathparent, NODE *centry) { NODE *samename; /* node with the same name as centry */ @@ -740,7 +737,7 @@ addchild(NODE *pathparent, NODE *centry) if (cur == NULL) { /* centry is pathparent's first and only child node so far */ pathparent->child = centry; - return; + return centry; } /* @@ -785,7 +782,7 @@ addchild(NODE *pathparent, NODE *centry) replacenode(samename, centry); if (samename == replacepos) { /* The just-replaced node was in the correct position */ - return; + return samename; } if (samename == insertpos || samename->prev == insertpos) { /* @@ -793,7 +790,7 @@ addchild(NODE *pathparent, NODE *centry) * or just after the replaced node, but that would * be equivalent to just retaining the replaced node. */ - return; + return samename; } /* @@ -833,7 +830,7 @@ addchild(NODE *pathparent, NODE *centry) if (centry->next) centry->next->prev = centry; } - return; + return centry; } /*