pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Change "import subprocess" to conditionally on running under python2 and on a posix system, import subprocess32 in its place. Also add conditional dependency on py-subprocess32 in that case. Yes, there is one indented " import subprocess" left... Bump PKGREVISION.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Tue Aug 15 16:52:07 2017 +0200
Changeset:	8ae93a953f23179df48ea11bd51af8c0d4f04de3

Modified Files:
	ansible/Makefile

Log Message:
Change "import subprocess" to conditionally on running under python2
and on a posix system, import subprocess32 in its place.  Also add
conditional dependency on py-subprocess32 in that case.
Yes, there is one indented "    import subprocess" left...
Bump PKGREVISION.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8ae93a953f23179df48ea11bd51af8c0d4f04de3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ansible/Makefile | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 51 insertions(+), 3 deletions(-)

diffs:
diff --git a/ansible/Makefile b/ansible/Makefile
index 45b9fd2c3d..4c72f7fbe8 100644
--- a/ansible/Makefile
+++ b/ansible/Makefile
@@ -2,6 +2,7 @@
 
 DISTNAME=	ansible-2.3.2.0
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=	1
 CATEGORIES=	python sysutils
 MASTER_SITES=	http://releases.ansible.com/ansible/
 
@@ -16,6 +17,12 @@ DEPENDS+=	${PYPKGPREFIX}-jinja2-[0-9]*:../../textproc/py-jinja2
 DEPENDS+=	${PYPKGPREFIX}-crypto>=2.6:../../security/py-crypto
 DEPENDS+=	${PYPKGPREFIX}-jxmlease-[0-9]*:../../textproc/py-jxmlease
 
+.include "../../lang/python/pyversion.mk"
+
+.if !empty(PYPKGPREFIX:Mpy2*)
+DEPENDS+=	${PYPKGPREFIX}-subprocess32-[0-9]*:../../devel/py-subprocess32
+.endif
+
 USE_TOOLS+=	gmake
 PYTHON_VERSIONS_ACCEPTED= 36 35 34 27
 
@@ -52,12 +59,53 @@ SUBST_SED.prefix=	-e "s,@PREFIX@,${PREFIX},"
 SUBST_SED.prefix+=	-e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g"
 SUBST_SED.prefix+=	-e "s,@PYSITELIB@,${PYSITELIB},"
 
+SUBST_CLASSES+=		subprocess
+SUBST_STAGE.subprocess=	pre-configure
+SUBST_FILES.subprocess+= test/runner/lib/util.py
+SUBST_FILES.subprocess+= test/runner/units/test_diff.py
+SUBST_FILES.subprocess+= test/utils/shippable/ansible-core-ci
+SUBST_FILES.subprocess+= test/sanity/code-smell/ansible-var-precedence-check.py
+SUBST_FILES.subprocess+= test/sanity/validate-modules/validate-modules
+SUBST_FILES.subprocess+= lib/ansible/module_utils/basic.py
+SUBST_FILES.subprocess+= lib/ansible/module_utils/service.py
+SUBST_FILES.subprocess+= lib/ansible/playbook/role/requirement.py
+SUBST_FILES.subprocess+= lib/ansible/utils/ssh_functions.py
+SUBST_FILES.subprocess+= lib/ansible/utils/cmd_functions.py
+SUBST_FILES.subprocess+= lib/ansible/utils/display.py
+SUBST_FILES.subprocess+= lib/ansible/inventory/script.py
+SUBST_FILES.subprocess+= lib/ansible/inventory/__init__.py
+SUBST_FILES.subprocess+= lib/ansible/cli/__init__.py
+SUBST_FILES.subprocess+= lib/ansible/executor/module_common.py
+SUBST_FILES.subprocess+= lib/ansible/modules/database/mysql/mysql_db.py
+SUBST_FILES.subprocess+= lib/ansible/modules/cloud/lxc/lxc_container.py
+SUBST_FILES.subprocess+= lib/ansible/modules/system/service.py
+SUBST_FILES.subprocess+= lib/ansible/modules/network/lldp.py
+SUBST_FILES.subprocess+= lib/ansible/modules/utilities/logic/async_wrapper.py
+SUBST_FILES.subprocess+= lib/ansible/modules/identity/opendj/opendj_backendprop.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/callback/osx_say.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/lookup/pipe.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/lookup/passwordstore.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/lookup/lines.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/chroot.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/zone.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/winrm.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/docker.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/jail.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/persistent.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/local.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/iocage.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/libvirt_lxc.py
+SUBST_FILES.subprocess+= lib/ansible/plugins/connection/ssh.py
+SUBST_FILES.subprocess+= contrib/inventory/fleet.py
+SUBST_FILES.subprocess+= contrib/inventory/spacewalk.py
+SUBST_FILES.subprocess+= contrib/inventory/vagrant.py
+SUBST_MESSAGE.subprocess=	Fix subprocess to subprocess32 import
+SUBST_SED.subprocess=	-e "/^import subprocess/{i\\$(.newline)import os, sys$(.newline)i\\$(.newline)if os.name == 'posix' and sys.version_info[0] < 3:$(.newline)i\\$(.newline)\\    import subprocess32 as subprocess$(.newline)i\\$(.newline)else:$(.newline)i\\$(.newline)\\    import subprocess$(.newline)d$(.newline)}"
+
 PY_DIRS=	lib/ansible
 PY_DIRS+=	contrib/inventory
 
-.for f in `find ${PY_DIRS} -name \*.py`
-REPLACE_PYTHON+=	${f}
-.endfor
+REPLACE_PYTHON= `find ${PY_DIRS} -name \*.py`
 
 MANPAGES=	ansible-doc.1 ansible-pull.1 ansible-galaxy.1 ansible-vault.1
 MANPAGES+=	ansible-playbook.1 ansible.1


Home | Main Index | Thread Index | Old Index