From nobody Mon Dec 16 15:15:23 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 4YBk5l4J7fz5hYRN; Mon, 16 Dec 2024 15:15:23 +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 4YBk5l3Ly1z48Nt; Mon, 16 Dec 2024 15:15:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362123; 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=BWeacFmBoY5Mgj2nZU3G1K/Fis+XrnbPTkxK+BFhsms=; b=pnkI/0N5rwywoNB7SXpZXOoVWMhpHxsqptfqyX76ShnQhZqAEvOV6T9yTF5/mctbv/L4Qc V2fr1IyUt+ADYe9uPfrgx2bS9nFk58s/KEqXny3nz/5XNCY3cM9ZsTOcyR2QjRL5LBUlzn eS8b+gghG4zRQgGXzdkOAhZ4FNOMrRcOLjP6xhvVLm39vK7L0pgmnsRjAOs8IUrPUL1qQT qReHPZIkejUKxWHYnhJzq3gjD9qlIWP8oePWpJUK2ofGbcOUAGoSCCCCo1eJo47gnyra2V r+nRd6a3lBK8QYvsCQ6xbh2nplvDh2bC1jAcoZBUKHUEEYhIwUFJTEqwpjQdZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734362123; 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=BWeacFmBoY5Mgj2nZU3G1K/Fis+XrnbPTkxK+BFhsms=; b=J4P3cENgUp2EBvGGjcCer6yPcBmSCKD8fIju1JmFgw04sR5hmCFrcFzJvrqZjbDy0PrRbR GrXHr7B6UxeEc7fprqdefbjsXfApWB4P1o04gKb+FmSzxBBi6bboX0t3ECq+5/OrfhADku R9ocEeyLXNR7A2iIOdU0DcGgVBqEpm6vYCunDa4hE3UrjZiLfenWbQFBLMMSVDuB2lg0nA AmaY1MUEzDEEWL5GSl4Jp7e+kTn00YgCJ8OqHnCGyis2qekQ6Oj3Tqxdf9Zd7EtS7DtKVc SaEDKP6dfKm2iDCiZFRQwkCTGRp6g6uZ784RudIwmMZoZjOCrrw+uAIO2ICq9A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734362123; a=rsa-sha256; cv=none; b=k8dmnvMGScK/Vn7YPcvbxSvHnOtSh5vUFXA5kP4MCdjGGSEEhzn2zIuLmWzFuSWfmhY1BT bbbZFCr+hGp1EdfMu/g38dFDRDkUP/Dg9Frmc8xmods+leVRBBcsGf80HZ7jkio0QQeNjL ZDryIF0C0UYrcJ1vNGIGpmL/sNcGodUWBjBJMYy21JuL/dXzhxxI76UuqdgBzqz2mI4LbO vp/Ks6W0FLC75SfkpUHoCcyKGflqWDAkqkG7Ly0uAtZluGyNTulT1mWl57uJR6NWE3lBlF rUENuH/tp3ov5fBGGOW0g66ENOWYfYD7baoCzqgi511judDaiKPLV6LtsU6xyw== 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 4YBk5l2zH3zym7; Mon, 16 Dec 2024 15:15:23 +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 4BGFFN1h011996; Mon, 16 Dec 2024 15:15:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BGFFNdM011993; Mon, 16 Dec 2024 15:15:23 GMT (envelope-from git) Date: Mon, 16 Dec 2024 15:15:23 GMT Message-Id: <202412161515.4BGFFNdM011993@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: f5613e2d4952 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: f5613e2d49523cb304638fcc322970128958f16f Auto-Submitted: auto-generated The branch stable/13 has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=f5613e2d49523cb304638fcc322970128958f16f commit f5613e2d49523cb304638fcc322970128958f16f Author: Jose Luis Duran AuthorDate: 2024-11-12 07:33:12 +0000 Commit: Jose Luis Duran CommitDate: 2024-12-16 15:13:37 +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