16404201 serialize pkglinting of components
authorMike Sullivan <Mike.Sullivan@Oracle.COM>
Fri, 01 Mar 2013 16:32:02 -0800
changeset 1188 d563dccb5adb
parent 1187 28a8efc39260
child 1189 c3e41d3c09cf
16404201 serialize pkglinting of components
Makefile
components/Makefile
make-rules/ips.mk
make-rules/shared-macros.mk
tools/Makefile
tools/pkglint.sh
--- a/Makefile	Fri Mar 01 14:09:35 2013 -0800
+++ b/Makefile	Fri Mar 01 16:32:02 2013 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include make-rules/shared-macros.mk
@@ -43,6 +43,6 @@
 test component-hook: $(SUBDIRS)
 
 $(SUBDIRS):	FORCE
-	+echo "$(TARGET) $@" ; $(GMAKE) -C $@ $(TARGET)
+	@+echo "$(TARGET) $@" ; $(GMAKE) -C $@ $(TARGET)
 
 FORCE:
--- a/components/Makefile	Fri Mar 01 14:09:35 2013 -0800
+++ b/components/Makefile	Fri Mar 01 16:32:02 2013 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
@@ -99,7 +99,7 @@
 DUMMYPKG += "set org.opensolaris.consolidation=userland\n"
 DUMMYPKG += "set info.classification=org.opensolaris.category.2008:System/Core"
 
-$(WS_LINT_CACHE):	$(WS_LOGS)
+$(WS_LINT_CACHE):	$(WS_LOGS) tools
 ifdef CANONICAL_REPO
 	@echo "Generating pkglint(1) cache from $(CANONICAL_REPO)..."
 	@(echo $(DUMMYPKG) | $(PKGLINT) \
--- a/make-rules/ips.mk	Fri Mar 01 14:09:35 2013 -0800
+++ b/make-rules/ips.mk	Fri Mar 01 16:32:02 2013 -0800
@@ -39,7 +39,11 @@
 PKGFMT =	/usr/bin/pkgfmt
 PKGMOGRIFY =	/usr/bin/pkgmogrify
 PKGSEND =	/usr/bin/pkgsend
+ifeq   ($(strip $(PKGLINT_COMPONENT)),)
 PKGLINT =	/usr/bin/pkglint
+else
+PKGLINT =	${WS_TOOLS}/pkglint
+endif
 PKGMANGLE =	$(WS_TOOLS)/userland-mangler
 
 # Package headers should all pretty much follow the same format
--- a/make-rules/shared-macros.mk	Fri Mar 01 14:09:35 2013 -0800
+++ b/make-rules/shared-macros.mk	Fri Mar 01 16:32:02 2013 -0800
@@ -336,7 +336,11 @@
 
 PKGREPO =	/usr/bin/pkgrepo
 PKGSEND =	/usr/bin/pkgsend
+ifeq   ($(strip $(PKGLINT_COMPONENT)),)
 PKGLINT =	/usr/bin/pkglint
+else
+PKGLINT =	${WS_TOOLS}/pkglint
+endif
 
 ACLOCAL =	/usr/bin/aclocal-1.10
 AUTOMAKE =	/usr/bin/automake-1.10
--- a/tools/Makefile	Fri Mar 01 14:09:35 2013 -0800
+++ b/tools/Makefile	Fri Mar 01 16:32:02 2013 -0800
@@ -18,20 +18,20 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../make-rules/shared-macros.mk
 
 download setup prep build install publish \
-validate:	links time-$(MACH32).so time-$(MACH64).so
+validate:	links pkglint time-$(MACH32).so time-$(MACH64).so
 
 # generate wrappers for parfait. we need to generate them
 # with the correct compiler variables from the common makefiles because
 # some things reset the environment which causes lovely infinite
 # loops
 links:
-	$(MKDIR) parfait
+	@$(MKDIR) parfait
 	@for i in cc CC gcc g++ ld ; do \
 		$(MKDIR) parfait ; \
 		$(RM) parfait/$$i ; \
@@ -45,20 +45,28 @@
 		chmod +x parfait/$$i ; \
 	done
 
+pkglint:
+	@rm -f pkglint
+	@sed -e "s,WS_TOP_XXX,$(WS_TOP)/$(MACH)," \
+	    < pkglint.sh \
+	    > pkglint
+	@chmod +x pkglint
+
 
 time-$(MACH64).o:			BITS=64
 time-$(MACH32).o time-$(MACH64).o:	CFLAGS += -Kpic
 
 time-$(MACH32).o time-$(MACH64).o:	time.c
-	$(CC) $(CFLAGS) -c -o $@ $<
+	@$(CC) $(CFLAGS) -c -o $@ $<
 
 time-%.so:	time-%.o
-	$(LD) -G -o $@ $<
+	@$(LD) -G -o $@ $<
 
 clean:
-	$(RM) time-*.o time*.bc
+	@$(RM) time-*.o time*.bc
+	@$(RM) pkglint
 
 clobber:	clean
-	$(RM) time-*.so python/pkglint/*.pyc
-	$(RM) -r parfait
+	@$(RM) time-*.so python/pkglint/*.pyc
+	@$(RM) -r parfait
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/pkglint.sh	Fri Mar 01 16:32:02 2013 -0800
@@ -0,0 +1,38 @@
+#!/bin/ksh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+#
+IFS=
+export WS_TOP=WS_TOP_XXX
+
+SLEEPTIME=60
+
+LOCKFILE=${WS_TOP}/pkglint.lock
+
+lockfile -${SLEEPTIME} ${LOCKFILE}
+
+/usr/bin/pkglint $*
+
+pls=$?
+
+rm -f ${LOCKFILE}
+exit ${pls}