From nobody Sat Nov 16 07:23:47 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 4Xr53S1zMqz5cySW; Sat, 16 Nov 2024 07:23:48 +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 4Xr53R6QzPz4g6p; Sat, 16 Nov 2024 07:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731741827; 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=SimdOCsTO2bfFJDg8M6LBwUDy6ra9DHr8XXtq3rQTU4=; b=yvWJw0IzMHOGq2os5RX0f3iDZzxlpHLSW9lmmhXPnGF6J8blAIxbN9P3hY0aqVWKKFJUYb K7WKnPABRVv/0iGy0Ln/V5sa0+/qdRXU17h2MrgOl0L9oKmB1A4Uynog7OxNL6MFlHMIlw VtiLXbfoFgEK9RwurM+31/hqFwt6CR+ZltE2g8nzYr7NZfsMK81JRedMadzzbsm505DJnV bSdt/KEcY2w97VVSzrgRpeo6XTzWSu6rgUWlN68YJH5pQupZNskILq39IMKCsf8FdZxXSx jvJMlZnAMGDsthb922PVpB6DN0H9swfoYC/jL9XDq/GEe8NIC5JMBbT9WfloCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1731741827; 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=SimdOCsTO2bfFJDg8M6LBwUDy6ra9DHr8XXtq3rQTU4=; b=XXYgknoovEa4nJou2QnMCRSYFOYzcWMl2aiCpDIuHJTVO0gICt//IIMa1aMrdB2DaNm6k/ pzn2mejo0Qa1rxQqd9q5UJ21pg1dFQOiqqM5VW+Uw0fyIG7jsckcyjhg+RwkPNOlYApi93 jHvXbbH1qbYsuIYesrgDwooQmXGK6aJUaFtXQGLthRcm3h8J737AqIUZIgcSw+qlWgK2y3 2SO+O4qlP8kr3lxehSstRThXor0yQy5BV82l8Ar6MW/K33gZ+jqqhpTneOylkgRm9pKVZV SPYHsmGxtO76o1uxE4s3vgTnoorRYMiiDsFVqTu8F8/+z+toAf6kCpkubh4JuA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1731741827; a=rsa-sha256; cv=none; b=huQb+coI6lwgnf1HixznMDHdSS3CjO/H6V8o5Yu3T7DUVSIDIwvL5cXQ5adpI/UPE68Q6Z hwH7jwY9iOcAJXYHvrtuYUjqoN2tx9L7lFokoIMQEddAwV97kZ0QW9RV7b6vIBctdCUygW hGP4BX6+B6PvgyqF78ieZT30p2TLnTGj2hlscozBuarFbUTByeBv766k3YQ4ZLTplC3GYE lL2CfXXFUhnu7Id2tpcDXnDrJ1nu/HLhpH/4wpwMl8JXGwLsUbVuW1riU2XYZisSASd/Ho eMBSH8plheMlyAMdERe+i+shaQ4/00aOZ7UIZEvcmRftKM+mbedUfpfNv1fgrg== 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 4Xr53R60qNzy7V; Sat, 16 Nov 2024 07:23:47 +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 4AG7NlKP018478; Sat, 16 Nov 2024 07:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4AG7NlRl018475; Sat, 16 Nov 2024 07:23:47 GMT (envelope-from git) Date: Sat, 16 Nov 2024 07:23:47 GMT Message-Id: <202411160723.4AG7NlRl018475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 4db04f5e3a9b - main - 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/main X-Git-Reftype: branch X-Git-Commit: 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f Auto-Submitted: auto-generated The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f commit 4db04f5e3a9bd927ba1173bf8d3b6a70178eab5f Author: Jose Luis Duran AuthorDate: 2024-11-12 07:33:12 +0000 Commit: Jose Luis Duran CommitDate: 2024-11-16 07:01:27 +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 --- 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