From nobody Mon Dec 16 15:14:40 2024 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 4YBk4x3nX0z5hYZG; Mon, 16 Dec 2024 15:14:41 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YBk4x0KVCz460Y; Mon, 16 Dec 2024 15:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362081; 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=0oC4XyFXxLaZ8qsaSCiVMHcsLL1Pnrudwe8wr3SC0Fc=; b=grB59ASt1K3P6FaNpeshZM5eluKW7To81kbcwDKjEIbEsWA2oORkB3u5pa8WuPEBrmsR1D /b6UEBBNOrNzdYcu5hdmym6ETgzmIqfIxqGtWoqKbCYhx6MicUft0s7JTi1NoOCQQzFvkF Kb1WfRqAfI9PYcO1nObQd4KV9wSMEdKqbGEf7/3WXLFqXal/YDl+l8xsBsqRjr29oNjScX n2WK/zKXTrBHEPwnZWjd9oaNiwvulHHshkihw4JKz5HcNlJ/Yk1lQYEL97Jx0haVygvFFx W765XEYgLO5fsOp4hoJe5nHUmPfqnL9PHsk2szi5Us62zUckcZyX9rhjmDVnlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362081; 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=0oC4XyFXxLaZ8qsaSCiVMHcsLL1Pnrudwe8wr3SC0Fc=; b=GfSYNdC+0jS0Y4qSWWwhOtL+FAlhT+brkQz1XZkQB22uc/dGHv/GjZn9L9WrRhZXPKzZRv koDHV5aJnbk0l5ZaD03hUBzwx9Mgb+stdqwTmZ3i0nyd0h2CTWa7Bsd5/JJjjGqtdqk4x3 TDBuf4w/wRkfRR9U6LblMo8MTdBZC6W2xmTbybVyxO7NuSPeFWA0O+DJWBZp6wbW1SDOK4 kyDP0+SIRiuTU0dIS/CzQ/8w03401T766FektM0ukxdC+T89q3GsaOF+r/cDsHsMj6zDn+ kVO65LX7k3MaOJfLEnnmWcKm+LffL+Wu7x7pCvWvj2mJrhPf5ptc7iSAOm9kvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362081; a=rsa-sha256; cv=none; b=hKtQsVOPA1U3rWlSiCvyKOfhibx2XbiKDYGBHgoQQ9xUvix0FEPE4ksZ8XCGfY42G/0/Mb KMZAhBWUKe9q3lqC+Ky+V0UgiKEDMnYc4lHjrFd/x5KGV6wHYtlPCQ+hhpkhbCPSa/gWcK idznIUetMH+9G01rISi6mbE//27nnjzVu99mDJKQ4/7A2An/kx9Q9jjz33cbZU+a1zFSTQ kGCvOl6P5tRcTYtI45vgCBJIK6LM8Vr1vYNh0d+NMSa9ocvvsIStUbneVowfjU6CsMf8Lh gbYHAS/owXosrCLz27JoRiGNsTp6aNX6pCvBtTT3+02RTGZgxvH+EO/ygU4wjA== 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 4YBk4w73bZzyTq; Mon, 16 Dec 2024 15:14:40 +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 4BGFEesc011225; Mon, 16 Dec 2024 15:14:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFEeGJ011222; Mon, 16 Dec 2024 15:14:40 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:14:40 GMT Message-Id: <202412161514.4BGFEeGJ011222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jose Luis Duran Subject: git: 4b26b3d2ac9b - stable/14 - nanobsd: Update fill_pkg.sh 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/14 X-Git-Reftype: branch X-Git-Commit: 4b26b3d2ac9b9947c98062104691d9df420d3a2b Auto-Submitted: auto-generated The branch stable/14 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4b26b3d2ac9b9947c98062104691d9df420d3a2b commit 4b26b3d2ac9b9947c98062104691d9df420d3a2b Author: Jose Luis Duran AuthorDate: 2024-11-12 07:33:12 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:11:57 +0000 nanobsd: Update fill_pkg.sh fill_pkg.sh is a script that links a package and its dependencies from a "package dump" directory (like /usr/ports/packages/All) to a specified directory (NANO_PACKAGE_DIR), for cust_pkgng()[*]. Update the script by: - Using `make package-name` instead of `make -V pkgname` - Looking for package files with *.pkg instead of *.txz - Adding a -c option that copies the files instead of linking them[*] [*] After 9af130ae8c03 cust_pkgng() cannot be used with a directory populated by fill_pkg.sh, because it uses a nullfs mount, which doesn't follow symlinks, therefore the links inside NANO_PACKAGE_DIR will not work. PR: 269884 Reviewed by: imp Approved by: emaste (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D47531 (cherry picked from commit 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f) --- tools/tools/nanobsd/fill_pkg.sh | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/tools/nanobsd/fill_pkg.sh b/tools/tools/nanobsd/fill_pkg.sh index 2869122c5fbf..6734498350a9 100644 --- a/tools/tools/nanobsd/fill_pkg.sh +++ b/tools/tools/nanobsd/fill_pkg.sh @@ -27,16 +27,16 @@ # # # Usage: -# $0 PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.txz]... +# $0 [-cv] PACKAGE_DUMP NANO_PACKAGE_DIR /usr/ports/foo/bar [package.pkg]... # -# Will symlink the packages listed, including their runtime dependencies, +# Will symlink/copy the packages listed, including their runtime dependencies, # from the PACKAGE_DUMP to the NANO_PACKAGE_DIR. # : ${PORTSDIR:=/usr/ports} usage () { - echo "Usage: $0 [-v] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 + echo "Usage: $0 [-cv] package-dump-dir nano-package-dir port-dir-or-pkg ..." 1>&2 exit 2 } @@ -53,29 +53,29 @@ ports_recurse() ( for p do if [ -d "$p" -a -f "$p/Makefile" ] ; then msg 3 "$p: full path to port" - pkgname=`cd "$p" && make -V pkgname` + pkgname=`cd "$p" && make package-name` type=port fullpath=$p elif [ -d "${PORTSDIR}/$p" -a -f "${PORTSDIR}/$p/Makefile" ] ; then msg 3 "$p: path to port relative to ${PORTSDIR}}" - pkgname=`cd "${PORTSDIR}/$p" && make -V pkgname` + pkgname=`cd "${PORTSDIR}/$p" && make package-name` type=port fullpath=${PORTSDIR}/$p - elif [ "${p%.txz}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$p" ] && pkg info -F "$p" > /dev/null 2>&1 ; then msg 3 "$p: full package file name" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$p - elif [ "${p%.txz}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then + elif [ "${p%.pkg}" != "$p" -a -f "$dumpdir/$p" ] && pkg info -F "$dumpdir/$p" > /dev/null 2>&1 ; then msg 3 "$p: package file name relative to $dumpdir" - pkgname=`basename "$p" | sed 's/\.txz$//I'` + pkgname=`basename "$p" | sed 's/\.pkg$//I'` type=pkg fullpath=$dumpdir/$p - elif [ -f "$dumpdir/$p.txz" ] && pkg info -F "$dumpdir/$p.txz" > /dev/null 2>&1 ; then + elif [ -f "$dumpdir/$p.pkg" ] && pkg info -F "$dumpdir/$p.pkg" > /dev/null 2>&1 ; then msg 3 "$p: package name relative to $dumpdir" pkgname=`basename "$p"` type=pkg - fullpath=$dumpdir/$p.txz + fullpath=$dumpdir/$p.pkg else echo "Missing port or package $p" 1>&2 exit 2 @@ -106,7 +106,7 @@ ports_recurse() ( fi deps=`pkg info -dF "$fullpath" | grep -v "$pkgname:"` for dep in $deps ; do - arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.txz/'` + arg=`echo $dep | sed -e "s|^|$dir|" -e 's/$/.pkg/'` msg 2 "Check $arg as requirement for package $pkgname" ports_recurse "$outputfile" "$dumpdir" "$arg" done @@ -116,10 +116,12 @@ ports_recurse() ( done ) +COPY="ln -s" VERBOSE=0 -while getopts v opt ; do +while getopts cv opt ; do case "$opt" in + c) COPY="cp -p" ;; v) VERBOSE=$(($VERBOSE + 1)) ;; [?]) usage ;; esac @@ -155,8 +157,8 @@ for p do done for i in `cat "$PL"` ; do - if [ -f "$NANO_PKG_DUMP/$i.txz" ] ; then - ln -s "$NANO_PKG_DUMP/$i.txz" "$NANO_PKG_DIR" + if [ -f "$NANO_PKG_DUMP/$i.pkg" ] ; then + $COPY "$NANO_PKG_DUMP/$i.pkg" "$NANO_PKG_DIR" else echo "Package $i misssing in $NANO_PKG_DUMP" 1>&2 exit 1