From nobody Wed Sep 18 19:54:11 2024 X-Original-To: dev-commits-src-main@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 4X88VW2d2jz52Dg9; Wed, 18 Sep 2024 19:54:11 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X88VW1k51z4rDw; Wed, 18 Sep 2024 19:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726689251; 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=7Y+smNCLm3TKM27dI+RWFsKl+CCAcLwaoDtdKnSC0DI=; b=L1lZmR4myt8YUHfAzZdoRwALdIGy77NUO1nGS0+pR9b68Ww80I8fvUtzw4VB2o0t0K8IqY x/1lz/evv0LF38JtFmV7IgkrPHE9imuVbZdSM9k2eSzEjJx1YdDKj+2G11qA3TWIMAc2pR 74M5lLb3Fm14XMCpYfQ9uSoUmtT73EGLLj5W20YsXm1ArytvvPzk2HYJCudQN6zoZtr27c 1Mk9eocSPgPFvf5bEbNFy9pinFLgT2Mgd9FrfYZ88uvmnwKNYhCBlE2FK/ZrYtnhhTKuoh wWyDOX9QGAHF/cKqgM8fKML0e9qYDoubCG0dNeoKf/g7yf8e8jJ/q5XG7saSig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726689251; a=rsa-sha256; cv=none; b=SWAK/bZv00RWy0A2BUE2z/eKYDRZMD6/fOoGg7Mhcu0trfkyhXH4g1MX24f35ZNtvtlCYM BSzend2qSrGJU+24kfWIFIdNr+qG75M8COe/LLECya0x8rSevUOnitv/ZVpqTpvkGCLE6h VjQD7w6sg3sjFQfx+SJ06V2QG7wPtpSl8Rn145YOjzHKIvy8teQn9Hsljp62XvfiRtGuaB pkjkv0+73m5dktDYCZiDZp7r+XUpDCHwXVKmZDITAE5QpNO20LnSAEFRd69OyqY6lo7icg /QhXbfojV14gKizPU0gFW9Hk609dTtbgeqcDZJPJRqoHIi2OkoYakNC5RIg3ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726689251; 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=7Y+smNCLm3TKM27dI+RWFsKl+CCAcLwaoDtdKnSC0DI=; b=tIjZJdIN6yEHkPizCN1QvST4M9CcBMoZcGVXY2jP1YRs2E0vnbelPDVNB9J/E6pvOek9v6 cnTHC5LaOJEItasW80y2KdXEonqg1gN/yc6uWyS5zyxPhyfWXEEN71cMrAqk12T4Vr3jTa CPOe3hRCcLNnaPD+s2FI/4iikTh1EWCGtXcXByo+pg5KXoP6jBWq2pk2eOGX5iEAFwMs5e +M5f/EL1YwlWl4F+fj/d6tJyJDd4P1aESF0rm68sFuEz+zeaLEkdfgYpF7IJUU+AlCwJBz 6kmsTG1/XZthIOK1zD5n4SQLg7n86pw9ZLYngh2x1JgRXpq3ogFXqL5PNNwqEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X88VW1KBHzbsF; Wed, 18 Sep 2024 19:54:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48IJsBLD047461; Wed, 18 Sep 2024 19:54:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48IJsBgL047458; Wed, 18 Sep 2024 19:54:11 GMT (envelope-from git) Date: Wed, 18 Sep 2024 19:54:11 GMT Message-Id: <202409181954.48IJsBgL047458@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Stephen J. Kiernan" Subject: git: ce9c3abf69c2 - main - config: Search include paths for files to be read (options, files) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: stevek X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 Auto-Submitted: auto-generated The branch main has been updated by stevek: URL: https://cgit.FreeBSD.org/src/commit/?id=ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 commit ce9c3abf69c2044c1aab0aa62e4a73f8eb13d787 Author: Stephen J. Kiernan AuthorDate: 2024-09-18 19:49:46 +0000 Commit: Stephen J. Kiernan CommitDate: 2024-09-18 19:49:46 +0000 config: Search include paths for files to be read (options, files) This is useful for downstream consumers to add their own kernel config files in another directory other than the default ones. Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D44538 --- usr.sbin/config/mkmakefile.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/usr.sbin/config/mkmakefile.cc b/usr.sbin/config/mkmakefile.cc index 060f08230550..a102b2b59767 100644 --- a/usr.sbin/config/mkmakefile.cc +++ b/usr.sbin/config/mkmakefile.cc @@ -384,13 +384,25 @@ read_file(char *fname) struct file_list *tp; struct device *dp; struct opt *op; + struct includepath *ipath; configword wd; - char *rfile, *compilewith, *depends, *clean, *warning; + char *rfile, *compilewith, *depends, *clean, *fnamebuf, *warning; const char *objprefix; int compile, match, nreqs, std, filetype, negate, imp_rule, no_ctfconvert, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); + if (fp == NULL) { + SLIST_FOREACH(ipath, &includepath, path_next) { + asprintf(&fnamebuf, "%s/%s", ipath->path, fname); + if (fnamebuf != NULL) { + fp = fopen(fnamebuf, "r"); + if (fp != NULL) + break; + free(fnamebuf); + } + } + } if (fp == NULL) err(1, "%s", fname); next: