nrelease: Fix for empty DPORTS_PACKAGES.

Operating Systems / DragonFlyBSD - Sascha Wildner [online.de] - 8 May 2015 19:20 UTC

Also fix up the previously existing 'nopkgs' target and document it.

###

diff --git a/nrelease/Makefile b/nrelease/Makefile
index 82d5c8c..990b26b 100644
--- a/nrelease/Makefile
+++ b/nrelease/Makefile
@@ -33,6 +33,7 @@ KERNCONF ?= X86_64_GENERIC

CHROOT_CMD?= /usr/sbin/chroot ${ISOROOT} sh -c

+.if !make(nopkgs)
# User may specify extra packages in addition to the defaults
#
DPORTS_EXTRA_PACKAGES?=
@@ -55,6 +56,7 @@ DPORTS_OPTIONS.devel_git+= -DWITH_GUI
.else
DPORTS_OPTIONS.devel_git+= -DWITHOUT_CONTRIB -DWITHOUT_PERL
.endif
+.endif

# Specify which root skeletons are required, and let the user include
# their own. They are copied into ISODIR during the `customizeiso'
@@ -226,11 +228,13 @@ srcs:
.if make(gui)
rm -f ${ISOROOT}/usr/src-sys.tgz
rm -f ${ISOROOT}/usr/src-sys.tar.bz2
+.if !empty(DPORTS_PACKAGES)
cd ${ISOROOT}/usr && make dports-create GITHOST_DPORTS=${GITHOST_DPORTS}
# NOTE: Adding the git gc --aggressive helps by significantly
# reducing the disk space required.
#
cd ${ISOROOT}/usr/dports && git gc --aggressive
+.endif
cd ${ISOROOT}/usr && make src-create-repo GITHOST=${GITHOST}
# XXX: git gc --aggressive
.else
@@ -269,11 +273,13 @@ customizeiso:
# Setup some things & mount dports tree. Use defensive umounts and
# rm -rf's to allow restarts. Allow /usr/dports to be read-only.
#
+ -@umount ${ISOROOT}/dev
+ mount_null /dev ${ISOROOT}/dev
+.if !empty(DPORTS_PACKAGES)
cp /etc/resolv.conf ${ISOROOT}/etc
${CHROOT_CMD} "ldconfig -elf /lib /usr/lib /usr/lib/gcc* /usr/lib/compat"
-@umount ${ISOROOT}/usr/distfiles
-@umount ${ISOROOT}/usr/dports
- -@umount ${ISOROOT}/dev
rm -rf ${ISOROOT}/usr/obj/dports
#
# Mount /usr/dports, make sure /usr/distfiles is writable.
@@ -283,7 +289,6 @@ customizeiso:
mkdir -p ${ISOROOT}/usr/dports
mkdir -p ${ISOROOT}/usr/distfiles
mount_null -o ro ${DPORTS_PATH} ${ISOROOT}/usr/dports
- mount_null /dev ${ISOROOT}/dev
cp /etc/shells ${ISOROOT}/usr/distfiles/.test > /dev/null 2>&1 \
|| mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/distfiles
#
@@ -308,6 +313,7 @@ customizeiso:
rm -rf ${ISOROOT}/usr/obj/dports
rm -rf ${ISOROOT}/usr/distfiles
rm -f ${ISOROOT}/etc/resolv.conf
+.endif
#
# Finally, update the locate(8) database
#
diff --git a/share/man/man7/release.7 b/share/man/man7/release.7
index 96be23d..513b5ca 100644
--- a/share/man/man7/release.7
+++ b/share/man/man7/release.7
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD: src/share/man/man7/release.7,v 1.3.2.6 2003/04/12 20:42:30 murray Exp $
.\"
-.Dd May 18, 2013
+.Dd May 9, 2015
.Dt NRELEASE 7
.Os
.Sh NAME
@@ -108,6 +108,11 @@ to add additional features:
Adds
.Xr Xorg 1
along with some additional applications to the ISO (LiveDVD).
+.It Cm nopkgs
+Do not add any packages (for debugging purposes).
+This is equivalent to setting
+.Va DPORTS_PACKAGES
+empty.
.El
.Pp
During the process of rolling a release a check is performed to find

165b1c1 nrelease: Fix for empty DPORTS_PACKAGES.
nrelease/Makefile | 10 ++++++++--
share/man/man7/release.7 | 7 ++++++-
2 files changed, 14 insertions(+), 3 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share