git: 012bb7fdafb3 - stable/14 - release: Exclude container images from globs

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Thu, 14 Nov 2024 22:40:16 UTC
The branch stable/14 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=012bb7fdafb30032f7a09212ffd6398eb4230b07

commit 012bb7fdafb30032f7a09212ffd6398eb4230b07
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2024-11-14 22:30:44 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2024-11-14 22:40:07 +0000

    release: Exclude container images from globs
    
    We use a *.txz glob to get all of the "distributions" which comprise
    the FreeBSD release, but we now (optionally) also build container
    images which are .txz files.  Grep those out from the distribution
    lists.
    
    A better long-term fix would probably be to generate an explicit list
    of the .txz files we want rather than using an overbroad glob and
    filtering out the files we *don't* want.
    
    Fixes:          d03c82c28da8 ("release: add optional OCI images")
    MFC after:      1 minute
    Sponsored by:   Amazon
    
    (cherry picked from commit 47866cdcc7278faa27250dcea16374231c676050)
---
 release/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/release/Makefile b/release/Makefile
index 4f95d3ba32ec..36c47e5ad454 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -177,12 +177,12 @@ disc1: packagesystem
 	    -DDB_FROM_SRC )
 # Copy distfiles
 	mkdir -p ${.TARGET}/usr/freebsd-dist
-	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
+	for dist in MANIFEST $$(ls *.txz | grep -v container | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
 	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
 	done
 .if defined(NO_ROOT)
 	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
-	for dist in MANIFEST $$(ls *.txz | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
+	for dist in MANIFEST $$(ls *.txz | grep -v container | grep -vE -- '(${base ${_ALL_libcompats}:L:ts|})-dbg'); \
 	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
 	done
 .endif
@@ -247,12 +247,12 @@ dvd: packagesystem
 		-DDB_FROM_SRC )
 # Copy distfiles
 	mkdir -p ${.TARGET}/usr/freebsd-dist
-	for dist in MANIFEST *.txz; \
+	for dist in MANIFEST $$(ls *.txz | grep -v container); \
 	    do cp $${dist} ${.TARGET}/usr/freebsd-dist; \
 	done
 .if defined(NO_ROOT)
 	echo "./usr/freebsd-dist type=dir uname=root gname=wheel mode=0755" >> ${.TARGET}/METALOG
-	for dist in MANIFEST *.txz; \
+	for dist in MANIFEST $$(ls *.txz | grep -v container); \
 	    do echo "./usr/freebsd-dist/$${dist} type=file uname=root gname=wheel mode=0644" >> ${.TARGET}/METALOG; \
 	done
 .endif
@@ -300,7 +300,7 @@ mini-memstick.img: bootonly-memstick
 	cd bootonly-memstick && sh ${.CURDIR}/${TARGET}/make-memstick.sh .${NO_ROOT:D/METALOG} ../${.TARGET}
 
 packagesystem: ${DISTRIBUTIONS}
-	sh ${.CURDIR}/scripts/make-manifest.sh *.txz > MANIFEST
+	sh ${.CURDIR}/scripts/make-manifest.sh $$(ls *.txz | grep -v container) > MANIFEST
 	touch ${.TARGET}
 
 pkg-stage: dvd