From owner-freebsd-python@FreeBSD.ORG Sat Jul 5 17:03:53 2014 Return-Path: Delivered-To: python@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F0D8BAD; Sat, 5 Jul 2014 17:03:53 +0000 (UTC) Received: from fire.magemana.nl (magemana.nl [IPv6:2a01:7c8:aaae:25e::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6AFDA2A96; Sat, 5 Jul 2014 17:03:53 +0000 (UTC) Received: by fire.magemana.nl (Postfix, from userid 1003) id CB1B44AB53B; Sat, 5 Jul 2014 19:03:51 +0200 (CEST) To: FreeBSD-gnats-submit@freebsd.org Subject: [PATCH] devel/py-setuptools: fix bytecompiled files From: Melvyn Sopacua X-send-pr-version: 3.113 X-GNATS-Notify: Message-Id: <20140705170351.CB1B44AB53B@fire.magemana.nl> Date: Sat, 5 Jul 2014 19:03:51 +0200 (CEST) Cc: python@FreeBSD.org X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jul 2014 17:03:53 -0000 >Submitter-Id: current-users >Originator: Melvyn Sopacua >Organization: >Confidential: no >Synopsis: [PATCH] devel/py-setuptools: fix bytecompiled files >Severity: serious >Priority: medium >Category: ports >Class: sw-bug >Release: FreeBSD 9.2-RELEASE-p8 amd64 >Environment: System: FreeBSD fire.magemana.nl 9.2-RELEASE-p8 FreeBSD 9.2-RELEASE-p8 #4 r267444: Sun Jun 15 21:33:00 CEST 2014 melvyn@fire.magemana.nl:/usr/obj/usr/src/sys/TRANSIP amd64 >Description: Fixes files that are added to PLIST when using DISTUTILS_AUTOPLIST and the package is a namespace_package. Details and upstream PR: Note: the port mentioned in the PR needs a oneliner fix to begin with. >Fix: --- fix-py-setuptools-namespace-packages.patch begins here --- diff -r 63528a5e5d19 -r a745a5a3e96d devel/py-setuptools/Makefile --- a/devel/py-setuptools/Makefile Sat Jul 05 09:54:36 2014 +0200 +++ b/devel/py-setuptools/Makefile Sat Jul 05 18:49:39 2014 +0200 @@ -2,6 +2,7 @@ PORTNAME= setuptools PORTVERSION= 5.1 +PORTREVISION= 1 CATEGORIES= devel python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} diff -r 63528a5e5d19 -r a745a5a3e96d devel/py-setuptools/files/patch-setuptools_command_install_lib.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/devel/py-setuptools/files/patch-setuptools_command_install_lib.py Sat Jul 05 18:49:39 2014 +0200 @@ -0,0 +1,35 @@ +--- setuptools/command/install_lib.py.orig Mon Jun 30 13:30:09 2014 +0200 ++++ setuptools/command/install_lib.py Sat Jul 05 17:43:39 2014 +0200 +@@ -1,5 +1,5 @@ + import distutils.command.install_lib as orig +-import os ++import os, imp + + class install_lib(orig.install_lib): + """Don't add compiled flags to filenames of non-Python files""" +@@ -16,12 +16,24 @@ + nsp = self.distribution.namespace_packages + svem = (nsp and self.get_finalized_command('install') + .single_version_externally_managed) ++ exclude_names = ['__init__.py', '__init__.pyc', '__init__.pyo'] ++ if hasattr(imp, 'get_tag') : ++ exclude_names.extend(( ++ os.path.join( ++ '__pycache__', ++ '__init__.' + imp.get_tag() + '.pyc' ++ ), ++ os.path.join( ++ '__pycache__', ++ '__init__.' + imp.get_tag() + '.pyo' ++ ), ++ )) + if svem: + for pkg in nsp: + parts = pkg.split('.') + while parts: + pkgdir = os.path.join(self.install_dir, *parts) +- for f in '__init__.py', '__init__.pyc', '__init__.pyo': ++ for f in exclude_names : + exclude[os.path.join(pkgdir,f)] = 1 + parts.pop() + return exclude --- fix-py-setuptools-namespace-packages.patch ends here ---