summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2013-01-28 21:37:21 +0000
committerRobert Mustacchi <rm@joyent.com>2013-01-29 00:07:29 +0000
commitccce5498e8acd2956467f73c04fa66e83fe9ddae (patch)
tree1db806f565909c6f0707e09a0337b7fc58086ed9
parenta0dfeda4da9e3b5c6682cdd039d7f4bcb052b1d5 (diff)
downloadillumos-joyent-ccce5498e8acd2956467f73c04fa66e83fe9ddae.tar.gz
OS-1799 stage-licenses should only be hit when building packages
OS-1800 onbld python tools shouldn't hardocde /usr/bin/python OS-1801 Remove vistigial git-active.py
-rw-r--r--usr/src/Makefile2
-rw-r--r--usr/src/Makefile.master12
-rw-r--r--usr/src/tools/onbld/Checks/Cddl.py2
-rw-r--r--usr/src/tools/onbld/Checks/CmtBlk.py2
-rw-r--r--usr/src/tools/onbld/Checks/Comments.py2
-rw-r--r--usr/src/tools/onbld/Checks/Copyright.py2
-rw-r--r--usr/src/tools/onbld/Checks/DbLookups.py2
-rw-r--r--usr/src/tools/onbld/Checks/HdrChk.py2
-rw-r--r--usr/src/tools/onbld/Checks/Keywords.py4
-rw-r--r--usr/src/tools/onbld/Checks/Mapfile.py2
-rw-r--r--usr/src/tools/onbld/Checks/__init__.py2
-rw-r--r--usr/src/tools/onbld/Scm/__init__.py4
-rw-r--r--usr/src/tools/onbld/hgext/__init__.py4
-rw-r--r--usr/src/tools/scripts/cddlchk.py2
-rw-r--r--usr/src/tools/scripts/copyrightchk.py2
-rw-r--r--usr/src/tools/scripts/git-active.py131
-rw-r--r--usr/src/tools/scripts/git-pbchk.py2
-rw-r--r--usr/src/tools/scripts/hdrchk.py2
-rw-r--r--usr/src/tools/scripts/hg-active.py2
-rw-r--r--usr/src/tools/scripts/mapfilechk.py2
-rw-r--r--usr/src/tools/scripts/nightly.sh3
-rw-r--r--usr/src/tools/scripts/validate_pkg.py2
-rw-r--r--usr/src/tools/scripts/wsdiff.py2
23 files changed, 33 insertions, 159 deletions
diff --git a/usr/src/Makefile b/usr/src/Makefile
index a2dedbc771..eadc394b7d 100644
--- a/usr/src/Makefile
+++ b/usr/src/Makefile
@@ -107,7 +107,7 @@ all: mapfiles closedbins sgs .WAIT $(SUBDIRS) pkg
# packaging to be pulled from $(SRC) and $(CLOSED) and staged in
# $(ROOT)/licenses.
#
-install: install1 install2 _msg stage-licenses
+install: install1 install2 _msg
@cd msg; pwd; $(MAKE) _msg
@rm -rf "$(ROOT)/catalog"
diff --git a/usr/src/Makefile.master b/usr/src/Makefile.master
index eba667bf3a..0b8c7b6ea2 100644
--- a/usr/src/Makefile.master
+++ b/usr/src/Makefile.master
@@ -277,7 +277,8 @@ INS.symlink= $(RM) $@; $(SYMLINK) $(INSLINKTARGET) $@
# rebuilds if the baked-in mtime != the mtime of the source file
# (rather than only if it's less than), thus when installing python
# files we must make certain to not adjust the mtime of the source
-# (.py) file.
+# (.py) file. As a part of this we also go through and change the #!
+# line in the python script to that of the actual python we are using.
#
INS.pyfile= $(INS.file); $(TOUCH) -r $< $@
@@ -1114,9 +1115,16 @@ PKGPUBLISHER_NONREDIST= on-extra
$(RM) $@;
$(SED) -e "s@TEXT_DOMAIN@\"$(TEXT_DOMAIN)\"@" $< > $@;
$(CHMOD) +x $@
+#
+# You might ask why we aren't using -i for sed here. That's because illumos
+# 1815 hasn't been fixed and sadly we didn't back out something that broke a lot
+# of working code in favor of GNU compatibility.
+#
+SED.py= $(SED) -e 's?^$(POUND_SIGN)!ON_PYTHON_26$$?$(POUND_SIGN)!$(PYTHON_26)?' \
+ -e 's?^$(POUND_SIGN)!ON_PYTHON$$?$(POUND_SIGN)!$(PYTHON)?'
.py:
- $(RM) $@; $(CAT) $< > $@; $(CHMOD) +x $@
+ $(RM) $@; $(SED.py) $< > $@; $(CHMOD) +x $@
.py.pyc:
$(RM) $@
diff --git a/usr/src/tools/onbld/Checks/Cddl.py b/usr/src/tools/onbld/Checks/Cddl.py
index 1f5f99f953..0f4d995e89 100644
--- a/usr/src/tools/onbld/Checks/Cddl.py
+++ b/usr/src/tools/onbld/Checks/Cddl.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
CDDL = '''
CDDL HEADER START
diff --git a/usr/src/tools/onbld/Checks/CmtBlk.py b/usr/src/tools/onbld/Checks/CmtBlk.py
index 2f3d29fa79..ddf5caec48 100644
--- a/usr/src/tools/onbld/Checks/CmtBlk.py
+++ b/usr/src/tools/onbld/Checks/CmtBlk.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
diff --git a/usr/src/tools/onbld/Checks/Comments.py b/usr/src/tools/onbld/Checks/Comments.py
index daf6aa47d9..6304e59818 100644
--- a/usr/src/tools/onbld/Checks/Comments.py
+++ b/usr/src/tools/onbld/Checks/Comments.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/Copyright.py b/usr/src/tools/onbld/Checks/Copyright.py
index 81a80058aa..8071b7f435 100644
--- a/usr/src/tools/onbld/Checks/Copyright.py
+++ b/usr/src/tools/onbld/Checks/Copyright.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/DbLookups.py b/usr/src/tools/onbld/Checks/DbLookups.py
index 331dc68090..1e0734e251 100644
--- a/usr/src/tools/onbld/Checks/DbLookups.py
+++ b/usr/src/tools/onbld/Checks/DbLookups.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/HdrChk.py b/usr/src/tools/onbld/Checks/HdrChk.py
index c2697dcaf2..8f7b946d12 100644
--- a/usr/src/tools/onbld/Checks/HdrChk.py
+++ b/usr/src/tools/onbld/Checks/HdrChk.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/Keywords.py b/usr/src/tools/onbld/Checks/Keywords.py
index 5c374c3abb..ac3555be32 100644
--- a/usr/src/tools/onbld/Checks/Keywords.py
+++ b/usr/src/tools/onbld/Checks/Keywords.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,8 +24,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# Mercurial (lack of) keyword checks
diff --git a/usr/src/tools/onbld/Checks/Mapfile.py b/usr/src/tools/onbld/Checks/Mapfile.py
index 2a8cb74aed..d4fa70d141 100644
--- a/usr/src/tools/onbld/Checks/Mapfile.py
+++ b/usr/src/tools/onbld/Checks/Mapfile.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Checks/__init__.py b/usr/src/tools/onbld/Checks/__init__.py
index 4bb5f3e262..b7ecf0e881 100644
--- a/usr/src/tools/onbld/Checks/__init__.py
+++ b/usr/src/tools/onbld/Checks/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/onbld/Scm/__init__.py b/usr/src/tools/onbld/Scm/__init__.py
index f45ecbc95f..8934eb3942 100644
--- a/usr/src/tools/onbld/Scm/__init__.py
+++ b/usr/src/tools/onbld/Scm/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,5 +24,3 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
diff --git a/usr/src/tools/onbld/hgext/__init__.py b/usr/src/tools/onbld/hgext/__init__.py
index f45ecbc95f..8934eb3942 100644
--- a/usr/src/tools/onbld/hgext/__init__.py
+++ b/usr/src/tools/onbld/hgext/__init__.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#!ON_PYTHON
#
# CDDL HEADER START
#
@@ -24,5 +24,3 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
diff --git a/usr/src/tools/scripts/cddlchk.py b/usr/src/tools/scripts/cddlchk.py
index 816d2f33a7..ad6a6e6f56 100644
--- a/usr/src/tools/scripts/cddlchk.py
+++ b/usr/src/tools/scripts/cddlchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/copyrightchk.py b/usr/src/tools/scripts/copyrightchk.py
index 210ef1b46c..f778947bfc 100644
--- a/usr/src/tools/scripts/copyrightchk.py
+++ b/usr/src/tools/scripts/copyrightchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/git-active.py b/usr/src/tools/scripts/git-active.py
deleted file mode 100644
index 475892b22c..0000000000
--- a/usr/src/tools/scripts/git-active.py
+++ /dev/null
@@ -1,131 +0,0 @@
-#! /usr/bin/python2.4
-#
-# 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]
-#
-
-#
-# Copyright 2009 Cyril Plisko. All rights reserved.
-# Use is subject to license terms.
-#
-# Copyright 2010 Joyent, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-
-'''
-Create a wx-style active list on stdout based on a Git
-workspace in support of webrev's Git support.
-'''
-
-import os
-import sys
-import optparse
-import subprocess
-
-def execCmd(cmd):
- '''Executes external command'''
-
- p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (out, err) = p.communicate()
-
- if out == None:
- out = ""
-
- return (p.returncode, out.splitlines(), err.splitlines())
-
-def main(argv):
-
- usage = "usage: %prog [-p parent] -w workspace"
- parser = optparse.OptionParser(version="%prog 1.0", usage=usage)
- parser.add_option("-p", dest="parentpath", default="", help="parent repo")
- parser.add_option("-w", dest="wspath", default="", help="workspace")
- parser.add_option("-o", dest="outputfile", help="output file")
- parser.disable_interspersed_args()
-
- (options, args) = parser.parse_args()
-
- if not options.wspath:
- parser.print_help()
- sys.exit(2)
-
- fh = None
- if options.outputfile:
- try:
- fh = open(options.outputfile, 'w')
- except EnvironmentError, e:
- sys.stderr.write("could not open output file: %s\n" % e)
- sys.exit(1)
- else:
- fh = sys.stdout
-
- branch = "master"
- cmd = ["git", "branch"]
- (rc, out, err) = execCmd(cmd)
- for i in out:
- if i.startswith("*"):
- branch = i.split()[1]
-
- cmd = ["git", "push", "--dry-run", "origin", "%s" % branch]
- (rc, out, err) = execCmd(cmd)
- for i in err:
- if i.startswith("To "):
- continue
- rev = i.split()[0]
-
- if rev == "":
- sys.exit(0)
-
- cmd = ["git", "--git-dir=%s" % options.wspath, "log", "--name-only",
- "--parents", "--reverse", "--pretty=short", "%s" % rev]
- (rc, out, err) = execCmd(cmd)
-
- if out == []:
- sys.exit(0)
-
- if "commit" in out[0]:
- parent = out[0].split()[2]
-
- files = {}
- comment = None
- for i in out:
- if "commit" in i:
- comment = None
- continue
- if i == "" or i.startswith("Author"):
- continue
- if i.startswith(" "):
- comment = i.strip()
- continue
- if comment:
- if i not in files:
- files[i] = []
- files[i].append(comment)
-
- fh.write("GIT_PARENT=%s\n" % parent)
-
- for file in sorted(files.iterkeys()):
- #if entry.is_renamed():
- # fh.write("%s %s\n" % (entry.name, entry.parentname))
- #else:
- # fh.write("%s\n" % entry.name)
- fh.write("%s\n\n" % file)
- fh.write("%s\n\n" % '\n'.join(files[file]))
-
-if __name__ == '__main__':
- try:
- main(sys.argv[1:])
- except KeyboardInterrupt:
- sys.exit(1)
diff --git a/usr/src/tools/scripts/git-pbchk.py b/usr/src/tools/scripts/git-pbchk.py
index 52c455f10e..82a63df70a 100644
--- a/usr/src/tools/scripts/git-pbchk.py
+++ b/usr/src/tools/scripts/git-pbchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
diff --git a/usr/src/tools/scripts/hdrchk.py b/usr/src/tools/scripts/hdrchk.py
index 84acbc8616..aa62f7b090 100644
--- a/usr/src/tools/scripts/hdrchk.py
+++ b/usr/src/tools/scripts/hdrchk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/hg-active.py b/usr/src/tools/scripts/hg-active.py
index 88394e98e5..23f6c7cd98 100644
--- a/usr/src/tools/scripts/hg-active.py
+++ b/usr/src/tools/scripts/hg-active.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
diff --git a/usr/src/tools/scripts/mapfilechk.py b/usr/src/tools/scripts/mapfilechk.py
index 9cf2000c7a..ed90d8b426 100644
--- a/usr/src/tools/scripts/mapfilechk.py
+++ b/usr/src/tools/scripts/mapfilechk.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh
index a788885787..40d7b9c3f9 100644
--- a/usr/src/tools/scripts/nightly.sh
+++ b/usr/src/tools/scripts/nightly.sh
@@ -654,6 +654,9 @@ function build {
rm -rf $PKGARCHIVE >> "$LOGFILE" 2>&1
mkdir -p $PKGARCHIVE >> "$LOGFILE" 2>&1
+ /bin/time $MAKE -e stage-licenses 2>&1 | \
+ tee -a $SRC/$d/${INSTALLOG}.out >> $LOGFILE
+
for d in pkg pkgdefs; do
if [ ! -f "$SRC/$d/Makefile" ]; then
continue
diff --git a/usr/src/tools/scripts/validate_pkg.py b/usr/src/tools/scripts/validate_pkg.py
index 2ac1e009d0..5bf8bd84f2 100644
--- a/usr/src/tools/scripts/validate_pkg.py
+++ b/usr/src/tools/scripts/validate_pkg.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#
diff --git a/usr/src/tools/scripts/wsdiff.py b/usr/src/tools/scripts/wsdiff.py
index 5156f03c20..b485a143a3 100644
--- a/usr/src/tools/scripts/wsdiff.py
+++ b/usr/src/tools/scripts/wsdiff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.6
+#!ON_PYTHON_26
#
# CDDL HEADER START
#