summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2010-04-22 10:13:38 -0700
committerRichard Lowe <richlowe@richlowe.net>2010-04-22 10:13:38 -0700
commit87ab362234f761757d96ff1a758ab5c3bd85ed83 (patch)
tree65ad13adcaca5489457a5ca5b184d6970ed70c13
parent704030f4517ac42005a5e3a4cb2fe578c959bfe2 (diff)
downloadillumos-gate-87ab362234f761757d96ff1a758ab5c3bd85ed83.tar.gz
6915602 onbld python modules should install into python version specific directories
-rw-r--r--usr/src/Makefile.master4
-rw-r--r--usr/src/pkg/manifests/developer-build-onbld.mf134
-rw-r--r--usr/src/tools/Makefile23
-rw-r--r--usr/src/tools/Makefile.python107
-rw-r--r--usr/src/tools/Makefile.tools7
-rw-r--r--usr/src/tools/README.tools14
-rw-r--r--usr/src/tools/onbld/Checks/Makefile25
-rw-r--r--usr/src/tools/onbld/Makefile33
-rw-r--r--usr/src/tools/onbld/Scm/Makefile26
-rw-r--r--usr/src/tools/onbld/hgext/Makefile39
-rw-r--r--usr/src/tools/onbld/hgext/cdm.py26
-rw-r--r--usr/src/tools/scripts/cddlchk.py10
-rw-r--r--usr/src/tools/scripts/copyrightchk.py10
-rw-r--r--usr/src/tools/scripts/hdrchk.py10
-rw-r--r--usr/src/tools/scripts/hg-active.py11
-rw-r--r--usr/src/tools/scripts/mapfilechk.py10
-rw-r--r--usr/src/tools/scripts/rtichk.py10
17 files changed, 337 insertions, 162 deletions
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index c03b0ba574..aa72256893 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -176,7 +176,9 @@ CTFFINDMOD= $(ONBLD_TOOLS)/bin/ctffindmod
XREF= $(ONBLD_TOOLS)/bin/xref
FIND= /usr/bin/find
PERL= /usr/bin/perl
-PYTHON= /usr/bin/python2.4
+PYTHON_24= /usr/bin/python2.4
+PYTHON_26= /usr/bin/python2.6
+PYTHON= $(PYTHON_24)
SORT= /usr/bin/sort
TOUCH= /usr/bin/touch
WC= /usr/bin/wc
diff --git a/usr/src/pkg/manifests/developer-build-onbld.mf b/usr/src/pkg/manifests/developer-build-onbld.mf
index cc54f9dbb8..4a4d3432d3 100644
--- a/usr/src/pkg/manifests/developer-build-onbld.mf
+++ b/usr/src/pkg/manifests/developer-build-onbld.mf
@@ -48,11 +48,16 @@ dir path=opt/onbld/gk
dir path=opt/onbld/lib
dir path=opt/onbld/lib/$(ARCH)
dir path=opt/onbld/lib/perl
-dir path=opt/onbld/lib/python
-dir path=opt/onbld/lib/python/onbld
-dir path=opt/onbld/lib/python/onbld/Checks
-dir path=opt/onbld/lib/python/onbld/Scm
-dir path=opt/onbld/lib/python/onbld/hgext
+dir path=opt/onbld/lib/python2.4
+dir path=opt/onbld/lib/python2.4/onbld
+dir path=opt/onbld/lib/python2.4/onbld/Checks
+dir path=opt/onbld/lib/python2.4/onbld/Scm
+dir path=opt/onbld/lib/python2.4/onbld/hgext
+dir path=opt/onbld/lib/python2.6
+dir path=opt/onbld/lib/python2.6/onbld
+dir path=opt/onbld/lib/python2.6/onbld/Checks
+dir path=opt/onbld/lib/python2.6/onbld/Scm
+dir path=opt/onbld/lib/python2.6/onbld/hgext
dir path=opt/onbld/man
dir path=opt/onbld/man/man1
dir path=opt/onbld/man/sman1
@@ -158,46 +163,84 @@ file path=opt/onbld/gk/.login
file path=opt/onbld/gk/gen_make.machines mode=0755
file path=opt/onbld/lib/$(ARCH)/libdwarf.so.1
file path=opt/onbld/lib/perl/onbld_elfmod.pm
-file path=opt/onbld/lib/python/onbld/Checks/CStyle.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/CStyle.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Cddl.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Cddl.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/CmtBlk.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/CmtBlk.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Comments.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Comments.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Copyright.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Copyright.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/DbLookups.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/DbLookups.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/HdrChk.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/HdrChk.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/JStyle.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/JStyle.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Keywords.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Keywords.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Mapfile.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Mapfile.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/ProcessCheck.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/ProcessCheck.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Rti.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/Rti.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/__init__.py mode=0444
-file path=opt/onbld/lib/python/onbld/Checks/__init__.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/Backup.py mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/Backup.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/Version.py mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/Version.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/WorkSpace.py mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/WorkSpace.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/__init__.py mode=0444
-file path=opt/onbld/lib/python/onbld/Scm/__init__.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/__init__.py mode=0444
-file path=opt/onbld/lib/python/onbld/__init__.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/hgext/__init__.py mode=0444
-file path=opt/onbld/lib/python/onbld/hgext/__init__.pyc mode=0444
-file path=opt/onbld/lib/python/onbld/hgext/cdm.py mode=0444
-file path=opt/onbld/lib/python/onbld/hgext/cdm.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/CStyle.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/CStyle.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Cddl.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Cddl.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/CmtBlk.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/CmtBlk.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Comments.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Comments.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Copyright.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Copyright.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/DbLookups.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/DbLookups.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/HdrChk.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/HdrChk.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/JStyle.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/JStyle.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Keywords.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Keywords.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Mapfile.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Mapfile.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/ProcessCheck.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/ProcessCheck.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Rti.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/Rti.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/__init__.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Checks/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/Backup.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/Backup.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/Version.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/Version.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/WorkSpace.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/WorkSpace.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/__init__.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/Scm/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/__init__.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/hgext/__init__.py mode=0444
+file path=opt/onbld/lib/python2.4/onbld/hgext/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.4/onbld/hgext/cdm.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/CStyle.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/CStyle.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Cddl.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Cddl.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/CmtBlk.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/CmtBlk.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Comments.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Comments.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Copyright.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Copyright.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/DbLookups.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/DbLookups.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/HdrChk.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/HdrChk.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/JStyle.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/JStyle.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Keywords.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Keywords.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Mapfile.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Mapfile.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/ProcessCheck.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/ProcessCheck.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Rti.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/Rti.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/__init__.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Checks/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Backup.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Backup.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Version.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/Version.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/WorkSpace.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/WorkSpace.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/__init__.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/Scm/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/__init__.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/hgext/__init__.py mode=0444
+file path=opt/onbld/lib/python2.6/onbld/hgext/__init__.pyc mode=0444
+file path=opt/onbld/lib/python2.6/onbld/hgext/cdm.py mode=0444
file path=opt/onbld/man/man1/Install.1
file path=opt/onbld/man/man1/bldenv.1
file path=opt/onbld/man/man1/bringovercheck.1
@@ -246,3 +289,4 @@ license lic_CDDL license=lic_CDDL
license tools/ctf/dwarf/THIRDPARTYLICENSE \
license=tools/ctf/dwarf/THIRDPARTYLICENSE
license tools/onbld/THIRDPARTYLICENSE license=tools/onbld/THIRDPARTYLICENSE
+link path=opt/onbld/lib/python target=python2.4
diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile
index 01754bb477..ca2e3f8be1 100644
--- a/usr/src/tools/Makefile
+++ b/usr/src/tools/Makefile
@@ -20,8 +20,7 @@
#
#
-# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
#
include ../Makefile.master
@@ -93,11 +92,16 @@ ROOTDIRS= \
$(ROOTONBLD)/lib \
$(ROOTONBLD)/lib/$(MACH) \
$(ROOTONBLD)/lib/perl \
- $(ROOTONBLD)/lib/python \
- $(ROOTONBLD)/lib/python/onbld \
- $(ROOTONBLD)/lib/python/onbld/Checks \
- $(ROOTONBLD)/lib/python/onbld/hgext \
- $(ROOTONBLD)/lib/python/onbld/Scm \
+ $(ROOTONBLD)/lib/python2.4 \
+ $(ROOTONBLD)/lib/python2.4/onbld \
+ $(ROOTONBLD)/lib/python2.4/onbld/Checks \
+ $(ROOTONBLD)/lib/python2.4/onbld/hgext \
+ $(ROOTONBLD)/lib/python2.4/onbld/Scm \
+ $(ROOTONBLD)/lib/python2.6 \
+ $(ROOTONBLD)/lib/python2.6/onbld \
+ $(ROOTONBLD)/lib/python2.6/onbld/Checks \
+ $(ROOTONBLD)/lib/python2.6/onbld/hgext \
+ $(ROOTONBLD)/lib/python2.6/onbld/Scm \
$(ROOTONBLD)/env \
$(ROOTONBLD)/etc \
$(ROOTONBLD)/etc/exception_lists \
@@ -138,10 +142,13 @@ _msg: $(MSGSUBDIRS)
$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
-$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) FRC
+$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $(ROOTONBLDLIBPY) FRC
@cd $@; pwd; $(MAKE) $(TARGET)
$(ROOTDIRS):
$(INS.dir)
+$(ROOTONBLDLIBPY): $(ROOTDIRS)
+ $(RM) -r $@; $(SYMLINK) python2.4 $@
+
FRC:
diff --git a/usr/src/tools/Makefile.python b/usr/src/tools/Makefile.python
new file mode 100644
index 0000000000..a68ff026f6
--- /dev/null
+++ b/usr/src/tools/Makefile.python
@@ -0,0 +1,107 @@
+#
+# 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) 2010, Oracle and/or its affiliates. All rights reserved.
+#
+
+#
+# This Makefile provides a framework for building the onbld python
+# modules with multiple versions of python.
+#
+# It expects as input:
+#
+# PYSRCS - List of python source files, these are also delivered as
+# build product.
+#
+# PYOBJS - List of compiled python (.pyc) files, with no directory prefix
+#
+# PYTOPDIR - Absolute (including $(ROOT)) path to which files will
+# be installed, up until the version specific component.
+#
+# PYMODDIR - Relative path to which files will be installed, below
+# the version specific component.
+#
+# For example, to install to /opt/onbld/lib/onbld/python*/bar/
+#
+# PYTOPDIR = $(ROOTONBLDLIB)
+# PYMODDIR = bar
+#
+#
+# It provides as output:
+#
+# ROOTPYFILES - The list of $(ROOT)-relative paths to which python
+# source and binary files will be installed. Your
+# Makefile's 'install' target should depend upon
+# this.
+#
+# PYVERSOBJS - The list of paths to compiled python build products,
+# including their subdirectory.
+#
+# pyclobber - A target on which 'clobber' should depend, which
+# removes the per-version python directories and the
+# output within them.
+#
+
+PYFILES = $(PYSRCS) $(PYOBJS)
+
+ROOTPYDIR_24 = $(PYTOPDIR)/python2.4/$(PYMODDIR)
+ROOTPYFILES_24 = $(PYFILES:%=$(ROOTPYDIR_24)/%)
+
+ROOTPYDIR_26 = $(PYTOPDIR)/python2.6/$(PYMODDIR)
+ROOTPYFILES_26 = $(PYFILES:%=$(ROOTPYDIR_26)/%)
+
+ROOTPYFILES = $(ROOTPYFILES_24) $(ROOTPYFILES_26)
+$(ROOTPYFILES) := FILEMODE = 0444
+
+PYVERSDIRS = python2.4 python2.6
+
+PY24OBJS = $(PYOBJS:%=python2.4/%)
+$(PY24OBJS) := PYTHON = $(PYTHON_24)
+
+PY26OBJS = $(PYOBJS:%=python2.6/%)
+$(PY26OBJS) := PYTHON = $(PYTHON_26)
+
+PYVERSOBJS = $(PY24OBJS) $(PY26OBJS)
+
+CLOBBERFILES += $(PYVERSOBJS)
+CLOBBERDIRS += $(PYVERSDIRS)
+
+.KEEP_STATE:
+
+python2.4/%.pyc python2.6/%.pyc: %.py
+ @[ -d $(@D) ] || mkdir $(@D)
+ $(RM) $@
+ $(PYTHON) -mpy_compile $<
+ $(MV) $(*).pyc $@
+
+$(ROOTPYDIR_24)/%.pyc: python2.4/%.pyc
+ $(INS.pyfile)
+
+$(ROOTPYDIR_26)/%.pyc: python2.6/%.pyc
+ $(INS.pyfile)
+
+$(ROOTPYDIR_24)/%.py $(ROOTPYDIR_26)/%.py: %.py
+ $(INS.pyfile)
+
+pyclobber:
+ $(RM) $(CLOBBERFILES)
+ $(RM) -rf $(CLOBBERDIRS)
diff --git a/usr/src/tools/Makefile.tools b/usr/src/tools/Makefile.tools
index 8233077144..24794344ab 100644
--- a/usr/src/tools/Makefile.tools
+++ b/usr/src/tools/Makefile.tools
@@ -19,8 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
#
# Definitions common to tool source.
#
@@ -28,8 +27,6 @@ include $(SRC)/Makefile.master
FILEMODE= 0555
-CLOBBERFILES += $(PYOBJS)
-
TOOLS= $(SRC)/tools
TOOLS_PROTO= $(TOOLS)/proto/root_$(MACH)-nd
ROOTOPT= $(TOOLS_PROTO)/opt
@@ -41,6 +38,8 @@ ROOTONBLDLIB= $(ROOTONBLD)/lib
ROOTONBLDLIBMACH= $(ROOTONBLD)/lib/$(MACH)
ROOTONBLDLIBPERL= $(ROOTONBLD)/lib/perl
ROOTONBLDLIBPY= $(ROOTONBLD)/lib/python
+ROOTONBLDLIBPY_24= $(ROOTONBLD)/lib/python2.4
+ROOTONBLDLIBPY_26= $(ROOTONBLD)/lib/python2.6
ROOTONBLDENV= $(ROOTONBLD)/env
ROOTONBLDGK= $(ROOTONBLD)/gk
ROOTONBLDMAN= $(ROOTONBLD)/man
diff --git a/usr/src/tools/README.tools b/usr/src/tools/README.tools
index 566938f380..857cd58af7 100644
--- a/usr/src/tools/README.tools
+++ b/usr/src/tools/README.tools
@@ -19,8 +19,7 @@
# CDDL HEADER END
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
This directory contains the tools used to do a full build of the
@@ -56,12 +55,19 @@ Layout of /opt/onbld
/opt/onbld/lib
libraries used by the build tools.
-/opt/onbld/lib/python
+/opt/onbld/lib/python<version>/
python modules used by the build tools.
-/opt/onbld/lib/python/onbld/hgext
+/opt/onbld/lib/python<version>/onbld/hgext
Mercurial extensions.
+/opt/onbld/lib/python/
+ symlink to the modules directory of the currently preferred
+ python version. This exists to retain compatibility both for
+ tools expecting only one supported version of python, and for
+ user .hgrc files that expect to find cdm.py in
+ /opt/onbld/lib/python/onbld/hgext.
+
/opt/onbld/man
rudimentary man pages for some of the tools.
diff --git a/usr/src/tools/onbld/Checks/Makefile b/usr/src/tools/onbld/Checks/Makefile
index 54e523ccd0..4558b4ad26 100644
--- a/usr/src/tools/onbld/Checks/Makefile
+++ b/usr/src/tools/onbld/Checks/Makefile
@@ -20,14 +20,13 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.master
include ../../Makefile.tools
-PYSRCS= \
+PYSRCS = \
CStyle.py \
Cddl.py \
CmtBlk.py \
@@ -42,22 +41,16 @@ PYSRCS= \
Rti.py \
__init__.py
-PYOBJS = $(PYSRCS:%.py=%.pyc)
+PYOBJS = $(PYSRCS:%.py=%.pyc)
+PYTOPDIR = $(ROOTONBLDLIB)
+PYMODDIR = onbld/Checks
-PYFILES= $(PYSRCS) $(PYOBJS)
+include ../../Makefile.python
-ROOTONBLDCHECKSFILES= $(PYFILES:%=$(ROOTONBLDLIBPY)/onbld/Checks/%)
-$(ROOTONBLDCHECKSFILES) := FILEMODE = 0444
+all: $(PYVERSOJBS)
-.KEEP_STATE:
-
-all: $(PYOBJS)
-
-install: $(ROOTONBLDCHECKSFILES)
+install: all $(ROOTPYFILES)
clean:
-$(ROOTONBLDLIBPY)/onbld/Checks/%: %
- $(INS.pyfile)
-
-include ../../Makefile.targ
+clobber: clean pyclobber
diff --git a/usr/src/tools/onbld/Makefile b/usr/src/tools/onbld/Makefile
index d0212cada2..08286f0258 100644
--- a/usr/src/tools/onbld/Makefile
+++ b/usr/src/tools/onbld/Makefile
@@ -20,8 +20,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.master
@@ -32,41 +31,37 @@ SUBDIRS= \
hgext \
Scm
-PYSRCS= \
+PYSRCS = \
__init__.py
-PYOBJS= $(PYSRCS:%.py=%.pyc)
+PYOBJS = $(PYSRCS:%.py=%.pyc)
+PYTOPDIR = $(ROOTONBLDLIB)
+PYMODDIR = onbld
-PYFILES= $(PYSRCS) $(PYOBJS)
-
-all := TARGET = all
+all := TARGET = all
install := TARGET = install
-clean := TARGET = clean
+clean := TARGET = clean
clobber := TARGET = clobber
-ROOTONBLDBASEFILES= $(PYFILES:%=$(ROOTONBLDLIBPY)/onbld/%)
-$(ROOTONBLDBASEFILES) := FILEMODE = 0444
-
CLOBBERFILES += THIRDPARTYLICENSE
+include ../Makefile.python
+
.KEEP_STATE:
-all: $(PYOBJS) $(SUBDIRS) THIRDPARTYLICENSE
+all: $(PYVERSOBJS) $(SUBDIRS) THIRDPARTYLICENSE
-install: all $(ROOTONBLDBASEFILES) $(SUBDIRS)
+install: all $(ROOTPYFILES) $(SUBDIRS)
-clean clobber: $(SUBDIRS)
+clean: $(SUBDIRS)
+
+clobber: clean pyclobber $(SUBDIRS)
THIRDPARTYLICENSE: $(SRC)/pkg/license_files/lic_GPLv2
$(RM) $@
$(CAT) $? > $@
-$(ROOTONBLDLIBPY)/onbld/%: %
- $(INS.pyfile)
-
$(SUBDIRS): FRC
@cd $@; pwd; $(MAKE) $(TARGET)
FRC:
-
-include ../Makefile.targ
diff --git a/usr/src/tools/onbld/Scm/Makefile b/usr/src/tools/onbld/Scm/Makefile
index 20285ba142..a31f7e5c87 100644
--- a/usr/src/tools/onbld/Scm/Makefile
+++ b/usr/src/tools/onbld/Scm/Makefile
@@ -20,36 +20,28 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.master
include ../../Makefile.tools
-PYSRCS= \
+PYSRCS = \
__init__.py \
Backup.py \
Version.py \
WorkSpace.py
-PYOBJS = $(PYSRCS:%.py=%.pyc)
+PYOBJS = $(PYSRCS:%.py=%.pyc)
+PYTOPDIR = $(ROOTONBLDLIB)
+PYMODDIR = onbld/Scm
-PYFILES = $(PYSRCS) $(PYOBJS)
+include ../../Makefile.python
-ROOTONBLDSCMFILES= $(PYFILES:%=$(ROOTONBLDLIBPY)/onbld/Scm/%)
+all: $(PYVERSOBJS)
-$(ROOTONBLDSCMFILES) := FILEMODE = 0444
-
-.KEEP_STATE:
-
-all: $(PYOBJS)
-
-install: all .WAIT $(ROOTONBLDSCMFILES)
+install: all $(ROOTPYFILES)
clean:
-$(ROOTONBLDLIBPY)/onbld/Scm/%: %
- $(INS.pyfile)
-
-include ../../Makefile.targ
+clobber: clean pyclobber
diff --git a/usr/src/tools/onbld/hgext/Makefile b/usr/src/tools/onbld/hgext/Makefile
index 02db613d9b..2247cb1f45 100644
--- a/usr/src/tools/onbld/hgext/Makefile
+++ b/usr/src/tools/onbld/hgext/Makefile
@@ -20,34 +20,39 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.master
include ../../Makefile.tools
-PYSRCS= \
+PYSRCS = \
__init__.py \
cdm.py
-PYOBJS = $(PYSRCS:%.py=%.pyc)
-
-PYFILES = $(PYSRCS) $(PYOBJS)
-
-ROOTONBLDHGEXTFILES= $(PYFILES:%=$(ROOTONBLDLIBPY)/onbld/hgext/%)
-
-$(ROOTONBLDHGEXTFILES) := FILEMODE = 0444
+#
+# We deliver .pyc files specific to the python version, with the
+# exception of cdm.pyc, which we don't deliver at all.
+#
+# An exception to this is cdm.py, which is typically loaded using an
+# extension path in an .hgrc. This path might refer to a Python
+# version that's different from the one Mercurial is using. If we
+# delivered a cdm.pyc, differing Pythons running Mercurial could cause
+# it to be overwritten, causing packaging noise. Logic within cdm.py
+# causes modules loaded from there to be those built by the correct
+# version of Python.
+#
+PYSRC2 = $(PYSRCS:cdm.py=)
+PYOBJS = $(PYSRC2:%.py=%.pyc)
+PYTOPDIR = $(ROOTONBLDLIB)
+PYMODDIR = onbld/hgext
-.KEEP_STATE:
+include ../../Makefile.python
-all: $(PYOBJS)
+all: $(PYVERSOBJS)
-install: all .WAIT $(ROOTONBLDHGEXTFILES)
+install: all $(ROOTPYFILES)
clean:
-$(ROOTONBLDLIBPY)/onbld/hgext/%: %
- $(INS.pyfile)
-
-include ../../Makefile.targ
+clobber: clean pyclobber
diff --git a/usr/src/tools/onbld/hgext/cdm.py b/usr/src/tools/onbld/hgext/cdm.py
index c78375558e..53328a4a46 100644
--- a/usr/src/tools/onbld/hgext/cdm.py
+++ b/usr/src/tools/onbld/hgext/cdm.py
@@ -14,8 +14,7 @@
#
#
-# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
'''OpenSolaris workspace extensions for mercurial
@@ -31,15 +30,28 @@ Run pre-putback checks - pbchk
Collapse all your changes into a single changeset - recommit'''
+import atexit, os, stat, sys, termios
+
#
-# NB: This assumes the normal directory structure, with this
-# extension 2 levels below .../lib/python.
+# Adjust the load path based on the location of cdm.py and the version
+# of python into which it is being loaded. This assumes the normal
+# onbld directory structure, where cdm.py is in
+# lib/python(version)?/onbld/hgext/. If that changes so too must
+# this.
#
-# If you change that, change this
+# This and the case below are not equivalent. In this case we may be
+# loading a cdm.py in python2.X/ via the lib/python/ symlink but need
+# python2.Y in sys.path.
#
-import atexit, os, stat, sys, termios
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "..", "..",
+ "python%d.%d" % sys.version_info[:2]))
-sys.path.insert(1, "%s/../../" % os.path.dirname(__file__))
+#
+# Add the relative path from cdm.py to usr/src/tools to the load path,
+# such that a cdm.py loaded from the source tree uses the modules also
+# within the source tree.
+#
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), "..", ".."))
from onbld.Scm import Version
from mercurial import util
diff --git a/usr/src/tools/scripts/cddlchk.py b/usr/src/tools/scripts/cddlchk.py
index 9f27f29687..62a2695946 100644
--- a/usr/src/tools/scripts/cddlchk.py
+++ b/usr/src/tools/scripts/cddlchk.py
@@ -21,8 +21,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -31,8 +30,11 @@
import sys, os, getopt, fnmatch
-sys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), '..'))
from onbld.Checks.Cddl import cddlchk
diff --git a/usr/src/tools/scripts/copyrightchk.py b/usr/src/tools/scripts/copyrightchk.py
index 0697cbd501..1426a69bfa 100644
--- a/usr/src/tools/scripts/copyrightchk.py
+++ b/usr/src/tools/scripts/copyrightchk.py
@@ -21,8 +21,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -31,8 +30,11 @@
import sys, os
-sys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), '..'))
from onbld.Checks.Copyright import copyright
diff --git a/usr/src/tools/scripts/hdrchk.py b/usr/src/tools/scripts/hdrchk.py
index a4525161c6..3ecec6b3f2 100644
--- a/usr/src/tools/scripts/hdrchk.py
+++ b/usr/src/tools/scripts/hdrchk.py
@@ -21,8 +21,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -31,8 +30,11 @@
import sys, os, getopt
-sys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), '..'))
from onbld.Checks.HdrChk import hdrchk
diff --git a/usr/src/tools/scripts/hg-active.py b/usr/src/tools/scripts/hg-active.py
index c76e3696b9..05b67ffcc1 100644
--- a/usr/src/tools/scripts/hg-active.py
+++ b/usr/src/tools/scripts/hg-active.py
@@ -15,8 +15,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
'''
@@ -28,8 +27,12 @@ workspace in support of webrev's Mercurial support.
# NB: This assumes the normal onbld directory structure
#
import sys, os
-sys.path.insert(1, "%s/../lib/python" % os.path.dirname(__file__))
-sys.path.insert(1, "%s/.." % os.path.dirname(__file__))
+
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), ".."))
from onbld.Scm import Version
diff --git a/usr/src/tools/scripts/mapfilechk.py b/usr/src/tools/scripts/mapfilechk.py
index ff5c1b24d1..83d3d9d70c 100644
--- a/usr/src/tools/scripts/mapfilechk.py
+++ b/usr/src/tools/scripts/mapfilechk.py
@@ -21,8 +21,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -31,8 +30,11 @@
import sys, os, getopt, fnmatch
-sys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), '..'))
from onbld.Checks.Mapfile import mapfilechk
diff --git a/usr/src/tools/scripts/rtichk.py b/usr/src/tools/scripts/rtichk.py
index f2b6ce8f9a..0bbfa04b3f 100644
--- a/usr/src/tools/scripts/rtichk.py
+++ b/usr/src/tools/scripts/rtichk.py
@@ -21,8 +21,7 @@
#
#
-# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
+# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -31,8 +30,11 @@
import sys, os, getopt
-sys.path.append(os.path.join(os.path.dirname(__file__), '../lib/python'))
-sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "lib",
+ "python%d.%d" % sys.version_info[:2]))
+
+# Allow running from the source tree, using the modules in the source tree
+sys.path.insert(2, os.path.join(os.path.dirname(__file__), '..'))
from onbld.Checks.Rti import rti