From 1d4bf32cf545ad7766bc2fdb3c9a7d09d31d1d45 Mon Sep 17 00:00:00 2001
From: Marcel Telka <marcel@telka.sk>
Date: Fri, 25 Mar 2022 07:08:03 +0100
Subject: [PATCH] ips.mk: the REQUIRED_PACKAGES target should update the list

---
 make-rules/ips.mk |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/make-rules/ips.mk b/make-rules/ips.mk
index a2cfa25..18ba2b8 100644
--- a/make-rules/ips.mk
+++ b/make-rules/ips.mk
@@ -506,18 +506,19 @@
 REQUIRED_PACKAGES_TRANSFORM=$(foreach p,$(REQUIRED_PACKAGES_SUBST), -e 's|$($(p))|$$($(p))|')
 
 #
-# Generate a set of REQUIRED_PACKAGES based on what is needed to for pkgdepend
-# to resolve properly.  Automatically append this to your Makefile for the truly
-# lazy among us.  This is only a piece of the REQUIRED_PACKAGES puzzle.
+# Generate a set of REQUIRED_PACKAGES based on what is needed for pkgdepend to
+# resolve properly.  Automatically update the list in your Makefile for the
+# truly lazy among us.  This is only a piece of the REQUIRED_PACKAGES puzzle.
 # You must still include packages for tools you build and test with.
 #
 REQUIRED_PACKAGES::     $(RESOLVED)
 	$(GMAKE) RESOLVE_DEPS= $(BUILD_DIR)/.resolved-$(MACH)
+	@$(GSED) -i -e '/^# Auto-generated dependencies$$/,$$d' Makefile
 	@echo "# Auto-generated dependencies" >>Makefile
 	@$(PKGMOGRIFY) $(WS_TRANSFORMS)/$@ $(RESOLVED) | \
 		$(GSED) -e '/^[\t ]*$$/d' -e '/^#/d' $(REQUIRED_PACKAGES_TRANSFORM) \
 			| sort -u >>Makefile
-	@echo "*** Please edit your Makefile and verify the new content at the end ***"
+	@echo "*** Please edit your Makefile and verify the new or updated content at the end ***"
 
 
 # lint the manifests all at once

--
Gitblit v1.9.3