make-rules/ips.mk
branchs11-update
changeset 2584 ad7971db6ec0
parent 2576 f1b6ecbb2d1e
child 2710 3c5579720afc
--- a/make-rules/ips.mk	Tue Apr 23 06:59:16 2013 -0700
+++ b/make-rules/ips.mk	Wed Apr 24 10:39:31 2013 -0700
@@ -237,9 +237,29 @@
 $(MANIFEST_BASE)-%.depend:	$(MANIFEST_BASE)-%.mangled
 	$(PKGDEPEND) generate $(PKGDEPEND_GENERATE_OPTIONS) $< >[email protected]
 
+# These files should contain a list of packages that the component is known to
+# depend on.  Using resolve.deps is not required, but significantly speeds up
+# the "pkg resolve" step.
+EXTDEPFILES = $(wildcard $(sort $(addsuffix ../resolve.deps, $(dir $(DEPENDED)))))
+
+# This is a target that should only be run by hand, and not something that
+# .resolved-$(MACH) should depend on.
+sample-resolve.deps:
+	@echo "<transform depend type=(require|require-any) -> print %(fmri)>" > rd-trans
+	@for i in build/*.depend; do \
+		$(PKGMOGRIFY) -O /dev/null $$i rd-trans | tr " " "\n" | sort -u > m1; \
+		$(PKGMOGRIFY) -O /dev/null $$i.res rd-trans | tr " " "\n" | sort -u > m2; \
+		comm -13 m1 m2; \
+	done | sed -e 's/@[^ ]*//g' -e 's,pkg:/,,g' | sort -u > resolve.deps
+	@$(RM) rd-trans m1 m2
+	@if [[ ! -s resolve.deps ]]; then \
+		echo "No computed dependencies found; removing empty resolve.deps."; \
+		$(RM) resolve.deps; \
+	fi
+
 # resolve the dependencies all at once
 $(BUILD_DIR)/.resolved-$(MACH):	$(DEPENDED)
-	$(PKGDEPEND) resolve -m $(DEPENDED)
+	$(PKGDEPEND) resolve $(EXTDEPFILES:%=-e %) -m $(DEPENDED)
 	$(TOUCH) [email protected]
 
 # lint the manifests all at once