# HG changeset patch # User Mike Sullivan # Date 1386701540 28800 # Node ID 24aca88f3e9982164abe439132dae9b2b8d709fd # Parent 07e597d0017b6029a8d37f62eca1649f89b0a98d 17852021 userland-incorporator should detect duplicate packages diff -r 07e597d0017b -r 24aca88f3e99 components/Makefile --- a/components/Makefile Tue Dec 10 08:58:01 2013 -0800 +++ b/components/Makefile Tue Dec 10 10:52:20 2013 -0800 @@ -134,7 +134,7 @@ $(BASS_O_MATIC) $(TEMPLATE_ZONE:%=--template-zone %) \ $(@:%=--component %) --make $(TARGET) $(LOG) -publish: +incorporation: $(PKGREPO) refresh -s $(PKG_REPO) $(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \ -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \ @@ -143,7 +143,9 @@ -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m $(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \ $(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m - $(PKGREPO) refresh -s $(PKG_REPO) + +publish: + $(MAKE) incorporation # pkglint all of the published manifests in one batch. ifdef CANONICAL_REPO @echo 'pkglinting all package manifests...' diff -r 07e597d0017b -r 24aca88f3e99 tools/userland-incorporator --- a/tools/userland-incorporator Tue Dec 10 08:58:01 2013 -0800 +++ b/tools/userland-incorporator Tue Dec 10 10:52:20 2013 -0800 @@ -54,7 +54,7 @@ push(@packages, $package); } } else { - die "cannot handle: ", $_; + die "error: cannot handle: ", $_; } } @@ -73,6 +73,7 @@ } my ($repository, $fmri, $summary, $description, $consolidation) = (); +my %seen = (); $consolidation = 'userland'; @@ -94,8 +95,13 @@ printf "set name=info.classification value='org.opensolaris.category.2008:Meta Packages/Incorporations'\n"; @packages = enumerate_packages($repository, $consolidation, @fmris); + for (@packages) { + if ($seen->{$_->{name}} == 1) { + die "error: duplicate package ", $_->{name}; + } printf "depend fmri=pkg:/%s@%s-%s %s=true type=incorporate\n", $_->{name}, $_->{version}, $_->{branch}, "facet.version-lock.".$_->{name}; + $seen->{$_->{name}} = 1; }