From 70143b9fb6146f632b4b5d924e508df293b600df Mon Sep 17 00:00:00 2001 From: Richard Lowe Date: Wed, 18 May 2022 17:33:24 -0500 Subject: 14769 remove support for Python 2.x Reviewed by: Toomas Soome Reviewed by: Andy Fiddaman Approved by: Robert Mustacchi --- usr/src/tools/Makefile | 11 ++------ usr/src/tools/Makefile.python | 15 +---------- usr/src/tools/env/illumos.sh | 13 ---------- usr/src/tools/onbld/Checks/Makefile | 4 +-- usr/src/tools/onbld/Checks/py2/Makefile | 45 --------------------------------- usr/src/tools/onbld/Makefile | 4 +-- usr/src/tools/onbld/Scm/Makefile | 4 +-- usr/src/tools/onbld/Scm/py2/Makefile | 45 --------------------------------- usr/src/tools/onbld/py2/Makefile | 45 --------------------------------- usr/src/tools/scripts/Makefile | 2 +- 10 files changed, 7 insertions(+), 181 deletions(-) delete mode 100644 usr/src/tools/onbld/Checks/py2/Makefile delete mode 100644 usr/src/tools/onbld/Scm/py2/Makefile delete mode 100644 usr/src/tools/onbld/py2/Makefile (limited to 'usr/src/tools') diff --git a/usr/src/tools/Makefile b/usr/src/tools/Makefile index 6a1f363ce9..e9acd189d8 100644 --- a/usr/src/tools/Makefile +++ b/usr/src/tools/Makefile @@ -122,13 +122,7 @@ ROOTDIRS= \ $(ROOTONBLD)/man \ $(ROOTONBLD)/man/man1onbld -$(BUILDPY2TOOLS)ROOTDIRS += \ - $(ROOTONBLD)/lib/python$(PYTHON_VERSION) \ - $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \ - $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \ - $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm - -$(BUILDPY3TOOLS)ROOTDIRS += \ +ROOTDIRS += \ $(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \ $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \ $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \ @@ -153,7 +147,6 @@ DOROOTDIRS= $(ROOTDIRS) clobber:= DOROOTDIRS= clean:= DOROOTDIRS= -$(BUILDPY2TOOLS)DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY) clobber:= DOROOTONBLDLIBPY= clean:= DOROOTONBLDLIBPY= @@ -180,6 +173,6 @@ $(ROOTDIRS): $(MKDIR) -p -m $(DIRMODE) $@ $(ROOTONBLDLIBPY): $(ROOTDIRS) - $(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@ + $(RM) -r $@; $(SYMLINK) python$(PYTHON3_VERSION) $@ FRC: diff --git a/usr/src/tools/Makefile.python b/usr/src/tools/Makefile.python index 63df6e7a36..229df0b945 100644 --- a/usr/src/tools/Makefile.python +++ b/usr/src/tools/Makefile.python @@ -85,19 +85,7 @@ pyclobber: $(RM) $(CLOBBERFILES) $(RM) -rf $(CLOBBERDIRS) -# Python 2 module compilation - -python$(PYVER)/%.pyc: ../%.py - @[ -d $(@D) ] || mkdir $(@D) - $(RM) $@ - $(PYTHON) -mpy_compile $< - $(MV) ../$(*).pyc $@ - -$(ROOTPYDIR)/%.pyc: python$(PYVER)/%.pyc - $(INS.pyfile) - -# Python 3 module compilation - +# Python module compilation python$(PYVER)/__pycache__/%.cpython$(PYPKGVERS).pyc: ../%.py @[ -d $(@D) ] || mkdir -p $(@D) $(RM) $@ @@ -106,4 +94,3 @@ python$(PYVER)/__pycache__/%.cpython$(PYPKGVERS).pyc: ../%.py $(ROOTPYDIR)/__pycache__/%.pyc: python$(PYVER)/__pycache__/%.pyc $(INS.pyfile) - diff --git a/usr/src/tools/env/illumos.sh b/usr/src/tools/env/illumos.sh index 77446ffce3..08765b1bc7 100644 --- a/usr/src/tools/env/illumos.sh +++ b/usr/src/tools/env/illumos.sh @@ -106,23 +106,10 @@ export ENABLE_SMB_PRINTING= # If your distro uses certain versions of Python, make sure either # Makefile.master contains your new defaults OR your .env file sets them. -#export PYTHON_VERSION=2.7 -#export PYTHON_PKGVERS=-27 -#export PYTHON_SUFFIX= #export PYTHON3_VERSION=3.5 #export PYTHON3_PKGVERS=-35 #export PYTHON3_SUFFIX=m -# To disable building with either Python2 or Python 3 (or both), uncomment -# these lines: -#export BUILDPY2='#' -#export BUILDPY3='#' - -# To disable building this workspace's tools in $SRC/tools with either Python2 -# or Python3 (but not both!), uncomment either of these lines: -#export BUILDPY2TOOLS='#' -#export BUILDPY3TOOLS='#' - # Set console color scheme either by build type: # #export RELEASE_CONSOLE_COLOR="-DDEFAULT_ANSI_FOREGROUND=ANSI_COLOR_BLACK \ diff --git a/usr/src/tools/onbld/Checks/Makefile b/usr/src/tools/onbld/Checks/Makefile index b6f18bdf85..1cdd9926f7 100644 --- a/usr/src/tools/onbld/Checks/Makefile +++ b/usr/src/tools/onbld/Checks/Makefile @@ -27,9 +27,7 @@ include ../../Makefile.tools -SUBDIRS= -$(BUILDPY2TOOLS)SUBDIRS += py2 -$(BUILDPY3TOOLS)SUBDIRS += py3 +SUBDIRS=py3 all := TARGET= all install := TARGET= install diff --git a/usr/src/tools/onbld/Checks/py2/Makefile b/usr/src/tools/onbld/Checks/py2/Makefile deleted file mode 100644 index 40b2b41255..0000000000 --- a/usr/src/tools/onbld/Checks/py2/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# Copyright 2010, Richard Lowe -# Copyright 2014 Garrett D'Amore -# Copyright 2016, Joyent, Inc. -# Copyright 2018 OmniOS Community Edition (OmniOSce) Association. - -include ../Makefile.com - -PYVER = $(PYTHON_VERSION) -PYPKGVERS = $(PYTHON_PKGVERS) -PYOBJS = $(PYSRCS:%.py=%.pyc) - -include ../../../Makefile.python - -all: $(PYVERSOJBS) - -install: all $(ROOTPYFILES) - -clean: - -clobber: clean pyclobber diff --git a/usr/src/tools/onbld/Makefile b/usr/src/tools/onbld/Makefile index 2127334ae7..8dcf63aca0 100644 --- a/usr/src/tools/onbld/Makefile +++ b/usr/src/tools/onbld/Makefile @@ -27,9 +27,7 @@ include ../Makefile.tools -SUBDIRS=Checks Scm -$(BUILDPY2TOOLS)SUBDIRS += py2 -$(BUILDPY3TOOLS)SUBDIRS += py3 +SUBDIRS=Checks Scm py3 all := TARGET= all install := TARGET= install diff --git a/usr/src/tools/onbld/Scm/Makefile b/usr/src/tools/onbld/Scm/Makefile index b6f18bdf85..2987a8bb8e 100644 --- a/usr/src/tools/onbld/Scm/Makefile +++ b/usr/src/tools/onbld/Scm/Makefile @@ -27,9 +27,7 @@ include ../../Makefile.tools -SUBDIRS= -$(BUILDPY2TOOLS)SUBDIRS += py2 -$(BUILDPY3TOOLS)SUBDIRS += py3 +SUBDIRS= py3 all := TARGET= all install := TARGET= install diff --git a/usr/src/tools/onbld/Scm/py2/Makefile b/usr/src/tools/onbld/Scm/py2/Makefile deleted file mode 100644 index 40b2b41255..0000000000 --- a/usr/src/tools/onbld/Scm/py2/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# Copyright 2010, Richard Lowe -# Copyright 2014 Garrett D'Amore -# Copyright 2016, Joyent, Inc. -# Copyright 2018 OmniOS Community Edition (OmniOSce) Association. - -include ../Makefile.com - -PYVER = $(PYTHON_VERSION) -PYPKGVERS = $(PYTHON_PKGVERS) -PYOBJS = $(PYSRCS:%.py=%.pyc) - -include ../../../Makefile.python - -all: $(PYVERSOJBS) - -install: all $(ROOTPYFILES) - -clean: - -clobber: clean pyclobber diff --git a/usr/src/tools/onbld/py2/Makefile b/usr/src/tools/onbld/py2/Makefile deleted file mode 100644 index 5b372bc0ce..0000000000 --- a/usr/src/tools/onbld/py2/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# -# 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) 2008, 2010, Oracle and/or its affiliates. All rights reserved. -# - -# Copyright 2010, Richard Lowe -# Copyright 2014 Garrett D'Amore -# Copyright 2016, Joyent, Inc. -# Copyright 2018 OmniOS Community Edition (OmniOSce) Association. - -include ../Makefile.com - -PYVER = $(PYTHON_VERSION) -PYPKGVERS = $(PYTHON_PKGVERS) -PYOBJS = $(PYSRCS:%.py=%.pyc) - -include ../../Makefile.python - -all: $(PYVERSOJBS) - -install: all $(ROOTPYFILES) - -clean: - -clobber: clean pyclobber diff --git a/usr/src/tools/scripts/Makefile b/usr/src/tools/scripts/Makefile index f28b285b14..ae74fc39a1 100644 --- a/usr/src/tools/scripts/Makefile +++ b/usr/src/tools/scripts/Makefile @@ -136,7 +136,7 @@ all: $(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \ $(MAN1ONBLDFILES) $(MAKEFILES) $(SCRIPTS) onu.sh: onu.sh.in - $(SED) -e "s:@PYTHON_VERSION@:$(PYTHON_VERSION):g" < onu.sh.in > $@ + $(SED) -e "s:@PYTHON_VERSION@:$(PYTHON3_VERSION):g" < onu.sh.in > $@ $(ROOTONBLDBIN)/git-nits: $(RM) $(ROOTONBLDBIN)/git-nits -- cgit v1.2.3