diff options
Diffstat (limited to 'debian')
66 files changed, 16491 insertions, 0 deletions
diff --git a/debian/TODO b/debian/TODO new file mode 100644 index 0000000..aea1b02 --- /dev/null +++ b/debian/TODO @@ -0,0 +1,20 @@ +* Triage and fix/skip all test failures +* Stop embedding expat strings +* Add a way to disable network tests. ATM they fail silently, so this isn't a big priority +* Look at importing distutils-sysconfig.diff from cpython, if it's needed. +* Forward patches to PyPy upstream: + - pep3147-* +* Provide an option for i386 machines without SSE2. + PyPy upstream claims SSE2 is vital for performance and we can't disable it + for i386, we should provide both SSE2-enabled and legacy binaries. + The JIT with out SSE2 is currently broken... +* Work out the details for module packages supporting pypy. +* Package rpython + - Figure out where to put rpython/_cache + - Stop writing things into rpytohn/translator/c/src +* Porting: + - _continutation needs a single function ported to each architecture. Mostly + copy-paste from python-greenlet, but slightly different API. +* Multi-Arch: + - config cache + - headers diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..3db6612 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,999 @@ +pypy (7.2.0+dfsg-1) unstable; urgency=medium + + * New upstream final release. + * Upload to unstable. + * Enable JIT and continuation module on arm64. + * Refresh patches. + * Drop patch fix-revdb, superseded upstream. + * Patch arm64-gcc-bug: Avoid a GCC bug in the new arm64 JIT. + * Bump Standards-Version to 4.4.1, no changes needed. + + -- Stefano Rivera <stefanor@debian.org> Sat, 02 Nov 2019 11:37:59 -0700 + +pypy (7.2.0~rc0+dfsg-1) experimental; urgency=medium + + * New upstream RC, upload to experimental. + * Drop Pre-Depends dpkg (>= 1.15.6~). xz is always supported, these days. + * Move more translation logic into debian/scripts/translate.sh + * Refresh patches. + * Drop patch version-7.1.1, superseded upstream. + * Refresh copyright. + * Bump Standards-Version to 4.4.0, no changes needed. + * Patch fix-revdb: Make RevDB build. + + -- Stefano Rivera <stefanor@debian.org> Thu, 03 Oct 2019 14:50:09 +0300 + +pypy (7.1.1+dfsg-1) unstable; urgency=medium + + * New upstream minor release. + * Update copyright. + * Drop patches, superseded upstream: hypothesis-crashes, hurd-sysmacros. + * Patch version-7.1.1: Set the version in the docs to 7.1.1, upstream got it + wrong. + * Drop patch graphlib-dots, superseded upstream. + + -- Stefano Rivera <stefanor@debian.org> Thu, 08 Aug 2019 20:10:56 -0300 + +pypy (7.0.0+dfsg-3) unstable; urgency=medium + + * Update watch file regex, upstream calls it pypy2.7 now. + * pypycompile and pypyclean now read namespaces from /usr/share/pypy/ns + (following dh_pypy). (Closes: #924676) + - Breaks old pypy-backports.functools-lru-cache, using the old location. + + -- Stefano Rivera <stefanor@debian.org> Sun, 24 Mar 2019 11:07:07 -0400 + +pypy (7.0.0+dfsg-2) unstable; urgency=medium + + * Remove dh_builddeb override, no longer necessary. + * Bump Standards-Version to 4.3.0, no changes needed. + * Patch from upstream release branch: hypothesis-crashes: Handle older + hypothesis versions better. + * Patch hurd-sysmacros: Include <sys/sysmacros.h> on GNU/Hurd. + (Closes: #921937) + * Use /usr/share/dpkg/architecture.mk to export DEB_HOST_MULTIARCH. + + -- Stefano Rivera <stefanor@debian.org> Tue, 12 Feb 2019 14:41:21 -0800 + +pypy (7.0.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Drop patches avoid-rvmprof-dummy, hurd, and rvmprof-dummy. Superseded + upstream. + * Update copyright. + * Clean up after the new "extra_tests" directory. + + -- Stefano Rivera <stefanor@debian.org> Thu, 07 Feb 2019 15:34:43 +0200 + +pypy (6.0.0+dfsg-4) unstable; urgency=medium + + * Replace patch dots-gctransform with graphlib-dots: Print some more + mandlebrot while breaking cycles, to avoid build timeouts. + * Add namespace package support. + * Add some superficial autopkgtests. + + -- Stefano Rivera <stefanor@debian.org> Wed, 30 Jan 2019 13:27:19 +0100 + +pypy (6.0.0+dfsg-3) unstable; urgency=medium + + * Build in multiarch tuple, even if built with a non-multiarch python. + * Patch skip-hurd-deadlock: Skip a locking test on hurd, that deadlocks. + * Patch dots-gctransform: Print some more mandelbrot while "Inlining GC + helpers", to avoid timeouts. + + -- Stefano Rivera <stefanor@debian.org> Tue, 28 Aug 2018 10:01:22 +0100 + +pypy (6.0.0+dfsg-2) unstable; urgency=medium + + * Add support for hurd-i386 (Closes: #904076), with some patches from + upstream. Thanks Samuel Thibault. + - rvmprof-dummy: A fix for rvmprof.dummy + - avoid-rvmprof-dummy: Disable rvmprof on platforms that won't support it + - hurd: The main platform support patch. + * pypy{compile,clean}: Don't attempt to byte-compile (or clean) python + scripts in /usr/share/doc, when using the -p flag to find all scripts in a + package. (Closes: #904521) + * Add temporary cleanup code to pypyclean, removing any byte-compiled files + that were created due to the above bug. + * Bump Standards-Version to 4.2.0, no changes needed. + + -- Stefano Rivera <stefanor@debian.org> Sat, 18 Aug 2018 12:18:35 -0700 + +pypy (6.0.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Drop patch rvmprof-cpu-detection, superseded upstream. + * Update copyright. + * Declare Rules-Requires-Root: no + * Bump Standards-Version to 4.1.4, no changes needed. + * Migrate VCS fields to salsa.debian.org. + * Correct cffi pydist-override location, thanks olasd. (Closes: #895938) + + -- Stefano Rivera <stefanor@debian.org> Fri, 27 Apr 2018 14:16:57 -0700 + +pypy (5.10.0+dfsg-3) unstable; urgency=medium + + * Patch: dots-stackcheck: Print more dots to avoid timing out on slower + buildds (Closes: #878479) + + -- Stefano Rivera <stefanor@debian.org> Sat, 20 Jan 2018 21:06:44 +1100 + +pypy (5.10.0+dfsg-2) unstable; urgency=medium + + * Patch: rvmprof: Handle ProcessorAutodetectError. Fixing builds on non-JIT + archs. + + -- Stefano Rivera <stefanor@debian.org> Thu, 28 Dec 2017 21:36:16 +0100 + +pypy (5.10.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Bump Standards_version to 4.1.2, no changes needed. + + -- Stefano Rivera <stefanor@debian.org> Thu, 28 Dec 2017 15:27:03 +0100 + +pypy (5.9.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Import patches into git-dpm (reformatting headers). + * Update copyright. + * Use VERSION_CHAR16CHAR32 as the cffi version. + * Bump Standards-Version to 4.1.1. + - Change priority to optional. + + -- Stefano Rivera <stefanor@debian.org> Sun, 08 Oct 2017 14:56:42 +0200 + +pypy (5.8.0+dfsg-2) unstable; urgency=medium + + * Disable _vmprof module on kFreeBSD, as it has no F_GETPATH, or equivalent. + * Stop using asmgcc, it's no longer the default upstream. And causes an + FTBFS on i386, with _vmprof. (Closes: #864814) + + -- Stefano Rivera <stefanor@debian.org> Fri, 16 Jun 2017 09:46:14 -0700 + +pypy (5.8.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Upload to unstable again, the freeze is (almost) over. + * Refresh patches. + * Update copyright. + * Use fPIC on m68k and sh4 (Closes: #861942, #861951) + * Bump Standards-Version to 4.0.0. + - Switch copyright file Format to https URL. + + -- Stefano Rivera <stefanor@debian.org> Wed, 14 Jun 2017 11:00:52 -0700 + +pypy (5.7.1+dfsg-2) experimental; urgency=medium + + * Install the new cpyext_* headers. + + -- Stefano Rivera <stefanor@debian.org> Tue, 02 May 2017 12:23:45 -0700 + +pypy (5.7.1+dfsg-1) experimental; urgency=medium + + * New upstream release. + * Upload to experimental, due to freeze. + * Refresh patches. + * Drop patches, superseded upstream: expat-2.2.0, noprofopt, trackgcroot, + non-recursive-graphlib. + * Update copyright. + * Build-Depend on python-pycparser, required for translation now. + * Update clean rule. + + -- Stefano Rivera <stefanor@debian.org> Tue, 25 Apr 2017 22:29:06 -0700 + +pypy (5.6.0+dfsg-4) unstable; urgency=medium + + * Fix clean rule. + * Patch non-recursive-graphlib: Hopefully fix stack overflow during + translation on mips{64,}el and armel. + + -- Stefano Rivera <stefanor@debian.org> Sun, 20 Nov 2016 11:08:46 +0100 + +pypy (5.6.0+dfsg-2) unstable; urgency=medium + + * Patch noprofopt: Allow the use of --no-profopt with -O3 and --shared. + * Use --no-profopt when the JIT is disabled, fixing FTBFS on many archs. + * Patch trackgcroot: Fix FTBFS on i386. + + -- Stefano Rivera <stefanor@debian.org> Sat, 12 Nov 2016 09:40:03 +0000 + +pypy (5.6.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + - Supports OpenSSL 1.1 (Closes: #828517) + * Refresh patches. + * Drop patch, superseded upstream: distutils-idempotent + * Update copyright. + * Build with --shared, to allow embedding. + * Patch expat-2.2.0: Don’t test error message detail that changed in Expat + 2.2.0. + + -- Stefano Rivera <stefanor@debian.org> Fri, 11 Nov 2016 22:27:20 +0000 + +pypy (5.4.1+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Drop patches, superseded upstream: cpython-recursionlimit, + floatingpoint-accuracy, libm-tests. + * Update copyright file. + * Enable continuation on s390x, it's been supported since 5.1. + + -- Stefano Rivera <stefanor@debian.org> Tue, 06 Sep 2016 15:06:37 -0700 + +pypy (5.4.0+dfsg-2) unstable; urgency=medium + + * Patch cpython-recursionlimit: Resolve FTBFS when translating with cpython + * Patch floatingpoint-accuracy: Hopefully resolve FTBFS on ppc64el. + * Patch libm-tests: Resolve test failures in _rawffi. + * Drop python-pypy.sandbox. It is broken upstream in 5.4.0, as it has been + in all upstream releases in recent history. + + -- Stefano Rivera <stefanor@debian.org> Wed, 31 Aug 2016 18:49:14 -0700 + +pypy (5.4.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Drop patches, superseded upstream: s390x-march, sandboxed-mkdir. + * Update watch file, following upstream's new tag syntax. + * Upstream now lets us target a s390x subarch, so target z10, the oldest + upstream supports. + * Patch distutils-idempotent: Make customize_compiler idempotent. This + avoids infinitely long command lines and thus an FTBFS. (Closes: #835772) + + -- Stefano Rivera <stefanor@debian.org> Wed, 31 Aug 2016 09:11:33 -0700 + +pypy (5.3.1+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Drop patches, superseded upstream: ppc-jit-ftbfs, pymem.h. + * Build with pypy on s390x again, the JIT is bootstrapped. + + -- Stefano Rivera <stefanor@debian.org> Sat, 18 Jun 2016 14:29:07 +0200 + +pypy (5.3+dfsg-2) unstable; urgency=medium + + * Cherry-pick two upstream patches. + - Patch ppc-jit-ftbfs: Fix JIT FTBFS on ppc64 (a trivial mistake). + - Patch pymem.h: Add include guards to pymem.h. + + -- Stefano Rivera <stefanor@debian.org> Fri, 10 Jun 2016 00:15:08 +0200 + +pypy (5.3+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Upstream is using a new tag syntax for releases. + * Refresh patches. + * Update copyright. + * Re-instate noise patch, upstream is detecting TTYs again. + * Patch sandbox-mkdir: Return EPERM to sandboxed pypy when it tries to + create __pycache__ directories (Closes: #825702) + + -- Stefano Rivera <stefanor@debian.org> Thu, 09 Jun 2016 00:55:16 +0200 + +pypy (5.1.2+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh s390x-march. + * Drop other s390x patches, superseded upstream. + * Build with cpython on s390x, until we've got a JIT bootstrapped (builds + timing out, without it). (Closes: #823916) + * britney now supports versioned Provides, so generate them in pydist. + + -- Stefano Rivera <stefanor@debian.org> Tue, 17 May 2016 19:31:56 +0200 + +pypy (5.1.1+dfsg-4) unstable; urgency=medium + + * Remove stray print in s390x-cpuinfo. + + -- Stefano Rivera <stefanor@debian.org> Sat, 14 May 2016 09:14:01 +0200 + +pypy (5.1.1+dfsg-3) unstable; urgency=medium + + * Correct s390x-cpunifo rpython. + * Build with pypy on s390x, as there's now a JIT. + + -- Stefano Rivera <stefanor@debian.org> Fri, 13 May 2016 10:49:18 +0200 + +pypy (5.1.1+dfsg-2) unstable; urgency=medium + + * Cherry-pick upstream s390x patches, that should (amongst other things) get + us building on s390x, again. (Closes: #823916) + + -- Stefano Rivera <stefanor@debian.org> Thu, 12 May 2016 23:43:29 +0200 + +pypy (5.1.1+dfsg-1) unstable; urgency=medium + + * New upstream patch release. + * Don't target newer subarchitectures on s390x, Debian doesn't support them + (Closes: #823916). + * Build pypy with pypy again on ppc64 (now that it has bootstrapped). + + -- Stefano Rivera <stefanor@debian.org> Tue, 10 May 2016 16:47:34 +0200 + +pypy (5.1+dfsg-1) unstable; urgency=medium + + * New upstream minor version. + * Refresh patches. + * Drop patches, superseded upstream: noise, sandbox-unlink, armv8l, + vmkprof-kfreebsd, neon, kfreebsd-tests, hg-updates, ensure-valid-term + * Update copyright. + * The ctypes config_cache no longer exists, drop handling of it. + * Enable JIT on s390x (now that it is supported). + * Build with pypy on kfreebsd. + * Bump Standards-Version to 3.9.8, no changes needed. + + -- Stefano Rivera <stefanor@debian.org> Sat, 30 Apr 2016 12:25:30 +0200 + +pypy (5.0.1+dfsg-4) unstable; urgency=medium + + * Disable building with pypy on ppc64, again. It has a JIT, but pypy itself + is just too buggy on big-endian, to manage a translation. + * hg-updates: fix wait() on big endian (which should resolve the above + issue). + * kfreebsd-tests: Skip PTY tests that hang forever on kFreeBSD. + + -- Stefano Rivera <stefanor@debian.org> Mon, 04 Apr 2016 16:54:44 -0700 + +pypy (5.0.1+dfsg-3) unstable; urgency=medium + + * Re-enable pypy builds on ppc64. + * ARM JIT backend: Only execute NEON instructions on CPUs with NEON support. + * hg-updates: Apply patches staged in upstream's release branch. + + -- Stefano Rivera <stefanor@debian.org> Fri, 25 Mar 2016 21:42:35 -0500 + +pypy (5.0.1+dfsg-2) unstable; urgency=medium + + * Drop libunwind build-dep, not used any more, in PyPy 5.0. + * Port the recent vmprof changes to kFreeBSD. + * Make pypy-lib an architecture-dependant package, so that we remain + installable on buildds, after Architecture: all build has been installed. + * Temporarily build with python2.7 on ppc64, to re-bootstrap. + + -- Stefano Rivera <stefanor@debian.org> Tue, 22 Mar 2016 20:46:30 -0700 + +pypy (5.0.1+dfsg-1) unstable; urgency=medium + + * New upstream patch release. + * Recognise armv8l architecture, so we can build in an armhf chroot on + arm64. + * Build with pypy on architectures with a JITted PyPy. This is now necessary + on armhf, as we otherwise can't build a jitted pypy in a 3GB address + space (32bit kernel userspace). + + -- Stefano Rivera <stefanor@debian.org> Sun, 20 Mar 2016 08:58:13 -0400 + +pypy (5.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Drop soabi patch, superseded upstream. + * Bump copyright years. + * Bump Standards-Version to 3.9.7, no changes needed. + * Switch both Vcs fields to the same https URL. + * Patch: sandbox-unlink allow the sandbox REPL to start, by supporting + unlink() (and rejecting it). + + -- Stefano Rivera <stefanor@debian.org> Sun, 13 Mar 2016 23:57:01 -0700 + +pypy (4.0.1+dfsg-1) unstable; urgency=medium + + * New upstream patch release. + * Refresh patches, drop hg-updates. + * Update copyright. + * Enable continuation on PPC64 and MIPS64. + * Switch VCS-Browser to cgit, on https. + + -- Stefano Rivera <stefanor@debian.org> Fri, 20 Nov 2015 11:21:52 -0800 + +pypy (4.0.0+dfsg-2) unstable; urgency=medium + + * Set the magic tag (.pyc filename) to the soabi, for simplicity. We haven't + had any changes to bytecode in a while. Part of #803689. + * Expose SOABI in sysconfig for dh_pypy, so it can generate dependencies on + pypy-abi-XX. + * Provide pypy-abi-XX. + * Force a re-byte-compile, if 4.0.0+dfsg-1 was installed. + * Apply upstream post-release bug-fixes. + + -- Stefano Rivera <stefanor@debian.org> Mon, 02 Nov 2015 13:20:28 -0800 + +pypy (4.0.0+dfsg-1) unstable; urgency=medium + + * New upstream release. (2.6.x skips to 4.0.x to avoid confusion with + current cPython releases). + - Now supports JIT on 64bit PPC (both endians) + * Refresh patches. + * valgrind is now available on mips64el. + + -- Stefano Rivera <stefanor@debian.org> Thu, 29 Oct 2015 11:03:32 -0700 + +pypy (2.6.1+dfsg-2) unstable; urgency=medium + + * pypy-dev: Move headers back to their include dir. (Closes: #799485) + + -- Stefano Rivera <stefanor@debian.org> Mon, 21 Sep 2015 14:49:17 -0700 + +pypy (2.6.1+dfsg-1) unstable; urgency=medium + + * New upstream release. (Closes: #786738) + * Refresh patches. + * Drop patch, superseded upstream: vmprof-amd64. + * Update copyright. + * Generate Provides for pypy-cffi, like python-cffi 1.1.2 does. + * Properly support the binary-indep target. + * Drop grammar pickles from lib2to3, not needed. + * Multiarch ctypes_config_cache. + * Build-Depend on dh-python, for dh_python2. + + -- Stefano Rivera <stefanor@debian.org> Thu, 17 Sep 2015 12:17:03 -0400 + +pypy (2.6.0+dfsg-3) unstable; urgency=medium + + * Upload to unstable. + * Use the correct (pypy) marshal module, in the sandbox. (Closes: #785559) + * Install ansiramp in the sandbox, to fix --verbose on 256 colour terminals. + (Closes: #785554) + + -- Stefano Rivera <stefanor@debian.org> Fri, 03 Jul 2015 13:43:58 -0700 + +pypy (2.6.0+dfsg-2) experimental; urgency=medium + + * libunwind is only available on Linux amd64. + * Patch hg-updates: Pull bugfixes from the upstream 2.6 maintenance branch. + * Patch vmprof-amd64: vmprof uses x86_64 assembler, so it's only available + on x86_64. + * Patch ensure-valid-term: Squash some readline related test failures. + + -- Stefano Rivera <stefanor@debian.org> Sun, 14 Jun 2015 18:05:35 -0700 + +pypy (2.6.0+dfsg-1) experimental; urgency=medium + + * New upstream release. + * Refresh patches. + * Update copyright. + * cffi modules are now explicitly built, use the function in upstream's + package tool to do this. + * Build-Depends and Recommend: libunwind-dev, for vmprof on any-amd64 only. + (With alternative B-Ds for building on older releases) + + -- Stefano Rivera <stefanor@debian.org> Sun, 07 Jun 2015 21:00:34 -0700 + +pypy (2.5.1+dfsg-1) experimental; urgency=medium + + * New upstream release. + + Drop ensurepip eggs from source tarball. + * Refresh patches. + * Drop patches, superseded upstream: test_jit-ffi, no-shared-export-symbols, + and no-ssl3. + * Build new CFFI module: audioop. + * Apply ensurepip-wheels and ensurepip-disabled from the python2.7 package. + + -- Stefano Rivera <stefanor@debian.org> Fri, 27 Mar 2015 08:31:36 -0700 + +pypy (2.5.0+dfsg-2) experimental; urgency=medium + + * Add a Depends: pypy to pypy-lib-testsuite - it uses pypycompile on + install, now. (Closes: #777641) + * Patch no-shared-export-symbols: Export symbols required by C extensions, + again. + * Patch skip-test_multiprocessing: Disable test_multiprocessing, it leaves + stray processes on buildds (and generally seems buggy). + + -- Stefano Rivera <stefanor@debian.org> Wed, 11 Feb 2015 13:36:11 -0800 + +pypy (2.5.0+dfsg-1) experimental; urgency=medium + + * New upstream release. + * Refresh patches. + * Upload to experimental (due to jessie freeze). + * Drop patches, superseded upstream: sandbox-access, trackgcroot-new-ops, + ast-segfault, io-double-rewind, streamio-ext-seek, + ndarray-swapaxes-segfault. + * Update copyright. + * Remove buildd RAM check, most buildds are now sufficiently capable, or + pypy has been blacklisted on them. (Closes: #730216) + * Adjust multiarch patch to build gracefully under a non-multiarch Python. + * Rejig maintainer scripts. All byte-compilation now happens in the pypy + binary package, without triggers. + * Bump Standards-Version to 3.9.6, no changes needed. + * Build with --no-shared for now. Upstream now builds a shared library by + default, but we aren't ready for it. + * Use valgrind headers on arm64 and ppc64el, they both now support it. + * Patch no-ssl3: Allow testing without SSLv3 support. + * Patch test_jit-ffi: Fix a test failure in the JIT. + + -- Stefano Rivera <stefanor@debian.org> Mon, 09 Feb 2015 11:13:52 -0800 + +pypy (2.4.0+dfsg-3) unstable; urgency=medium + + * Switch to noawait triggers on /usr/lib/pypy/lib-python. Byte-compilation + isn't critical (Closes: #772863). + + -- Stefano Rivera <stefanor@debian.org> Sat, 20 Dec 2014 12:44:38 +0200 + +pypy (2.4.0+dfsg-2) unstable; urgency=medium + + * Patch trackgcroot-new-ops: Fix FTBFS with gcc 4.9.2, expect some new + operations. (Closes: #771137) + * Cherry-pick upstream patches for: + - ast-segfault: an AST compiler crash. + - io-double-rewind: EINVAL in raw io. + - streamio-ext-seek: Avoid an crash when fds are unexpectedly seeked. + - ndarray-swapaxes-segfault: Description: Fix a segfault when doing a noop + swapaxes. + + -- Stefano Rivera <stefanor@debian.org> Wed, 26 Nov 2014 22:51:30 -0800 + +pypy (2.4.0+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Update copyright. + * Refresh patches. + * Drop patches, superseded upstream: so_reuseport, sqlite-3.8.4. + * Patch fpic-archs: hppa and x32 require -fPIC (Closes: #760267). + * Don't attempt to build a JIT on x32. + * Patch: sandbox-access: Implement os.access, to get the sandbox working in + 2.4.0. + * Update kFreeBSD releases in patch plat-gnukfreebsd. + * Clean up local variables in patch plat-linux2-differences. + * Add lintian overrides for pypy-lib-testsuite, that were missed in the + stdlib break-up. + * First multi-arch steps: + - Patch: multiarch: Add multiarch tag to C extension file names. + - Build-Depend on dh-exec, to ease installing to multiarch paths. + - Move pypy-c-sandbox to a multiarch path. + - Fully qualify (cffi) extension filenames with multiarch tags. + + -- Stefano Rivera <stefanor@debian.org> Wed, 24 Sep 2014 00:51:03 -0700 + +pypy (2.3.1+dfsg-1) unstable; urgency=medium + + * New upstream point release. + - Includes gdbm module. + + Build-Depend on libgdbm-dev. + * Refresh patches. + * Drop patches, superseded upstream: _struct, gcc-4.9, unknown-cpu. + * Update copyright. + + -- Stefano Rivera <stefanor@debian.org> Tue, 10 Jun 2014 02:07:03 +0200 + +pypy (2.3+dfsg-3) unstable; urgency=medium + + * And similarly, avoid an assertion about VFP support, in an ARM specific + path, in the same function, fixing an FTBFS on armel. + + -- Stefano Rivera <stefanor@debian.org> Tue, 27 May 2014 01:55:01 +0200 + +pypy (2.3+dfsg-2) unstable; urgency=medium + + * Patch unknown-cpu: Fix an FTBFS on archs which don't have JIT support, due + to the use of a previously JIT-specific CPU detection function. + + -- Stefano Rivera <stefanor@debian.org> Sun, 25 May 2014 22:51:01 +0200 + +pypy (2.3+dfsg-1) unstable; urgency=medium + + * New upstream release. + * Refresh patches. + * Drop patches, superseded upstream: fpic-ppc, multiprocessing-typos, + site-builddir, webbrowser, pypirc-secure. + * PyPy.h isn't copied in at build time (unlike all the other headers) + * Patch: _struct - Like CPython, the built-in module should be "_struct", + imported. + * Patch: gcc-4.9 - Build on GCC 4.9 (Closes: #746892) + * Patch: sqlite-3.8.4 - Test suite fix for 3.8.4 compatibility. + + -- Stefano Rivera <stefanor@debian.org> Sun, 25 May 2014 16:51:43 +0200 + +pypy (2.2.1+dfsg-3) unstable; urgency=medium + + * fpic-ppc: Compile with -fPIC on PPC. + * Put exits in the right places in the maintainer scripts (Closes: #747177) + + -- Stefano Rivera <stefanor@debian.org> Tue, 06 May 2014 12:00:44 +0200 + +pypy (2.2.1+dfsg-2) unstable; urgency=medium + + * pep3147-stdlib: In compileall, only create __pycache__ directories when + we've found a .py file. (Closes: #742132) + * Bump Standards-Version to 3.9.5, no changes needed. + * Abort in postinst if PyPy won't run on the machine's CPU. Unfortunately, + the non-SSE2 build is currently broken. (Closes: #737018) + + -- Stefano Rivera <stefanor@debian.org> Sun, 04 May 2014 23:57:47 +0200 + +pypy (2.2.1+dfsg-1) unstable; urgency=low + + * New upstream bugfix release. + - Fixes a ref-counting bug in socket. + * Drop build-dep on execstack. Doesn't appear to be necessary any more (and + doesn't work on all achitectures). + + -- Stefano Rivera <stefanor@debian.org> Wed, 27 Nov 2013 11:41:10 -0800 + +pypy (2.2.0+dfsg-1) unstable; urgency=low + + * New upstream release. + * Refresh patches. + * Add new upstream copyright holders to debian/copyright. + * Drop test_bootstrap-path patch, applied upstream. + * pypy{clean,compile}: Perform a logical and instead of or, when -p and a + directory are specified (matching pycompile semantics). + * Disable JIT on armel. ARMv5 isn't supported. + * Drop build-dep on valgrind on armel. It's no longer a supported platform + for valgrind (Closes: #729141). + * Bump debian/compat to 9, for executable dh_install scripts. + * Split the stdlib test suite into a new binary package: pypy-lib-testsuite. + * Split the _tkinter module into a new binary package: pypy-tk. + * Run pypyclean on the stdlib before upgrading. + + -- Stefano Rivera <stefanor@debian.org> Sat, 16 Nov 2013 23:05:19 +0000 + +pypy (2.1.0+dfsg-3) unstable; urgency=low + + * The wildcard for ARM is any-arm. + * Build the syslog cffi module in lib_pypy. + + -- Stefano Rivera <stefanor@debian.org> Thu, 12 Sep 2013 10:33:55 +0200 + +pypy (2.1.0+dfsg-2) unstable; urgency=low + + * Disable continuation on all architectures except x86 and ARM (requires + porting). + + -- Stefano Rivera <stefanor@debian.org> Tue, 10 Sep 2013 17:10:34 +0200 + +pypy (2.1.0+dfsg-1) unstable; urgency=low + + * New upstream release. + - The ARM JIT is now supported and enabled. + - Several bug fixes and performance improvements. + * Refresh patches. + * Drop patches, applied/superseded upstream: + - shared-ffi + - distutils-cflags + - gnukfreebsd + - l2-cache-detection + * Add pypycompile and pypyclean scripts for dh_pypy packages. + - Use for byte-compiling the stdlib. + * Build cffi module for tkinter. + * Patch: test_bootstrap-path - avoid a spurious test failure when TMPDIR is + set to inside the source tree. + * Add /usr/lib/pypy/runtime.d, so that module re-byte-compilation can be + triggered on minor version updates. As we only have one pypy version + installed concurrently, only .rtupdate is supported. + + -- Stefano Rivera <stefanor@debian.org> Sun, 01 Sep 2013 09:35:58 +0200 + +pypy (2.0.2+dfsg-4) unstable; urgency=low + + * Relax the RAM check on kfreebsd-amd64, which currently has 3GB buildds. + + -- Stefano Rivera <stefanor@debian.org> Fri, 28 Jun 2013 01:12:07 +0200 + +pypy (2.0.2+dfsg-3) unstable; urgency=low + + * Let dh_usrlocal handle the empty directories in /usr/local, and create + them with dh_installdirs. (Closes: #713958) + * Use a more conservative RAM requirement on x86. (Closes: #713787) + + -- Stefano Rivera <stefanor@debian.org> Mon, 24 Jun 2013 18:44:22 +0200 + +pypy (2.0.2+dfsg-2) unstable; urgency=low + + * Create empty directories in /usr/local + * Fix a bug in l2-cache-detection on sparc, causing FTBFS due to the + interpreter aborting on startup. + + -- Stefano Rivera <stefanor@debian.org> Sun, 23 Jun 2013 23:07:54 +0200 + +pypy (2.0.2+dfsg-1) unstable; urgency=low + + * New upstream bug-fix release. + - mainly fatal errors or crashes in the stdlib, and a JIT bug around + foreign functions calls in multi-threaded programs. + * Refresh patches. + * Drop docs-version patch. + * Clean up after cffi tests. + * so_reuseport: Avoid test failures on machines without SO_REUSEPORT + support. + * gnukfreebsd: Add the GNUkFreebsd platform descriptions that were + accidentally deleted upstream. + * Drop B-D on python-greenlet, unneeded. + * l2-cache-detection: Add L2 cache size detection code for non-x86 + architectures. + * Bullet pypy's description to make it more readable. Thanks Jonas + Smedegaard. (Closes: #709091) + * Disable ARM JIT until declared stable by upstream. + + -- Stefano Rivera <stefanor@debian.org> Fri, 24 May 2013 01:08:28 +0200 + +pypy (2.0.0+dfsg-1) unstable; urgency=low + + * New upstream release (Closes: #698524) + * Upload to unstable. + * Refresh patches. + * Update copyright. + * Drop patches, applied/superseded upstream: + - test_telnetlib-deadlock + - test_subprocess + - ignore-paddd + - issue670664 + - fpic-archs + - gnukfreebsd-link-rt + * Patches: + - pep3147-core: Drop validation of .py filenames. This is behaviour is now + expected in tests. + - pep3147-stdlib: Use cached_from_source in added tests. + - distutils-install-layout: Let pydoc handle dist-packages the same as + site-packages. + - shared-ffi: Don't static link with libffi. + - docs-version: Update docs versions for 2.0 final. + - distutils-cflags: Build cffi modules when CFLAGS contains a space. + * Export TERM=dumb for lib-python tests (if not already in the environment). + Required by test_readline. + * Build-Depend on procps, for test_signal. + * Build-Depend on netbase, for test_socket. + * Build-Depend on libsqlite3-dev, _sqlite3 (which now uses CFFI). + * Build with JIT on ARM. + * Use valgrind headers on mips, now that they are available there. + * Update paths for the rpython-pypy split. + * Rename python-pypy.translator.sandbox -> python-pypy.sandbox, following + the pypy-rpython split. + * cffi is now bundled in the stdlib: + - Move _cffi shared libraries out of __pycache__, and put them in the + pypy binary package. + - Provides pypy-cffi. + * Byte-compile lib_pypy, too. + * Bumped Standards-Version to 3.9.4, no changes needed. + * Build-Depend on python-greenlet, enabling stackless builds on, sparc and + sparc64, now that it's available there. Blacklist sh4. + * Use valgrind headers on mipsel, now that they are available. + + -- Stefano Rivera <stefanor@debian.org> Fri, 10 May 2013 20:15:26 +0200 + +pypy (1.9+dfsg-2) experimental; urgency=low + + * Redirect translation output to stdout. Buildds don't watch stderr for + checking timeouts. + * Do enforce the RAM check on Ubuntu, for non-primary-archive builds. + + -- Stefano Rivera <stefanor@debian.org> Thu, 12 Jul 2012 21:51:31 -0600 + +pypy (1.9+dfsg-1) experimental; urgency=low + + * New upstream release. + * Refresh patches. + * Update patches for the removal of lib-python/modified-2.7. + * Drop patches, applied upstream: + - ignore-shufps + - pypy-help + * Apply patches applied in python2.7 2.7.3~rc2-2: + - pypirc-secure: CVE-2011-4944, distutils creates ~/.pypirc insecurely. + - xdg-gvfs-open: Use xdg-open/gvfs-open in webbrowser. + * Moved RAM check and translation options generation into shell scripts in + debian/scripts. They were getting unwieldy in debian/rules. + * Updated machine-readable copyright Format to 1.0. + - Removed mentions of lib-python/modified-2.7. + * Bumped Standards-Version to 3.9.3, no changes needed. + * Use valgrind headers on ppc64 and s390x, now that they are available + there. + * Don't enforce the RAM check on Ubuntu. + * Patch ignore-paddd: Update ignored operations in trackinggcroot, as our + gcc4.7 produces paddd on i386. + + -- Stefano Rivera <stefanor@debian.org> Tue, 19 Jun 2012 14:42:45 +0200 + +pypy (1.8+dfsg-2) experimental; urgency=low + + * Build the sandboxed PyPy with -O2, not -O3 or -Ojit. Sandboxed pypy can't + be built with profile-guided optimisations. + - Use generational gc, now that we aren't using the JIT. + * Patch gnukfreebsd-link-rt: Link with -lrt on GNU/kFreeBSD. + + -- Stefano Rivera <stefanor@debian.org> Sat, 18 Feb 2012 09:28:14 +0200 + +pypy (1.8+dfsg-1) experimental; urgency=low + + * New upstream release. + * Refresh patches. + * Drop patches, applied upstream: + - compiler-flags + - docs-version + - hardcoded-nursery-size + - test_ssl-errno0 + - test_unix_socket_connect + - big-endian-test_codecs + - big-endian-clibffi + - kfreebsd-glibc + - kfreebsd-test-hangs + * Build manpage from upstream docs. + * Patch doc-envvars: Update manpage, to include environment variables. + * Patch fpic-archs: Build shared libraries with -fPIC on arm and mips. + * Patch pypy-help: Make --help not crash. + * Update copyright contributors and years. + * pep3147-core: Assert the absence of nulls (assert_str0) on the pathnames + provided in make_compiled_pathname and make_source_pathname. + * Build sandboxed pypy: python-pypy.translator.sandbox + - Patch ignore-shufps: Fix build failure. + - Patch sandbox-bin: Change pypy_interact's --help to name it pypy-sandbox + - Patch sandbox-dependencies: Reduce the amount of pypy source that + pypy-sandobx needs. + - Patch sandbox-manpage: pypy-sandbox manpage. + - B-D on python (>= 2.6.6-11~) for dh_python2 with .pyinstall support. + * Run translations and tests with unbuffered I/O, to combat build timeouts. + - Lower build-time RAM requirement to 1.4G. + + -- Stefano Rivera <stefanor@debian.org> Tue, 14 Feb 2012 15:10:21 +0200 + +pypy (1.7+dfsg-6) experimental; urgency=low + + * Restrict architectures to linux-any and kfreebsd-any. Not yet ported to + hurd. + * Include swap in the RAM calculation on s390*. + * Forwarded many patches upstream. + * Drop user-prefix patch, and adjust distutils-install-layout patch and + package install layout to match. + * Update manpage, to include environment variables. + + -- Stefano Rivera <stefanor@debian.org> Mon, 06 Feb 2012 16:50:16 +0200 + +pypy (1.7+dfsg-5) experimental; urgency=low + + * Revert memory requirement bump. Timeout was unrelated. + * kfreebsd: + - Patch plat-gnkfreebsd: Add gnukfreebsd9 platform. + - Patch kfreebsd-glibc: Adjust platform checks to be aware of the + difference between gnkfreebsd and freebsd. + - Patch kfreebsd-test-hangs: Skip tests that deadlock. + + -- Stefano Rivera <stefanor@debian.org> Sun, 22 Jan 2012 02:20:06 +0200 + +pypy (1.7+dfsg-4) experimental; urgency=low + + * Really upload to experimental. + * Patches: + - big-endian-test_codecs: Add big endian test case to + test_utf16_encode_decode. + - big-endian-clibffi: Correctly handle ushort, ubyte, byte, and char types + in clibffi on big endian. + - kfreebsd-glibc: Don't attempt to link to libcompat. Link with libdl. + * Bump memory requirement to 2100 MiB (32-bit), to avoid timeout on + caballero (4G, ia64). + * kfreebsd: + - Enable JIT. + - Augment, rather than replace, compiler flags from the environment. + * Don't fail without execstack. + + -- Stefano Rivera <stefanor@debian.org> Mon, 16 Jan 2012 01:10:27 +0200 + +pypy (1.7+dfsg-3) experimental; urgency=low + + * Add pypy.1 manpage. + * Don't BD on greenlet on architectures which it's known not to be ported + to. + * Don't BD on execstack on non-linux. + * Suppress stdlib bytecompilation output. + * Avoid timeout during build, by running make ourselves. PyPy buffers all + make output, until it completes. + + -- Stefano Rivera <stefanor@debian.org> Sat, 14 Jan 2012 17:48:30 +0200 + +pypy (1.7+dfsg-2) experimental; urgency=low + + * Fix architecture dependant only builds. + * Remove spurious copyright newline. + + -- Stefano Rivera <stefanor@debian.org> Mon, 09 Jan 2012 15:52:29 +0200 + +pypy (1.7+dfsg-1) experimental; urgency=low + + * Re-introduce package in experimental. + * New upstream version. + * New packaging: + - Drop rpython development bits from pypy-dev. + - Drop pypy-stackless: Now part of the default configuration. + * Incorporate all useful stdlib patches from python2.7 + * PEP3147 support + + -- Stefano Rivera <stefanor@debian.org> Mon, 09 Jan 2012 13:32:00 +0200 + +pypy (1.0.0-svn55443-1) unstable; urgency=low + + * New upstream snapshot. + - Doesn't hardcode libc6.so.6; fixes FTBFS on ia64 (Closes: #440331) + * Don't build pypy-stackless on platforms the greenlet module has not been + ported to. (Closes: #475868) + * Run tests after build on request by upstream. + + -- Chris Lamb <chris@chris-lamb.co.uk> Sat, 31 May 2008 18:50:58 +0100 + +pypy (1.0.0-svn51288-1) unstable; urgency=low + + * New upstream release. (Closes: #459118) + * New maintainer. (Closes: #455734) + * Bump debhelper compatibility version. + * Refresh and tidy package descriptions. + * Tidy debian/configure.py, debian/rules, Lintian overrides. + * Add pypy(1), py.py(1), pypy-translate(1), jscompile(1) and + pypy-stackless(1) manpages. + * Add get-orig-source target in debian/rules. + * Use quilt to manage Thiemo Seufer's MIPS and MIPSEL patch. + * Use PyPy-specific temporary directory prefixes. (Closes: #452851) + + -- Chris Lamb <chris@chris-lamb.co.uk> Tue, 05 Feb 2008 13:26:11 +0000 + +pypy (1.0.0-svn51091-1) unstable; urgency=low + + * New upstream svn snapshot, fixing 64bit build (closes: #462008) + + -- Alexandre Fayolle <afayolle@debian.org> Mon, 28 Jan 2008 09:40:48 +0100 + +pypy (1.0.0-svn50146-2) unstable; urgency=low + + * Added missing build dependency on zlib1g-dev (closes: #460696) + + -- Alexandre Fayolle <afayolle@debian.org> Mon, 14 Jan 2008 18:15:32 +0100 + +pypy (1.0.0-svn50146-1) unstable; urgency=low + + * Acknowledge NMU (closes: #431197) + * Apply Yaroslav Hachenko's patch to use more recent svn snapshot, and + enable threading support (closes: #458953) + * Apply Thiemo Seufer's patch to enable mips and mipsel support + (closes: #459520) + * Added build dep on procps (closes: #444652) + * Bumped up standards to 3.7.3 + * Note that pypy is currently under ITA: I lack time to properly follow + upstream developments, and all patches and NMU's are welcome. If you'd + like to adopt pypy, just send me an email to notify me and jump for + it. Offers to co-maintain are welcome too. Thanks. + + -- Alexandre Fayolle <afayolle@debian.org> Mon, 14 Jan 2008 09:46:11 +0100 + +pypy (1.0.0-3.1) unstable; urgency=low + + * Non-maintainer upload. + * Disable build of upstream removed logic object space. Remove pypy-logic + package. (closes: #442060) + * Move build output away from /tmp. (closes: #452850) + * Move compile step out of the main translation. This reduces the memory + footprint by one third. + + -- Bastian Blank <waldi@debian.org> Tue, 27 Nov 2007 12:08:06 +0000 + +pypy (1.0.0-3) unstable; urgency=low + + * Use more conservative options for platforms for which support is uncertain + * Enable check of available memory during configuration + * Packages are once again arch: any + + -- Alexandre.Fayolle <afayolle@debian.org> Wed, 18 Jul 2007 12:57:28 +0200 + +pypy (1.0.0-2) unstable; urgency=low + + * Updated debian/copyright (Closes: #423603) + * Removed support for archs not supported upstream (Closes: #426265, #423725) + * Adds missing conftest.py (Closes: #428539) + + -- Alexandre.Fayolle <afayolle@debian.org> Thu, 28 Jun 2007 12:25:53 +0200 + +pypy (1.0.0-1) unstable; urgency=low + + * Fixed debian/copyright and reupload (Closes: #326892) + * New upstream release + + -- Alexandre Fayolle <afayolle@debian.org> Fri, 13 Apr 2007 09:33:09 +0200 + +pypy (0.99.0-1) experimental; urgency=low + + * Initial release (Closes: #326892) + + -- Alexandre Fayolle <afayolle@debian.org> Mon, 19 Feb 2007 10:47:33 +0100 diff --git a/debian/clean b/debian/clean new file mode 100755 index 0000000..f624a72 --- /dev/null +++ b/debian/clean @@ -0,0 +1,56 @@ +#!/bin/sh +set -eu + +# Temporary build directories +rm -rf build-* + +# Caches +rm -rf rpython/_cache + +# Created by our PEP3147 patch: +echo pypy/doc/config/objspace.magic_tag.txt + +# Build artifacts +find . -name '*.pyc' +find . -name __pycache__ | xargs rm -rf +echo pypy/goal/pypy-c pypy/goal/libpypy-c.so +echo rpython/rlib/rvmprof/src/shared/libbacktrace/config.h +find rpython/translator/c pypy/module/cpyext/test -name '*.o' +find include '(' -name '*.h' -o -name '*.inl' ')' \ + -a ! -name 'PyPy.h' +find lib_pypy '(' -name '*.so' -o -name '*.o' -o -name '*.c' ')' \ + -a ! -name '_ctypes_test.c' -a ! -name '_testcapimodule.c' \ + -a ! -path 'lib_pypy/_cffi_ssl/_cffi_src/hazmat_src/*' \ + -a ! -path 'lib_pypy/_cffi_ssl/_cffi_src/openssl/src/*' \ + -a ! -path 'lib_pypy/_cffi_ssl/openssl/src/*' + +# Tests +echo pypy/test.db +find extra_tests/ -name '*.o' +find lib-python/2.7/lib2to3/ -name '*Grammar*.pickle' +find lib-python/2.7/test/data/ -type f -a ! -name README + +# Failures +echo core +echo pypy/core +rm -rf .cache + +# Docs +rm -rf pypy/doc/_build + +find pypy/doc/config -name 'commandline*.rst' \ + -o -name 'objspace*.rst' \ + -o -name 'translation*.rst' +find pypy/doc/config \( \ + -name 'objspace*.txt' \ + -o -name 'translation*.txt' \ + \) -size 0 \ + ! -name 'objspace.honor__builtins__.txt' \ + ! -name 'objspace.std.sharesmallstr.txt' \ + ! -name 'objspace.usemodules._vmprof.txt' \ + ! -name 'translation.backendopt.really_remove_asserts.txt' \ + ! -name 'translation.icon.txt' \ + ! -name 'translation.noprofopt.txt' + +# Generated in override_dh_installdeb +echo debian/pypy.preinst debian/pypy.postinst diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..14bb9cf --- /dev/null +++ b/debian/control @@ -0,0 +1,118 @@ +Source: pypy +Section: python +Priority: optional +Maintainer: Stefano Rivera <stefanor@debian.org> +Build-Depends: + debhelper (>= 9.20141010~), + dh-exec, + dpkg-dev (>= 1.17.14~), + libbz2-dev, + libexpat1-dev, + libffi-dev, + libgdbm-dev, + libncurses-dev, + libsqlite3-dev, + libssl-dev, + netbase, + pkg-config, + procps, + pypy [any-amd64 any-i386 armhf ppc64 ppc64el s390x] <!stage1>, + python (>= 2.6.6-11~), + python-docutils, + python-pycparser, + python-sphinx (>= 1.0.7+dfsg), + python2.7-dev, + tcl-dev, + tk-dev, + valgrind [amd64 arm64 armhf i386 mips mips64el mipsel powerpc ppc64 ppc64el s390x], + zlib1g-dev +Build-Depends-Indep: graphviz +Standards-Version: 4.4.1 +Homepage: http://pypy.org/ +Vcs-Git: https://salsa.debian.org/debian/pypy.git +Vcs-Browser: https://salsa.debian.org/debian/pypy +Rules-Requires-Root: no + +Package: pypy +Architecture: any +Depends: pypy-lib (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Breaks: + pypy-backports.functools-lru-cache (<< 1.5-3~), + pypy-dev (<< ${source:Version}) +Provides: ${pypy-abi} +Suggests: pypy-doc, pypy-tk (= ${binary:Version}) +Description: fast alternative implementation of Python - PyPy interpreter + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). It has several advantages and distinct features: + * Speed: thanks to its Just-in-Time compiler (on x86), Python programs often + run faster on PyPy. + * Memory usage: large, memory-hungry Python programs might end up taking less + space than they do in CPython. + * Compatibility: PyPy is highly compatible with existing Python code. + It supports ctypes and can run popular Python libraries like twisted and + django. + * Stackless: PyPy supports stackless mode on most platforms, providing + micro-threads for massive concurrency. + . + This package contains the PyPy interpreter. + +Package: pypy-tk +Architecture: any +Depends: pypy (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Replaces: pypy-lib (<< 2.2) +Description: Tkinter module for PyPy (an alternative Python interpreter) + A module for writing portable GUI applications with PyPy using Tk. + Also known as Tkinter. + . + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). + +Package: pypy-lib +Architecture: any +Multi-Arch: same +Depends: ${misc:Depends} +Provides: ${cffi:Provides} +Description: standard library for PyPy (an alternative Python interpreter) + The PyPy standard library. This is a combination of modules, copied directly + from cpython, modified cpython modules, and modules entirely re-implemented + (usually in pure Python, where they are C extensions in cpython). + . + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). + +Package: pypy-lib-testsuite +Architecture: all +Depends: pypy, pypy-lib (>= ${source:Version}), ${misc:Depends} +Replaces: pypy-lib (<< 2.2) +Description: standard library test suite for PyPy (an alternative Python interpreter) + The complete test suite for the PyPy standard library. + . + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). + +Package: pypy-doc +Section: doc +Architecture: all +Depends: ${misc:Depends}, ${sphinxdoc:Depends} +Suggests: python-doc +Description: developer Documentation for PyPy (an alternative Python interpreter) + The Developer documentation for PyPy. This mostly covers the internals of + PyPy, and development of PyPy itself. + . + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). + +Package: pypy-dev +Architecture: all +Depends: pypy (>= ${source:Version}), ${misc:Depends} +Provides: libpypy-dev +Description: header files for PyPy (an alternative Python interpreter) + Header files for compiling cpython C extension modules for use with PyPy. + Note that pure Python modules will probably perform better. + . + PyPy supports a subset of cpython's C API through its CPyExt subsystem. + . + Also included is PyPy.h, for embedding the PyPy interpreter. + . + PyPy is a fast, compliant alternative implementation of the Python language + (2.7). diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5d91c6c --- /dev/null +++ b/debian/copyright @@ -0,0 +1,1193 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: PyPy +Source: https://bitbucket.org/pypy/pypy/ +Comment: + Some files included in the upstream tarball are non-free. + The following files have been removed for the Debian version of this package: + * lib-python/2.7/distutils/command/*.exe: Unnecessary Windows binaries + * lib-python/2.7/ensurepip/_bundled: Bundled libraries for ensurepip, which we + disable + +Files: * +Copyright: 2003-2019, + Armin Rigo + Maciej Fijalkowski + Carl Friedrich Bolz-Tereick + Matti Picus + Antonio Cuni + Amaury Forgeot d'Arc + Ronan Lamy + Samuele Pedroni + Alex Gaynor + Philip Jenvey + Richard Plangger + Brian Kearns + Michael Hudson-Doyle + Manuel Jacob + David Schneider + Holger Krekel + Christian Tismer + Hakan Ardo + Benjamin Peterson + Anders Chrigstrom + Wim Lavrijsen + Eric van Riet Paap + Remi Meier + Richard Emslie + Alexander Schremmer + Dan Villiom Podlaski Christiansen + Lukas Diekmann + Sven Hager + Anders Lehmann + Aurelien Campeas + Niklaus Haldimann + Camillo Bruni + Laura Creighton + Toon Verwaest + Leonardo Santagada + Seo Sanghyeon + Romain Guillebert + Ronny Pfannschmidt + Justin Peel + Raffael Tfirst + David Edelsohn + Anders Hammarquist + Jakub Gustak + Gregor Wegberg + Guido Wesdorp + Lawrence Oluyede + Bartosz Skowron + Daniel Roberts + Adrien Di Mascio + Niko Matsakis + Alexander Hesse + Ludovic Aubry + stian + Jacob Hallen + Jason Creighton + Mark Young + Alex Martelli + Andrew Lawrence + Spenser Bauman + Michal Bendowski + Jan de Mooij + Tyler Wade + Vincent Legoll + Michael Foord + Stephan Diehl + Stefano Rivera + Jean-Paul Calderone + Stefan Schwarzer + Tomek Meka + Valentino Volonghi + Stefan Beyer + Patrick Maupin + Devin Jeanpierre + Bob Ippolito + Bruno Gola + David Malcolm + Squeaky + Edd Barrett + Timo Paulssen + Laurence Tratt + Marius Gedminas + Nicolas Truessel + Alexandre Fayolle + Simon Burton + Martin Matusiak + Wenzhu Man + Konstantin Lopuhin + John Witulski + Jeremy Thurgood + Greg Price + Ivan Sichmann Freitas + Dario Bertini + Mark Pearse + Simon Cross + Tobias Pape + Andreas Stührk + Jean-Philippe St. Pierre + Guido van Rossum + Pavel Vinogradov + William Leslie + Paweł Piotr Przeradowski + Stian Andreassen + marky1991 + Ilya Osadchiy + Tobias Oberstein + Paul deGrandis + Boris Feigin + Taavi Burns + Adrian Kuhn + tav + Georg Brandl + Joannah Nanjekye + Julian Berman + Bert Freudenberg + Wanja Saatkamp + Mike Blume + Gerald Klix + Oscar Nierstrasz + Rami Chowdhury + Stefan H. Muller + Dodan Mihai + Tim Felgentreff + Eugene Oden + Colin Valliant + Jeff Terrace + Henry Mason + Vasily Kuznetsov + Preston Timmons + David Ripton + Pieter Zieschang + Dusty Phillips + Lukas Renggli + Guenter Jantzen + Jasper Schulz + Ned Batchelder + Amit Regmi + Anton Gulenko + Sergey Matyunin + Andrew Chambers + Łukasz Langa + Nicolas Chauvat + Andrew Durdin + Ben Young + Michael Schneider + Yusuke Tsutsumi + Nicholas Riley + Jason Chu + Igor Trindade Oliveira + Yichao Yu + Michael Twomey + Rocco Moretti + Gintautas Miliauskas + Lucian Branescu Mihaila + Mariano Anaya + anatoly techtonik + Karl Bartel + Gabriel Lavoie + Jared Grubb + Alecsandru Patrascu + Olivier Dormond + Wouter van Heyst + Sebastian Pawluś + Brian Dorsey + Victor Stinner + Andrews Medina + Aaron Iles + Toby Watson + Lin Cheng + Daniel Patrick + Stuart Williams + Antoine Pitrou + Christian Hudon + Justas Sadzevicius + Neil Shepperd + Michael Cheng + Mikael Schönenberg + Stanislaw Halik + Mihnea Saracin + Matt Jackson + Berkin Ilbeyi + Gasper Zejn + Faye Zhao + Elmo Mäntynen + Anders Qvist + Corbin Simpson + Chirag Jadwani + Pauli Virtanen + Jonathan David Riehl + Beatrice During + Alex Perry + Robert Zaremba + Alan McIntyre + Alexander Sedov + David C Ellis + Vaibhav Sood + Reuben Cummings + Attila Gobi + Floris Bruynooghe + Christopher Pope + Tristan Arthur + Christian Tismer + Dan Stromberg + Carl Meyer + Florin Papa + Arianna Avanzini + Jens-Uwe Mager + Valentina Mukhamedzhanova + Stefano Parmesan + touilleMan + Anthony Sottile + Marc Abramowitz + Arjun Naik + Aaron Gallagher + Alexis Daboville + Karl Ramm + Lukas Vacek + Omer Katz + Jacek Generowicz + Tomasz Dziopa + Sylvain Thenault + Jakub Stasiak + Andrew Dalke + Alejandro J. Cura + Vladimir Kryachko + Gabriel + Thomas Hisch + Mark Williams + Kunal Grover + Nathan Taylor + Barry Hart + Travis Francis Athougies + Yasir Suhail + Sergey Kishchenko + Martin Blais + Lutz Paelike + Ian Foote + Philipp Rustemeuer + Logan Chien + Catalin Gabriel Manciu + Jacob Oscarson + Ryan Gonzalez + Antoine Dupre + Kristjan Valur Jonsson + Lucio Torre + Richard Lancaster + Dan Buch + Lene Wagner + Tomo Cocoa + Miro Hrončok + David Lievens + Neil Blakey-Milner + Henrik Vendelbo + Lars Wassermann + Ignas Mikalajunas + Christoph Gerum + Miguel de Val Borro + Artur Lisiecki + joserubiovidales@gmail.com + afteryu + Toni Mattis + Vincent Michel + Laurens Van Houtven + Bobby Impollonia + Roberto De Ioris + Yannick Jadoul + Jeong YunWon + Christopher Armstrong + Aaron Tubbs + Vasantha Ganesh K + Jason Michalski + Radu Ciorba + Markus Holtermann + Andrew Thompson + Yusei Tahara + Ruochen Huang + Fabio Niephaus + Akira Li + Gustavo Niemeyer + joachim-ballmann@bitbucket.org + Nate Bragg + Lucas Stadler + roberto@goyle + Carl Bordum Hansen + Matt Bogosian + Yury V. Zaytsev + florinpapa + Anders Sigfridsson + Nikolay Zinov + rafalgalczynski@gmail.com + Joshua Gilbert + Anna Katrina Dominguez + Kim Jin Su + Amber Brown + Andrew Stepanov + Rafał Gałczyński + Ben Darnell + Juan Francisco Cantero Hurtado + Godefroid Chappelle + Paul Ganssle + Michal Kuffa + Stephan Busemann + Bystroushaak + Dan Colish + Ram Rachum + timo + Volodymyr Vladymyrov + Daniel Neuhäuser + Flavio Percoco + halgari + Jim Baker + Chris Lambacher + John Aldis + coolbutuseless@gmail.com + Yasen Kiprov + Mike Bayer + Rodrigo Araújo + Daniil Yarancev + Min RK + OlivierBlanvillain + dakarpov@gmail.com + Jonas Pfannschmidt + Zearin + Johan Forsberg + Andrey Churin + Dan Crosta + reubano@gmail.com + Ryan Hileman + Stanisław Halik + DeVerne Jones + Julien Phalip + Roman Podoliaka + Steve Papanik + Eli Stevens + Boglarka Vezer + gabrielg@ec2-54-146-239-158.compute-1.amazonaws.com + PavloKapyshin + Hervé Beraud + Tomer Chachamu + Christopher Groskopf + Asmo Soinio + Antony Lee + Jim Hunziker + shoma hosaka + Buck Golemon + whitequark + Iraklis D. + JohnDoe + yrttyr + Michael Chermside + Anna Ravencroft + remarkablerocket + Ivan + Petre Vijiac + Berker Peksag + Christian Muirhead + soareschen + Matthew Miller + Jesdi + Konrad Delong + Dinu Gherman + pizi + Tomáš Pružina + James Robert + Armin Ronacher + Diana Popa + Mads Kiilerich + Brett Cannon + Caleb Hattingh + aliceinwire + Zooko Wilcox-O Hearn + James Lan + jiaaro + Evgenii Gorinov + Markus Unterwaditzer + Kristoffer Kleine + Graham Markall + paugier + Dan Loewenherz + werat + Filip Salomonsson + Niclas Olofsson + Zsolt Cserna + Chris Pressey + Tobias Diaz + Paul Graydon + mkuffa + Nikolaos-Digenis Karagiannis + Kurt Griffiths + Ben Mather + Donald Stufft + Dan Sanders + Jason Madden + Yaroslav Fedevych + Even Wiik Thomassen + m@funkyhat.org + Stefan Marr + . + Heinrich-Heine University, Germany + Open End AB (formerly AB Strakt), Sweden + merlinux GmbH, Germany + tismerysoft GmbH, Germany + Logilab Paris, France + DFKI GmbH, Germany + Impara, Germany + Change Maker, Sweden + University of California Berkeley, USA + Google Inc. + King's College London +License: Expat + +Files: lib_pypy/_cffi_ssl/cryptography/* +Copyright: 2013-2017, The cryptography developers <cryptography-dev@python.org> +License: BSD-3-generic or Apache-2.0 + +Files: lib_pypy/_cffi_ssl/osx-roots.diff +Copyright: 2009 Apple Inc. +License: BSD-2 + +Files: lib_pypy/cffi/_pycparser/* +Copyright: 2008-2015, Eli Bendersky <eliben@gmail.com> +License: BSD-3-Bendersky + +Files: lib_pypy/cffi/_pycparser/ply/* +Copyright: 2001-2017, David M. Beazley (Dabeaz LLC) <dave@dabeaz.com> +License: BSD-3-Dabeaz + +Files: lib_pypy/_tkinter/* +Copyright: The Regents of the University of California + Sun Microsystems, Inc., + Scriptics Corporation, + and other parties +License: Tcl + +Files: lib-python/2.7/* +Copyright: 2008, Armin Ronacher + 2004-2005, Elemental Security, Inc. + 1999-2008, Fredrik Lundh + 2006, Georg Brandl + 2006-2008, Google, Inc. + 2005-2010, Gregory P. Smith <greg@krypto.org> + 2005, Ian Bicking and contributors to Paste + 2005-2006, Martin von Löwis + 2003-2005, Peter Astrand <astrand@lysator.liu.se> + 2001-2011, Python Software Foundation +License: Python-2.0 + +Files: lib_pypy/_sqlite3.py + lib_pypy/_sqlite3_build.py + lib-python/2.7/sqlite3/* +Copyright: 2007-2008, Gerhard Häring <gh@ghaering.de> +License: Zlib + +Files: lib-python/2.7/asynchat.py + lib-python/2.7/asyncore.py +Copyright: 1996, Sam Rushing +License: MIT-Rushing + +Files: lib-python/2.7/bsddb/__init__.py + lib-python/2.7/bsddb/db.py +Copyright: 1999-2001, Digital Creations, Fredericksburg + Andrew Kuchling +License: BSD-3-DigitalCreations + +Files: lib-python/2.7/bsddb/dbobj.py + lib-python/2.7/bsddb/dbshelve.py + lib-python/2.7/bsddb/dbtables.py + lib-python/2.7/bsddb/dbutils.py + lib-python/2.7/bsddb/test/test_dbtables.py +Copyright: 1997-2001, Total Control Software + 2000-2001, Autonomous Zone Industries + 2002, Gregory P. Smith +License: bsddb + This is free software. You may use this software for any purpose including + modification/redistribution, so long as this header remains intact and that + you do not claim any rights of ownership or authorship of this software. This + software has been tested, but no warranty is expressed or implied. + +Files: lib-python/2.7/compiler/transformer.py +Copyright: 1997-1998, Greg Stein +License: BSD-2-generic + +Files: lib-python/2.7/Cookie.py +Copyright: 2000, Timothy O'Malley <timo@alum.mit.edu> +License: MIT-OMalley + +Files: lib-python/2.7/lib-tk/turtle.py +Copyright: 2006-2010, Gregor Lingl +License: Zlib + +Files: lib-python/2.7/optparse.py +Copyright: 2001-2006, Gregory P. Ward. + 2002-2006, Python Software Foundation. +License: BSD-3-generic + +Files: lib-python/2.7/profile.py + lib-python/2.7/pstats.py +Copyright: Disney Enterprises, Inc. +License: Apache-2.0 + +Files: lib-python/2.7/logging/* + lib-python/2.7/test/test_logging.py +Copyright: 2001-2014 by Vinay Sajip +License: MIT-Sajip + +Files: lib-python/2.7/multiprocessing/* +Copyright: 2006-2008, R Oudkerk +License: BSD-3-generic + +Files: lib-python/2.7/tarfile.py +Copyright: 2002, Lars Gustäbel <lars@gustaebel.de> +License: Expat + +Files: lib-python/2.7/test/test_epoll.py +Copyright: 2001-2006, Twisted Matrix Laboratories. +License: Expat + +Files: lib-python/2.7/trace.py +Copyright: 2000, Mojam Media, Inc. + 1999, Bioreason, Inc. + 1995-1997, Automatrix, Inc. + 1991-1995, Stichting Mathematisch Centrum +License: trace + Permission to use, copy, modify, and distribute this Python software and its + associated documentation for any purpose without fee is hereby granted, + provided that the above copyright notice appears in all copies, and that both + that copyright notice and this permission notice appear in supporting + documentation, and that the name of neither Automatrix, Bioreason or Mojam + Media be used in advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + +Files: lib-python/2.7/unittest/__init__.py +Copyright: 1999-2003, Steve Purcell + 2003-2010, Python Software Foundation +License: BSD-pyunit + +Files: lib-python/2.7/uu.py +Copyright: 1994, Lance Ellinghouse +License: MIT-Ellinghouse + +Files: lib-python/2.7/xmlrpclib.py +Copyright: 1999-2002, Secret Labs AB + 1999-2002, Fredrik Lundh +License: MIT-SecretLabs + +Files: lib-python/2.7/sre_*.py + pypy/module/cpyext/test/sre*.h + pypy/module/cpyext/test/_sre.c +Copyright: 1997-2002 by Secret Labs AB +License: Python-2.0 + +Files: rpython/rlib/rvmprof/src/* +Copyright: 2005, Google Inc. +License: BSD-3-Google + +Files: rpython/rlib/rvmprof/src/shared/khash.h +Copyright: 2008-2011, Attractive Chaos <attractor@live.co.uk> +License: Expat + +Files: rpython/rlib/rvmprof/src/shared/libbacktrace/* +Copyright: 2012-2017 Free Software Foundation, Inc. +License: BSD-3-generic + +Files: rpython/rlib/rvmprof/src/shared/libbacktrace/install-sh +Copyright: 1994, X Consortium +License: Expat + +Files: rpython/rlib/rvmprof/src/shared/msiinttypes/* +Copyright: 2006, Alexander Chemeris +License: BSD-3-generic + +Files: rpython/rlib/unicodedata/*.txt +Copyright: 1991-2015 Unicode, Inc. +License: Unicode-Data + +Files: rpython/tool/progressbar.py + rpython/tool/terminal.py +Copyright: 2009, Nadia Alramli +License: BSD-undefined + Stated to be a BSD licence, but the licence body isn't included + +Files: rpython/translator/c/src/dtoa.c +Copyright: 1991-2001, Lucent Technologies +License: MIT-Lucent + +Files: rpython/translator/c/src/ll_math.c +Copyright: 1993, by Sun Microsystems, Inc. +License: SunPro-Attribution + Developed at SunPro, a Sun Microsystems, Inc. business. + Permission to use, copy, modify, and distribute this software is freely + granted, provided that this notice is preserved. + +Files: rpython/translator/c/src/libffi_msvc/* +Copyright: 1996-2003, Red Hat, Inc + 2002, Bo Thorsen + 2001, John Beniton + 2002, Ranjit Mathew + 2002, Roger Sayle +License: Expat + +Files: rpython/translator/revdb/src-revdb/ancillary.h + rpython/translator/revdb/src-revdb/fd_recv.c +Copyright: Nicolas George +License: BSD-3-generic + +Files: rpython/rlib/parsing/test/pcre_test_7.py + rpython/rlib/parsing/test/test_pcre_regtest.py +Copyright: 2007-2008, Google Inc. + 1997-2008, University of Cambridge +License: BSD-3-Cambridge-Google + +Files: rpython/rlib/rsre/rsre_char.py +Copyright: 2005, Nik Haldimann +License: Expat + +Files: dotviewer/font/* +Copyright: 2008, The Android Open Source Project +License: Apache-2.0 + +Files: debian/* +Copyright: 2011-2019, Stefano Rivera <stefanor@debian.org> +License: Expat + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language overning permissions and limitations under + the License. + . + On Debian systems, the Apache 2.0 license can be found in + /usr/share/common-licenses/Apache-2.0. + +License: BSD-2-generic + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-generic + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of author nor the names of any contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-Cambridge-Google + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the University of Cambridge nor the name of Google Inc. + nor the names of their contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-DigitalCreations + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + o Redistributions of source code must retain the above copyright notice, this + list of conditions, and the disclaimer that follows. + o Redistributions in binary form must reproduce the above copyright notice, + this list of conditions, and the following disclaimer in the documentation + and/or other materials provided with the distribution. + o Neither the name of Digital Creations nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + THIS SOFTWARE IS PROVIDED BY DIGITAL CREATIONS AND CONTRIBUTORS *AS IS* AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL DIGITAL CREATIONS OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-Bendersky + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Eli Bendersky nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-Dabeaz + All rights reserved. + . + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + . + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + . + * Neither the name of the David Beazley or Dabeaz LLC may be used to endorse + or promote products derived from this software without specific prior + written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +License: BSD-3-Google + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of Google Inc. nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: BSD-pyunit + This module is free software, and you may redistribute it and/or modify it + under the same terms as Python itself, so long as this copyright message and + disclaimer are retained in their original form. + . + IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, + SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS + CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO + OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, + OR MODIFICATIONS. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +License: MIT-Ellinghouse + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and that + the name of Lance Ellinghouse not be used in advertising or publicity + pertaining to distribution of the software without specific, written prior + permission. + LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT + SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + +License: MIT-Lucent + Permission to use, copy, modify, and distribute this software for any purpose + without fee is hereby granted, provided that this entire notice is included in + all copies of any software which is or includes a copy or modification of this + software and in all copies of the supporting documentation for such software. + . + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS + SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +License: MIT-OMalley + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and that + the name of Timothy O'Malley not be used in advertising or publicity + pertaining to distribution of the software without specific, written prior + permission. + . + Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT + SHALL Timothy O'Malley BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: MIT-Rushing + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and that + the name of Sam Rushing not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + . + SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SAM + RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: MIT-Sajip + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and that + the name of Vinay Sajip not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL VINAY + SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +License: MIT-SecretLabs + By obtaining, using, and/or copying this software and/or its associated + documentation, you agree that you have read, understood, and will comply with + the following terms and conditions: + . + Permission to use, copy, modify, and distribute this software and its + associated documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appears in all copies, and that both + that copyright notice and this permission notice appear in supporting + documentation, and that the name of Secret Labs AB or the author not be used + in advertising or publicity pertaining to distribution of the software without + specific, written prior permission. + . + SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- ABILITY AND FITNESS. + IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +License: Python-2.0 + PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 + -------------------------------------------- + 1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), + and the Individual or Organization ("Licensee") accessing and otherwise using + this software ("Python") in source or binary form and its associated + documentation. + . + 2. Subject to the terms and conditions of this License Agreement, PSF hereby + grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, + analyze, test, perform and/or display publicly, prepare derivative works, + distribute, and otherwise use Python alone or in any derivative version, + provided, however, that PSF's License Agreement and PSF's notice of copyright, + i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software + Foundation; All Rights Reserved" are retained in Python alone or in any + derivative version prepared by Licensee. + . + 3. In the event Licensee prepares a derivative work that is based on or + incorporates Python or any part thereof, and wants to make the derivative work + available to others as provided herein, then Licensee hereby agrees to include + in any such work a brief summary of the changes made to Python. + . + 4. PSF is making Python available to Licensee on an "AS IS" basis. PSF MAKES + NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT + NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF + MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF + PYTHON WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + . + 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON FOR ANY + INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, OR ANY DERIVATIVE THEREOF, + EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + . + 6. This License Agreement will automatically terminate upon a material breach + of its terms and conditions. + . + 7. Nothing in this License Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between PSF and + Licensee. This License Agreement does not grant permission to use PSF + trademarks or trade name in a trademark sense to endorse or promote products + or services of Licensee, or any third party. + 8. By copying, installing or otherwise using Python, Licensee agrees to be + bound by the terms and conditions of this License Agreement. + . + BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 + ------------------------------------------- + . + BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + . + 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office + at 160 Saratoga Avenue, Santa Clara, CA 95051, and the Individual or + Organization ("Licensee") accessing and otherwise using this software in + source or binary form and its associated documentation ("the Software"). + . + 2. Subject to the terms and conditions of this BeOpen Python License + Agreement, BeOpen hereby grants Licensee a non-exclusive, royalty-free, + world-wide license to reproduce, analyze, test, perform and/or display + publicly, prepare derivative works, distribute, and otherwise use the Software + alone or in any derivative version, provided, however, that the BeOpen Python + License is retained in the Software, alone or in any derivative version + prepared by Licensee. + . + 3. BeOpen is making the Software available to Licensee on an "AS IS" basis. + BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF + EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND DISCLAIMS ANY REPRESENTATION + OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT + THE USE OF THE SOFTWARE WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + . + 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE + FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN + IF ADVISED OF THE POSSIBILITY THEREOF. + . + 5. This License Agreement will automatically terminate upon a material breach + of its terms and conditions. + . + 6. This License Agreement shall be governed by and interpreted in all respects + by the law of the State of California, excluding conflict of law provisions. + Nothing in this License Agreement shall be deemed to create any relationship + of agency, partnership, or joint venture between BeOpen and Licensee. This + License Agreement does not grant permission to use BeOpen trademarks or trade + names in a trademark sense to endorse or promote products or services of + Licensee, or any third party. As an exception, the "BeOpen Python" logos + available at http://www.pythonlabs.com/logos.html may be used according to the + permissions granted on that web page. + . + 7. By copying, installing or otherwise using the software, Licensee agrees to + be bound by the terms and conditions of this License Agreement. + . + CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 + --------------------------------------- + 1. This LICENSE AGREEMENT is between the Corporation for National Research + Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 + ("CNRI"), and the Individual or Organization ("Licensee") accessing and + otherwise using Python 1.6.1 software in source or binary form and its + associated documentation. + . + 2. Subject to the terms and conditions of this License Agreement, CNRI hereby + grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, + analyze, test, perform and/or display publicly, prepare derivative works, + distribute, and otherwise use Python 1.6.1 alone or in any derivative version, + provided, however, that CNRI's License Agreement and CNRI's notice of + copyright, i.e., "Copyright (c) 1995-2001 Corporation for National Research + Initiatives; All Rights Reserved" are retained in Python 1.6.1 alone or in any + derivative version prepared by Licensee. Alternately, in lieu of CNRI's + License Agreement, Licensee may substitute the following text (omitting the + quotes): "Python 1.6.1 is made available subject to the terms and conditions + in CNRI's License Agreement. This Agreement together with Python 1.6.1 may be + located on the Internet using the following unique, persistent identifier + (known as a handle): 1895.22/1013. This Agreement may also be obtained from a + proxy server on the Internet using the following URL: + http://hdl.handle.net/1895.22/1013". + . + 3. In the event Licensee prepares a derivative work that is based on or + incorporates Python 1.6.1 or any part thereof, and wants to make the + derivative work available to others as provided herein, then Licensee hereby + agrees to include in any such work a brief summary of the changes made to + Python 1.6.1. + . + 4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" basis. CNRI + MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, + BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY + OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF + PYTHON 1.6.1 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. + . + 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 1.6.1 FOR + ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF + MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, OR ANY DERIVATIVE + THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + . + 6. This License Agreement will automatically terminate upon a material breach + of its terms and conditions. + . + 7. This License Agreement shall be governed by the federal intellectual + property law of the United States, including without limitation the federal + copyright law, and, to the extent such U.S. federal law does not apply, by the + law of the Commonwealth of Virginia, excluding Virginia's conflict of law + provisions. Notwithstanding the foregoing, with regard to derivative works + based on Python 1.6.1 that incorporate non-separable material that was + previously distributed under the GNU General Public License (GPL), the law of + the Commonwealth of Virginia shall govern this License Agreement only as to + issues arising under or with respect to Paragraphs 4, 5, and 7 of this License + Agreement. Nothing in this License Agreement shall be deemed to create any + relationship of agency, partnership, or joint venture between CNRI and + Licensee. This License Agreement does not grant permission to use CNRI + trademarks or trade name in a trademark sense to endorse or promote products + or services of Licensee, or any third party. + . + 8. By clicking on the "ACCEPT" button where indicated, or by copying, + installing or otherwise using Python 1.6.1, Licensee agrees to be bound by the + terms and conditions of this License Agreement. + . + ACCEPT + . + CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 + -------------------------------------------------- + . + Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, The + Netherlands. All rights reserved. + . + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided that + the above copyright notice appear in all copies and that both that copyright + notice and this permission notice appear in supporting documentation, and that + the name of Stichting Mathematisch Centrum or CWI not be used in advertising + or publicity pertaining to distribution of the software without specific, + written prior permission. + . + STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +License: Tcl + The authors hereby grant permission to use, copy, modify, distribute, and + license this software and its documentation for any purpose, provided that + existing copyright notices are retained in all copies and that this notice is + included verbatim in any distributions. No written agreement, license, or + royalty fee is required for any of the authorized uses. Modifications to this + software may be copyrighted by their authors and need not follow the licensing + terms described here, provided that the new terms are clearly indicated on the + first page of each file where they apply. + . + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR + DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF + THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN + IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + . + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS + IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE + MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + . + GOVERNMENT USE: If you are acquiring this software on behalf of the U.S. + government, the Government shall have only "Restricted Rights" in the software + and related documentation as defined in the Federal· Acquisition Regulations + (FARs) in Clause 52.227.19 (c) (2). If you are acquiring the software on + behalf of the Department of Defense, the software shall be classified as + "Commercial Computer Software" and the Government shall have only "Restricted + Rights" as defined in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding + the foregoing, the authors grant the U.S. Government and others acting in its + behalf permission to use and distribute the software in accordance with the + terms specified in this license. + +License: Unicode-Data + Permission is hereby granted, free of charge, to any person obtaining a copy + of the Unicode data files and any associated documentation (the "Data Files") + or Unicode software and any associated documentation (the "Software") to deal + in the Data Files or Software without restriction, including without + limitation the rights to use, copy, modify, merge, publish, distribute, and/or + sell copies of the Data Files or Software, and to permit persons to whom the + Data Files or Software are furnished to do so, provided that (a) the above + copyright notice(s) and this permission notice appear with all copies of the + Data Files or Software, (b) both the above copyright notice(s) and this + permission notice appear in associated documentation, and (c) there is clear + notice in each modified Data File or in the Software as well as in the + documentation associated with the Data File(s) or Software that the data or + software has been modified. + . + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY + KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD + PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL + DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES + OR SOFTWARE. + . + Except as contained in this notice, the name of a copyright holder shall not + be used in advertising or otherwise to promote the sale, use or other dealings + in these Data Files or Software without prior written authorization of the + copyright holder. + . + Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be + registered in some jurisdictions. All other trademarks and registered + trademarks mentioned herein are the property of their respective owners. + +License: Zlib + This software is provided 'as-is', without any express or implied warranty. + In no event will the authors be held liable for any damages arising from the + use of this software. + . + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it freely, + subject to the following restrictions: + 1. The origin of this software must not be misrepresented; you must not claim + that you wrote the original software. If you use this software in a + product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..3dfdb43 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +debian-branch = debian + +[import-orig] +pristine-tar = True diff --git a/debian/patches/arm64-gcc-bug b/debian/patches/arm64-gcc-bug new file mode 100644 index 0000000..fca2a30 --- /dev/null +++ b/debian/patches/arm64-gcc-bug @@ -0,0 +1,58 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Tue, 22 Oct 2019 11:37:12 -0700 +Subject: Avoid GCC bug in arm64 JIT + +Arguably, clarify the logic. The real motivation is a gcc bug, see +issue #3086 + +Bug-Upstream: https://bitbucket.org/pypy/pypy/issues/3086/arm64-jit-lots-of-crashes +Bug-GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92131 +Author: Armin Rigo <arigo@tunes.org> +Origin: upstream, https://bitbucket.org/pypy/pypy/commits/d81c769a2353 +--- + rpython/jit/backend/aarch64/opassembler.py | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/rpython/jit/backend/aarch64/opassembler.py b/rpython/jit/backend/aarch64/opassembler.py +index e8607a8..cfd9d58 100644 +--- a/rpython/jit/backend/aarch64/opassembler.py ++++ b/rpython/jit/backend/aarch64/opassembler.py +@@ -808,9 +808,7 @@ class ResOpAssembler(BaseAssembler): + # Inline a series of STR operations, starting at 'dstaddr_loc'. + # + self.mc.gen_load_int(r.ip0.value, 0) +- i = 0 +- adjustment = 0 +- needs_adjustment = itemsize < 8 and (startbyte % 8) ++ i = dst_i = 0 + total_size = size_box.getint() + while i < total_size: + sz = itemsize +@@ -818,19 +816,19 @@ class ResOpAssembler(BaseAssembler): + next_group += 8 + if next_group <= total_size: + sz = 8 ++ if dst_i % 8: # unaligned? ++ self.mc.ADD_ri(dstaddr_loc.value, dstaddr_loc.value, dst_i) ++ dst_i = 0 + if sz == 8: +- if needs_adjustment: +- self.mc.ADD_ri(dstaddr_loc.value, dstaddr_loc.value, i) +- adjustment = -i +- needs_adjustment = False +- self.mc.STR_ri(r.ip0.value, dstaddr_loc.value, i + adjustment) ++ self.mc.STR_ri(r.ip0.value, dstaddr_loc.value, dst_i) + elif sz == 4: +- self.mc.STRW_ri(r.ip0.value, dstaddr_loc.value, i + adjustment) ++ self.mc.STRW_ri(r.ip0.value, dstaddr_loc.value, dst_i) + elif sz == 2: +- self.mc.STRH_ri(r.ip0.value, dstaddr_loc.value, i + adjustment) ++ self.mc.STRH_ri(r.ip0.value, dstaddr_loc.value, dst_i) + else: +- self.mc.STRB_ri(r.ip0.value, dstaddr_loc.value, i + adjustment) ++ self.mc.STRB_ri(r.ip0.value, dstaddr_loc.value, dst_i) + i += sz ++ dst_i += sz + + else: + if isinstance(size_box, ConstInt): diff --git a/debian/patches/ctypes-arm b/debian/patches/ctypes-arm new file mode 100644 index 0000000..2d49d54 --- /dev/null +++ b/debian/patches/ctypes-arm @@ -0,0 +1,52 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: armhf support +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Workaround the presentce of hard-float in ldconfig -p output. +Also, handle the wide variety of ARM unames. + +Author: Loïc Minier +Bug-Ubuntu: https://bugs.launchpad.net/bugs/898172 +Bug-cpython: http://bugs.python.org/issue13508 +Last-Update: 2011-12-19 +--- + lib-python/2.7/ctypes/util.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/lib-python/2.7/ctypes/util.py b/lib-python/2.7/ctypes/util.py +index 16930e4..eb1c8e1 100644 +--- a/lib-python/2.7/ctypes/util.py ++++ b/lib-python/2.7/ctypes/util.py +@@ -237,16 +237,27 @@ elif os.name == "posix": + + def _findSoname_ldconfig(name): + import struct ++ # XXX this code assumes that we know all unames and that a single ++ # ABI is supported per uname; instead we should find what the ++ # ABI is (e.g. check ABI of current process) or simply ask libc ++ # to load the library for us ++ uname = os.uname()[4] ++ # ARM has a variety of unames, e.g. armv7l ++ if uname.startswith("arm"): ++ uname = "arm" + if struct.calcsize('l') == 4: +- machine = os.uname()[4] + '-32' ++ machine = uname + '-32' + else: +- machine = os.uname()[4] + '-64' ++ machine = uname + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', ++ # this actually breaks on biarch or multiarch as the first ++ # library wins; uname doesn't tell us which ABI we're using ++ 'arm-32': 'libc6(,hard-float)?', + } + abi_type = mach_map.get(machine, 'libc6') + diff --git a/debian/patches/distutils-install-layout b/debian/patches/distutils-install-layout new file mode 100644 index 0000000..d98ba4f --- /dev/null +++ b/debian/patches/distutils-install-layout @@ -0,0 +1,331 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: distutils: Add an option --install-layout=deb + +This option: + - installs into $prefix/dist-packages instead of $prefix/site-packages. + - doesn't encode the python version into the egg name. + +Based on cpython Debian packaging + +Author: Matthias Klose <doko@debian.org> +Author: Stefano Rivera <stefanor@debian.org> +Last-Update: 2013-02-23 +--- + lib-python/2.7/distutils/command/install.py | 44 +++++++++++++++++++++- + .../2.7/distutils/command/install_egg_info.py | 30 ++++++++++++--- + lib-python/2.7/distutils/sysconfig_pypy.py | 6 ++- + lib-python/2.7/pydoc.py | 1 + + lib-python/2.7/site.py | 18 ++++++++- + lib-python/2.7/sysconfig.py | 29 +++++++++++++- + lib-python/2.7/test/test_site.py | 2 +- + lib-python/2.7/test/test_sysconfig.py | 3 +- + 8 files changed, 119 insertions(+), 14 deletions(-) + +diff --git a/lib-python/2.7/distutils/command/install.py b/lib-python/2.7/distutils/command/install.py +index fc43951..76fdd75 100644 +--- a/lib-python/2.7/distutils/command/install.py ++++ b/lib-python/2.7/distutils/command/install.py +@@ -90,6 +90,20 @@ INSTALL_SCHEMES = { + 'scripts': '$base/bin', + 'data' : '$base', + }, ++ 'pypy-deb': { ++ 'purelib': '$base/dist-packages', ++ 'platlib': '$base/dist-packages', ++ 'headers': '$base/include', ++ 'scripts': '$base/bin', ++ 'data' : '$base', ++ }, ++ 'pypy-local': { ++ 'purelib': '$base/../../local/lib/pypy$py_version_short/dist-packages', ++ 'platlib': '$base/../../local/lib/pypy$py_version_short/dist-packages', ++ 'headers': '$base/../../local/include', ++ 'scripts': '$base/../../local/bin', ++ 'data' : '$base/../../local', ++ }, + } + + # The keys to an installation scheme; if any new types of files are to be +@@ -161,6 +175,9 @@ class install (Command): + + ('record=', None, + "filename in which to record list of installed files"), ++ ++ ('install-layout=', None, ++ "installation layout to choose (known values: deb, unix)"), + ] + + boolean_options = ['compile', 'force', 'skip-build', 'user'] +@@ -175,6 +192,7 @@ class install (Command): + self.exec_prefix = None + self.home = None + self.user = 0 ++ self.prefix_option = None + + # These select only the installation base; it's up to the user to + # specify the installation scheme (currently, that means supplying +@@ -196,6 +214,9 @@ class install (Command): + self.install_userbase = USER_BASE + self.install_usersite = USER_SITE + ++ # enable custom installation, known values: deb ++ self.install_layout = None ++ + self.compile = None + self.optimize = None + +@@ -428,6 +449,7 @@ class install (Command): + self.install_base = self.install_platbase = self.home + self.select_scheme("unix_home") + else: ++ self.prefix_option = self.prefix + if self.prefix is None: + if self.exec_prefix is not None: + raise DistutilsOptionError, \ +@@ -442,7 +464,25 @@ class install (Command): + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix +- self.select_scheme("unix_prefix") ++ if self.install_layout: ++ if self.install_layout.lower() in ['deb']: ++ self.select_scheme("pypy-deb") ++ elif self.install_layout.lower() in ['posix', 'unix']: ++ self.select_scheme("unix_prefix") ++ else: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ elif ((self.prefix_option ++ and not os.path.normpath(self.prefix).startswith( ++ '/usr/local/')) ++ or 'PYTHONUSERBASE' in os.environ ++ or 'real_prefix' in sys.__dict__): ++ self.select_scheme("unix_prefix") ++ else: ++ if os.path.normpath(self.prefix).startswith('/usr/local/'): ++ self.select_scheme("pypy-deb") ++ else: ++ self.select_scheme("pypy-local") + + # finalize_unix () + +@@ -475,7 +515,7 @@ class install (Command): + def select_scheme (self, name): + # it's the caller's problem if they supply a bad name! + if (hasattr(sys, 'pypy_version_info') and +- not name.endswith(('_user', '_home'))): ++ not (name.endswith(('_user', '_home')) or name.startswith('pypy'))): + name = 'pypy' + scheme = INSTALL_SCHEMES[name] + for key in SCHEME_KEYS: +diff --git a/lib-python/2.7/distutils/command/install_egg_info.py b/lib-python/2.7/distutils/command/install_egg_info.py +index c888031..88b5d94 100644 +--- a/lib-python/2.7/distutils/command/install_egg_info.py ++++ b/lib-python/2.7/distutils/command/install_egg_info.py +@@ -14,18 +14,38 @@ class install_egg_info(Command): + description = "Install package's PKG-INFO metadata as an .egg-info file" + user_options = [ + ('install-dir=', 'd', "directory to install to"), ++ ('install-layout', None, "custom installation layout"), + ] + + def initialize_options(self): + self.install_dir = None ++ self.install_layout = None ++ self.prefix_option = None + + def finalize_options(self): + self.set_undefined_options('install_lib',('install_dir','install_dir')) +- basename = "%s-%s-py%s.egg-info" % ( +- to_filename(safe_name(self.distribution.get_name())), +- to_filename(safe_version(self.distribution.get_version())), +- sys.version[:3] +- ) ++ self.set_undefined_options('install',('install_layout','install_layout')) ++ self.set_undefined_options('install',('prefix_option','prefix_option')) ++ if self.install_layout: ++ if not self.install_layout.lower() in ['deb', 'unix']: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ no_pyver = (self.install_layout.lower() == 'deb') ++ elif self.prefix_option: ++ no_pyver = False ++ else: ++ no_pyver = True ++ if no_pyver: ++ basename = "%s-%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())) ++ ) ++ else: ++ basename = "%s-%s-py%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())), ++ sys.version[:3] ++ ) + self.target = os.path.join(self.install_dir, basename) + self.outputs = [self.target] + +diff --git a/lib-python/2.7/distutils/sysconfig_pypy.py b/lib-python/2.7/distutils/sysconfig_pypy.py +index 9b0d941..d6f4bdb 100644 +--- a/lib-python/2.7/distutils/sysconfig_pypy.py ++++ b/lib-python/2.7/distutils/sysconfig_pypy.py +@@ -49,11 +49,15 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + If 'prefix' is supplied, use it instead of sys.prefix or + sys.exec_prefix -- i.e., ignore 'plat_specific'. + """ ++ is_default_prefix = not prefix or os.path.normpath(prefix).startswith(('/usr/lib/pypy')) + if prefix is None: + prefix = PREFIX + if standard_lib: + return os.path.join(prefix, "lib-python", get_python_version()) +- return os.path.join(prefix, 'site-packages') ++ if is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__: ++ return os.path.join(prefix, 'dist-packages') ++ else: ++ return os.path.join(prefix, 'site-packages') + + + _config_vars = None +diff --git a/lib-python/2.7/pydoc.py b/lib-python/2.7/pydoc.py +index 14ff9bb..985f285 100755 +--- a/lib-python/2.7/pydoc.py ++++ b/lib-python/2.7/pydoc.py +@@ -393,6 +393,7 @@ class Doc: + 'marshal', 'posix', 'signal', 'sys', + 'thread', 'zipimport') or + (file.startswith(basedir) and ++ not file.startswith(os.path.join(basedir, 'dist-packages')) and + not file.startswith(os.path.join(basedir, 'site-packages')))) and + object.__name__ not in ('xml.etree', 'test.pydoc_mod')): + if docloc.startswith(("http://", "https://")): +diff --git a/lib-python/2.7/site.py b/lib-python/2.7/site.py +index 37de98e..7cfa6be 100644 +--- a/lib-python/2.7/site.py ++++ b/lib-python/2.7/site.py +@@ -12,13 +12,18 @@ works). + + This will append site-specific paths to the module search path. On + Unix (including Mac OSX), it starts with sys.prefix and +-sys.exec_prefix (if different) and appends +-lib/python<version>/site-packages as well as lib/site-python. ++sys.exec_prefix (if different) and appends dist-packages. + On other platforms (such as Windows), it tries each of the + prefixes directly, as well as with lib/site-packages appended. The + resulting directories, if they exist, are appended to sys.path, and + also inspected for path configuration files. + ++For Debian and derivatives, this sys.path is augmented with directories ++for packages distributed within the distribution. Local addons go ++into /usr/local/lib/pypy<version>/dist-packages, Debian addons ++install into /usr/{lib,share}/pypy<version>/dist-packages. ++/usr/lib/pypy<version>/site-packages is not used. ++ + A path configuration file is a file whose name has the form + <package>.pth; its contents are additional directories (one per line) + to be added to sys.path. Non-existing directories (or +@@ -277,6 +282,13 @@ def addusersitepackages(known_paths): + + if ENABLE_USER_SITE and os.path.isdir(user_site): + addsitedir(user_site, known_paths) ++ if ENABLE_USER_SITE: ++ for dist_libdir in ("local/lib", "lib"): ++ user_site = os.path.join(USER_BASE, dist_libdir, ++ "pypy" + sys.version[:3], ++ "dist-packages") ++ if os.path.isdir(user_site): ++ addsitedir(user_site, known_paths) + return known_paths + + def getsitepackages(): +@@ -301,6 +313,8 @@ def getsitepackages(): + elif is_pypy: + from distutils.sysconfig import get_python_lib + sitedir = get_python_lib(standard_lib=False, prefix=prefix) ++ sitepackages.append(sitedir.replace('lib/pypy', 'local/lib/' ++ 'pypy' + sys.version[:3])) + sitepackages.append(sitedir) + elif os.sep == '/': + sitepackages.append(os.path.join(prefix, "lib", +diff --git a/lib-python/2.7/sysconfig.py b/lib-python/2.7/sysconfig.py +index 22af6e8..9be6a5b 100644 +--- a/lib-python/2.7/sysconfig.py ++++ b/lib-python/2.7/sysconfig.py +@@ -36,6 +36,26 @@ _INSTALL_SCHEMES = { + 'scripts': '{base}/bin', + 'data' : '{base}', + }, ++ 'pypy-deb': { ++ 'stdlib': '{base}/lib-python', ++ 'platstdlib': '{base}/lib-python', ++ 'purelib': '{base}/lib-python', ++ 'platlib': '{base}/lib-python', ++ 'include': '{base}/include', ++ 'platinclude': '{base}/include', ++ 'scripts': '{base}/bin', ++ 'data' : '{base}', ++ }, ++ 'pypy-local': { ++ 'stdlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', ++ 'platstdlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', ++ 'purelib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', ++ 'platlib': '{base}/../../local/lib/pypy{py_version_short}/lib-python', ++ 'include': '{base}/../../local/include', ++ 'platinclude': '{base}/../../local/include', ++ 'scripts': '{base}/../../local/bin', ++ 'data' : '{base}/../../local', ++ }, + 'nt': { + 'stdlib': '{base}/Lib', + 'platstdlib': '{base}/Lib', +@@ -178,7 +198,11 @@ def _expand_vars(scheme, vars): + + def _get_default_scheme(): + if '__pypy__' in sys.builtin_module_names: +- return 'pypy' ++ # the default scheme for posix on Debian/Ubuntu is pypy-local ++ # FIXME: return dist-packages/posix_prefix only for ++ # is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'real_prefix' not in sys.__dict__ ++ # is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local') ++ return 'pypy-local' + elif os.name == 'posix': + # the default scheme for posix is posix_prefix + return 'posix_prefix' +@@ -425,7 +449,8 @@ def get_config_h_filename(): + else: + inc_dir = _PROJECT_BASE + else: +- inc_dir = get_path('platinclude') ++ inc_dir = get_path('platinclude', 'pypy-deb').replace("/../../local/", ++ "/", 1) + return os.path.join(inc_dir, 'pyconfig.h') + + def get_scheme_names(): +diff --git a/lib-python/2.7/test/test_site.py b/lib-python/2.7/test/test_site.py +index 02331be..8a34204 100644 +--- a/lib-python/2.7/test/test_site.py ++++ b/lib-python/2.7/test/test_site.py +@@ -234,7 +234,7 @@ class HelperFunctionsTests(unittest.TestCase): + wanted = os.path.join('xoxo', 'Lib', 'site-packages') + self.assertEqual(dirs[0], wanted) + elif '__pypy__' in sys.builtin_module_names: +- self.assertEquals(len(dirs), 1) ++ self.assertEquals(len(dirs), 2) + wanted = os.path.join('xoxo', 'site-packages') + self.assertEquals(dirs[0], wanted) + elif os.sep == '/': +diff --git a/lib-python/2.7/test/test_sysconfig.py b/lib-python/2.7/test/test_sysconfig.py +index 95d3a3c..a874d8d 100644 +--- a/lib-python/2.7/test/test_sysconfig.py ++++ b/lib-python/2.7/test/test_sysconfig.py +@@ -253,7 +253,8 @@ class TestSysConfig(unittest.TestCase): + + def test_get_scheme_names(self): + wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user', +- 'posix_home', 'posix_prefix', 'posix_user', 'pypy') ++ 'posix_home', 'posix_prefix', 'posix_user', 'pypy', ++ 'pypy-deb', 'pypy-local') + self.assertEqual(get_scheme_names(), wanted) + + @unittest.skipIf(check_impl_detail(pypy=True), diff --git a/debian/patches/distutils-link b/debian/patches/distutils-link new file mode 100644 index 0000000..1fd6066 --- /dev/null +++ b/debian/patches/distutils-link @@ -0,0 +1,30 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Don't add standard library dirs to library_dirs and + runtime_library_dirs. + +Origin: Debian cpython packaging +Author: Matthias Klose <doko@debian.org> +Last-Update: 2011-12-19 +--- + lib-python/2.7/distutils/unixccompiler.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/lib-python/2.7/distutils/unixccompiler.py b/lib-python/2.7/distutils/unixccompiler.py +index 250ff12..bf55820 100644 +--- a/lib-python/2.7/distutils/unixccompiler.py ++++ b/lib-python/2.7/distutils/unixccompiler.py +@@ -172,7 +172,12 @@ class UnixCCompiler(CCompiler): + objects, output_dir = self._fix_object_args(objects, output_dir) + libraries, library_dirs, runtime_library_dirs = \ + self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) +- ++ # filter out standard library paths, which are not explicitely needed ++ # for linking ++ library_dirs = [dir for dir in library_dirs ++ if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] ++ runtime_library_dirs = [dir for dir in runtime_library_dirs ++ if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] + lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, + libraries) + if type(output_dir) not in (StringType, NoneType): diff --git a/debian/patches/ensurepip-disabled b/debian/patches/ensurepip-disabled new file mode 100644 index 0000000..a1563a3 --- /dev/null +++ b/debian/patches/ensurepip-disabled @@ -0,0 +1,63 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Disable ensurepip in Debian for now + +Origin: Debian cpython packaging +Last-Update: 2015-03-26 +--- + lib-python/2.7/ensurepip/__init__.py | 17 +++++++++++++++++ + lib-python/2.7/test/test_ensurepip.py | 1 + + 2 files changed, 18 insertions(+) + +diff --git a/lib-python/2.7/ensurepip/__init__.py b/lib-python/2.7/ensurepip/__init__.py +index f1cdbd1..896feee 100644 +--- a/lib-python/2.7/ensurepip/__init__.py ++++ b/lib-python/2.7/ensurepip/__init__.py +@@ -12,6 +12,21 @@ import tempfile + + __all__ = ["version", "bootstrap"] + ++def _ensurepip_is_disabled_in_debian(): ++ if True: ++ print ('''\ ++ensurepip is disabled in Debian/Ubuntu for the system python. ++ ++Python modules For the system python are usually handled by dpkg and apt-get. ++ ++ apt-get install pypy-<module name> ++ ++Install the python-pip package to use pip itself. Using pip together ++with the system python might have unexpected results for any system installed ++module, so use it on your own risk, or make sure to only use it in virtual ++environments. ++''') ++ sys.exit(1) + + _PROJECTS = [ + "setuptools", +@@ -33,6 +48,7 @@ def version(): + """ + Returns a string specifying the bundled version of pip. + """ ++ _ensurepip_is_disabled_in_debian() + whl_name = 'pip' + wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % whl_name) + if len(wheel_names) == 1: +@@ -61,6 +77,7 @@ def bootstrap(root=None, upgrade=False, user=False, + + Note that calling this function will alter both sys.path and os.environ. + """ ++ _ensurepip_is_disabled_in_debian() + if altinstall and default_pip: + raise ValueError("Cannot use altinstall and default_pip together") + +diff --git a/lib-python/2.7/test/test_ensurepip.py b/lib-python/2.7/test/test_ensurepip.py +index 3316fcf..e5f972d 100644 +--- a/lib-python/2.7/test/test_ensurepip.py ++++ b/lib-python/2.7/test/test_ensurepip.py +@@ -1,4 +1,5 @@ + import unittest ++raise unittest.SkipTest('ensurepip is disabled in debian') + import os + import os.path + import contextlib diff --git a/debian/patches/ensurepip-wheels b/debian/patches/ensurepip-wheels new file mode 100644 index 0000000..4533f33 --- /dev/null +++ b/debian/patches/ensurepip-wheels @@ -0,0 +1,145 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Let ensurepip use the system wheels + +Not the ones from the python source. + +Origin: Debian cpython packaging +Last-Update: 2015-03-26 +--- + lib-python/2.7/ensurepip/__init__.py | 74 ++++++++++++++++++++++++++---------- + 1 file changed, 54 insertions(+), 20 deletions(-) + +diff --git a/lib-python/2.7/ensurepip/__init__.py b/lib-python/2.7/ensurepip/__init__.py +index c2abed8..f1cdbd1 100644 +--- a/lib-python/2.7/ensurepip/__init__.py ++++ b/lib-python/2.7/ensurepip/__init__.py +@@ -1,6 +1,7 @@ + #!/usr/bin/env python2 + from __future__ import print_function + ++import glob + import os + import os.path + import pkgutil +@@ -12,13 +13,9 @@ import tempfile + __all__ = ["version", "bootstrap"] + + +-_SETUPTOOLS_VERSION = "28.8.0" +- +-_PIP_VERSION = "9.0.1" +- + _PROJECTS = [ +- ("setuptools", _SETUPTOOLS_VERSION), +- ("pip", _PIP_VERSION), ++ "setuptools", ++ "pip", + ] + + +@@ -36,7 +33,11 @@ def version(): + """ + Returns a string specifying the bundled version of pip. + """ +- return _PIP_VERSION ++ whl_name = 'pip' ++ wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % whl_name) ++ if len(wheel_names) == 1: ++ return os.path.basename(wheel_names[0]).split('-')[1] ++ raise RuntimeError('missing dependency wheel %s. Installation of the python-%s-whl package is needed to use ensurepip.' % (whl_name, whl_name)) + + + def _disable_pip_configuration_settings(): +@@ -78,21 +79,53 @@ def bootstrap(root=None, upgrade=False, user=False, + # omit pip and easy_install + os.environ["ENSUREPIP_OPTIONS"] = "install" + ++ # Debian: The bundled wheels are useless to us because we must use ones ++ # crafted from source code in the archive. As we build the virtual ++ # environment, copy the wheels from the system location into the virtual ++ # environment, and place those wheels on sys.path. ++ def copy_wheels(wheels, destdir, paths): ++ for project in wheels: ++ wheel_names = glob.glob( ++ '/usr/share/python-wheels/{}-*.whl'.format(project)) ++ if len(wheel_names) == 0: ++ raise RuntimeError('missing dependency wheel %s. Installation of the python-%s-whl package is needed to use ensurepip.' % (project, project)) ++ assert len(wheel_names) == 1, wheel_names ++ wheel_name = os.path.basename(wheel_names[0]) ++ path = os.path.join('/usr/share/python-wheels', wheel_name) ++ with open(path, 'rb') as fp: ++ whl = fp.read() ++ dest = os.path.join(destdir, wheel_name) ++ with open(dest, 'wb') as fp: ++ fp.write(whl) ++ paths.append(dest) ++ ++ # check that the python-{pip,setuptools}-whl packages are installed ++ missing = [] ++ for project in reversed(_PROJECTS): ++ wheel_names = glob.glob('/usr/share/python-wheels/%s-*.whl' % project) ++ if len(wheel_names) != 1: ++ missing.append(project) ++ if missing: ++ raise RuntimeError('missing wheel(s) %s. Installation of the %s package(s) is needed to use ensurepip.' \ ++ % (', '.join([missing]), ++ ', '.join(['python-%s-whl' % m for m in missing])) \ ++ ) ++ + tmpdir = tempfile.mkdtemp() ++ ++ for project in _PROJECTS: ++ try: ++ with open('/usr/share/python-wheels/%s.dependencies' % project) as fp: ++ dependencies = [line[:-1].split()[0] for line in fp.readlines()] ++ except IOError: ++ dependencies = [] ++ copy_wheels(dependencies, tmpdir, sys.path) ++ + try: + # Put our bundled wheels into a temporary directory and construct the + # additional paths that need added to sys.path + additional_paths = [] +- for project, version in _PROJECTS: +- wheel_name = "{}-{}-py2.py3-none-any.whl".format(project, version) +- whl = pkgutil.get_data( +- "ensurepip", +- "_bundled/{}".format(wheel_name), +- ) +- with open(os.path.join(tmpdir, wheel_name), "wb") as fp: +- fp.write(whl) +- +- additional_paths.append(os.path.join(tmpdir, wheel_name)) ++ copy_wheels(_PROJECTS, tmpdir, additional_paths) + + # Construct the arguments to be passed to the pip command + args = ["install", "--no-index", "--find-links", tmpdir] +@@ -105,7 +138,7 @@ def bootstrap(root=None, upgrade=False, user=False, + if verbosity: + args += ["-" + "v" * verbosity] + +- _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) ++ _run_pip(args + _PROJECTS, additional_paths) + finally: + shutil.rmtree(tmpdir, ignore_errors=True) + +@@ -122,7 +155,8 @@ def _uninstall_helper(verbosity=0): + return + + # If the pip version doesn't match the bundled one, leave it alone +- if pip.__version__ != _PIP_VERSION: ++ # Disabled for Debian, always using the version from the python3-pip package. ++ if False and pip.__version__ != _PIP_VERSION: + msg = ("ensurepip will only uninstall a matching version " + "({!r} installed, {!r} bundled)") + print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr) +@@ -135,7 +169,7 @@ def _uninstall_helper(verbosity=0): + if verbosity: + args += ["-" + "v" * verbosity] + +- _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) ++ _run_pip(args + reversed(_PROJECTS)) + + + def _main(argv=None): diff --git a/debian/patches/fpic-archs b/debian/patches/fpic-archs new file mode 100644 index 0000000..0acf102 --- /dev/null +++ b/debian/patches/fpic-archs @@ -0,0 +1,24 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: x32 requires -fPIC + +x32 detection is currently Debian-specific. +--- + rpython/translator/platform/__init__.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/rpython/translator/platform/__init__.py b/rpython/translator/platform/__init__.py +index 1833a95..4f6879e 100644 +--- a/rpython/translator/platform/__init__.py ++++ b/rpython/translator/platform/__init__.py +@@ -265,7 +265,9 @@ if sys.platform.startswith('linux'): + # detect armhf without shelling out + if (platform.architecture()[0] == '64bit' + or platform.machine().startswith( +- ('arm', 'm68k', 'mips', 'parisc', 'ppc', 'sh4'))): ++ ('arm', 'm68k', 'mips', 'parisc', 'ppc', 'sh4')) ++ or getattr(getattr(sys, 'implementation', sys), '_multiarch', ++ None) == 'x86_64-linux-gnux32'): + host_factory = LinuxPIC + else: + host_factory = Linux diff --git a/debian/patches/langpack-gettext b/debian/patches/langpack-gettext new file mode 100644 index 0000000..cd230fe --- /dev/null +++ b/debian/patches/langpack-gettext @@ -0,0 +1,46 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Support Ubuntu langpacks + +Support alternative gettext tree in /usr/share/locale-langpack; if a +file is present in both trees, prefer the newer one + +Forwarded: not-needed +Origin: Debian cpython packaging +Author: Michael Vogt <michael.vogt@ubuntu.com> +Last-Update: 2011-12-19 +--- + lib-python/2.7/gettext.py | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/lib-python/2.7/gettext.py b/lib-python/2.7/gettext.py +index 765cc8c..b210f8d 100644 +--- a/lib-python/2.7/gettext.py ++++ b/lib-python/2.7/gettext.py +@@ -522,11 +522,26 @@ def find(domain, localedir=None, languages=None, all=0): + if lang == 'C': + break + mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) ++ mofile_lp = os.path.join("/usr/share/locale-langpack", lang, ++ 'LC_MESSAGES', '%s.mo' % domain) ++ ++ # first look into the standard locale dir, then into the ++ # langpack locale dir ++ ++ # standard mo file + if os.path.exists(mofile): + if all: + result.append(mofile) + else: + return mofile ++ ++ # langpack mofile -> use it ++ if os.path.exists(mofile_lp): ++ if all: ++ result.append(mofile_lp) ++ else: ++ return mofile_lp ++ + return result + + diff --git a/debian/patches/locale-module b/debian/patches/locale-module new file mode 100644 index 0000000..539598f --- /dev/null +++ b/debian/patches/locale-module @@ -0,0 +1,29 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Don't map 'utf8', 'utf-8' to 'utf' + +'utf' is not a known encoding for glibc. + +Author: Matthias Klose <doko@debian.org> +Origin: Debian cpython packaging +Bug-cpython: http://bugs.python.org/issue1166957 +Last-Update: 2011-12-19 +--- + lib-python/2.7/locale.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib-python/2.7/locale.py b/lib-python/2.7/locale.py +index 5aab163..9527d95 100644 +--- a/lib-python/2.7/locale.py ++++ b/lib-python/2.7/locale.py +@@ -1701,8 +1701,8 @@ locale_alias = { + 'uk_ua.iso88595': 'uk_UA.ISO8859-5', + 'uk_ua.koi8u': 'uk_UA.KOI8-U', + 'uk_ua.microsoftcp1251': 'uk_UA.CP1251', +- 'univ': 'en_US.utf', +- 'universal': 'en_US.utf', ++ 'univ': 'en_US.UTF-8', ++ 'universal': 'en_US.UTF-8', + 'universal.utf8@ucs4': 'en_US.UTF-8', + 'unm_us': 'unm_US.UTF-8', + 'ur': 'ur_PK.CP1256', diff --git a/debian/patches/multiarch b/debian/patches/multiarch new file mode 100644 index 0000000..e459566 --- /dev/null +++ b/debian/patches/multiarch @@ -0,0 +1,190 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Add multiarch tag to C extension file names + +Add _multiarch variable to sys, and MULTIARCH to sysconfig variables, +exposing the multiarch tag. + +Add the multiarch tag to C extension file names, by default, while still +supporting bare suffixes. + +Based on multiarch.diff in Debian cPython. + +Forwarded: not-needed +Last-Modified: 2014-09-20 +--- + lib-python/2.7/sysconfig.py | 3 +++ + lib-python/2.7/test/test_sysconfig.py | 5 +++++ + lib_pypy/_sysconfigdata.py | 5 +++++ + pypy/module/imp/importing.py | 5 ++++- + pypy/module/imp/interp_imp.py | 8 ++++++-- + pypy/module/imp/test/test_import.py | 3 ++- + pypy/module/sys/debian.py | 12 ++++++++++++ + pypy/module/sys/moduledef.py | 4 ++++ + pypy/module/sys/test/test_sysmodule.py | 5 +++++ + 9 files changed, 46 insertions(+), 4 deletions(-) + create mode 100644 pypy/module/sys/debian.py + +diff --git a/lib-python/2.7/sysconfig.py b/lib-python/2.7/sysconfig.py +index 9621a49..22af6e8 100644 +--- a/lib-python/2.7/sysconfig.py ++++ b/lib-python/2.7/sysconfig.py +@@ -526,6 +526,9 @@ def get_config_vars(*args): + import imp + for suffix, mode, type_ in imp.get_suffixes(): + if type_ == imp.C_EXTENSION: ++ multiarch = _CONFIG_VARS.get('MULTIARCH') ++ if multiarch and multiarch in suffix: ++ continue + _CONFIG_VARS['SOABI'] = suffix.split('.')[1] + break + _CONFIG_VARS['INCLUDEPY'] = os.path.join(_CONFIG_VARS['prefix'], +diff --git a/lib-python/2.7/test/test_sysconfig.py b/lib-python/2.7/test/test_sysconfig.py +index 69d660b..95d3a3c 100644 +--- a/lib-python/2.7/test/test_sysconfig.py ++++ b/lib-python/2.7/test/test_sysconfig.py +@@ -344,6 +344,11 @@ class TestSysConfig(unittest.TestCase): + self.assertEqual(status, 0) + self.assertEqual(my_platform, test_platform) + ++ def test_multiarch_config_var(self): ++ multiarch = get_config_var('MULTIARCH') ++ self.assertIsInstance(multiarch, str) ++ ++ + def test_main(): + run_unittest(TestSysConfig) + +diff --git a/lib_pypy/_sysconfigdata.py b/lib_pypy/_sysconfigdata.py +index dda3edd..8b20ea8 100644 +--- a/lib_pypy/_sysconfigdata.py ++++ b/lib_pypy/_sysconfigdata.py +@@ -1,5 +1,10 @@ + import imp ++import sys + + build_time_vars = { + "SO": [s[0] for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION][0] + } ++if hasattr(sys, '_multiarch'): ++ build_time_vars.update({ ++ 'MULTIARCH': sys._multiarch, ++ }) +diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py +index 12635cb..55fb2b6 100644 +--- a/pypy/module/imp/importing.py ++++ b/pypy/module/imp/importing.py +@@ -43,7 +43,7 @@ DEFAULT_SOABI = 'pypy-41' + DEFAULT_MAGIC_TAG = DEFAULT_SOABI + + @specialize.memo() +-def get_so_extension(space): ++def get_so_extension(space, multiarch=True): + if space.config.objspace.soabi is not None: + soabi = space.config.objspace.soabi + else: +@@ -55,6 +55,9 @@ def get_so_extension(space): + if not space.config.translating: + soabi += 'i' + ++ if multiarch and hasattr(sys, '_multiarch'): ++ soabi += '-' + sys._multiarch ++ + return '.' + soabi + SO + + def log_pyverbose(space, level, message): +diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py +index 7d133f5..21b9f3d 100644 +--- a/pypy/module/imp/interp_imp.py ++++ b/pypy/module/imp/interp_imp.py +@@ -11,10 +11,14 @@ from pypy.interpreter.streamutil import wrap_streamerror + def get_suffixes(space): + suffixes_w = [] + if importing.has_so_extension(space): +- suffixes_w.append( ++ suffixes_w.extend([ + space.newtuple([space.newtext(importing.get_so_extension(space)), + space.newtext('rb'), +- space.newint(importing.C_EXTENSION)])) ++ space.newint(importing.C_EXTENSION)]), ++ space.newtuple([space.newtext(importing.get_so_extension(space, False)), ++ space.newtext('rb'), ++ space.newint(importing.C_EXTENSION)]), ++ ]) + suffixes_w.extend([ + space.newtuple([space.newtext('.py'), + space.newtext('U'), +diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py +index e5851ea..ba85776 100644 +--- a/pypy/module/imp/test/test_import.py ++++ b/pypy/module/imp/test/test_import.py +@@ -850,11 +850,12 @@ class TestAbi: + def test_abi_tag(self): + space1 = maketestobjspace(make_config(None, soabi='TEST')) + space2 = maketestobjspace(make_config(None, soabi='')) ++ ma = sys._multiarch + if sys.platform == 'win32': + assert importing.get_so_extension(space1) == '.TESTi.pyd' + assert importing.get_so_extension(space2) == '.pyd' + else: +- assert importing.get_so_extension(space1) == '.TESTi.so' ++ assert importing.get_so_extension(space1) == '.TESTi-%s.so' % ma + assert importing.get_so_extension(space2) == '.so' + + def _getlong(data): +diff --git a/pypy/module/sys/debian.py b/pypy/module/sys/debian.py +new file mode 100644 +index 0000000..6c5fbdb +--- /dev/null ++++ b/pypy/module/sys/debian.py +@@ -0,0 +1,12 @@ ++import os ++import sys ++ ++_multiarch = getattr(getattr(sys, 'implementation', sys), '_multiarch', None) ++# Support building under the Debian buildsystem, on older releases ++if not _multiarch: ++ _multiarch = os.environ['DEB_HOST_MULTIARCH'] ++del os, sys ++ ++ ++def get_multiarch_tuple(space): ++ return space.wrap(_multiarch) +diff --git a/pypy/module/sys/moduledef.py b/pypy/module/sys/moduledef.py +index 5a7d4bd..32944d6 100644 +--- a/pypy/module/sys/moduledef.py ++++ b/pypy/module/sys/moduledef.py +@@ -2,6 +2,7 @@ from pypy.interpreter.mixedmodule import MixedModule + from pypy.interpreter.error import OperationError + from rpython.rlib.objectmodel import we_are_translated + from rpython.rlib import rdynload ++import os + import sys + + _WIN = sys.platform == 'win32' +@@ -100,6 +101,9 @@ class Module(MixedModule): + interpleveldefs['getdlopenflags'] = 'system.getdlopenflags' + interpleveldefs['setdlopenflags'] = 'system.setdlopenflags' + ++ if hasattr(sys, '_multiarch') or os.environ.get('DEB_HOST_MULTIARCH'): ++ interpleveldefs['_multiarch'] = 'debian.get_multiarch_tuple(space)' ++ + appleveldefs = { + 'excepthook' : 'app.excepthook', + '__excepthook__' : 'app.excepthook', +diff --git a/pypy/module/sys/test/test_sysmodule.py b/pypy/module/sys/test/test_sysmodule.py +index cf0812a..f498809 100644 +--- a/pypy/module/sys/test/test_sysmodule.py ++++ b/pypy/module/sys/test/test_sysmodule.py +@@ -141,6 +141,11 @@ class AppTestAppSysTests: + exc = raises(SystemExit, sys.exit, (1, 2, 3)) + assert exc.value.code == (1, 2, 3) + ++ def test_sys_multiarch(self): ++ import sys ++ multiarch = sys._multiarch ++ assert isinstance(multiarch, str) ++ + + class AppTestSysModulePortedFromCPython: + diff --git a/debian/patches/noise b/debian/patches/noise new file mode 100644 index 0000000..2693d75 --- /dev/null +++ b/debian/patches/noise @@ -0,0 +1,24 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Always output the mandelbrot + +So that our buildds see progress + +Forwarded: not-needed +--- + rpython/tool/ansi_print.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpython/tool/ansi_print.py b/rpython/tool/ansi_print.py +index bfa40be..22ab296 100644 +--- a/rpython/tool/ansi_print.py ++++ b/rpython/tool/ansi_print.py +@@ -7,7 +7,7 @@ from py.io import ansi_print + from rpython.tool.ansi_mandelbrot import Driver + + +-isatty = getattr(sys.stderr, 'isatty', lambda: False) ++isatty = lambda: True + mandelbrot_driver = Driver() + wrote_dot = False # global shared state + diff --git a/debian/patches/pep3147-core b/debian/patches/pep3147-core new file mode 100644 index 0000000..44fbc17 --- /dev/null +++ b/debian/patches/pep3147-core @@ -0,0 +1,831 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: PEP3147 support + +Tests modified from Barry Warsaw's PEP3147 cpython support. + +Forwarded: no +Last-Update: 2013-02-23 +--- + pypy/config/pypyoption.py | 5 + + pypy/doc/interpreter.rst | 1 + + pypy/interpreter/app_main.py | 1 + + pypy/interpreter/main.py | 1 + + pypy/interpreter/test/test_main.py | 11 + + pypy/module/imp/importing.py | 81 +++++- + pypy/module/imp/interp_imp.py | 12 + + pypy/module/imp/moduledef.py | 3 + + pypy/module/imp/test/test_app.py | 7 +- + pypy/module/imp/test/test_import.py | 323 ++++++++++++++++++++++-- + pypy/module/zipimport/test/test_undocumented.py | 23 +- + 11 files changed, 430 insertions(+), 38 deletions(-) + +diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py +index 9c627a9..52db19f 100644 +--- a/pypy/config/pypyoption.py ++++ b/pypy/config/pypyoption.py +@@ -151,6 +151,11 @@ pypy_optiondescription = OptionDescription("objspace", "Object Space Options", [ + cmdline="--soabi", + default=None), + ++ StrOption("magic_tag", ++ "Tag to differentiate .pyc files for different Python interpreters", ++ cmdline="--magic_tag", ++ default=None), ++ + BoolOption("honor__builtins__", + "Honor the __builtins__ key of a module dictionary", + default=False), +diff --git a/pypy/doc/interpreter.rst b/pypy/doc/interpreter.rst +index 57b5207..7f32dfd 100644 +--- a/pypy/doc/interpreter.rst ++++ b/pypy/doc/interpreter.rst +@@ -239,6 +239,7 @@ attributes: + + * ``__doc__`` the docstring of the module + * ``__file__`` the source filename from which this module was instantiated ++* ``__cached__`` the filename for the byte-compiled cache of this module + * ``__path__`` state used for relative imports + + Apart from the basic Module used for importing +diff --git a/pypy/interpreter/app_main.py b/pypy/interpreter/app_main.py +index ec5dcab..d9f154d 100755 +--- a/pypy/interpreter/app_main.py ++++ b/pypy/interpreter/app_main.py +@@ -742,6 +742,7 @@ def run_command_line(interactive, + # on the command-line. + filename = sys.argv[0] + mainmodule.__file__ = filename ++ mainmodule.__cached__ = None + sys.path.insert(0, sys.pypy_resolvedirof(filename)) + # assume it's a pyc file only if its name says so. + # CPython goes to great lengths to detect other cases +diff --git a/pypy/interpreter/main.py b/pypy/interpreter/main.py +index e1141a5..24f58b7 100644 +--- a/pypy/interpreter/main.py ++++ b/pypy/interpreter/main.py +@@ -43,6 +43,7 @@ def _run_eval_string(source, filename, space, eval): + space.setitem(w_globals, space.newtext('__builtins__'), space.builtin) + if filename is not None: + space.setitem(w_globals, space.newtext('__file__'), space.newtext(filename)) ++ space.setitem(w_globals, space.newtext('__cached__'), space.w_None) + + retval = pycode.exec_code(space, w_globals, w_globals) + if eval: +diff --git a/pypy/interpreter/test/test_main.py b/pypy/interpreter/test/test_main.py +index dc7e536..54eebe2 100644 +--- a/pypy/interpreter/test/test_main.py ++++ b/pypy/interpreter/test/test_main.py +@@ -13,6 +13,12 @@ def main(): + main() + """ + ++test__file__code = """ ++assert __file__ is not None ++assert __cached__ is None ++print len('hello world') ++""" ++ + # On module test we want to ensure that the called module __name__ is + # '__main__' and argv is set as expected. + testmodulecode = """ +@@ -39,12 +45,14 @@ def checkoutput(space, expected_output, f, *args): + assert capturefn.read(mode='rU') == expected_output + + testfn = udir.join('tmp_hello_world.py') ++test__file__fn = udir.join('test__file__.py') + testmodule = 'tmp_hello_module' + testpackage = 'tmp_package' + + class TestMain: + def setup_class(cls): + testfn.write(testcode, 'w') ++ test__file__fn.write(test__file__code, 'w') + udir.join(testmodule + '.py').write(testmodulecode, 'w') + udir.ensure(testpackage, '__init__.py') + udir.join(testpackage, testmodule + '.py').write(testmodulecode, 'w') +@@ -78,3 +86,6 @@ class TestMain: + testmodule, ['hello world']) + checkoutput(self.space, testresultoutput, main.run_module, + testpackage + '.' + testmodule, ['hello world']) ++ ++ def test__file__file(self): ++ checkoutput(self.space, testresultoutput, main.run_file, str(test__file__fn)) +diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py +index 24e5b31..12635cb 100644 +--- a/pypy/module/imp/importing.py ++++ b/pypy/module/imp/importing.py +@@ -12,7 +12,7 @@ from pypy.interpreter.baseobjspace import W_Root, CannotHaveLock + from pypy.interpreter.eval import Code + from pypy.interpreter.pycode import PyCode + from pypy.interpreter.streamutil import wrap_streamerror +-from rpython.rlib import streamio, jit ++from rpython.rlib import rstring, streamio, jit + from rpython.rlib.streamio import StreamErrors + from rpython.rlib.objectmodel import we_are_translated, specialize + from pypy.module.sys.version import PYPY_VERSION +@@ -40,6 +40,7 @@ SO = '.pyd' if _WIN32 else '.so' + # split the two usages again. + #DEFAULT_SOABI = 'pypy-%d%d' % PYPY_VERSION[:2] + DEFAULT_SOABI = 'pypy-41' ++DEFAULT_MAGIC_TAG = DEFAULT_SOABI + + @specialize.memo() + def get_so_extension(space): +@@ -605,6 +606,7 @@ def find_module(space, modulename, w_modulename, partname, w_path, + def _prepare_module(space, w_mod, filename, pkgdir): + space.sys.setmodule(w_mod) + space.setattr(w_mod, space.newtext('__file__'), space.newtext(filename)) ++ space.setattr(w_mod, space.newtext('__cached__'), space.w_None) + space.setattr(w_mod, space.newtext('__doc__'), space.w_None) + if pkgdir is not None: + space.setattr(w_mod, space.newtext('__path__'), space.newlist([space.newtext(pkgdir)])) +@@ -885,6 +887,65 @@ def get_pyc_magic(space): + + return default_magic + ++def get_pyc_tag(space): ++ """Return the tag used in __pycache__ filenames""" ++ # XXX CPython testing hack: use the default ++ if not we_are_translated(): ++ return DEFAULT_MAGIC_TAG ++ ++ if space.config.objspace.magic_tag is not None: ++ magic_tag = space.config.objspace.magic_tag ++ else: ++ magic_tag = DEFAULT_MAGIC_TAG ++ return magic_tag ++ ++def make_compiled_pathname(space, pathname): ++ """ ++ The PEP 3147 path to the byte-compiled file associated with the source path ++ """ ++ pathname = rstring.assert_str0(pathname) ++ ++ index = pathname.rfind(os.sep) ++ if index < 0: ++ pycachedir = '__pycache__' ++ basename = pathname ++ else: ++ pycachedir = pathname[:index + 1] + '__pycache__' ++ basename = pathname[index + 1:] ++ ++ index = basename.rfind('.') ++ if index > 0: ++ basename = basename[:index + 1] ++ ++ filename = basename + get_pyc_tag(space) + '.pyc' ++ cpathname = os.path.join(pycachedir, filename) ++ return cpathname ++ ++def make_source_pathname(space, cpathname): ++ """ ++ Given the path to a PEP 3147 file name, return the associated source code ++ file path. ++ """ ++ cpathname = rstring.assert_str0(cpathname) ++ ++ index = cpathname.rfind(os.sep) ++ if index < 0: ++ raise OperationError(space.w_ValueError, space.newtext( ++ "Not a PEP 3147 pyc path: %s" % cpathname)) ++ pycachedir = cpathname[:index] ++ filename = cpathname[index + 1:] ++ ++ index = pycachedir.rfind(os.sep) ++ extension = '.' + get_pyc_tag(space) + '.pyc' ++ ext_index = len(filename) - len(extension) ++ if (index < 0 or pycachedir[index + 1:] != '__pycache__' ++ or not filename.endswith(extension) ++ or ext_index < 0): ++ raise OperationError(space.w_ValueError, space.newtext( ++ "Not a PEP 3147 pyc path: %s" % cpathname)) ++ basedir = pycachedir[:index] ++ basename = filename[:ext_index] ++ return os.path.join(basedir, basename + '.py') + + def parse_source_module(space, pathname, source): + """ Parse a source file and return the corresponding code object """ +@@ -927,7 +988,7 @@ def load_source_module(space, w_modulename, w_mod, pathname, source, fd, + src_stat = os.fstat(fd) + except OSError as e: + raise wrap_oserror(space, e, pathname) # better report this error +- cpathname = pathname + 'c' ++ cpathname = make_compiled_pathname(space, pathname) + mtime = int(src_stat[stat.ST_MTIME]) + mode = src_stat[stat.ST_MODE] + stream = check_compiled_module(space, cpathname, mtime) +@@ -939,7 +1000,7 @@ def load_source_module(space, w_modulename, w_mod, pathname, source, fd, + _wrap_readall(space, stream)) + finally: + _close_ignore(stream) +- space.setattr(w_mod, space.newtext('__file__'), space.newtext(cpathname)) ++ space.setattr(w_mod, space.newtext('__file__'), space.newtext(pathname)) + else: + code_w = parse_source_module(space, pathname, source) + +@@ -955,6 +1016,7 @@ def load_source_module(space, w_modulename, w_mod, pathname, source, fd, + if optimize >= 2: + code_w.remove_docstrings(space) + ++ space.setattr(w_mod, space.newtext('__cached__'), space.newtext(cpathname)) + update_code_filenames(space, code_w, pathname) + return exec_code_module(space, w_mod, code_w, w_modulename, + check_afterwards=check_afterwards) +@@ -1117,6 +1179,19 @@ def write_compiled_module(space, co, cpathname, src_mode, src_mtime): + raise + #print "Problem while marshalling %s, skipping" % cpathname + return ++ ++ # Create PEP3147 __pycache__ dir if necessary ++ index = cpathname.rfind(os.sep) ++ if index < 0: ++ return ++ pycachedir = cpathname[:index] ++ if not os.path.isdir(pycachedir): ++ mode = src_mode | 0755 ++ try: ++ os.mkdir(pycachedir, mode) ++ except OSError: ++ return ++ + # + # Careful here: we must not crash nor leave behind something that looks + # too much like a valid pyc file but really isn't one. +diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py +index 09127ab..7d133f5 100644 +--- a/pypy/module/imp/interp_imp.py ++++ b/pypy/module/imp/interp_imp.py +@@ -36,6 +36,18 @@ def get_magic(space): + d = x & 0xff + return space.newbytes(chr(a) + chr(b) + chr(c) + chr(d)) + ++def get_tag(space): ++ return space.newtext(importing.get_pyc_tag(space)) ++ ++@unwrap_spec(path='fsencode') ++def cache_from_source(space, path, w_debug_override=None): ++ # w_debug_override is ignored, pypy doesn't support __debug__ ++ return space.newtext(importing.make_compiled_pathname(space, path)) ++ ++@unwrap_spec(path='fsencode') ++def source_from_cache(space, path): ++ return space.newtext(importing.make_source_pathname(space, path)) ++ + def get_file(space, w_file, filename, filemode): + if space.is_none(w_file): + try: +diff --git a/pypy/module/imp/moduledef.py b/pypy/module/imp/moduledef.py +index 39b577a..fb1023a 100644 +--- a/pypy/module/imp/moduledef.py ++++ b/pypy/module/imp/moduledef.py +@@ -17,6 +17,9 @@ class Module(MixedModule): + 'get_suffixes': 'interp_imp.get_suffixes', + + 'get_magic': 'interp_imp.get_magic', ++ 'get_tag': 'interp_imp.get_tag', ++ 'cache_from_source': 'interp_imp.cache_from_source', ++ 'source_from_cache': 'interp_imp.source_from_cache', + 'find_module': 'interp_imp.find_module', + 'load_module': 'interp_imp.load_module', + 'load_source': 'interp_imp.load_source', +diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py +index f095168..70c0a00 100644 +--- a/pypy/module/imp/test/test_app.py ++++ b/pypy/module/imp/test/test_app.py +@@ -150,6 +150,7 @@ class AppTestImpModule: + + def test_rewrite_pyc_check_code_name(self): + # This one is adapted from cpython's Lib/test/test_import.py ++ from imp import cache_from_source + from os import chmod + from os.path import join + from sys import modules, path +@@ -159,6 +160,7 @@ class AppTestImpModule: + import sys + code_filename = sys._getframe().f_code.co_filename + module_filename = __file__ ++ module_bytefilename = __cached__ + constant = 1 + def func(): + pass +@@ -170,7 +172,7 @@ class AppTestImpModule: + file_name = join(dir_name, module_name + '.py') + with open(file_name, "wb") as f: + f.write(code) +- compiled_name = file_name + ("c" if __debug__ else "o") ++ compiled_name = cache_from_source(file_name) + chmod(file_name, 0777) + + # Setup +@@ -188,7 +190,8 @@ class AppTestImpModule: + try: + # Ensure proper results + assert mod != orig_module +- assert mod.module_filename == compiled_name ++ assert mod.module_filename == file_name ++ assert mod.module_bytefilename == compiled_name + assert mod.code_filename == file_name + assert mod.func_filename == file_name + finally: +diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py +index a7b92a0..e5851ea 100644 +--- a/pypy/module/imp/test/test_import.py ++++ b/pypy/module/imp/test/test_import.py +@@ -8,7 +8,7 @@ from rpython.rlib import streamio + from pypy.tool.option import make_config + from pypy.tool.pytest.objspace import maketestobjspace + import pytest +-import sys, os ++import shutil, sys, os + import tempfile, marshal + + from pypy.module.imp import importing +@@ -107,12 +107,18 @@ def setup_directory_structure(space): + + # create compiled/x.py and a corresponding pyc file + p = setuppkg("compiled", x = "x = 84") ++ try: ++ p.mkdir('__pycache__') ++ except py.error.EEXIST: ++ pass ++ cpathname = p.join('__pycache__').join( ++ 'x.' + importing.get_pyc_tag(space) + '.pyc') + if conftest.option.runappdirect: + import marshal, stat, struct, imp + code = py.code.Source(p.join("x.py").read()).compile() + s3 = marshal.dumps(code) + s2 = struct.pack("<i", os.stat(str(p.join("x.py")))[stat.ST_MTIME]) +- p.join("x.pyc").write(imp.get_magic() + s2 + s3, mode='wb') ++ cpathname.write(imp.get_magic() + s2 + s3, mode='wb') + else: + w = space.wrap + w_modname = w("compiled.x") +@@ -127,8 +133,9 @@ def setup_directory_structure(space): + stream.close() + if not space.config.translation.sandbox: + # also create a lone .pyc file +- p.join('lone.pyc').write(p.join('x.pyc').read(mode='rb'), +- mode='wb') ++ ++ p.join(importing.make_compiled_pathname(space, 'lone.py') ++ ).write(cpathname.read(mode='rb'), mode='wb') + + # create a .pyw file + p = setuppkg("windows", x = "x = 78") +@@ -873,6 +880,8 @@ def _testfilesource(source="x=42"): + + class TestPycStuff: + # ___________________ .pyc related stuff _________________ ++ def setup_class(cls): ++ cls.tag = importing.get_pyc_tag(cls.space) + + def test_check_compiled_module(self): + space = self.space +@@ -1013,7 +1022,8 @@ class TestPycStuff: + ret = space.int_w(w_ret) + assert ret == 42 + +- cpathname = udir.join('test.pyc') ++ cpathname = importing.make_compiled_pathname(space, 'test.py') ++ cpathname = udir.join(cpathname) + assert cpathname.check() + cpathname.remove() + +@@ -1031,7 +1041,8 @@ class TestPycStuff: + write_pyc=False) + finally: + stream.close() +- cpathname = udir.join('test.pyc') ++ cpathname = importing.make_compiled_pathname(space, 'test.py') ++ cpathname = udir.join(cpathname) + assert not cpathname.check() + + def test_load_source_module_dont_write_bytecode(self): +@@ -1051,7 +1062,8 @@ class TestPycStuff: + space.setattr(space.sys, space.wrap('dont_write_bytecode'), + space.w_False) + stream.close() +- cpathname = udir.join('test.pyc') ++ cpathname = importing.make_compiled_pathname(space, 'test.py') ++ cpathname = udir.join(cpathname) + assert not cpathname.check() + + def test_load_source_module_syntaxerror(self): +@@ -1071,7 +1083,8 @@ class TestPycStuff: + pass + stream.close() + +- cpathname = udir.join('test.pyc') ++ cpathname = importing.make_compiled_pathname(space, 'test.py') ++ cpathname = udir.join(cpathname) + assert not cpathname.check() + + def test_load_source_module_importerror(self): +@@ -1092,7 +1105,8 @@ class TestPycStuff: + stream.close() + + # And the .pyc has been generated +- cpathname = udir.join('test.pyc') ++ cpathname = importing.make_compiled_pathname(space, 'test.py') ++ cpathname = udir.join(cpathname) + assert cpathname.check() + + def test_write_compiled_module(self): +@@ -1109,7 +1123,8 @@ class TestPycStuff: + pycode = w_ret + assert type(pycode) is pypy.interpreter.pycode.PyCode + +- cpathname = str(udir.join('cpathname.pyc')) ++ cpathname = importing.make_compiled_pathname(space, 'cpathname.py') ++ cpathname = str(udir.join(cpathname)) + mode = 0777 + mtime = 12345 + importing.write_compiled_module(space, +@@ -1181,6 +1196,271 @@ class TestPycStuff: + finally: + stream.close() + ++ def test_make_compiled_pathname(self): ++ # Given the path to a .py file, return the path to its PEP 3147 ++ # defined .pyc file (i.e. under __pycache__). ++ cpathname = importing.make_compiled_pathname(self.space, ++ '/foo/bar/baz/qux.py') ++ expected = '/foo/bar/baz/__pycache__/qux.%s.pyc' % self.tag ++ assert cpathname == expected ++ ++ def test_make_compiled_pathname_cwd(self): ++ cpathname = importing.make_compiled_pathname(self.space, 'foo.py') ++ expected = os.sep.join(('__pycache__', 'foo.%s.pyc' % self.tag)) ++ assert cpathname == expected ++ ++ @pytest.mark.skipif('os.altsep is None') ++ def test_altsep_make_compiled_pathname(self): ++ # Windows path and PEP 3147. ++ cpathname = importing.make_compiled_pathname(self.space, ++ '\\foo\\bar\\baz\\qux.py') ++ expected = '\\foo\\bar\\baz\\__pycache__\\qux.%s.pyc' % self.tag ++ assert cpathname == expected ++ ++ @pytest.mark.skipif('os.altsep is None') ++ def test_altsep_and_sep_make_compiled_pathname(self): ++ # Windows path and PEP 3147 where altsep is right of sep. ++ cpathname = importing.make_compiled_pathname(self.space, ++ '\\foo\\bar/baz\\qux.py') ++ expected = '\\foo\\bar/baz\\__pycache__\\qux.%s.pyc' % self.tag ++ assert cpathname == expected ++ ++ @pytest.mark.skipif('os.altsep is None') ++ def test_sep_altsep_and_sep_make_compiled_pathname(self): ++ # Windows path and PEP 3147 where sep is right of altsep. ++ cpathname = importing.make_compiled_pathname(self.space, ++ '\\foo\\bar\\baz/qux.py') ++ expected = '\\foo\\bar\\baz/__pycache__/qux.%s.pyc' % self.tag ++ assert cpathname == expected ++ ++ def test_make_source_pathname(self): ++ # Given the path to a PEP 3147 defined .pyc file, return the path to ++ # its source. This tests the good path. ++ pathname = importing.make_source_pathname(self.space, ++ '/foo/bar/baz/__pycache__/qux.%s.pyc' % self.tag) ++ assert pathname == '/foo/bar/baz/qux.py' ++ ++ def test_make_source_pathname_bad_path(self): ++ # When the path to a pyc file is not in PEP 3147 format, a ValueError ++ # is raised. ++ try: ++ importing.make_source_pathname(self.space, '/foo/bar/bazqux.pyc') ++ except OperationError, e: ++ if not e.match(self.space, self.space.w_ValueError): ++ raise ++ else: ++ raise Exception("Should have raised ValueError") ++ ++ def test_make_source_pathname_no_slash(self): ++ # No slashes at all in path -> ValueError ++ try: ++ importing.make_source_pathname(self.space, 'foo.%s.pyc' % self.tag) ++ except OperationError, e: ++ if not e.match(self.space, self.space.w_ValueError): ++ raise ++ else: ++ raise Exception("Should have raised ValueError") ++ ++ def test_make_source_pathname_too_few_dots(self): ++ # Too few dots in final path component -> ValueError ++ try: ++ importing.make_source_pathname(self.space, '__pycache__/foo.pyc') ++ except OperationError, e: ++ if not e.match(self.space, self.space.w_ValueError): ++ raise ++ else: ++ raise Exception("Should have raised ValueError") ++ ++ def test_make_source_pathname_too_many_dots(self): ++ # Too many dots in final path component -> ValueError ++ pathname = '__pycache__/foo.%s.foo.pyc' % self.tag ++ try: ++ importing.make_source_pathname(self.space, pathname) ++ except OperationError, e: ++ if not e.match(self.space, self.space.w_ValueError): ++ raise ++ else: ++ raise Exception("Should have raised ValueError") ++ ++ def test_make_source_pathname_no__pycache__(self): ++ # Another problem with the path -> ValueError ++ pathname = '/foo/bar/foo.%s.foo.pyc' % self.tag ++ try: ++ importing.make_source_pathname(self.space, pathname) ++ except OperationError, e: ++ if not e.match(self.space, self.space.w_ValueError): ++ raise ++ else: ++ raise Exception("Should have raised ValueError") ++ ++ ++class AppTestPEP3147Pyc(object): ++ def test_package___file__(self): ++ import os, sys, shutil ++ # Test that a package's __file__ points to the right source directory. ++ try: ++ os.mkdir('pep3147') ++ sys.path.insert(0, os.curdir) ++ # Touch the __init__.py file. ++ with open('pep3147/__init__.py', 'w'): ++ pass ++ m = __import__('pep3147') ++ # Ensure we load the pyc file. ++ del sys.modules['pep3147'] ++ m = __import__('pep3147') ++ assert m.__file__ == os.sep.join(('.', 'pep3147', '__init__.py')) ++ finally: ++ if sys.path[0] == os.curdir: ++ del sys.path[0] ++ shutil.rmtree('pep3147') ++ ++ ++class AppTestPycache(object): ++ # Test the various PEP 3147 related behaviors. ++ ++ def setup_class(cls): ++ space = cls.space ++ ++ cls.module = '_app_test_pycache' ++ cls.filename = cls.module + '.py' ++ cls.w_module = space.wrap(cls.module) ++ cls.w_filename = space.wrap(cls.filename) ++ cls.w_tag = space.wrap(importing.get_pyc_tag(space)) ++ ++ def setup_method(cls, method): ++ if os.path.exists('__pycache__'): ++ shutil.rmtree('__pycache__') ++ if os.path.exists(cls.filename): ++ os.unlink(cls.filename) ++ ++ with open(cls.filename, 'w') as fp: ++ print >> fp, '# This is a test file written by test_import.py' ++ ++ def teardown_method(cls, method): ++ if os.path.exists('__pycache__'): ++ shutil.rmtree('__pycache__') ++ if os.path.exists(cls.filename): ++ os.unlink(cls.filename) ++ ++ def test_import_pyc_path(self): ++ import sys, os ++ sys.path.insert(0, '.') ++ try: ++ assert not os.path.exists('__pycache__') ++ __import__(self.module) ++ assert os.path.exists('__pycache__') ++ assert os.path.exists(os.path.join( ++ '__pycache__', '%s.%s.pyc' % (self.module, self.tag))) ++ finally: ++ del sys.path[0] ++ sys.modules.pop(self.module, None) ++ ++ @pytest.mark.skipif('os.name != "posix"') ++ def test_unwritable_directory(self): ++ # When the umask causes the new __pycache__ directory to be ++ # unwritable, the import still succeeds but no .pyc file is written. ++ import os, sys ++ sys.path.insert(0, '.') ++ try: ++ oldmask = os.umask(0222) ++ try: ++ __import__(self.module) ++ finally: ++ os.umask(oldmask) ++ assert os.path.exists('__pycache__') ++ assert not os.path.exists(os.path.join( ++ '__pycache__', '%s.%s.pyc' % (self.module, self.tag))) ++ finally: ++ del sys.path[0] ++ sys.modules.pop(self.module, None) ++ ++ def test_missing_source(self): ++ # With PEP 3147 cache layout, removing the source but leaving the pyc ++ # file does not satisfy the import. ++ import imp, os, sys ++ sys.path.insert(0, '.') ++ try: ++ __import__(self.module) ++ pyc_file = imp.cache_from_source(self.filename) ++ assert os.path.exists(pyc_file) ++ os.remove(self.filename) ++ del sys.modules[self.module] ++ try: ++ __import__(self.module) ++ except ImportError: ++ pass ++ else: ++ raise "Expected ImportError to be raised" ++ finally: ++ del sys.path[0] ++ sys.modules.pop(self.module, None) ++ ++ def test___cached__(self): ++ # Modules now also have an __cached__ that points to the pyc file. ++ import imp, os, sys ++ sys.path.insert(0, '.') ++ try: ++ m = __import__(self.module) ++ pyc_file = imp.cache_from_source(self.filename) ++ assert m.__cached__ == os.path.join(os.curdir, pyc_file) ++ finally: ++ del sys.path[0] ++ sys.modules.pop(self.module, None) ++ ++ def test_package___cached__(self): ++ # Like test___cached__ but for packages. ++ import imp, os, shutil, sys ++ sys.path.insert(0, '.') ++ try: ++ os.mkdir('_test_pep3147') ++ # Touch the __init__.py ++ with open(os.path.join('_test_pep3147', '__init__.py'), 'w'): ++ pass ++ with open(os.path.join('_test_pep3147', 'foo.py'), 'w'): ++ pass ++ m = __import__('_test_pep3147.foo') ++ init_pyc = imp.cache_from_source( ++ os.path.join('_test_pep3147', '__init__.py')) ++ assert m.__cached__ == os.path.join(os.curdir, init_pyc) ++ foo_pyc = imp.cache_from_source(os.path.join('_test_pep3147', ++ 'foo.py')) ++ assert (sys.modules['_test_pep3147.foo'].__cached__ ++ == os.path.join(os.curdir, foo_pyc)) ++ finally: ++ shutil.rmtree('_test_pep3147') ++ del sys.path[0] ++ sys.modules.pop('_test_pep3147.foo', None) ++ sys.modules.pop('_test_pep3147', None) ++ ++ def test_package___cached___from_pyc(self): ++ # Like test___cached__ but ensuring __cached__ when imported from a ++ # PEP 3147 pyc file. ++ import imp, os, shutil, sys ++ sys.path.insert(0, '.') ++ try: ++ os.mkdir('_test_pep3147') ++ # Touch the __init__.py ++ with open(os.path.join('_test_pep3147', '__init__.py'), 'w'): ++ pass ++ with open(os.path.join('_test_pep3147', 'foo.py'), 'w'): ++ pass ++ m = __import__('_test_pep3147.foo') ++ del sys.modules['_test_pep3147.foo'] ++ del sys.modules['_test_pep3147'] ++ m = __import__('_test_pep3147.foo') ++ init_pyc = imp.cache_from_source( ++ os.path.join('_test_pep3147', '__init__.py')) ++ assert m.__cached__ == os.path.join(os.curdir, init_pyc) ++ foo_pyc = imp.cache_from_source(os.path.join('_test_pep3147', ++ 'foo.py')) ++ assert (sys.modules['_test_pep3147.foo'].__cached__ ++ == os.path.join(os.curdir, foo_pyc)) ++ finally: ++ shutil.rmtree('_test_pep3147') ++ del sys.path[0] ++ sys.modules.pop('_test_pep3147.foo', None) ++ sys.modules.pop('_test_pep3147', None) ++ + + def test_PYTHONPATH_takes_precedence(space): + if sys.platform == "win32": +@@ -1486,24 +1766,21 @@ class AppTestWriteBytecode(object): + def test_default(self): + import os.path + from test_bytecode import a +- assert a.__file__.endswith('a.py') +- assert os.path.exists(a.__file__ + 'c') == (not self.sandbox) ++ assert os.path.exists(a.__cached__) == (not self.sandbox) + + def test_write_bytecode(self): + import os.path + import sys + sys.dont_write_bytecode = False + from test_bytecode import b +- assert b.__file__.endswith('b.py') +- assert os.path.exists(b.__file__ + 'c') ++ assert os.path.exists(b.__cached__) + + def test_dont_write_bytecode(self): + import os.path + import sys + sys.dont_write_bytecode = True + from test_bytecode import c +- assert c.__file__.endswith('c.py') +- assert not os.path.exists(c.__file__ + 'c') ++ assert not os.path.exists(c.__cached__) + + + class AppTestWriteBytecodeSandbox(AppTestWriteBytecode): +@@ -1523,25 +1800,21 @@ class _AppTestLonePycFileBase(object): + + def test_import_possibly_from_pyc(self): + from compiled import x +- assert x.__file__.endswith('x.pyc') ++ assert x.__file__.endswith('x.py') ++ assert x.__cached__.endswith('.pyc') + try: + from compiled import lone + except ImportError: +- assert not self.lonepycfiles, "should have found 'lone.pyc'" ++ assert not self.lonepycfiles, "should have found 'lone.TAG.pyc'" + else: +- assert self.lonepycfiles, "should not have found 'lone.pyc'" +- assert lone.__file__.endswith('lone.pyc') ++ assert self.lonepycfiles, "should not have found 'lone.TAG.pyc'" ++ assert lone.__cached__.endswith('.pyc') + + class AppTestNoLonePycFile(_AppTestLonePycFileBase): + spaceconfig = { + "objspace.lonepycfiles": False + } + +-class AppTestLonePycFile(_AppTestLonePycFileBase): +- spaceconfig = { +- "objspace.lonepycfiles": True +- } +- + + class AppTestMultithreadedImp(object): + spaceconfig = dict(usemodules=['thread', 'time']) +diff --git a/pypy/module/zipimport/test/test_undocumented.py b/pypy/module/zipimport/test/test_undocumented.py +index 7271f20..44f47c7 100644 +--- a/pypy/module/zipimport/test/test_undocumented.py ++++ b/pypy/module/zipimport/test/test_undocumented.py +@@ -31,12 +31,11 @@ class AppTestZipImport: + Clears zipimport._zip_directory_cache. + + """ +- import zipimport, os, shutil, zipfile, py_compile ++ import zipimport, os, shutil, zipfile, py_compile, imp + example_code = 'attr = None' + TESTFN = '@test' + zipimport._zip_directory_cache.clear() + zip_path = TESTFN + '.zip' +- bytecode_suffix = 'c'# if __debug__ else 'o' + zip_file = zipfile.ZipFile(zip_path, 'w') + for path in created_paths: + if os.sep in path: +@@ -53,13 +52,13 @@ class AppTestZipImport: + zip_file.write(code_path) + if bytecode: + py_compile.compile(code_path, doraise=True) +- zip_file.write(code_path + bytecode_suffix) ++ bytecode_path = imp.cache_from_source(code_path) ++ zip_file.write(bytecode_path) + zip_file.close() + return os.path.abspath(zip_path) + + def w_cleanup_zipfile(self, created_paths): +- import os, shutil +- bytecode_suffix = 'c'# if __debug__ else 'o' ++ import os, shutil, imp + zip_path = '@test.zip' + for path in created_paths: + if os.sep in path: +@@ -67,9 +66,17 @@ class AppTestZipImport: + if os.path.exists(directory): + shutil.rmtree(directory) + else: +- for suffix in ('.py', '.py' + bytecode_suffix): +- if os.path.exists(path + suffix): +- os.unlink(path + suffix) ++ source_file = path + '.py' ++ if os.path.exists(source_file): ++ os.unlink(source_file) ++ bytecode_file = imp.cache_from_source(source_file) ++ if os.path.exists(bytecode_file): ++ os.unlink(bytecode_file) ++ try: ++ os.rmdir(os.path.dirname(bytecode_file)) ++ except OSError: ++ pass ++ + os.unlink(zip_path) + + def test_inheritance(self): diff --git a/debian/patches/pep3147-issue11254 b/debian/patches/pep3147-issue11254 new file mode 100644 index 0000000..912301a --- /dev/null +++ b/debian/patches/pep3147-issue11254 @@ -0,0 +1,340 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: PEP3147 distutils patches +MIME-Version: 1.0 +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: 8bit + +Backported from cpython. + +Origin: cpython, http://hg.python.org/cpython/rev/27a36b05caed +Origin: cpython, http://hg.python.org/cpython/rev/651e84363001 +Origin: cpython, http://hg.python.org/cpython/rev/ea926dff958f +Bug-cpython: http://bugs.python.org/issue11254 +Author: Jeff Ramnani +Author: Éric Araujo <merwok@netwok.org> +Author: Stefano Rivera <stefanor@debian.org> +Last-Update: 2011-12-20 +--- + lib-python/2.7/distutils/command/build_py.py | 7 +- + lib-python/2.7/distutils/command/install_lib.py | 7 +- + lib-python/2.7/distutils/tests/test_build_py.py | 76 ++++++++++++++-------- + lib-python/2.7/distutils/tests/test_install_lib.py | 60 ++++++++++------- + lib-python/2.7/distutils/util.py | 17 +++-- + 5 files changed, 109 insertions(+), 58 deletions(-) + +diff --git a/lib-python/2.7/distutils/command/build_py.py b/lib-python/2.7/distutils/command/build_py.py +index c123c62..f4cc5c9 100644 +--- a/lib-python/2.7/distutils/command/build_py.py ++++ b/lib-python/2.7/distutils/command/build_py.py +@@ -5,6 +5,7 @@ Implements the Distutils 'build_py' command.""" + __revision__ = "$Id$" + + import os ++import imp + import sys + from glob import glob + +@@ -314,9 +315,11 @@ class build_py(Command): + outputs.append(filename) + if include_bytecode: + if self.compile: +- outputs.append(filename + "c") ++ outputs.append(imp.cache_from_source(filename, ++ debug_override=True)) + if self.optimize > 0: +- outputs.append(filename + "o") ++ outputs.append(imp.cache_from_source(filename, ++ debug_override=False)) + + outputs += [ + os.path.join(build_dir, filename) +diff --git a/lib-python/2.7/distutils/command/install_lib.py b/lib-python/2.7/distutils/command/install_lib.py +index 043e8b6..1f6141d 100644 +--- a/lib-python/2.7/distutils/command/install_lib.py ++++ b/lib-python/2.7/distutils/command/install_lib.py +@@ -6,6 +6,7 @@ Implements the Distutils 'install_lib' command + __revision__ = "$Id$" + + import os ++import imp + import sys + + from distutils.core import Command +@@ -169,9 +170,11 @@ class install_lib(Command): + if ext != PYTHON_SOURCE_EXTENSION: + continue + if self.compile: +- bytecode_files.append(py_file + "c") ++ bytecode_files.append(imp.cache_from_source( ++ py_file, debug_override=True)) + if self.optimize > 0: +- bytecode_files.append(py_file + "o") ++ bytecode_files.append(imp.cache_from_source( ++ py_file, debug_override=False)) + + return bytecode_files + +diff --git a/lib-python/2.7/distutils/tests/test_build_py.py b/lib-python/2.7/distutils/tests/test_build_py.py +index c4498bc..7c12dbf 100644 +--- a/lib-python/2.7/distutils/tests/test_build_py.py ++++ b/lib-python/2.7/distutils/tests/test_build_py.py +@@ -2,7 +2,7 @@ + + import os + import sys +-import StringIO ++import imp + import unittest + + from distutils.command.build_py import build_py +@@ -59,17 +59,16 @@ class BuildPyTestCase(support.TempdirManager, + files = os.listdir(pkgdest) + self.assertIn("__init__.py", files) + self.assertIn("README.txt", files) ++ pycache_dir = os.path.join(pkgdest, "__pycache__") ++ pyc_files = os.listdir(pycache_dir) + # XXX even with -O, distutils writes pyc, not pyo; bug? + if sys.dont_write_bytecode: +- self.assertNotIn("__init__.pyc", files) ++ self.assertNotIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) + else: +- self.assertIn("__init__.pyc", files) ++ self.assertIn("__init__.%s.pyc" % imp.get_tag(), pyc_files) + + def test_empty_package_dir(self): +- # See SF 1668596/1720897. +- cwd = os.getcwd() +- +- # create the distribution files. ++ # See bugs #1668596/#1720897 + sources = self.mkdtemp() + open(os.path.join(sources, "__init__.py"), "w").close() + +@@ -78,26 +77,51 @@ class BuildPyTestCase(support.TempdirManager, + open(os.path.join(testdir, "testfile"), "w").close() + + os.chdir(sources) +- old_stdout = sys.stdout +- sys.stdout = StringIO.StringIO() ++ dist = Distribution({"packages": ["pkg"], ++ "package_dir": {"pkg": ""}, ++ "package_data": {"pkg": ["doc/*"]}}) ++ # script_name need not exist, it just need to be initialized ++ dist.script_name = os.path.join(sources, "setup.py") ++ dist.script_args = ["build"] ++ dist.parse_command_line() + + try: +- dist = Distribution({"packages": ["pkg"], +- "package_dir": {"pkg": ""}, +- "package_data": {"pkg": ["doc/*"]}}) +- # script_name need not exist, it just need to be initialized +- dist.script_name = os.path.join(sources, "setup.py") +- dist.script_args = ["build"] +- dist.parse_command_line() +- +- try: +- dist.run_commands() +- except DistutilsFileError: +- self.fail("failed package_data test when package_dir is ''") +- finally: +- # Restore state. +- os.chdir(cwd) +- sys.stdout = old_stdout ++ dist.run_commands() ++ except DistutilsFileError: ++ self.fail("failed package_data test when package_dir is ''") ++ ++ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') ++ def test_byte_compile(self): ++ project_dir, dist = self.create_dist(py_modules=['boiledeggs']) ++ os.chdir(project_dir) ++ self.write_file('boiledeggs.py', 'import antigravity') ++ cmd = build_py(dist) ++ cmd.compile = 1 ++ cmd.build_lib = 'here' ++ cmd.finalize_options() ++ cmd.run() ++ ++ found = os.listdir(cmd.build_lib) ++ self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) ++ found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) ++ self.assertEqual(found, ['boiledeggs.%s.pyc' % imp.get_tag()]) ++ ++ @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled') ++ def test_byte_compile_optimized(self): ++ project_dir, dist = self.create_dist(py_modules=['boiledeggs']) ++ os.chdir(project_dir) ++ self.write_file('boiledeggs.py', 'import antigravity') ++ cmd = build_py(dist) ++ cmd.compile = 0 ++ cmd.optimize = 1 ++ cmd.build_lib = 'here' ++ cmd.finalize_options() ++ cmd.run() ++ ++ found = os.listdir(cmd.build_lib) ++ self.assertEqual(sorted(found), ['__pycache__', 'boiledeggs.py']) ++ found = os.listdir(os.path.join(cmd.build_lib, '__pycache__')) ++ self.assertEqual(sorted(found), ['boiledeggs.%s.pyo' % imp.get_tag()]) + + def test_dir_in_package_data(self): + """ +@@ -132,7 +156,7 @@ class BuildPyTestCase(support.TempdirManager, + + def test_dont_write_bytecode(self): + # makes sure byte_compile is not used +- pkg_dir, dist = self.create_dist() ++ dist = self.create_dist()[1] + cmd = build_py(dist) + cmd.compile = 1 + cmd.optimize = 1 +diff --git a/lib-python/2.7/distutils/tests/test_install_lib.py b/lib-python/2.7/distutils/tests/test_install_lib.py +index 0defbd6..446bdba 100644 +--- a/lib-python/2.7/distutils/tests/test_install_lib.py ++++ b/lib-python/2.7/distutils/tests/test_install_lib.py +@@ -1,6 +1,7 @@ + """Tests for distutils.command.install_data.""" + import os + import sys ++import imp + import unittest + + from distutils.command.install_lib import install_lib +@@ -15,7 +16,7 @@ class InstallLibTestCase(support.TempdirManager, + unittest.TestCase): + + def test_finalize_options(self): +- pkg_dir, dist = self.create_dist() ++ dist = self.create_dist()[1] + cmd = install_lib(dist) + + cmd.finalize_options() +@@ -44,49 +45,62 @@ class InstallLibTestCase(support.TempdirManager, + + @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile not enabled') + def test_byte_compile(self): +- pkg_dir = self._setup_byte_compile() +- if sys.flags.optimize < 1: +- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyc'))) +- else: +- self.assertTrue(os.path.exists(os.path.join(pkg_dir, 'foo.pyo'))) ++ project_dir, dist = self.create_dist() ++ os.chdir(project_dir) ++ cmd = install_lib(dist) ++ cmd.compile = cmd.optimize = 1 ++ ++ f = os.path.join(project_dir, 'foo.py') ++ self.write_file(f, '# python file') ++ cmd.byte_compile([f]) ++ pyc_file = imp.cache_from_source('foo.py', debug_override=True) ++ pyo_file = imp.cache_from_source('foo.py', debug_override=False) ++ self.assertTrue(os.path.exists(pyc_file)) ++ self.assertTrue(os.path.exists(pyo_file)) + + def test_get_outputs(self): +- pkg_dir, dist = self.create_dist() ++ project_dir, dist = self.create_dist() ++ os.chdir(project_dir) ++ os.mkdir('spam') + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 +- cmd.install_dir = pkg_dir +- f = os.path.join(pkg_dir, 'foo.py') +- self.write_file(f, '# python file') +- cmd.distribution.py_modules = [pkg_dir] ++ cmd.install_dir = self.mkdtemp() ++ f = os.path.join(project_dir, 'spam', '__init__.py') ++ self.write_file(f, '# python package') + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] +- cmd.distribution.packages = [pkg_dir] ++ cmd.distribution.packages = ['spam'] + cmd.distribution.script_name = 'setup.py' + +- # get_output should return 4 elements +- self.assertGreaterEqual(len(cmd.get_outputs()), 2) ++ # get_outputs should return 4 elements: spam/__init__.py, .pyc and ++ # .pyo, foo.import-tag-abiflags.so / foo.pyd ++ outputs = cmd.get_outputs() ++ self.assertEqual(len(outputs), 4, outputs) + + def test_get_inputs(self): +- pkg_dir, dist = self.create_dist() ++ project_dir, dist = self.create_dist() ++ os.chdir(project_dir) ++ os.mkdir('spam') + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 +- cmd.install_dir = pkg_dir +- f = os.path.join(pkg_dir, 'foo.py') +- self.write_file(f, '# python file') +- cmd.distribution.py_modules = [pkg_dir] ++ cmd.install_dir = self.mkdtemp() ++ f = os.path.join(project_dir, 'spam', '__init__.py') ++ self.write_file(f, '# python package') + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] +- cmd.distribution.packages = [pkg_dir] ++ cmd.distribution.packages = ['spam'] + cmd.distribution.script_name = 'setup.py' + +- # get_input should return 2 elements +- self.assertEqual(len(cmd.get_inputs()), 2) ++ # get_inputs should return 2 elements: spam/__init__.py and ++ # foo.import-tag-abiflags.so / foo.pyd ++ inputs = cmd.get_inputs() ++ self.assertEqual(len(inputs), 2, inputs) + + def test_dont_write_bytecode(self): + # makes sure byte_compile is not used +- pkg_dir, dist = self.create_dist() ++ dist = self.create_dist()[1] + cmd = install_lib(dist) + cmd.compile = 1 + cmd.optimize = 1 +diff --git a/lib-python/2.7/distutils/util.py b/lib-python/2.7/distutils/util.py +index 2b4d784..5792df7 100644 +--- a/lib-python/2.7/distutils/util.py ++++ b/lib-python/2.7/distutils/util.py +@@ -6,7 +6,11 @@ one of the other *util.py modules. + + __revision__ = "$Id$" + +-import sys, os, string, re ++import os ++import re ++import imp ++import sys ++import string + from distutils.errors import DistutilsPlatformError + from distutils.dep_util import newer + from distutils.spawn import spawn +@@ -331,9 +335,9 @@ def byte_compile (py_files, + verbose=1, dry_run=0, + direct=None): + """Byte-compile a collection of Python source files to either .pyc +- or .pyo files in the same directory. 'py_files' is a list of files +- to compile; any files that don't end in ".py" are silently skipped. +- 'optimize' must be one of the following: ++ or .pyo files in a __pycache__ subdirectory. 'py_files' is a list ++ of files to compile; any files that don't end in ".py" are silently ++ skipped. 'optimize' must be one of the following: + 0 - don't optimize (generate .pyc) + 1 - normal optimization (like "python -O") + 2 - extra optimization (like "python -OO") +@@ -445,7 +449,10 @@ byte_compile(files, optimize=%r, force=%r, + # Terminology from the py_compile module: + # cfile - byte-compiled file + # dfile - purported source filename (same as 'file' by default) +- cfile = file + (__debug__ and "c" or "o") ++ if optimize >= 0: ++ cfile = imp.cache_from_source(file, debug_override=not optimize) ++ else: ++ cfile = imp.cache_from_source(file) + dfile = file + if prefix: + if file[:len(prefix)] != prefix: diff --git a/debian/patches/pep3147-stdlib b/debian/patches/pep3147-stdlib new file mode 100644 index 0000000..12c3076 --- /dev/null +++ b/debian/patches/pep3147-stdlib @@ -0,0 +1,1440 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: PEP3147 changes to lib-python + +Backported from cpython's PEP3147 commit + +Origin: cpython: http://hg.python.org/cpython/rev/7b69e630d237 +Author: Barry Warsaw <barry@python.org> +Author: Stefano Rivera <stefanor@debian.org> +Last-Update: 2013-02-23 +--- + lib-python/2.7/compileall.py | 67 ++++++++----- + lib-python/2.7/inspect.py | 1 + + lib-python/2.7/py_compile.py | 35 ++++--- + lib-python/2.7/pydoc.py | 3 +- + lib-python/2.7/runpy.py | 2 + + lib-python/2.7/site.py | 13 ++- + lib-python/2.7/test/script_helper.py | 23 ++--- + lib-python/2.7/test/test_cmd_line_script.py | 20 ++-- + lib-python/2.7/test/test_compileall.py | 61 +++++++++++- + lib-python/2.7/test/test_imp.py | 142 ++++++++++++++++++++++++++++ + lib-python/2.7/test/test_import.py | 65 +++++++------ + lib-python/2.7/test/test_pkg.py | 20 ++-- + lib-python/2.7/test/test_pkgimport.py | 20 ++-- + lib-python/2.7/test/test_py_compile.py | 5 +- + lib-python/2.7/test/test_pydoc.py | 3 +- + lib-python/2.7/test/test_runpy.py | 23 +++-- + lib-python/2.7/test/test_site.py | 47 ++++++--- + lib-python/2.7/test/test_support.py | 48 ++++++++-- + lib-python/2.7/test/test_traceback.py | 5 +- + lib-python/2.7/test/test_zipfile.py | 9 +- + lib-python/2.7/test/test_zipimport.py | 9 +- + lib-python/2.7/zipfile.py | 43 ++++++--- + 22 files changed, 499 insertions(+), 165 deletions(-) + +diff --git a/lib-python/2.7/compileall.py b/lib-python/2.7/compileall.py +index 5cfa8be..1418be2 100644 +--- a/lib-python/2.7/compileall.py ++++ b/lib-python/2.7/compileall.py +@@ -11,6 +11,7 @@ packages -- for now, you'll have to deal with packages separately.) + See module py_compile for details of the actual byte-compilation. + """ + import os ++import errno + import sys + import py_compile + import struct +@@ -19,7 +20,7 @@ import imp + __all__ = ["compile_dir","compile_file","compile_path"] + + def compile_dir(dir, maxlevels=10, ddir=None, +- force=0, rx=None, quiet=0): ++ force=False, rx=None, quiet=False, legacy=False): + """Byte-compile all modules in the given directory tree. + + Arguments (only dir is required): +@@ -28,8 +29,9 @@ def compile_dir(dir, maxlevels=10, ddir=None, + maxlevels: maximum recursion level (default 10) + ddir: the directory that will be prepended to the path to the + file as it is compiled into each byte-code file. +- force: if 1, force compilation, even if timestamps are up-to-date +- quiet: if 1, be quiet during compilation ++ force: if True, force compilation, even if timestamps are up-to-date ++ quiet: if True, be quiet during compilation ++ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths + """ + if not quiet: + print 'Listing', dir, '...' +@@ -47,18 +49,20 @@ def compile_dir(dir, maxlevels=10, ddir=None, + else: + dfile = None + if not os.path.isdir(fullname): +- if not compile_file(fullname, ddir, force, rx, quiet): ++ if not compile_file(fullname, ddir, force, rx, quiet, legacy): + success = 0 + elif maxlevels > 0 and \ + name != os.curdir and name != os.pardir and \ + os.path.isdir(fullname) and \ +- not os.path.islink(fullname): ++ not os.path.islink(fullname) and \ ++ name != '__pycache__': + if not compile_dir(fullname, maxlevels - 1, dfile, force, rx, +- quiet): ++ quiet, legacy): + success = 0 + return success + +-def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): ++def compile_file(fullname, ddir=None, force=0, rx=None, quiet=False, ++ legacy=False): + """Byte-compile one file. + + Arguments (only fullname is required): +@@ -66,8 +70,9 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): + fullname: the file to byte-compile + ddir: if given, the directory name compiled in to the + byte-code file. +- force: if 1, force compilation, even if timestamps are up-to-date +- quiet: if 1, be quiet during compilation ++ force: if True, force compilation, even if timestamps are up-to-date ++ quiet: if True, be quiet during compilation ++ legacy: if True, produce legacy pyc paths instead of PEP 3147 paths + """ + success = 1 + name = os.path.basename(fullname) +@@ -82,11 +87,20 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): + if os.path.isfile(fullname): + head, tail = name[:-3], name[-3:] + if tail == '.py': ++ if legacy: ++ cfile = fullname + ('c' if __debug__ else 'o') ++ else: ++ cfile = imp.cache_from_source(fullname) ++ cache_dir = os.path.dirname(cfile) ++ try: ++ os.mkdir(cache_dir) ++ except OSError, error: ++ if error.errno != errno.EEXIST: ++ raise + if not force: + try: + mtime = int(os.stat(fullname).st_mtime) + expect = struct.pack('<4sl', imp.get_magic(), mtime) +- cfile = fullname + (__debug__ and 'c' or 'o') + with open(cfile, 'rb') as chandle: + actual = chandle.read(8) + if expect == actual: +@@ -96,7 +110,7 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): + if not quiet: + print 'Compiling', fullname, '...' + try: +- ok = py_compile.compile(fullname, None, dfile, True) ++ ok = py_compile.compile(fullname, cfile, dfile, True) + except py_compile.PyCompileError,err: + if quiet: + print 'Compiling', fullname, '...' +@@ -110,15 +124,17 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): + success = 0 + return success + +-def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0): ++def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=False, ++ legacy=False): + """Byte-compile all module on sys.path. + + Arguments (all optional): + + skip_curdir: if true, skip current directory (default true) + maxlevels: max recursion level (default 0) +- force: as for compile_dir() (default 0) +- quiet: as for compile_dir() (default 0) ++ force: as for compile_dir() (default False) ++ quiet: as for compile_dir() (default False) ++ legacy: as for compile_dir() (default False) + """ + success = 1 + for dir in sys.path: +@@ -126,7 +142,8 @@ def compile_path(skip_curdir=1, maxlevels=0, force=0, quiet=0): + print 'Skipping current directory' + else: + success = success and compile_dir(dir, maxlevels, None, +- force, quiet=quiet) ++ force, quiet=quiet, ++ legacy=legacy) + return success + + def expand_args(args, flist): +@@ -152,7 +169,7 @@ def main(): + """Script main program.""" + import getopt + try: +- opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:') ++ opts, args = getopt.getopt(sys.argv[1:], 'lfqd:x:i:b') + except getopt.error, msg: + print msg + print "usage: python compileall.py [-l] [-f] [-q] [-d destdir] " \ +@@ -177,23 +194,26 @@ def main(): + print "-i file: add all the files and directories listed in file to " \ + "the list considered for" + print ' compilation; if "-", names are read from stdin' ++ print "-b: Produce legacy byte-compile file paths" + + sys.exit(2) + maxlevels = 10 + ddir = None +- force = 0 +- quiet = 0 ++ force = False ++ quiet = False + rx = None + flist = None ++ legacy = False + for o, a in opts: + if o == '-l': maxlevels = 0 + if o == '-d': ddir = a +- if o == '-f': force = 1 +- if o == '-q': quiet = 1 ++ if o == '-f': force = True ++ if o == '-q': quiet = True + if o == '-x': + import re + rx = re.compile(a) + if o == '-i': flist = a ++ if o == '-b': legacy = True + if ddir: + if len(args) != 1 and not os.path.isdir(args[0]): + print "-d destdir require exactly one directory argument" +@@ -210,13 +230,14 @@ def main(): + for arg in args: + if os.path.isdir(arg): + if not compile_dir(arg, maxlevels, ddir, +- force, rx, quiet): ++ force, rx, quiet, legacy): + success = 0 + else: +- if not compile_file(arg, ddir, force, rx, quiet): ++ if not compile_file(arg, ddir, force, rx, ++ quiet, legacy): + success = 0 + else: +- success = compile_path() ++ success = compile_path(legacy=legacy) + except KeyboardInterrupt: + print "\n[interrupted]" + success = 0 +diff --git a/lib-python/2.7/inspect.py b/lib-python/2.7/inspect.py +index 4335258..32d3ba3 100644 +--- a/lib-python/2.7/inspect.py ++++ b/lib-python/2.7/inspect.py +@@ -56,6 +56,7 @@ def ismodule(object): + """Return true if the object is a module. + + Module objects provide these attributes: ++ __cached__ pathname to byte compiled file + __doc__ documentation string + __file__ filename (missing for built-in modules)""" + return isinstance(object, types.ModuleType) +diff --git a/lib-python/2.7/py_compile.py b/lib-python/2.7/py_compile.py +index 8334ed9..9d0ad16 100644 +--- a/lib-python/2.7/py_compile.py ++++ b/lib-python/2.7/py_compile.py +@@ -4,6 +4,7 @@ This module has intimate knowledge of the format of .pyc files. + """ + + import __builtin__ ++import errno + import imp + import marshal + import os +@@ -71,20 +72,18 @@ def wr_long(f, x): + def compile(file, cfile=None, dfile=None, doraise=False): + """Byte-compile one Python source file to Python bytecode. + +- Arguments: +- +- file: source filename +- cfile: target filename; defaults to source with 'c' or 'o' appended +- ('c' normally, 'o' in optimizing mode, giving .pyc or .pyo) +- dfile: purported filename; defaults to source (this is the filename +- that will show up in error messages) +- doraise: flag indicating whether or not an exception should be +- raised when a compile error is found. If an exception +- occurs and this flag is set to False, a string +- indicating the nature of the exception will be printed, +- and the function will return to the caller. If an +- exception occurs and this flag is set to True, a +- PyCompileError exception will be raised. ++ :param file: The source file name. ++ :param cfile: The target byte compiled file name. When not given, this ++ defaults to the PEP 3147 location. ++ :param dfile: Purported file name, i.e. the file name that shows up in ++ error messages. Defaults to the source file name. ++ :param doraise: Flag indicating whether or not an exception should be ++ raised when a compile error is found. If an exception occurs and this ++ flag is set to False, a string indicating the nature of the exception ++ will be printed, and the function will return to the caller. If an ++ exception occurs and this flag is set to True, a PyCompileError ++ exception will be raised. ++ :return: Path to the resulting byte compiled file. + + Note that it isn't necessary to byte-compile Python modules for + execution efficiency -- Python itself byte-compiles a module when +@@ -119,7 +118,12 @@ def compile(file, cfile=None, dfile=None, doraise=False): + sys.stderr.write(py_exc.msg + '\n') + return + if cfile is None: +- cfile = file + (__debug__ and 'c' or 'o') ++ cfile = imp.cache_from_source(file) ++ try: ++ os.mkdir(os.path.dirname(cfile)) ++ except OSError, error: ++ if error.errno != errno.EEXIST: ++ raise + with open(cfile, 'wb') as fc: + fc.write('\0\0\0\0') + wr_long(fc, timestamp) +@@ -127,6 +131,7 @@ def compile(file, cfile=None, dfile=None, doraise=False): + fc.flush() + fc.seek(0, 0) + fc.write(MAGIC) ++ return cfile + + def main(args=None): + """Compile several source files. +diff --git a/lib-python/2.7/pydoc.py b/lib-python/2.7/pydoc.py +index de9ce1c..14ff9bb 100755 +--- a/lib-python/2.7/pydoc.py ++++ b/lib-python/2.7/pydoc.py +@@ -162,7 +162,8 @@ def visiblename(name, all=None, obj=None): + """Decide whether to show documentation on a variable.""" + # Certain special names are redundant. + _hidden_names = ('__builtins__', '__doc__', '__file__', '__path__', +- '__module__', '__name__', '__slots__', '__package__') ++ '__module__', '__name__', '__slots__', '__package__', ++ '__cached__') + if name in _hidden_names: return 0 + # Private names are hidden, but special names are displayed. + if name.startswith('__') and name.endswith('__'): return 1 +diff --git a/lib-python/2.7/runpy.py b/lib-python/2.7/runpy.py +index ad4d077..9c436bb 100644 +--- a/lib-python/2.7/runpy.py ++++ b/lib-python/2.7/runpy.py +@@ -67,6 +67,7 @@ def _run_code(code, run_globals, init_globals=None, + run_globals.update(init_globals) + run_globals.update(__name__ = mod_name, + __file__ = mod_fname, ++ __cached__ = None, + __loader__ = mod_loader, + __package__ = pkg_name) + exec code in run_globals +@@ -154,6 +155,7 @@ def _run_module_as_main(mod_name, alter_argv=True): + At the very least, these variables in __main__ will be overwritten: + __name__ + __file__ ++ __cached__ + __loader__ + __package__ + """ +diff --git a/lib-python/2.7/site.py b/lib-python/2.7/site.py +index 1a42691..37de98e 100644 +--- a/lib-python/2.7/site.py ++++ b/lib-python/2.7/site.py +@@ -85,8 +85,8 @@ def makepath(*paths): + return dir, os.path.normcase(dir) + + +-def abs__file__(): +- """Set all module' __file__ attribute to an absolute path""" ++def abs_paths(): ++ """Set all module __file__ and __cached__ attributes to an absolute path""" + for m in sys.modules.values(): + if hasattr(m, '__loader__'): + continue # don't mess with a PEP 302-supplied __file__ +@@ -97,6 +97,13 @@ def abs__file__(): + m.__file__ = new + except (AttributeError, OSError): + pass ++ try: ++ prev = m.__cached__ ++ new = os.path.abspath(m.__cached__) ++ if prev != new: ++ m.__cached__ = new ++ except (AttributeError, OSError): ++ pass + + + def removeduppaths(): +@@ -543,7 +550,7 @@ def main(): + global ENABLE_USER_SITE + + import_builtin_stuff() +- abs__file__() ++ abs_paths() + known_paths = removeduppaths() + if ENABLE_USER_SITE is None: + ENABLE_USER_SITE = check_enableusersite() +diff --git a/lib-python/2.7/test/script_helper.py b/lib-python/2.7/test/script_helper.py +index 6be47bd..28a73dd 100644 +--- a/lib-python/2.7/test/script_helper.py ++++ b/lib-python/2.7/test/script_helper.py +@@ -20,6 +20,9 @@ except ImportError: + + from test.test_support import strip_python_stderr + ++from imp import source_from_cache ++from test.test_support import make_legacy_pyc ++ + # Executing the interpreter in a subprocess + def _assert_python(expected_success, *args, **env_vars): + cmd_line = [sys.executable] +@@ -111,20 +114,18 @@ def make_script(script_dir, script_basename, source): + script_file.close() + return script_name + +-def compile_script(script_name): +- py_compile.compile(script_name, doraise=True) +- if __debug__: +- compiled_name = script_name + 'c' +- else: +- compiled_name = script_name + 'o' +- return compiled_name +- + def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None): + zip_filename = zip_basename+os.extsep+'zip' + zip_name = os.path.join(zip_dir, zip_filename) + zip_file = zipfile.ZipFile(zip_name, 'w') + if name_in_zip is None: +- name_in_zip = os.path.basename(script_name) ++ parts = script_name.split(os.sep) ++ if len(parts) >= 2 and parts[-2] == '__pycache__': ++ legacy_pyc = make_legacy_pyc(source_from_cache(script_name)) ++ name_in_zip = os.path.basename(legacy_pyc) ++ script_name = legacy_pyc ++ else: ++ name_in_zip = os.path.basename(script_name) + zip_file.write(script_name, name_in_zip) + zip_file.close() + #if test.test_support.verbose: +@@ -147,8 +148,8 @@ def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, + script_name = make_script(zip_dir, script_basename, source) + unlink.append(script_name) + if compiled: +- init_name = compile_script(init_name) +- script_name = compile_script(script_name) ++ init_name = py_compile(init_name, doraise=True) ++ script_name = py_compile(script_name, doraise=True) + unlink.extend((init_name, script_name)) + pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)] + script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name)) +diff --git a/lib-python/2.7/test/test_cmd_line_script.py b/lib-python/2.7/test/test_cmd_line_script.py +index 2e12ff2..5895285 100644 +--- a/lib-python/2.7/test/test_cmd_line_script.py ++++ b/lib-python/2.7/test/test_cmd_line_script.py +@@ -4,9 +4,10 @@ import contextlib + import unittest + import os + import os.path ++import py_compile + import test.test_support + from test.script_helper import (run_python, +- temp_dir, make_script, compile_script, ++ temp_dir, make_script, + assert_python_failure, make_pkg, + make_zip_script, make_zip_pkg) + +@@ -33,6 +34,7 @@ assertEqual(result, ['Top level assignment', 'Lower level reference']) + # Check population of magic variables + assertEqual(__name__, '__main__') + print '__file__==%r' % __file__ ++assertEqual(__cached__, None) + print '__package__==%r' % __package__ + # Check the sys module + import sys +@@ -106,7 +108,7 @@ class CmdLineTest(unittest.TestCase): + def test_script_compiled(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, 'script') +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) + self._check_script(compiled_name, compiled_name, compiled_name, None) + +@@ -120,9 +122,10 @@ class CmdLineTest(unittest.TestCase): + raise unittest.SkipTest("pypy won't load lone .pyc files") + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, '__main__') +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) +- self._check_script(script_dir, compiled_name, script_dir, '') ++ pyc_file = test.test_support.make_legacy_pyc(script_name) ++ self._check_script(script_dir, pyc_file, script_dir, '') + + def test_directory_error(self): + with temp_dir() as script_dir: +@@ -138,7 +141,7 @@ class CmdLineTest(unittest.TestCase): + def test_zipfile_compiled(self): + with temp_dir() as script_dir: + script_name = _make_test_script(script_dir, '__main__') +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) + self._check_script(zip_name, run_name, zip_name, '') + +@@ -185,11 +188,12 @@ class CmdLineTest(unittest.TestCase): + pkg_dir = os.path.join(script_dir, 'test_pkg') + make_pkg(pkg_dir) + script_name = _make_test_script(pkg_dir, '__main__') +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) ++ pyc_file = test.test_support.make_legacy_pyc(script_name) + launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') +- self._check_script(launch_name, compiled_name, +- compiled_name, 'test_pkg') ++ self._check_script(launch_name, pyc_file, ++ pyc_file, 'test_pkg') + + def test_package_error(self): + with temp_dir() as script_dir: +diff --git a/lib-python/2.7/test/test_compileall.py b/lib-python/2.7/test/test_compileall.py +index d3a26db..7fd44c5 100644 +--- a/lib-python/2.7/test/test_compileall.py ++++ b/lib-python/2.7/test/test_compileall.py +@@ -4,6 +4,8 @@ import os + import py_compile + import shutil + import struct ++import sys ++import subprocess + import tempfile + from test import test_support + import unittest +@@ -14,11 +16,11 @@ class CompileallTests(unittest.TestCase): + def setUp(self): + self.directory = tempfile.mkdtemp() + self.source_path = os.path.join(self.directory, '_test.py') +- self.bc_path = self.source_path + ('c' if __debug__ else 'o') ++ self.bc_path = imp.cache_from_source(self.source_path) + with open(self.source_path, 'w') as file: + file.write('x = 123\n') + self.source_path2 = os.path.join(self.directory, '_test2.py') +- self.bc_path2 = self.source_path2 + ('c' if __debug__ else 'o') ++ self.bc_path2 = imp.cache_from_source(self.source_path2) + shutil.copyfile(self.source_path, self.source_path2) + + def tearDown(self): +@@ -71,8 +73,61 @@ class CompileallTests(unittest.TestCase): + os.unlink(self.bc_path) + os.unlink(self.bc_path2) + ++class CommandLineTests(unittest.TestCase): ++ """Test some aspects of compileall's CLI.""" ++ ++ def setUp(self): ++ self.addCleanup(self._cleanup) ++ self.directory = tempfile.mkdtemp() ++ self.pkgdir = os.path.join(self.directory, 'foo') ++ os.mkdir(self.pkgdir) ++ # Touch the __init__.py and a package module. ++ with open(os.path.join(self.pkgdir, '__init__.py'), 'w'): ++ pass ++ with open(os.path.join(self.pkgdir, 'bar.py'), 'w'): ++ pass ++ sys.path.insert(0, self.directory) ++ ++ def _cleanup(self): ++ test_support.rmtree(self.directory) ++ assert sys.path[0] == self.directory, 'Missing path' ++ del sys.path[0] ++ ++ def test_pep3147_paths(self): ++ # Ensure that the default behavior of compileall's CLI is to create ++ # PEP 3147 pyc/pyo files. ++ retcode = subprocess.call( ++ (sys.executable, '-m', 'compileall', '-q', self.pkgdir)) ++ self.assertEqual(retcode, 0) ++ # Verify the __pycache__ directory contents. ++ cachedir = os.path.join(self.pkgdir, '__pycache__') ++ self.assertTrue(os.path.exists(cachedir)) ++ ext = ('pyc' if __debug__ else 'pyo') ++ expected = sorted(base.format(imp.get_tag(), ext) for base in ++ ('__init__.{}.{}', 'bar.{}.{}')) ++ self.assertEqual(sorted(os.listdir(cachedir)), expected) ++ # Make sure there are no .pyc files in the source directory. ++ self.assertFalse([pyc_file for pyc_file in os.listdir(self.pkgdir) ++ if pyc_file.endswith(ext)]) ++ ++ def test_legacy_paths(self): ++ # Ensure that with the proper switch, compileall leaves legacy ++ # pyc/pyo files, and no __pycache__ directory. ++ retcode = subprocess.call( ++ (sys.executable, '-m', 'compileall', '-b', '-q', self.pkgdir)) ++ self.assertEqual(retcode, 0) ++ # Verify the __pycache__ directory contents. ++ cachedir = os.path.join(self.pkgdir, '__pycache__') ++ self.assertFalse(os.path.exists(cachedir)) ++ ext = ('pyc' if __debug__ else 'pyo') ++ expected = [base.format(ext) for base in ('__init__.{}', 'bar.{}')] ++ expected.extend(['__init__.py', 'bar.py']) ++ expected.sort() ++ self.assertEqual(sorted(os.listdir(self.pkgdir)), expected) ++ ++ + def test_main(): +- test_support.run_unittest(CompileallTests) ++ test_support.run_unittest(CommandLineTests, CompileallTests) + + + if __name__ == "__main__": +diff --git a/lib-python/2.7/test/test_imp.py b/lib-python/2.7/test/test_imp.py +index 1bdc47a..341d36b 100644 +--- a/lib-python/2.7/test/test_imp.py ++++ b/lib-python/2.7/test/test_imp.py +@@ -1,4 +1,7 @@ + import imp ++import os ++import shutil ++import sys + import unittest + from test import test_support + +@@ -70,8 +73,147 @@ class ReloadTests(unittest.TestCase): + imp.reload(marshal) + + ++class PEP3147Tests(unittest.TestCase): ++ """Tests of PEP 3147.""" ++ ++ tag = imp.get_tag() ++ ++ def test_cache_from_source(self): ++ # Given the path to a .py file, return the path to its PEP 3147 ++ # defined .pyc file (i.e. under __pycache__). ++ self.assertEqual( ++ imp.cache_from_source('/foo/bar/baz/qux.py', True), ++ '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)) ++ ++ def test_cache_from_source_optimized(self): ++ # Given the path to a .py file, return the path to its PEP 3147 ++ # defined .pyo file (i.e. under __pycache__). ++ if test_support.check_impl_detail(pypy=True): ++ # PyPy doesn't support .pyo, so we expect .pyc ++ extension = 'pyc' ++ else: ++ extension = 'pyo' ++ self.assertEqual( ++ imp.cache_from_source('/foo/bar/baz/qux.py', False), ++ '/foo/bar/baz/__pycache__/qux.{}.{}'.format(self.tag, extension)) ++ ++ def test_cache_from_source_cwd(self): ++ self.assertEqual(imp.cache_from_source('foo.py', True), ++ os.sep.join(('__pycache__', ++ 'foo.{}.pyc'.format(self.tag)))) ++ ++ def test_cache_from_source_override(self): ++ # When debug_override is not None, it can be any true-ish or false-ish ++ # value. ++ if test_support.check_impl_detail(pypy=True): ++ # PyPy doesn't support .pyo, so we expect .pyc ++ extension = 'pyc' ++ else: ++ extension = 'pyo' ++ self.assertEqual( ++ imp.cache_from_source('/foo/bar/baz.py', []), ++ '/foo/bar/__pycache__/baz.{}.pyc'.format(self.tag)) ++ self.assertEqual( ++ imp.cache_from_source('/foo/bar/baz.py', [17]), ++ '/foo/bar/__pycache__/baz.{}.{}'.format(self.tag, extension)) ++ # However if the bool-ishness can't be determined, the exception ++ # propagates. ++ class Bearish: ++ def __bool__(self): raise RuntimeError ++ ++ if test_support.check_impl_detail(pypy=True): ++ # Pypy doesn't even determine bool-ishness ++ try: ++ imp.cache_from_source('/foo/bar/baz.py', Bearish()) ++ except RuntimeError: ++ pass ++ else: ++ self.assertRaises( ++ RuntimeError, ++ imp.cache_from_source, '/foo/bar/baz.py', Bearish()) ++ ++ @unittest.skipIf(os.altsep is None, ++ 'test meaningful only where os.altsep is defined') ++ def test_altsep_cache_from_source(self): ++ # Windows path and PEP 3147. ++ self.assertEqual( ++ imp.cache_from_source('\\foo\\bar\\baz\\qux.py', True), ++ '\\foo\\bar\\baz\\__pycache__\\qux.{}.pyc'.format(self.tag)) ++ ++ @unittest.skipIf(os.altsep is None, ++ 'test meaningful only where os.altsep is defined') ++ def test_altsep_and_sep_cache_from_source(self): ++ # Windows path and PEP 3147 where altsep is right of sep. ++ self.assertEqual( ++ imp.cache_from_source('\\foo\\bar/baz\\qux.py', True), ++ '\\foo\\bar/baz\\__pycache__\\qux.{}.pyc'.format(self.tag)) ++ ++ @unittest.skipIf(os.altsep is None, ++ 'test meaningful only where os.altsep is defined') ++ def test_sep_altsep_and_sep_cache_from_source(self): ++ # Windows path and PEP 3147 where sep is right of altsep. ++ self.assertEqual( ++ imp.cache_from_source('\\foo\\bar\\baz/qux.py', True), ++ '\\foo\\bar\\baz/__pycache__/qux.{}.pyc'.format(self.tag)) ++ ++ def test_source_from_cache(self): ++ # Given the path to a PEP 3147 defined .pyc file, return the path to ++ # its source. This tests the good path. ++ self.assertEqual(imp.source_from_cache( ++ '/foo/bar/baz/__pycache__/qux.{}.pyc'.format(self.tag)), ++ '/foo/bar/baz/qux.py') ++ ++ def test_source_from_cache_bad_path(self): ++ # When the path to a pyc file is not in PEP 3147 format, a ValueError ++ # is raised. ++ self.assertRaises( ++ ValueError, imp.source_from_cache, '/foo/bar/bazqux.pyc') ++ ++ def test_source_from_cache_no_slash(self): ++ # No slashes at all in path -> ValueError ++ self.assertRaises( ++ ValueError, imp.source_from_cache, 'foo.cpython-32.pyc') ++ ++ def test_source_from_cache_too_few_dots(self): ++ # Too few dots in final path component -> ValueError ++ self.assertRaises( ++ ValueError, imp.source_from_cache, '__pycache__/foo.pyc') ++ ++ def test_source_from_cache_too_many_dots(self): ++ # Too many dots in final path component -> ValueError ++ self.assertRaises( ++ ValueError, imp.source_from_cache, ++ '__pycache__/foo.cpython-32.foo.pyc') ++ ++ def test_source_from_cache_no__pycache__(self): ++ # Another problem with the path -> ValueError ++ self.assertRaises( ++ ValueError, imp.source_from_cache, ++ '/foo/bar/foo.cpython-32.foo.pyc') ++ ++ def test_package___file__(self): ++ # Test that a package's __file__ points to the right source directory. ++ os.mkdir('pep3147') ++ sys.path.insert(0, os.curdir) ++ def cleanup(): ++ if sys.path[0] == os.curdir: ++ del sys.path[0] ++ shutil.rmtree('pep3147') ++ self.addCleanup(cleanup) ++ # Touch the __init__.py file. ++ with open('pep3147/__init__.py', 'w'): ++ pass ++ m = __import__('pep3147') ++ # Ensure we load the pyc file. ++ test_support.forget('pep3147') ++ m = __import__('pep3147') ++ self.assertEqual(m.__file__, ++ os.sep.join(('.', 'pep3147', '__init__.py'))) ++ ++ + def test_main(): + tests = [ ++ PEP3147Tests, + ReloadTests, + LockTests, + ] +diff --git a/lib-python/2.7/test/test_import.py b/lib-python/2.7/test/test_import.py +index 716f8e0..0618068 100644 +--- a/lib-python/2.7/test/test_import.py ++++ b/lib-python/2.7/test/test_import.py +@@ -13,7 +13,8 @@ import shutil + + from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree, + is_jython, check_warnings, EnvironmentVarGuard, +- impl_detail, check_impl_detail) ++ impl_detail, check_impl_detail, forget, ++ make_legacy_pyc, temp_umask) + from test import symlink_support + from test import script_helper + +@@ -35,6 +36,11 @@ def chmod_files(name): + def remove_files(name): + for f in _files(name): + unlink(f) ++ try: ++ shutil.rmtree('__pycache__') ++ except OSError, error: ++ if error.errno != errno.ENOENT: ++ raise + + + class ImportTests(unittest.TestCase): +@@ -95,9 +101,9 @@ class ImportTests(unittest.TestCase): + except ImportError, err: + self.fail("import from .pyc/.pyo failed: %s" % err) + finally: ++ forget(TESTFN) + unlink(pyc) + unlink(pyo) +- unload(TESTFN) + + sys.path.insert(0, os.curdir) + try: +@@ -115,28 +121,26 @@ class ImportTests(unittest.TestCase): + def test_execute_bit_not_copied(self): + # Issue 6070: under posix .pyc files got their execute bit set if + # the .py file had the execute bit set, but they aren't executable. +- oldmask = os.umask(022) +- sys.path.insert(0, os.curdir) +- try: +- fname = TESTFN + os.extsep + "py" +- f = open(fname, 'w').close() +- os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | +- stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)) +- __import__(TESTFN) +- fn = fname + 'c' +- if not os.path.exists(fn): +- fn = fname + 'o' ++ with temp_umask(022): ++ sys.path.insert(0, os.curdir) ++ try: ++ fname = TESTFN + os.extsep + "py" ++ f = open(fname, 'w').close() ++ os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH | ++ stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)) ++ __import__(TESTFN) ++ fn = imp.cache_from_source(fname) + if not os.path.exists(fn): + self.fail("__import__ did not result in creation of " + "either a .pyc or .pyo file") +- s = os.stat(fn) +- self.assertEqual(stat.S_IMODE(s.st_mode), +- stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) +- finally: +- os.umask(oldmask) +- remove_files(TESTFN) +- unload(TESTFN) +- del sys.path[0] ++ s = os.stat(fn) ++ self.assertEqual( ++ stat.S_IMODE(s.st_mode), ++ stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH) ++ finally: ++ del sys.path[0] ++ remove_files(TESTFN) ++ unload(TESTFN) + + @unittest.skipIf(sys.dont_write_bytecode, + "test meaningful only when writing bytecode") +@@ -205,12 +209,14 @@ class ImportTests(unittest.TestCase): + f.write('"",\n') + f.write(']') + +- # Compile & remove .py file, we only need .pyc (or .pyo). ++ # Compile & remove .py file, we only need .pyc (or .pyo), but that ++ # must be relocated to the PEP 3147 bytecode-only location. + with open(filename, 'r') as f: + py_compile.compile(filename) + if check_impl_detail(pypy=False): + # pypy refuses to import a .pyc if the .py does not exist + unlink(filename) ++ make_legacy_pyc(filename) + + # Need to be able to load from current dir. + sys.path.append('') +@@ -345,7 +351,7 @@ class ImportTests(unittest.TestCase): + sys.path.insert(0, os.curdir) + try: + source = TESTFN + ".py" +- compiled = source + ('c' if __debug__ else 'o') ++ compiled = imp.cache_from_source(source) + with open(source, 'w') as f: + pass + try: +@@ -440,6 +446,7 @@ class PycRewritingTests(unittest.TestCase): + import sys + code_filename = sys._getframe().f_code.co_filename + module_filename = __file__ ++module_pyc_filename = __cached__ + constant = 1 + def func(): + pass +@@ -447,7 +454,7 @@ func_filename = func.func_code.co_filename + """ + dir_name = os.path.abspath(TESTFN) + file_name = os.path.join(dir_name, module_name) + os.extsep + "py" +- compiled_name = file_name + ("c" if __debug__ else "o") ++ compiled_name = imp.cache_from_source(file_name) + + def setUp(self): + self.sys_path = sys.path[:] +@@ -475,19 +482,22 @@ func_filename = func.func_code.co_filename + def test_basics(self): + mod = self.import_module() + self.assertEqual(mod.module_filename, self.file_name) ++ self.assertEqual(mod.module_pyc_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + del sys.modules[self.module_name] + mod = self.import_module() ++ self.assertEqual(mod.module_filename, self.file_name) + if not sys.dont_write_bytecode: +- self.assertEqual(mod.module_filename, self.compiled_name) ++ self.assertEqual(mod.module_pyc_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + + def test_incorrect_code_name(self): + py_compile.compile(self.file_name, dfile="another_module.py") + mod = self.import_module() +- self.assertEqual(mod.module_filename, self.compiled_name) ++ self.assertEqual(mod.module_filename, self.file_name) ++ self.assertEqual(mod.module_pyc_filename, self.compiled_name) + self.assertEqual(mod.code_filename, self.file_name) + self.assertEqual(mod.func_filename, self.file_name) + +@@ -496,8 +506,9 @@ func_filename = func.func_code.co_filename + target = "another_module.py" + py_compile.compile(self.file_name, dfile=target) + os.remove(self.file_name) ++ pyc_file = make_legacy_pyc(self.file_name) + mod = self.import_module() +- self.assertEqual(mod.module_filename, self.compiled_name) ++ self.assertEqual(mod.module_filename, pyc_file) + self.assertEqual(mod.code_filename, target) + self.assertEqual(mod.func_filename, target) + +diff --git a/lib-python/2.7/test/test_pkg.py b/lib-python/2.7/test/test_pkg.py +index 5f1659b..853069a 100644 +--- a/lib-python/2.7/test/test_pkg.py ++++ b/lib-python/2.7/test/test_pkg.py +@@ -194,14 +194,14 @@ class Test(unittest.TestCase): + + import t5 + self.assertEqual(fixdir(dir(t5)), +- ['__doc__', '__file__', '__name__', ++ ['__cached__', '__doc__', '__file__', '__name__', + '__package__', '__path__', 'foo', 'string', 't5']) + self.assertEqual(fixdir(dir(t5.foo)), +- ['__doc__', '__file__', '__name__', '__package__', +- 'string']) ++ ['__cached__', '__doc__', '__file__', '__name__', ++ '__package__', 'string']) + self.assertEqual(fixdir(dir(t5.string)), +- ['__doc__', '__file__', '__name__','__package__', +- 'spam']) ++ ['__cached__', '__doc__', '__file__', '__name__', ++ '__package__', 'spam']) + + def test_6(self): + hier = [ +@@ -216,13 +216,13 @@ class Test(unittest.TestCase): + + import t6 + self.assertEqual(fixdir(dir(t6)), +- ['__all__', '__doc__', '__file__', ++ ['__all__', '__cached__', '__doc__', '__file__', + '__name__', '__package__', '__path__']) + s = """ + import t6 + from t6 import * + self.assertEqual(fixdir(dir(t6)), +- ['__all__', '__doc__', '__file__', ++ ['__all__', '__cached__', '__doc__', '__file__', + '__name__', '__package__', '__path__', + 'eggs', 'ham', 'spam']) + self.assertEqual(dir(), ['eggs', 'ham', 'self', 'spam', 't6']) +@@ -250,18 +250,18 @@ class Test(unittest.TestCase): + t7, sub, subsub = None, None, None + import t7 as tas + self.assertEqual(fixdir(dir(tas)), +- ['__doc__', '__file__', '__name__', ++ ['__cached__', '__doc__', '__file__', '__name__', + '__package__', '__path__']) + self.assertFalse(t7) + from t7 import sub as subpar + self.assertEqual(fixdir(dir(subpar)), +- ['__doc__', '__file__', '__name__', ++ ['__cached__', '__doc__', '__file__', '__name__', + '__package__', '__path__']) + self.assertFalse(t7) + self.assertFalse(sub) + from t7.sub import subsub as subsubsub + self.assertEqual(fixdir(dir(subsubsub)), +- ['__doc__', '__file__', '__name__', ++ ['__cached__', '__doc__', '__file__', '__name__', + '__package__', '__path__', 'spam']) + self.assertFalse(t7) + self.assertFalse(sub) +diff --git a/lib-python/2.7/test/test_pkgimport.py b/lib-python/2.7/test/test_pkgimport.py +index 30d48cd..490060f 100644 +--- a/lib-python/2.7/test/test_pkgimport.py ++++ b/lib-python/2.7/test/test_pkgimport.py +@@ -1,5 +1,6 @@ +-import os, sys, string, random, tempfile, unittest ++import os, sys, shutil, string, random, tempfile, unittest + ++from imp import cache_from_source + from test.test_support import run_unittest + + class TestImport(unittest.TestCase): +@@ -27,22 +28,17 @@ class TestImport(unittest.TestCase): + self.module_path = os.path.join(self.package_dir, 'foo'+os.extsep+'py') + + def tearDown(self): +- for file in os.listdir(self.package_dir): +- os.remove(os.path.join(self.package_dir, file)) +- os.rmdir(self.package_dir) +- os.rmdir(self.test_dir) ++ shutil.rmtree(self.test_dir) + self.assertNotEqual(sys.path.count(self.test_dir), 0) + sys.path.remove(self.test_dir) + self.remove_modules() + + def rewrite_file(self, contents): +- for extension in "co": +- compiled_path = self.module_path + extension +- if os.path.exists(compiled_path): +- os.remove(compiled_path) +- f = open(self.module_path, 'w') +- f.write(contents) +- f.close() ++ compiled_path = cache_from_source(self.module_path) ++ if os.path.exists(compiled_path): ++ os.remove(compiled_path) ++ with open(self.module_path, 'w') as f: ++ f.write(contents) + + def test_package_import__semantics(self): + +diff --git a/lib-python/2.7/test/test_py_compile.py b/lib-python/2.7/test/test_py_compile.py +index 5ec523a..eff87df 100644 +--- a/lib-python/2.7/test/test_py_compile.py ++++ b/lib-python/2.7/test/test_py_compile.py +@@ -12,7 +12,7 @@ class PyCompileTests(unittest.TestCase): + def setUp(self): + self.directory = tempfile.mkdtemp() + self.source_path = os.path.join(self.directory, '_test.py') +- self.pyc_path = self.source_path + 'c' ++ self.pyc_path = imp.cache_from_source(self.source_path) + self.cwd_drive = os.path.splitdrive(os.getcwd())[0] + # In these tests we compute relative paths. When using Windows, the + # current working directory path and the 'self.source_path' might be +@@ -35,9 +35,10 @@ class PyCompileTests(unittest.TestCase): + self.assertTrue(os.path.exists(self.pyc_path)) + + def test_cwd(self): ++ pyc_file = imp.cache_from_source(os.path.basename(self.source_path)) + with support.change_cwd(self.directory): + py_compile.compile(os.path.basename(self.source_path), +- os.path.basename(self.pyc_path)) ++ pyc_file) + self.assertTrue(os.path.exists(self.pyc_path)) + + def test_relative_path(self): +diff --git a/lib-python/2.7/test/test_pydoc.py b/lib-python/2.7/test/test_pydoc.py +index 0e9f5f3..58c5781 100644 +--- a/lib-python/2.7/test/test_pydoc.py ++++ b/lib-python/2.7/test/test_pydoc.py +@@ -6,6 +6,7 @@ import re + import py_compile + import pydoc + import contextlib ++import imp + import inspect + import keyword + import pkgutil +@@ -418,7 +419,7 @@ foo = 1 + def test_synopsis_sourceless_empty_doc(self): + with test.test_support.temp_cwd() as test_dir: + init_path = os.path.join(test_dir, 'foomod42.py') +- cached_path = os.path.join(test_dir, 'foomod42.pyc') ++ cached_path = imp.cache_from_source(init_path) + with open(init_path, 'w') as fobj: + fobj.write("foo = 1") + py_compile.compile(init_path) +diff --git a/lib-python/2.7/test/test_runpy.py b/lib-python/2.7/test/test_runpy.py +index b635c1d..a45f9be 100644 +--- a/lib-python/2.7/test/test_runpy.py ++++ b/lib-python/2.7/test/test_runpy.py +@@ -5,8 +5,9 @@ import os.path + import sys + import re + import tempfile +-from test.test_support import verbose, run_unittest, forget, check_impl_detail +-from test.script_helper import (temp_dir, make_script, compile_script, ++import py_compile ++from test.test_support import verbose, run_unittest, forget, check_impl_detail, make_legacy_pyc ++from test.script_helper import (temp_dir, make_script, + make_pkg, make_zip_script, make_zip_pkg) + + if check_impl_detail(pypy=True): +@@ -50,6 +51,7 @@ class RunModuleCodeTest(unittest.TestCase): + self.assertEqual(d["result"], self.expected_result) + self.assertIs(d["__name__"], None) + self.assertIs(d["__file__"], None) ++ self.assertIs(d["__cached__"], None) + self.assertIs(d["__loader__"], None) + self.assertIs(d["__package__"], None) + self.assertIs(d["run_argv0"], saved_argv0) +@@ -78,6 +80,7 @@ class RunModuleCodeTest(unittest.TestCase): + self.assertTrue(d2["run_name_in_sys_modules"]) + self.assertTrue(d2["module_in_sys_modules"]) + self.assertIs(d2["__file__"], file) ++ self.assertIs(d2["__cached__"], None) + self.assertIs(d2["run_argv0"], file) + self.assertIs(d2["__loader__"], loader) + self.assertIs(d2["__package__"], package) +@@ -177,6 +180,7 @@ class RunModuleTest(unittest.TestCase): + __import__(mod_name) + os.remove(mod_fname) + if not sys.dont_write_bytecode: ++ make_legacy_pyc(mod_fname) + if verbose: print "Running from compiled:", mod_name + d2 = run_module(mod_name) # Read from bytecode + self.assertIn("x", d2) +@@ -201,6 +205,7 @@ class RunModuleTest(unittest.TestCase): + __import__(mod_name) + os.remove(mod_fname) + if not sys.dont_write_bytecode: ++ make_legacy_pyc(mod_fname) + if verbose: print "Running from compiled:", pkg_name + d2 = run_module(pkg_name) # Read from bytecode + self.assertIn("x", d2) +@@ -257,6 +262,7 @@ from ..uncle.cousin import nephew + __import__(mod_name) + os.remove(mod_fname) + if not sys.dont_write_bytecode: ++ make_legacy_pyc(mod_fname) + if verbose: print "Running from compiled:", mod_name + d2 = run_module(mod_name, run_name=run_name) # Read from bytecode + self.assertIn("__package__", d2) +@@ -348,6 +354,7 @@ argv0 = sys.argv[0] + result = run_path(script_name) + self.assertEqual(result["__name__"], expected_name) + self.assertEqual(result["__file__"], expected_file) ++ self.assertEqual(result["__cached__"], None) + self.assertIn("argv0", result) + self.assertEqual(result["argv0"], expected_argv0) + self.assertEqual(result["__package__"], expected_package) +@@ -367,7 +374,7 @@ argv0 = sys.argv[0] + with temp_dir() as script_dir: + mod_name = 'script' + script_name = self._make_test_script(script_dir, mod_name) +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) + self._check_script(compiled_name, "<run_path>", compiled_name, + compiled_name, None) +@@ -385,9 +392,10 @@ argv0 = sys.argv[0] + with temp_dir() as script_dir: + mod_name = '__main__' + script_name = self._make_test_script(script_dir, mod_name) +- compiled_name = compile_script(script_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) +- self._check_script(script_dir, "<run_path>", compiled_name, ++ legacy_pyc = make_legacy_pyc(script_name) ++ self._check_script(script_dir, "<run_path>", legacy_pyc, + script_dir, '') + + def test_directory_error(self): +@@ -408,8 +416,9 @@ argv0 = sys.argv[0] + with temp_dir() as script_dir: + mod_name = '__main__' + script_name = self._make_test_script(script_dir, mod_name) +- compiled_name = compile_script(script_name) +- zip_name, fname = make_zip_script(script_dir, 'test_zip', compiled_name) ++ compiled_name = py_compile.compile(script_name, doraise=True) ++ zip_name, fname = make_zip_script(script_dir, 'test_zip', ++ compiled_name) + self._check_script(zip_name, "<run_path>", fname, zip_name, '') + + def test_zipfile_error(self): +diff --git a/lib-python/2.7/test/test_site.py b/lib-python/2.7/test/test_site.py +index de3f28b..02331be 100644 +--- a/lib-python/2.7/test/test_site.py ++++ b/lib-python/2.7/test/test_site.py +@@ -318,19 +318,40 @@ class ImportSideEffectTests(unittest.TestCase): + """Restore sys.path""" + sys.path[:] = self.sys_path + +- def test_abs__file__(self): +- # Make sure all imported modules have their __file__ attribute +- # as an absolute path. +- # Handled by abs__file__() +- site.abs__file__() +- for module in (sys, os, __builtin__): +- try: +- self.assertTrue(os.path.isabs(module.__file__), repr(module)) +- except AttributeError: +- continue +- # We could try everything in sys.modules; however, when regrtest.py +- # runs something like test_frozen before test_site, then we will +- # be testing things loaded *after* test_site did path normalization ++ def test_abs_paths(self): ++ # Make sure all imported modules have their __file__ and __cached__ ++ # attributes as absolute paths. Arranging to put the Lib directory on ++ # PYTHONPATH would cause the os module to have a relative path for ++ # __file__ if abs_paths() does not get run. sys and builtins (the ++ # only other modules imported before site.py runs) do not have ++ # __file__ or __cached__ because they are built-in. ++ parent = os.path.relpath(os.path.dirname(os.__file__)) ++ env = os.environ.copy() ++ env['PYTHONPATH'] = parent ++ # We use uuid rather than os, as os isn't modified in pypy ++ # and so not in the same path as test_site ++ command = 'import uuid; print uuid.__file__, uuid.__cached__' ++ # First, prove that with -S (no 'import site'), the paths are ++ # relative. ++ proc = subprocess.Popen([sys.executable, '-S', '-c', command], ++ env=env, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE) ++ stdout, stderr = proc.communicate() ++ self.assertEqual(proc.returncode, 0) ++ os__file__, os__cached__ = stdout.split() ++ self.assertFalse(os.path.isabs(os__file__)) ++ self.assertFalse(os.path.isabs(os__cached__)) ++ # Now, with 'import site', it works. ++ proc = subprocess.Popen([sys.executable, '-c', command], ++ env=env, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE) ++ stdout, stderr = proc.communicate() ++ self.assertEqual(proc.returncode, 0) ++ os__file__, os__cached__ = stdout.split() ++ self.assertTrue(os.path.isabs(os__file__)) ++ self.assertTrue(os.path.isabs(os__cached__)) + + def test_no_duplicate_paths(self): + # No duplicate paths should exist in sys.path +diff --git a/lib-python/2.7/test/test_support.py b/lib-python/2.7/test/test_support.py +index 258b339..0e34980 100644 +--- a/lib-python/2.7/test/test_support.py ++++ b/lib-python/2.7/test/test_support.py +@@ -18,6 +18,7 @@ import unittest + import importlib + import UserDict + import re ++import imp + import time + import struct + import sysconfig +@@ -36,7 +37,7 @@ __all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", + "open_urlresource", "check_warnings", "check_py3k_warnings", + "CleanImport", "EnvironmentVarGuard", "captured_output", + "captured_stdout", "TransientResource", "transient_internet", +- "run_with_locale", "set_memlimit", "bigmemtest", "bigaddrspacetest", ++ "run_with_locale", "set_memlimit", "temp_umask", "bigmemtest", "bigaddrspacetest", + "BasicTestRunner", "run_unittest", "run_doctest", "threading_setup", + "threading_cleanup", "reap_threads", "start_threads", "cpython_only", + "check_impl_detail", "get_attribute", "py3k_bytes", +@@ -292,16 +293,37 @@ def rmtree(path): + if e.errno not in (errno.ENOENT, errno.ESRCH): + raise + ++def make_legacy_pyc(source): ++ """Move a PEP 3147 pyc/pyo file to its legacy pyc/pyo location. ++ ++ The choice of .pyc or .pyo extension is done based on the __debug__ flag ++ value. ++ ++ :param source: The file system path to the source file. The source file ++ does not need to exist, however the PEP 3147 pyc file must exist. ++ :return: The file system path to the legacy pyc file. ++ """ ++ pyc_file = imp.cache_from_source(source) ++ up_one = os.path.dirname(os.path.abspath(source)) ++ legacy_pyc = os.path.join(up_one, source + ('c' if __debug__ else 'o')) ++ os.rename(pyc_file, legacy_pyc) ++ return legacy_pyc ++ + def forget(modname): +- '''"Forget" a module was ever imported by removing it from sys.modules and +- deleting any .pyc and .pyo files.''' ++ """'Forget' a module was ever imported. ++ ++ This removes the module from sys.modules and deletes any PEP 3147 or ++ legacy .pyc and .pyo files. ++ """ + unload(modname) + for dirname in sys.path: +- unlink(os.path.join(dirname, modname + os.extsep + 'pyc')) +- # Deleting the .pyo file cannot be within the 'try' for the .pyc since +- # the chance exists that there is no .pyc (and thus the 'try' statement +- # is exited) but there is a .pyo file. +- unlink(os.path.join(dirname, modname + os.extsep + 'pyo')) ++ source = os.path.join(dirname, modname + os.extsep + 'py') ++ # It doesn't matter if they exist or not, unlink all possible ++ # combinations of PEP 3147 and legacy pyc and pyo files. ++ unlink(source + 'c') ++ unlink(source + 'o') ++ unlink(imp.cache_from_source(source, debug_override=True)) ++ unlink(imp.cache_from_source(source, debug_override=False)) + + # Check whether a gui is actually available + def _is_gui_available(): +@@ -765,6 +787,16 @@ def temp_cwd(name='tempcwd', quiet=False): + rmtree(name) + + ++@contextlib.contextmanager ++def temp_umask(umask): ++ """Context manager that temporarily sets the process umask.""" ++ oldmask = os.umask(umask) ++ try: ++ yield ++ finally: ++ os.umask(oldmask) ++ ++ + def findfile(file, here=None, subdir=None): + """Try to find a file on sys.path and the working directory. If it is not + found the argument passed to the function is returned (this does not +diff --git a/lib-python/2.7/test/test_traceback.py b/lib-python/2.7/test/test_traceback.py +index c8ade06..7635579 100644 +--- a/lib-python/2.7/test/test_traceback.py ++++ b/lib-python/2.7/test/test_traceback.py +@@ -1,6 +1,7 @@ + """Test cases for traceback module""" + + from StringIO import StringIO ++import shutil + import sys + import unittest + from imp import reload +@@ -114,9 +115,7 @@ def test(): + self.assertEqual(src, 'raise NotImplementedError') + finally: + sys.path[:] = savedpath +- for f in os.listdir(testdir): +- os.unlink(os.path.join(testdir, f)) +- os.rmdir(testdir) ++ shutil.rmtree(testdir) + + err = self.get_exception_format(self.syntax_error_bad_indentation2, + IndentationError) +diff --git a/lib-python/2.7/test/test_zipfile.py b/lib-python/2.7/test/test_zipfile.py +index 9c63aeb..a084019 100644 +--- a/lib-python/2.7/test/test_zipfile.py ++++ b/lib-python/2.7/test/test_zipfile.py +@@ -6,6 +6,7 @@ except ImportError: + + import os + import io ++import imp + import sys + import time + import struct +@@ -836,7 +837,13 @@ class PyZipFileTests(unittest.TestCase): + with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp: + fn = __file__ + if fn.endswith('.pyc') or fn.endswith('.pyo'): +- fn = fn[:-1] ++ path_split = fn.split(os.sep) ++ if os.altsep is not None: ++ path_split.extend(fn.split(os.altsep)) ++ if '__pycache__' in path_split: ++ fn = imp.source_from_cache(fn) ++ else: ++ fn = fn[:-1] + + zipfp.writepy(fn) + +diff --git a/lib-python/2.7/test/test_zipimport.py b/lib-python/2.7/test/test_zipimport.py +index a66738a..da8c38e 100644 +--- a/lib-python/2.7/test/test_zipimport.py ++++ b/lib-python/2.7/test/test_zipimport.py +@@ -43,17 +43,14 @@ NOW = time.time() + test_pyc = make_pyc(test_co, NOW) + + +-if __debug__: +- pyc_ext = ".pyc" +-else: +- pyc_ext = ".pyo" +- +- + TESTMOD = "ziptestmodule" + TESTPACK = "ziptestpackage" + TESTPACK2 = "ziptestpackage2" + TEMP_ZIP = os.path.abspath("junk95142" + os.extsep + "zip") + ++pyc_file = imp.cache_from_source(TESTMOD + '.py') ++pyc_ext = ('.pyc' if __debug__ else '.pyo') ++ + + class UncompressedZipImportTestCase(ImportHooksBaseTestCase): + +diff --git a/lib-python/2.7/zipfile.py b/lib-python/2.7/zipfile.py +index a16d860..2198048 100644 +--- a/lib-python/2.7/zipfile.py ++++ b/lib-python/2.7/zipfile.py +@@ -3,6 +3,7 @@ Read and write ZIP files. + """ + import struct, os, time, sys, shutil + import binascii, cStringIO, stat ++import imp + import io + import re + import string +@@ -1457,22 +1458,42 @@ class PyZipFile(ZipFile): + file_py = pathname + ".py" + file_pyc = pathname + ".pyc" + file_pyo = pathname + ".pyo" +- if os.path.isfile(file_pyo) and \ +- os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime: +- fname = file_pyo # Use .pyo file +- elif not os.path.isfile(file_pyc) or \ +- os.stat(file_pyc).st_mtime < os.stat(file_py).st_mtime: ++ pycache_pyc = imp.cache_from_source(file_py, True) ++ pycache_pyo = imp.cache_from_source(file_py, False) ++ if (os.path.isfile(file_pyo) and ++ os.stat(file_pyo).st_mtime >= os.stat(file_py).st_mtime): ++ # Use .pyo file. ++ arcname = fname = file_pyo ++ elif (os.path.isfile(file_pyc) and ++ os.stat(file_pyc).st_mtime >= os.stat(file_py).st_mtime): ++ # Use .pyc file. ++ arcname = fname = file_pyc ++ elif (os.path.isfile(pycache_pyc) and ++ os.stat(pycache_pyc).st_mtime >= os.stat(file_py).st_mtime): ++ # Use the __pycache__/*.pyc file, but write it to the legacy pyc ++ # file name in the archive. ++ fname = pycache_pyc ++ arcname = file_pyc ++ elif (os.path.isfile(pycache_pyo) and ++ os.stat(pycache_pyo).st_mtime >= os.stat(file_py).st_mtime): ++ # Use the __pycache__/*.pyo file, but write it to the legacy pyo ++ # file name in the archive. ++ fname = pycache_pyo ++ arcname = file_pyo ++ else: ++ # Compile py into PEP 3147 pyc file. + import py_compile + if self.debug: + print "Compiling", file_py + try: +- py_compile.compile(file_py, file_pyc, None, True) +- except py_compile.PyCompileError,err: ++ py_compile.compile(file_py, doraise=True) ++ except py_compile.PyCompileError, error: + print err.msg +- fname = file_pyc +- else: +- fname = file_pyc +- archivename = os.path.split(fname)[1] ++ fname = file_py ++ else: ++ fname = (pycache_pyc if __debug__ else pycache_pyo) ++ arcname = (file_pyc if __debug__ else file_pyo) ++ archivename = os.path.split(arcname)[1] + if basename: + archivename = "%s/%s" % (basename, archivename) + return (fname, archivename) diff --git a/debian/patches/plat-gnukfreebsd b/debian/patches/plat-gnukfreebsd new file mode 100644 index 0000000..d4d236a --- /dev/null +++ b/debian/patches/plat-gnukfreebsd @@ -0,0 +1,5027 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: DLFCN.py for kfreebsd + +Author: Jakub Wilk <jwilk@debian.org> +Origin: Debian cpython packaging +Bug-Debian: http://bugs.debian.org/593818 +Last-Update: 2014-09-22 +--- + lib-python/2.7/plat-gnukfreebsd10/DLFCN.py | 118 +++++ + lib-python/2.7/plat-gnukfreebsd10/IN.py | 809 +++++++++++++++++++++++++++++ + lib-python/2.7/plat-gnukfreebsd10/TYPES.py | 303 +++++++++++ + lib-python/2.7/plat-gnukfreebsd11/DLFCN.py | 118 +++++ + lib-python/2.7/plat-gnukfreebsd11/IN.py | 809 +++++++++++++++++++++++++++++ + lib-python/2.7/plat-gnukfreebsd11/TYPES.py | 303 +++++++++++ + lib-python/2.7/plat-gnukfreebsd8/DLFCN.py | 118 +++++ + lib-python/2.7/plat-gnukfreebsd8/IN.py | 809 +++++++++++++++++++++++++++++ + lib-python/2.7/plat-gnukfreebsd8/TYPES.py | 303 +++++++++++ + lib-python/2.7/plat-gnukfreebsd9/DLFCN.py | 118 +++++ + lib-python/2.7/plat-gnukfreebsd9/IN.py | 809 +++++++++++++++++++++++++++++ + lib-python/2.7/plat-gnukfreebsd9/TYPES.py | 303 +++++++++++ + 12 files changed, 4920 insertions(+) + create mode 100644 lib-python/2.7/plat-gnukfreebsd10/DLFCN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd10/IN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd10/TYPES.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd11/DLFCN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd11/IN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd11/TYPES.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd8/DLFCN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd8/IN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd8/TYPES.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd9/DLFCN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd9/IN.py + create mode 100644 lib-python/2.7/plat-gnukfreebsd9/TYPES.py + +diff --git a/lib-python/2.7/plat-gnukfreebsd10/DLFCN.py b/lib-python/2.7/plat-gnukfreebsd10/DLFCN.py +new file mode 100644 +index 0000000..d020fe1 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd10/DLFCN.py +@@ -0,0 +1,118 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00004 ++RTLD_DEEPBIND = 0x00008 ++RTLD_GLOBAL = 0x00100 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 ++LM_ID_BASE = 0 ++LM_ID_NEWLM = -1 +diff --git a/lib-python/2.7/plat-gnukfreebsd10/IN.py b/lib-python/2.7/plat-gnukfreebsd10/IN.py +new file mode 100644 +index 0000000..7e5f845 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd10/IN.py +@@ -0,0 +1,809 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MAX = (2147483647) ++__WCHAR_MIN = (-__WCHAR_MAX - 1) ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ++ ++def UINT16_C(c): return c ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from sys/socket.h ++_SYS_SOCKET_H = 1 ++ ++# Included from sys/uio.h ++_SYS_UIO_H = 1 ++from TYPES import * ++ ++# Included from bits/uio.h ++_BITS_UIO_H = 1 ++from TYPES import * ++UIO_MAXIOV = 1024 ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++ ++# Included from bits/socket.h ++__BITS_SOCKET_H = 1 ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 25 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_HOST_NAME_MAX = 255 ++_POSIX_LINK_MAX = 8 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NAME_MAX = 14 ++_POSIX_NGROUPS_MAX = 8 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 20 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RE_DUP_MAX = 255 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_SYMLINK_MAX = 255 ++_POSIX_SYMLOOP_MAX = 8 ++_POSIX_TIMER_MAX = 32 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from sys/syslimits.h ++ARG_MAX = 262144 ++CHILD_MAX = 40 ++LINK_MAX = 32767 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++NGROUPS_MAX = 1023 ++OPEN_MAX = 64 ++PATH_MAX = 1024 ++PIPE_BUF = 512 ++IOV_MAX = 1024 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++DELAYTIMER_MAX = 2147483647 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = 8 ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 1024 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 64 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_IMPLINK = 3 ++PF_PUP = 4 ++PF_CHAOS = 5 ++PF_NS = 6 ++PF_ISO = 7 ++PF_OSI = PF_ISO ++PF_ECMA = 8 ++PF_DATAKIT = 9 ++PF_CCITT = 10 ++PF_SNA = 11 ++PF_DECnet = 12 ++PF_DLI = 13 ++PF_LAT = 14 ++PF_HYLINK = 15 ++PF_APPLETALK = 16 ++PF_ROUTE = 17 ++PF_LINK = 18 ++PF_XTP = 19 ++PF_COIP = 20 ++PF_CNT = 21 ++PF_RTIP = 22 ++PF_IPX = 23 ++PF_SIP = 24 ++PF_PIP = 25 ++PF_ISDN = 26 ++PF_KEY = 27 ++PF_INET6 = 28 ++PF_NATM = 29 ++PF_ATM = 30 ++PF_HDRCMPLT = 31 ++PF_NETGRAPH = 32 ++PF_MAX = 33 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_IMPLINK = PF_IMPLINK ++AF_PUP = PF_PUP ++AF_CHAOS = PF_CHAOS ++AF_NS = PF_NS ++AF_ISO = PF_ISO ++AF_OSI = PF_OSI ++AF_ECMA = PF_ECMA ++AF_DATAKIT = PF_DATAKIT ++AF_CCITT = PF_CCITT ++AF_SNA = PF_SNA ++AF_DECnet = PF_DECnet ++AF_DLI = PF_DLI ++AF_LAT = PF_LAT ++AF_HYLINK = PF_HYLINK ++AF_APPLETALK = PF_APPLETALK ++AF_ROUTE = PF_ROUTE ++AF_LINK = PF_LINK ++pseudo_AF_XTP = PF_XTP ++AF_COIP = PF_COIP ++AF_CNT = PF_CNT ++pseudo_AF_RTIP = PF_RTIP ++AF_IPX = PF_IPX ++AF_SIP = PF_SIP ++pseudo_AF_PIP = PF_PIP ++AF_ISDN = PF_ISDN ++AF_E164 = AF_ISDN ++pseudo_AF_KEY = PF_KEY ++AF_INET6 = PF_INET6 ++AF_NATM = PF_NATM ++AF_ATM = PF_ATM ++pseudo_AF_HDRCMPLT = PF_HDRCMPLT ++AF_NETGRAPH = PF_NETGRAPH ++AF_MAX = PF_MAX ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_HAVE_SA_LEN = 1 ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++CMGROUP_MAX = 16 ++SOL_SOCKET = 0xffff ++LOCAL_PEERCRED = 0x001 ++LOCAL_CREDS = 0x002 ++LOCAL_CONNWAIT = 0x004 ++ ++# Included from bits/socket2.h ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/in.h ++IMPLINK_IP = 155 ++IMPLINK_LOWEXPER = 156 ++IMPLINK_HIGHEXPER = 158 ++IPPROTO_DIVERT = 258 ++SOL_IP = 0 ++IP_OPTIONS = 1 ++IP_HDRINCL = 2 ++IP_TOS = 3 ++IP_TTL = 4 ++IP_RECVOPTS = 5 ++IP_RECVRETOPTS = 6 ++IP_RECVDSTADDR = 7 ++IP_SENDSRCADDR = IP_RECVDSTADDR ++IP_RETOPTS = 8 ++IP_MULTICAST_IF = 9 ++IP_MULTICAST_TTL = 10 ++IP_MULTICAST_LOOP = 11 ++IP_ADD_MEMBERSHIP = 12 ++IP_DROP_MEMBERSHIP = 13 ++IP_MULTICAST_VIF = 14 ++IP_RSVP_ON = 15 ++IP_RSVP_OFF = 16 ++IP_RSVP_VIF_ON = 17 ++IP_RSVP_VIF_OFF = 18 ++IP_PORTRANGE = 19 ++IP_RECVIF = 20 ++IP_IPSEC_POLICY = 21 ++IP_FAITH = 22 ++IP_ONESBCAST = 23 ++IP_NONLOCALOK = 24 ++IP_FW_TABLE_ADD = 40 ++IP_FW_TABLE_DEL = 41 ++IP_FW_TABLE_FLUSH = 42 ++IP_FW_TABLE_GETSIZE = 43 ++IP_FW_TABLE_LIST = 44 ++IP_FW_ADD = 50 ++IP_FW_DEL = 51 ++IP_FW_FLUSH = 52 ++IP_FW_ZERO = 53 ++IP_FW_GET = 54 ++IP_FW_RESETLOG = 55 ++IP_FW_NAT_CFG = 56 ++IP_FW_NAT_DEL = 57 ++IP_FW_NAT_GET_CONFIG = 58 ++IP_FW_NAT_GET_LOG = 59 ++IP_DUMMYNET_CONFIGURE = 60 ++IP_DUMMYNET_DEL = 61 ++IP_DUMMYNET_FLUSH = 62 ++IP_DUMMYNET_GET = 64 ++IP_RECVTTL = 65 ++IP_MINTTL = 66 ++IP_DONTFRAG = 67 ++IP_ADD_SOURCE_MEMBERSHIP = 70 ++IP_DROP_SOURCE_MEMBERSHIP = 71 ++IP_BLOCK_SOURCE = 72 ++IP_UNBLOCK_SOURCE = 73 ++IP_MSFILTER = 74 ++MCAST_JOIN_GROUP = 80 ++MCAST_LEAVE_GROUP = 81 ++MCAST_JOIN_SOURCE_GROUP = 82 ++MCAST_LEAVE_SOURCE_GROUP = 83 ++MCAST_BLOCK_SOURCE = 84 ++MCAST_UNBLOCK_SOURCE = 85 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MIN_MEMBERSHIPS = 31 ++IP_MAX_MEMBERSHIPS = 4095 ++IP_MAX_SOURCE_FILTER = 1024 ++MCAST_UNDEFINED = 0 ++MCAST_INCLUDE = 1 ++MCAST_EXCLUDE = 2 ++IP_PORTRANGE_DEFAULT = 0 ++IP_PORTRANGE_HIGH = 1 ++IP_PORTRANGE_LOW = 2 ++IPCTL_FORWARDING = 1 ++IPCTL_SENDREDIRECTS = 2 ++IPCTL_DEFTTL = 3 ++IPCTL_DEFMTU = 4 ++IPCTL_RTEXPIRE = 5 ++IPCTL_RTMINEXPIRE = 6 ++IPCTL_RTMAXCACHE = 7 ++IPCTL_SOURCEROUTE = 8 ++IPCTL_DIRECTEDBROADCAST = 9 ++IPCTL_INTRQMAXLEN = 10 ++IPCTL_INTRQDROPS = 11 ++IPCTL_STATS = 12 ++IPCTL_ACCEPTSOURCEROUTE = 13 ++IPCTL_FASTFORWARDING = 14 ++IPCTL_KEEPFAITH = 15 ++IPCTL_GIF_TTL = 16 ++IPCTL_MAXID = 17 ++IPV6_SOCKOPT_RESERVED1 = 3 ++IPV6_UNICAST_HOPS = 4 ++IPV6_MULTICAST_IF = 9 ++IPV6_MULTICAST_HOPS = 10 ++IPV6_MULTICAST_LOOP = 11 ++IPV6_JOIN_GROUP = 12 ++IPV6_LEAVE_GROUP = 13 ++IPV6_PORTRANGE = 14 ++ICMP6_FILTER = 18 ++IPV6_CHECKSUM = 26 ++IPV6_V6ONLY = 27 ++IPV6_IPSEC_POLICY = 28 ++IPV6_FAITH = 29 ++IPV6_FW_ADD = 30 ++IPV6_FW_DEL = 31 ++IPV6_FW_FLUSH = 32 ++IPV6_FW_ZERO = 33 ++IPV6_FW_GET = 34 ++IPV6_RTHDRDSTOPTS = 35 ++IPV6_RECVPKTINFO = 36 ++IPV6_RECVHOPLIMIT = 37 ++IPV6_RECVRTHDR = 38 ++IPV6_RECVHOPOPTS = 39 ++IPV6_RECVDSTOPTS = 40 ++IPV6_USE_MIN_MTU = 42 ++IPV6_RECVPATHMTU = 43 ++IPV6_PATHMTU = 44 ++IPV6_PKTINFO = 46 ++IPV6_HOPLIMIT = 47 ++IPV6_NEXTHOP = 48 ++IPV6_HOPOPTS = 49 ++IPV6_DSTOPTS = 50 ++IPV6_RTHDR = 51 ++IPV6_RECVTCLASS = 57 ++IPV6_AUTOFLOWLABEL = 59 ++IPV6_TCLASS = 61 ++IPV6_DONTFRAG = 62 ++IPV6_PREFER_TEMPADDR = 63 ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_DEFAULT_MULTICAST_HOPS = 1 ++IPV6_DEFAULT_MULTICAST_LOOP = 1 ++IPV6_PORTRANGE_DEFAULT = 0 ++IPV6_PORTRANGE_HIGH = 1 ++IPV6_PORTRANGE_LOW = 2 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++IPV6CTL_FORWARDING = 1 ++IPV6CTL_SENDREDIRECTS = 2 ++IPV6CTL_DEFHLIM = 3 ++IPV6CTL_FORWSRCRT = 5 ++IPV6CTL_STATS = 6 ++IPV6CTL_MRTSTATS = 7 ++IPV6CTL_MRTPROTO = 8 ++IPV6CTL_MAXFRAGPACKETS = 9 ++IPV6CTL_SOURCECHECK = 10 ++IPV6CTL_SOURCECHECK_LOGINT = 11 ++IPV6CTL_ACCEPT_RTADV = 12 ++IPV6CTL_KEEPFAITH = 13 ++IPV6CTL_LOG_INTERVAL = 14 ++IPV6CTL_HDRNESTLIMIT = 15 ++IPV6CTL_DAD_COUNT = 16 ++IPV6CTL_AUTO_FLOWLABEL = 17 ++IPV6CTL_DEFMCASTHLIM = 18 ++IPV6CTL_GIF_HLIM = 19 ++IPV6CTL_KAME_VERSION = 20 ++IPV6CTL_USE_DEPRECATED = 21 ++IPV6CTL_RR_PRUNE = 22 ++IPV6CTL_V6ONLY = 24 ++IPV6CTL_RTEXPIRE = 25 ++IPV6CTL_RTMINEXPIRE = 26 ++IPV6CTL_RTMAXCACHE = 27 ++IPV6CTL_USETEMPADDR = 32 ++IPV6CTL_TEMPPLTIME = 33 ++IPV6CTL_TEMPVLTIME = 34 ++IPV6CTL_AUTO_LINKLOCAL = 35 ++IPV6CTL_RIP6STATS = 36 ++IPV6CTL_PREFER_TEMPADDR = 37 ++IPV6CTL_ADDRCTLPOLICY = 38 ++IPV6CTL_USE_DEFAULTZONE = 39 ++IPV6CTL_MAXFRAGS = 41 ++IPV6CTL_MCAST_PMTU = 44 ++IPV6CTL_STEALTH = 45 ++ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 ++IPV6CTL_MAXID = 48 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return \ ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd10/TYPES.py b/lib-python/2.7/plat-gnukfreebsd10/TYPES.py +new file mode 100644 +index 0000000..4132c8f +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd10/TYPES.py +@@ -0,0 +1,303 @@ ++# Generated by h2py from /usr/include/sys/types.h ++_SYS_TYPES_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++ ++# Included from time.h ++_TIME_H = 1 ++ ++# Included from bits/time.h ++_BITS_TIME_H = 1 ++CLOCKS_PER_SEC = 1000000l ++CLK_TCK = 128 ++CLOCK_REALTIME = 0 ++CLOCK_PROCESS_CPUTIME_ID = 2 ++CLOCK_THREAD_CPUTIME_ID = 3 ++CLOCK_MONOTONIC = 4 ++CLOCK_VIRTUAL = 1 ++CLOCK_PROF = 2 ++CLOCK_UPTIME = 5 ++CLOCK_UPTIME_PRECISE = 7 ++CLOCK_UPTIME_FAST = 8 ++CLOCK_REALTIME_PRECISE = 9 ++CLOCK_REALTIME_FAST = 10 ++CLOCK_MONOTONIC_PRECISE = 11 ++CLOCK_MONOTONIC_FAST = 12 ++CLOCK_SECOND = 13 ++TIMER_RELTIME = 0 ++TIMER_ABSTIME = 1 ++_STRUCT_TIMEVAL = 1 ++CLK_TCK = CLOCKS_PER_SEC ++__clock_t_defined = 1 ++__time_t_defined = 1 ++__clockid_t_defined = 1 ++__timer_t_defined = 1 ++__timespec_defined = 1 ++ ++# Included from xlocale.h ++_XLOCALE_H = 1 ++def __isleap(year): return \ ++ ++__BIT_TYPES_DEFINED__ = 1 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++ ++# Included from sys/select.h ++_SYS_SELECT_H = 1 ++ ++# Included from bits/select.h ++def __FD_ZERO(fdsp): return \ ++ ++def __FD_ZERO(set): return \ ++ ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++def __FDELT(d): return ((d) / __NFDBITS) ++ ++FD_SETSIZE = __FD_SETSIZE ++def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) ++ ++ ++# Included from sys/sysmacros.h ++_SYS_SYSMACROS_H = 1 ++def minor(dev): return ((int)((dev) & (-65281))) ++ ++def gnu_dev_major(dev): return major (dev) ++ ++def gnu_dev_minor(dev): return minor (dev) ++ ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 2 ++SCHED_FIFO = 1 ++SCHED_RR = 3 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++CLONE_SYSVSEM = 0x00040000 ++__defined_schedparam = 1 ++__CPU_SETSIZE = 128 ++def __CPUELT(cpu): return ((cpu) / __NCPUBITS) ++ ++def __CPU_ALLOC_SIZE(count): return \ ++ ++def __CPU_ALLOC(count): return __sched_cpualloc (count) ++ ++def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd11/DLFCN.py b/lib-python/2.7/plat-gnukfreebsd11/DLFCN.py +new file mode 100644 +index 0000000..d020fe1 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd11/DLFCN.py +@@ -0,0 +1,118 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00004 ++RTLD_DEEPBIND = 0x00008 ++RTLD_GLOBAL = 0x00100 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 ++LM_ID_BASE = 0 ++LM_ID_NEWLM = -1 +diff --git a/lib-python/2.7/plat-gnukfreebsd11/IN.py b/lib-python/2.7/plat-gnukfreebsd11/IN.py +new file mode 100644 +index 0000000..7e5f845 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd11/IN.py +@@ -0,0 +1,809 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MAX = (2147483647) ++__WCHAR_MIN = (-__WCHAR_MAX - 1) ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ++ ++def UINT16_C(c): return c ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from sys/socket.h ++_SYS_SOCKET_H = 1 ++ ++# Included from sys/uio.h ++_SYS_UIO_H = 1 ++from TYPES import * ++ ++# Included from bits/uio.h ++_BITS_UIO_H = 1 ++from TYPES import * ++UIO_MAXIOV = 1024 ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++ ++# Included from bits/socket.h ++__BITS_SOCKET_H = 1 ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 25 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_HOST_NAME_MAX = 255 ++_POSIX_LINK_MAX = 8 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NAME_MAX = 14 ++_POSIX_NGROUPS_MAX = 8 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 20 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RE_DUP_MAX = 255 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_SYMLINK_MAX = 255 ++_POSIX_SYMLOOP_MAX = 8 ++_POSIX_TIMER_MAX = 32 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from sys/syslimits.h ++ARG_MAX = 262144 ++CHILD_MAX = 40 ++LINK_MAX = 32767 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++NGROUPS_MAX = 1023 ++OPEN_MAX = 64 ++PATH_MAX = 1024 ++PIPE_BUF = 512 ++IOV_MAX = 1024 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++DELAYTIMER_MAX = 2147483647 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = 8 ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 1024 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 64 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_IMPLINK = 3 ++PF_PUP = 4 ++PF_CHAOS = 5 ++PF_NS = 6 ++PF_ISO = 7 ++PF_OSI = PF_ISO ++PF_ECMA = 8 ++PF_DATAKIT = 9 ++PF_CCITT = 10 ++PF_SNA = 11 ++PF_DECnet = 12 ++PF_DLI = 13 ++PF_LAT = 14 ++PF_HYLINK = 15 ++PF_APPLETALK = 16 ++PF_ROUTE = 17 ++PF_LINK = 18 ++PF_XTP = 19 ++PF_COIP = 20 ++PF_CNT = 21 ++PF_RTIP = 22 ++PF_IPX = 23 ++PF_SIP = 24 ++PF_PIP = 25 ++PF_ISDN = 26 ++PF_KEY = 27 ++PF_INET6 = 28 ++PF_NATM = 29 ++PF_ATM = 30 ++PF_HDRCMPLT = 31 ++PF_NETGRAPH = 32 ++PF_MAX = 33 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_IMPLINK = PF_IMPLINK ++AF_PUP = PF_PUP ++AF_CHAOS = PF_CHAOS ++AF_NS = PF_NS ++AF_ISO = PF_ISO ++AF_OSI = PF_OSI ++AF_ECMA = PF_ECMA ++AF_DATAKIT = PF_DATAKIT ++AF_CCITT = PF_CCITT ++AF_SNA = PF_SNA ++AF_DECnet = PF_DECnet ++AF_DLI = PF_DLI ++AF_LAT = PF_LAT ++AF_HYLINK = PF_HYLINK ++AF_APPLETALK = PF_APPLETALK ++AF_ROUTE = PF_ROUTE ++AF_LINK = PF_LINK ++pseudo_AF_XTP = PF_XTP ++AF_COIP = PF_COIP ++AF_CNT = PF_CNT ++pseudo_AF_RTIP = PF_RTIP ++AF_IPX = PF_IPX ++AF_SIP = PF_SIP ++pseudo_AF_PIP = PF_PIP ++AF_ISDN = PF_ISDN ++AF_E164 = AF_ISDN ++pseudo_AF_KEY = PF_KEY ++AF_INET6 = PF_INET6 ++AF_NATM = PF_NATM ++AF_ATM = PF_ATM ++pseudo_AF_HDRCMPLT = PF_HDRCMPLT ++AF_NETGRAPH = PF_NETGRAPH ++AF_MAX = PF_MAX ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_HAVE_SA_LEN = 1 ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++CMGROUP_MAX = 16 ++SOL_SOCKET = 0xffff ++LOCAL_PEERCRED = 0x001 ++LOCAL_CREDS = 0x002 ++LOCAL_CONNWAIT = 0x004 ++ ++# Included from bits/socket2.h ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/in.h ++IMPLINK_IP = 155 ++IMPLINK_LOWEXPER = 156 ++IMPLINK_HIGHEXPER = 158 ++IPPROTO_DIVERT = 258 ++SOL_IP = 0 ++IP_OPTIONS = 1 ++IP_HDRINCL = 2 ++IP_TOS = 3 ++IP_TTL = 4 ++IP_RECVOPTS = 5 ++IP_RECVRETOPTS = 6 ++IP_RECVDSTADDR = 7 ++IP_SENDSRCADDR = IP_RECVDSTADDR ++IP_RETOPTS = 8 ++IP_MULTICAST_IF = 9 ++IP_MULTICAST_TTL = 10 ++IP_MULTICAST_LOOP = 11 ++IP_ADD_MEMBERSHIP = 12 ++IP_DROP_MEMBERSHIP = 13 ++IP_MULTICAST_VIF = 14 ++IP_RSVP_ON = 15 ++IP_RSVP_OFF = 16 ++IP_RSVP_VIF_ON = 17 ++IP_RSVP_VIF_OFF = 18 ++IP_PORTRANGE = 19 ++IP_RECVIF = 20 ++IP_IPSEC_POLICY = 21 ++IP_FAITH = 22 ++IP_ONESBCAST = 23 ++IP_NONLOCALOK = 24 ++IP_FW_TABLE_ADD = 40 ++IP_FW_TABLE_DEL = 41 ++IP_FW_TABLE_FLUSH = 42 ++IP_FW_TABLE_GETSIZE = 43 ++IP_FW_TABLE_LIST = 44 ++IP_FW_ADD = 50 ++IP_FW_DEL = 51 ++IP_FW_FLUSH = 52 ++IP_FW_ZERO = 53 ++IP_FW_GET = 54 ++IP_FW_RESETLOG = 55 ++IP_FW_NAT_CFG = 56 ++IP_FW_NAT_DEL = 57 ++IP_FW_NAT_GET_CONFIG = 58 ++IP_FW_NAT_GET_LOG = 59 ++IP_DUMMYNET_CONFIGURE = 60 ++IP_DUMMYNET_DEL = 61 ++IP_DUMMYNET_FLUSH = 62 ++IP_DUMMYNET_GET = 64 ++IP_RECVTTL = 65 ++IP_MINTTL = 66 ++IP_DONTFRAG = 67 ++IP_ADD_SOURCE_MEMBERSHIP = 70 ++IP_DROP_SOURCE_MEMBERSHIP = 71 ++IP_BLOCK_SOURCE = 72 ++IP_UNBLOCK_SOURCE = 73 ++IP_MSFILTER = 74 ++MCAST_JOIN_GROUP = 80 ++MCAST_LEAVE_GROUP = 81 ++MCAST_JOIN_SOURCE_GROUP = 82 ++MCAST_LEAVE_SOURCE_GROUP = 83 ++MCAST_BLOCK_SOURCE = 84 ++MCAST_UNBLOCK_SOURCE = 85 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MIN_MEMBERSHIPS = 31 ++IP_MAX_MEMBERSHIPS = 4095 ++IP_MAX_SOURCE_FILTER = 1024 ++MCAST_UNDEFINED = 0 ++MCAST_INCLUDE = 1 ++MCAST_EXCLUDE = 2 ++IP_PORTRANGE_DEFAULT = 0 ++IP_PORTRANGE_HIGH = 1 ++IP_PORTRANGE_LOW = 2 ++IPCTL_FORWARDING = 1 ++IPCTL_SENDREDIRECTS = 2 ++IPCTL_DEFTTL = 3 ++IPCTL_DEFMTU = 4 ++IPCTL_RTEXPIRE = 5 ++IPCTL_RTMINEXPIRE = 6 ++IPCTL_RTMAXCACHE = 7 ++IPCTL_SOURCEROUTE = 8 ++IPCTL_DIRECTEDBROADCAST = 9 ++IPCTL_INTRQMAXLEN = 10 ++IPCTL_INTRQDROPS = 11 ++IPCTL_STATS = 12 ++IPCTL_ACCEPTSOURCEROUTE = 13 ++IPCTL_FASTFORWARDING = 14 ++IPCTL_KEEPFAITH = 15 ++IPCTL_GIF_TTL = 16 ++IPCTL_MAXID = 17 ++IPV6_SOCKOPT_RESERVED1 = 3 ++IPV6_UNICAST_HOPS = 4 ++IPV6_MULTICAST_IF = 9 ++IPV6_MULTICAST_HOPS = 10 ++IPV6_MULTICAST_LOOP = 11 ++IPV6_JOIN_GROUP = 12 ++IPV6_LEAVE_GROUP = 13 ++IPV6_PORTRANGE = 14 ++ICMP6_FILTER = 18 ++IPV6_CHECKSUM = 26 ++IPV6_V6ONLY = 27 ++IPV6_IPSEC_POLICY = 28 ++IPV6_FAITH = 29 ++IPV6_FW_ADD = 30 ++IPV6_FW_DEL = 31 ++IPV6_FW_FLUSH = 32 ++IPV6_FW_ZERO = 33 ++IPV6_FW_GET = 34 ++IPV6_RTHDRDSTOPTS = 35 ++IPV6_RECVPKTINFO = 36 ++IPV6_RECVHOPLIMIT = 37 ++IPV6_RECVRTHDR = 38 ++IPV6_RECVHOPOPTS = 39 ++IPV6_RECVDSTOPTS = 40 ++IPV6_USE_MIN_MTU = 42 ++IPV6_RECVPATHMTU = 43 ++IPV6_PATHMTU = 44 ++IPV6_PKTINFO = 46 ++IPV6_HOPLIMIT = 47 ++IPV6_NEXTHOP = 48 ++IPV6_HOPOPTS = 49 ++IPV6_DSTOPTS = 50 ++IPV6_RTHDR = 51 ++IPV6_RECVTCLASS = 57 ++IPV6_AUTOFLOWLABEL = 59 ++IPV6_TCLASS = 61 ++IPV6_DONTFRAG = 62 ++IPV6_PREFER_TEMPADDR = 63 ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_DEFAULT_MULTICAST_HOPS = 1 ++IPV6_DEFAULT_MULTICAST_LOOP = 1 ++IPV6_PORTRANGE_DEFAULT = 0 ++IPV6_PORTRANGE_HIGH = 1 ++IPV6_PORTRANGE_LOW = 2 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++IPV6CTL_FORWARDING = 1 ++IPV6CTL_SENDREDIRECTS = 2 ++IPV6CTL_DEFHLIM = 3 ++IPV6CTL_FORWSRCRT = 5 ++IPV6CTL_STATS = 6 ++IPV6CTL_MRTSTATS = 7 ++IPV6CTL_MRTPROTO = 8 ++IPV6CTL_MAXFRAGPACKETS = 9 ++IPV6CTL_SOURCECHECK = 10 ++IPV6CTL_SOURCECHECK_LOGINT = 11 ++IPV6CTL_ACCEPT_RTADV = 12 ++IPV6CTL_KEEPFAITH = 13 ++IPV6CTL_LOG_INTERVAL = 14 ++IPV6CTL_HDRNESTLIMIT = 15 ++IPV6CTL_DAD_COUNT = 16 ++IPV6CTL_AUTO_FLOWLABEL = 17 ++IPV6CTL_DEFMCASTHLIM = 18 ++IPV6CTL_GIF_HLIM = 19 ++IPV6CTL_KAME_VERSION = 20 ++IPV6CTL_USE_DEPRECATED = 21 ++IPV6CTL_RR_PRUNE = 22 ++IPV6CTL_V6ONLY = 24 ++IPV6CTL_RTEXPIRE = 25 ++IPV6CTL_RTMINEXPIRE = 26 ++IPV6CTL_RTMAXCACHE = 27 ++IPV6CTL_USETEMPADDR = 32 ++IPV6CTL_TEMPPLTIME = 33 ++IPV6CTL_TEMPVLTIME = 34 ++IPV6CTL_AUTO_LINKLOCAL = 35 ++IPV6CTL_RIP6STATS = 36 ++IPV6CTL_PREFER_TEMPADDR = 37 ++IPV6CTL_ADDRCTLPOLICY = 38 ++IPV6CTL_USE_DEFAULTZONE = 39 ++IPV6CTL_MAXFRAGS = 41 ++IPV6CTL_MCAST_PMTU = 44 ++IPV6CTL_STEALTH = 45 ++ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 ++IPV6CTL_MAXID = 48 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return \ ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd11/TYPES.py b/lib-python/2.7/plat-gnukfreebsd11/TYPES.py +new file mode 100644 +index 0000000..4132c8f +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd11/TYPES.py +@@ -0,0 +1,303 @@ ++# Generated by h2py from /usr/include/sys/types.h ++_SYS_TYPES_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++ ++# Included from time.h ++_TIME_H = 1 ++ ++# Included from bits/time.h ++_BITS_TIME_H = 1 ++CLOCKS_PER_SEC = 1000000l ++CLK_TCK = 128 ++CLOCK_REALTIME = 0 ++CLOCK_PROCESS_CPUTIME_ID = 2 ++CLOCK_THREAD_CPUTIME_ID = 3 ++CLOCK_MONOTONIC = 4 ++CLOCK_VIRTUAL = 1 ++CLOCK_PROF = 2 ++CLOCK_UPTIME = 5 ++CLOCK_UPTIME_PRECISE = 7 ++CLOCK_UPTIME_FAST = 8 ++CLOCK_REALTIME_PRECISE = 9 ++CLOCK_REALTIME_FAST = 10 ++CLOCK_MONOTONIC_PRECISE = 11 ++CLOCK_MONOTONIC_FAST = 12 ++CLOCK_SECOND = 13 ++TIMER_RELTIME = 0 ++TIMER_ABSTIME = 1 ++_STRUCT_TIMEVAL = 1 ++CLK_TCK = CLOCKS_PER_SEC ++__clock_t_defined = 1 ++__time_t_defined = 1 ++__clockid_t_defined = 1 ++__timer_t_defined = 1 ++__timespec_defined = 1 ++ ++# Included from xlocale.h ++_XLOCALE_H = 1 ++def __isleap(year): return \ ++ ++__BIT_TYPES_DEFINED__ = 1 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++ ++# Included from sys/select.h ++_SYS_SELECT_H = 1 ++ ++# Included from bits/select.h ++def __FD_ZERO(fdsp): return \ ++ ++def __FD_ZERO(set): return \ ++ ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++def __FDELT(d): return ((d) / __NFDBITS) ++ ++FD_SETSIZE = __FD_SETSIZE ++def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) ++ ++ ++# Included from sys/sysmacros.h ++_SYS_SYSMACROS_H = 1 ++def minor(dev): return ((int)((dev) & (-65281))) ++ ++def gnu_dev_major(dev): return major (dev) ++ ++def gnu_dev_minor(dev): return minor (dev) ++ ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 2 ++SCHED_FIFO = 1 ++SCHED_RR = 3 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++CLONE_SYSVSEM = 0x00040000 ++__defined_schedparam = 1 ++__CPU_SETSIZE = 128 ++def __CPUELT(cpu): return ((cpu) / __NCPUBITS) ++ ++def __CPU_ALLOC_SIZE(count): return \ ++ ++def __CPU_ALLOC(count): return __sched_cpualloc (count) ++ ++def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd8/DLFCN.py b/lib-python/2.7/plat-gnukfreebsd8/DLFCN.py +new file mode 100644 +index 0000000..d020fe1 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd8/DLFCN.py +@@ -0,0 +1,118 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00004 ++RTLD_DEEPBIND = 0x00008 ++RTLD_GLOBAL = 0x00100 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 ++LM_ID_BASE = 0 ++LM_ID_NEWLM = -1 +diff --git a/lib-python/2.7/plat-gnukfreebsd8/IN.py b/lib-python/2.7/plat-gnukfreebsd8/IN.py +new file mode 100644 +index 0000000..7e5f845 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd8/IN.py +@@ -0,0 +1,809 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MAX = (2147483647) ++__WCHAR_MIN = (-__WCHAR_MAX - 1) ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ++ ++def UINT16_C(c): return c ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from sys/socket.h ++_SYS_SOCKET_H = 1 ++ ++# Included from sys/uio.h ++_SYS_UIO_H = 1 ++from TYPES import * ++ ++# Included from bits/uio.h ++_BITS_UIO_H = 1 ++from TYPES import * ++UIO_MAXIOV = 1024 ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++ ++# Included from bits/socket.h ++__BITS_SOCKET_H = 1 ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 25 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_HOST_NAME_MAX = 255 ++_POSIX_LINK_MAX = 8 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NAME_MAX = 14 ++_POSIX_NGROUPS_MAX = 8 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 20 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RE_DUP_MAX = 255 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_SYMLINK_MAX = 255 ++_POSIX_SYMLOOP_MAX = 8 ++_POSIX_TIMER_MAX = 32 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from sys/syslimits.h ++ARG_MAX = 262144 ++CHILD_MAX = 40 ++LINK_MAX = 32767 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++NGROUPS_MAX = 1023 ++OPEN_MAX = 64 ++PATH_MAX = 1024 ++PIPE_BUF = 512 ++IOV_MAX = 1024 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++DELAYTIMER_MAX = 2147483647 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = 8 ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 1024 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 64 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_IMPLINK = 3 ++PF_PUP = 4 ++PF_CHAOS = 5 ++PF_NS = 6 ++PF_ISO = 7 ++PF_OSI = PF_ISO ++PF_ECMA = 8 ++PF_DATAKIT = 9 ++PF_CCITT = 10 ++PF_SNA = 11 ++PF_DECnet = 12 ++PF_DLI = 13 ++PF_LAT = 14 ++PF_HYLINK = 15 ++PF_APPLETALK = 16 ++PF_ROUTE = 17 ++PF_LINK = 18 ++PF_XTP = 19 ++PF_COIP = 20 ++PF_CNT = 21 ++PF_RTIP = 22 ++PF_IPX = 23 ++PF_SIP = 24 ++PF_PIP = 25 ++PF_ISDN = 26 ++PF_KEY = 27 ++PF_INET6 = 28 ++PF_NATM = 29 ++PF_ATM = 30 ++PF_HDRCMPLT = 31 ++PF_NETGRAPH = 32 ++PF_MAX = 33 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_IMPLINK = PF_IMPLINK ++AF_PUP = PF_PUP ++AF_CHAOS = PF_CHAOS ++AF_NS = PF_NS ++AF_ISO = PF_ISO ++AF_OSI = PF_OSI ++AF_ECMA = PF_ECMA ++AF_DATAKIT = PF_DATAKIT ++AF_CCITT = PF_CCITT ++AF_SNA = PF_SNA ++AF_DECnet = PF_DECnet ++AF_DLI = PF_DLI ++AF_LAT = PF_LAT ++AF_HYLINK = PF_HYLINK ++AF_APPLETALK = PF_APPLETALK ++AF_ROUTE = PF_ROUTE ++AF_LINK = PF_LINK ++pseudo_AF_XTP = PF_XTP ++AF_COIP = PF_COIP ++AF_CNT = PF_CNT ++pseudo_AF_RTIP = PF_RTIP ++AF_IPX = PF_IPX ++AF_SIP = PF_SIP ++pseudo_AF_PIP = PF_PIP ++AF_ISDN = PF_ISDN ++AF_E164 = AF_ISDN ++pseudo_AF_KEY = PF_KEY ++AF_INET6 = PF_INET6 ++AF_NATM = PF_NATM ++AF_ATM = PF_ATM ++pseudo_AF_HDRCMPLT = PF_HDRCMPLT ++AF_NETGRAPH = PF_NETGRAPH ++AF_MAX = PF_MAX ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_HAVE_SA_LEN = 1 ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++CMGROUP_MAX = 16 ++SOL_SOCKET = 0xffff ++LOCAL_PEERCRED = 0x001 ++LOCAL_CREDS = 0x002 ++LOCAL_CONNWAIT = 0x004 ++ ++# Included from bits/socket2.h ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/in.h ++IMPLINK_IP = 155 ++IMPLINK_LOWEXPER = 156 ++IMPLINK_HIGHEXPER = 158 ++IPPROTO_DIVERT = 258 ++SOL_IP = 0 ++IP_OPTIONS = 1 ++IP_HDRINCL = 2 ++IP_TOS = 3 ++IP_TTL = 4 ++IP_RECVOPTS = 5 ++IP_RECVRETOPTS = 6 ++IP_RECVDSTADDR = 7 ++IP_SENDSRCADDR = IP_RECVDSTADDR ++IP_RETOPTS = 8 ++IP_MULTICAST_IF = 9 ++IP_MULTICAST_TTL = 10 ++IP_MULTICAST_LOOP = 11 ++IP_ADD_MEMBERSHIP = 12 ++IP_DROP_MEMBERSHIP = 13 ++IP_MULTICAST_VIF = 14 ++IP_RSVP_ON = 15 ++IP_RSVP_OFF = 16 ++IP_RSVP_VIF_ON = 17 ++IP_RSVP_VIF_OFF = 18 ++IP_PORTRANGE = 19 ++IP_RECVIF = 20 ++IP_IPSEC_POLICY = 21 ++IP_FAITH = 22 ++IP_ONESBCAST = 23 ++IP_NONLOCALOK = 24 ++IP_FW_TABLE_ADD = 40 ++IP_FW_TABLE_DEL = 41 ++IP_FW_TABLE_FLUSH = 42 ++IP_FW_TABLE_GETSIZE = 43 ++IP_FW_TABLE_LIST = 44 ++IP_FW_ADD = 50 ++IP_FW_DEL = 51 ++IP_FW_FLUSH = 52 ++IP_FW_ZERO = 53 ++IP_FW_GET = 54 ++IP_FW_RESETLOG = 55 ++IP_FW_NAT_CFG = 56 ++IP_FW_NAT_DEL = 57 ++IP_FW_NAT_GET_CONFIG = 58 ++IP_FW_NAT_GET_LOG = 59 ++IP_DUMMYNET_CONFIGURE = 60 ++IP_DUMMYNET_DEL = 61 ++IP_DUMMYNET_FLUSH = 62 ++IP_DUMMYNET_GET = 64 ++IP_RECVTTL = 65 ++IP_MINTTL = 66 ++IP_DONTFRAG = 67 ++IP_ADD_SOURCE_MEMBERSHIP = 70 ++IP_DROP_SOURCE_MEMBERSHIP = 71 ++IP_BLOCK_SOURCE = 72 ++IP_UNBLOCK_SOURCE = 73 ++IP_MSFILTER = 74 ++MCAST_JOIN_GROUP = 80 ++MCAST_LEAVE_GROUP = 81 ++MCAST_JOIN_SOURCE_GROUP = 82 ++MCAST_LEAVE_SOURCE_GROUP = 83 ++MCAST_BLOCK_SOURCE = 84 ++MCAST_UNBLOCK_SOURCE = 85 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MIN_MEMBERSHIPS = 31 ++IP_MAX_MEMBERSHIPS = 4095 ++IP_MAX_SOURCE_FILTER = 1024 ++MCAST_UNDEFINED = 0 ++MCAST_INCLUDE = 1 ++MCAST_EXCLUDE = 2 ++IP_PORTRANGE_DEFAULT = 0 ++IP_PORTRANGE_HIGH = 1 ++IP_PORTRANGE_LOW = 2 ++IPCTL_FORWARDING = 1 ++IPCTL_SENDREDIRECTS = 2 ++IPCTL_DEFTTL = 3 ++IPCTL_DEFMTU = 4 ++IPCTL_RTEXPIRE = 5 ++IPCTL_RTMINEXPIRE = 6 ++IPCTL_RTMAXCACHE = 7 ++IPCTL_SOURCEROUTE = 8 ++IPCTL_DIRECTEDBROADCAST = 9 ++IPCTL_INTRQMAXLEN = 10 ++IPCTL_INTRQDROPS = 11 ++IPCTL_STATS = 12 ++IPCTL_ACCEPTSOURCEROUTE = 13 ++IPCTL_FASTFORWARDING = 14 ++IPCTL_KEEPFAITH = 15 ++IPCTL_GIF_TTL = 16 ++IPCTL_MAXID = 17 ++IPV6_SOCKOPT_RESERVED1 = 3 ++IPV6_UNICAST_HOPS = 4 ++IPV6_MULTICAST_IF = 9 ++IPV6_MULTICAST_HOPS = 10 ++IPV6_MULTICAST_LOOP = 11 ++IPV6_JOIN_GROUP = 12 ++IPV6_LEAVE_GROUP = 13 ++IPV6_PORTRANGE = 14 ++ICMP6_FILTER = 18 ++IPV6_CHECKSUM = 26 ++IPV6_V6ONLY = 27 ++IPV6_IPSEC_POLICY = 28 ++IPV6_FAITH = 29 ++IPV6_FW_ADD = 30 ++IPV6_FW_DEL = 31 ++IPV6_FW_FLUSH = 32 ++IPV6_FW_ZERO = 33 ++IPV6_FW_GET = 34 ++IPV6_RTHDRDSTOPTS = 35 ++IPV6_RECVPKTINFO = 36 ++IPV6_RECVHOPLIMIT = 37 ++IPV6_RECVRTHDR = 38 ++IPV6_RECVHOPOPTS = 39 ++IPV6_RECVDSTOPTS = 40 ++IPV6_USE_MIN_MTU = 42 ++IPV6_RECVPATHMTU = 43 ++IPV6_PATHMTU = 44 ++IPV6_PKTINFO = 46 ++IPV6_HOPLIMIT = 47 ++IPV6_NEXTHOP = 48 ++IPV6_HOPOPTS = 49 ++IPV6_DSTOPTS = 50 ++IPV6_RTHDR = 51 ++IPV6_RECVTCLASS = 57 ++IPV6_AUTOFLOWLABEL = 59 ++IPV6_TCLASS = 61 ++IPV6_DONTFRAG = 62 ++IPV6_PREFER_TEMPADDR = 63 ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_DEFAULT_MULTICAST_HOPS = 1 ++IPV6_DEFAULT_MULTICAST_LOOP = 1 ++IPV6_PORTRANGE_DEFAULT = 0 ++IPV6_PORTRANGE_HIGH = 1 ++IPV6_PORTRANGE_LOW = 2 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++IPV6CTL_FORWARDING = 1 ++IPV6CTL_SENDREDIRECTS = 2 ++IPV6CTL_DEFHLIM = 3 ++IPV6CTL_FORWSRCRT = 5 ++IPV6CTL_STATS = 6 ++IPV6CTL_MRTSTATS = 7 ++IPV6CTL_MRTPROTO = 8 ++IPV6CTL_MAXFRAGPACKETS = 9 ++IPV6CTL_SOURCECHECK = 10 ++IPV6CTL_SOURCECHECK_LOGINT = 11 ++IPV6CTL_ACCEPT_RTADV = 12 ++IPV6CTL_KEEPFAITH = 13 ++IPV6CTL_LOG_INTERVAL = 14 ++IPV6CTL_HDRNESTLIMIT = 15 ++IPV6CTL_DAD_COUNT = 16 ++IPV6CTL_AUTO_FLOWLABEL = 17 ++IPV6CTL_DEFMCASTHLIM = 18 ++IPV6CTL_GIF_HLIM = 19 ++IPV6CTL_KAME_VERSION = 20 ++IPV6CTL_USE_DEPRECATED = 21 ++IPV6CTL_RR_PRUNE = 22 ++IPV6CTL_V6ONLY = 24 ++IPV6CTL_RTEXPIRE = 25 ++IPV6CTL_RTMINEXPIRE = 26 ++IPV6CTL_RTMAXCACHE = 27 ++IPV6CTL_USETEMPADDR = 32 ++IPV6CTL_TEMPPLTIME = 33 ++IPV6CTL_TEMPVLTIME = 34 ++IPV6CTL_AUTO_LINKLOCAL = 35 ++IPV6CTL_RIP6STATS = 36 ++IPV6CTL_PREFER_TEMPADDR = 37 ++IPV6CTL_ADDRCTLPOLICY = 38 ++IPV6CTL_USE_DEFAULTZONE = 39 ++IPV6CTL_MAXFRAGS = 41 ++IPV6CTL_MCAST_PMTU = 44 ++IPV6CTL_STEALTH = 45 ++ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 ++IPV6CTL_MAXID = 48 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return \ ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd8/TYPES.py b/lib-python/2.7/plat-gnukfreebsd8/TYPES.py +new file mode 100644 +index 0000000..4132c8f +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd8/TYPES.py +@@ -0,0 +1,303 @@ ++# Generated by h2py from /usr/include/sys/types.h ++_SYS_TYPES_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++ ++# Included from time.h ++_TIME_H = 1 ++ ++# Included from bits/time.h ++_BITS_TIME_H = 1 ++CLOCKS_PER_SEC = 1000000l ++CLK_TCK = 128 ++CLOCK_REALTIME = 0 ++CLOCK_PROCESS_CPUTIME_ID = 2 ++CLOCK_THREAD_CPUTIME_ID = 3 ++CLOCK_MONOTONIC = 4 ++CLOCK_VIRTUAL = 1 ++CLOCK_PROF = 2 ++CLOCK_UPTIME = 5 ++CLOCK_UPTIME_PRECISE = 7 ++CLOCK_UPTIME_FAST = 8 ++CLOCK_REALTIME_PRECISE = 9 ++CLOCK_REALTIME_FAST = 10 ++CLOCK_MONOTONIC_PRECISE = 11 ++CLOCK_MONOTONIC_FAST = 12 ++CLOCK_SECOND = 13 ++TIMER_RELTIME = 0 ++TIMER_ABSTIME = 1 ++_STRUCT_TIMEVAL = 1 ++CLK_TCK = CLOCKS_PER_SEC ++__clock_t_defined = 1 ++__time_t_defined = 1 ++__clockid_t_defined = 1 ++__timer_t_defined = 1 ++__timespec_defined = 1 ++ ++# Included from xlocale.h ++_XLOCALE_H = 1 ++def __isleap(year): return \ ++ ++__BIT_TYPES_DEFINED__ = 1 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++ ++# Included from sys/select.h ++_SYS_SELECT_H = 1 ++ ++# Included from bits/select.h ++def __FD_ZERO(fdsp): return \ ++ ++def __FD_ZERO(set): return \ ++ ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++def __FDELT(d): return ((d) / __NFDBITS) ++ ++FD_SETSIZE = __FD_SETSIZE ++def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) ++ ++ ++# Included from sys/sysmacros.h ++_SYS_SYSMACROS_H = 1 ++def minor(dev): return ((int)((dev) & (-65281))) ++ ++def gnu_dev_major(dev): return major (dev) ++ ++def gnu_dev_minor(dev): return minor (dev) ++ ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 2 ++SCHED_FIFO = 1 ++SCHED_RR = 3 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++CLONE_SYSVSEM = 0x00040000 ++__defined_schedparam = 1 ++__CPU_SETSIZE = 128 ++def __CPUELT(cpu): return ((cpu) / __NCPUBITS) ++ ++def __CPU_ALLOC_SIZE(count): return \ ++ ++def __CPU_ALLOC(count): return __sched_cpualloc (count) ++ ++def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd9/DLFCN.py b/lib-python/2.7/plat-gnukfreebsd9/DLFCN.py +new file mode 100644 +index 0000000..d020fe1 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd9/DLFCN.py +@@ -0,0 +1,118 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00004 ++RTLD_DEEPBIND = 0x00008 ++RTLD_GLOBAL = 0x00100 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 ++LM_ID_BASE = 0 ++LM_ID_NEWLM = -1 +diff --git a/lib-python/2.7/plat-gnukfreebsd9/IN.py b/lib-python/2.7/plat-gnukfreebsd9/IN.py +new file mode 100644 +index 0000000..7e5f845 +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd9/IN.py +@@ -0,0 +1,809 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MAX = (2147483647) ++__WCHAR_MIN = (-__WCHAR_MAX - 1) ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ++ ++def UINT16_C(c): return c ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from sys/socket.h ++_SYS_SOCKET_H = 1 ++ ++# Included from sys/uio.h ++_SYS_UIO_H = 1 ++from TYPES import * ++ ++# Included from bits/uio.h ++_BITS_UIO_H = 1 ++from TYPES import * ++UIO_MAXIOV = 1024 ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++ ++# Included from bits/socket.h ++__BITS_SOCKET_H = 1 ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 25 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_HOST_NAME_MAX = 255 ++_POSIX_LINK_MAX = 8 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NAME_MAX = 14 ++_POSIX_NGROUPS_MAX = 8 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 20 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RE_DUP_MAX = 255 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_SYMLINK_MAX = 255 ++_POSIX_SYMLOOP_MAX = 8 ++_POSIX_TIMER_MAX = 32 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from sys/syslimits.h ++ARG_MAX = 262144 ++CHILD_MAX = 40 ++LINK_MAX = 32767 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++NGROUPS_MAX = 1023 ++OPEN_MAX = 64 ++PATH_MAX = 1024 ++PIPE_BUF = 512 ++IOV_MAX = 1024 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++DELAYTIMER_MAX = 2147483647 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = 8 ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 1024 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 64 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_IMPLINK = 3 ++PF_PUP = 4 ++PF_CHAOS = 5 ++PF_NS = 6 ++PF_ISO = 7 ++PF_OSI = PF_ISO ++PF_ECMA = 8 ++PF_DATAKIT = 9 ++PF_CCITT = 10 ++PF_SNA = 11 ++PF_DECnet = 12 ++PF_DLI = 13 ++PF_LAT = 14 ++PF_HYLINK = 15 ++PF_APPLETALK = 16 ++PF_ROUTE = 17 ++PF_LINK = 18 ++PF_XTP = 19 ++PF_COIP = 20 ++PF_CNT = 21 ++PF_RTIP = 22 ++PF_IPX = 23 ++PF_SIP = 24 ++PF_PIP = 25 ++PF_ISDN = 26 ++PF_KEY = 27 ++PF_INET6 = 28 ++PF_NATM = 29 ++PF_ATM = 30 ++PF_HDRCMPLT = 31 ++PF_NETGRAPH = 32 ++PF_MAX = 33 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_IMPLINK = PF_IMPLINK ++AF_PUP = PF_PUP ++AF_CHAOS = PF_CHAOS ++AF_NS = PF_NS ++AF_ISO = PF_ISO ++AF_OSI = PF_OSI ++AF_ECMA = PF_ECMA ++AF_DATAKIT = PF_DATAKIT ++AF_CCITT = PF_CCITT ++AF_SNA = PF_SNA ++AF_DECnet = PF_DECnet ++AF_DLI = PF_DLI ++AF_LAT = PF_LAT ++AF_HYLINK = PF_HYLINK ++AF_APPLETALK = PF_APPLETALK ++AF_ROUTE = PF_ROUTE ++AF_LINK = PF_LINK ++pseudo_AF_XTP = PF_XTP ++AF_COIP = PF_COIP ++AF_CNT = PF_CNT ++pseudo_AF_RTIP = PF_RTIP ++AF_IPX = PF_IPX ++AF_SIP = PF_SIP ++pseudo_AF_PIP = PF_PIP ++AF_ISDN = PF_ISDN ++AF_E164 = AF_ISDN ++pseudo_AF_KEY = PF_KEY ++AF_INET6 = PF_INET6 ++AF_NATM = PF_NATM ++AF_ATM = PF_ATM ++pseudo_AF_HDRCMPLT = PF_HDRCMPLT ++AF_NETGRAPH = PF_NETGRAPH ++AF_MAX = PF_MAX ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_HAVE_SA_LEN = 1 ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++CMGROUP_MAX = 16 ++SOL_SOCKET = 0xffff ++LOCAL_PEERCRED = 0x001 ++LOCAL_CREDS = 0x002 ++LOCAL_CONNWAIT = 0x004 ++ ++# Included from bits/socket2.h ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/in.h ++IMPLINK_IP = 155 ++IMPLINK_LOWEXPER = 156 ++IMPLINK_HIGHEXPER = 158 ++IPPROTO_DIVERT = 258 ++SOL_IP = 0 ++IP_OPTIONS = 1 ++IP_HDRINCL = 2 ++IP_TOS = 3 ++IP_TTL = 4 ++IP_RECVOPTS = 5 ++IP_RECVRETOPTS = 6 ++IP_RECVDSTADDR = 7 ++IP_SENDSRCADDR = IP_RECVDSTADDR ++IP_RETOPTS = 8 ++IP_MULTICAST_IF = 9 ++IP_MULTICAST_TTL = 10 ++IP_MULTICAST_LOOP = 11 ++IP_ADD_MEMBERSHIP = 12 ++IP_DROP_MEMBERSHIP = 13 ++IP_MULTICAST_VIF = 14 ++IP_RSVP_ON = 15 ++IP_RSVP_OFF = 16 ++IP_RSVP_VIF_ON = 17 ++IP_RSVP_VIF_OFF = 18 ++IP_PORTRANGE = 19 ++IP_RECVIF = 20 ++IP_IPSEC_POLICY = 21 ++IP_FAITH = 22 ++IP_ONESBCAST = 23 ++IP_NONLOCALOK = 24 ++IP_FW_TABLE_ADD = 40 ++IP_FW_TABLE_DEL = 41 ++IP_FW_TABLE_FLUSH = 42 ++IP_FW_TABLE_GETSIZE = 43 ++IP_FW_TABLE_LIST = 44 ++IP_FW_ADD = 50 ++IP_FW_DEL = 51 ++IP_FW_FLUSH = 52 ++IP_FW_ZERO = 53 ++IP_FW_GET = 54 ++IP_FW_RESETLOG = 55 ++IP_FW_NAT_CFG = 56 ++IP_FW_NAT_DEL = 57 ++IP_FW_NAT_GET_CONFIG = 58 ++IP_FW_NAT_GET_LOG = 59 ++IP_DUMMYNET_CONFIGURE = 60 ++IP_DUMMYNET_DEL = 61 ++IP_DUMMYNET_FLUSH = 62 ++IP_DUMMYNET_GET = 64 ++IP_RECVTTL = 65 ++IP_MINTTL = 66 ++IP_DONTFRAG = 67 ++IP_ADD_SOURCE_MEMBERSHIP = 70 ++IP_DROP_SOURCE_MEMBERSHIP = 71 ++IP_BLOCK_SOURCE = 72 ++IP_UNBLOCK_SOURCE = 73 ++IP_MSFILTER = 74 ++MCAST_JOIN_GROUP = 80 ++MCAST_LEAVE_GROUP = 81 ++MCAST_JOIN_SOURCE_GROUP = 82 ++MCAST_LEAVE_SOURCE_GROUP = 83 ++MCAST_BLOCK_SOURCE = 84 ++MCAST_UNBLOCK_SOURCE = 85 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MIN_MEMBERSHIPS = 31 ++IP_MAX_MEMBERSHIPS = 4095 ++IP_MAX_SOURCE_FILTER = 1024 ++MCAST_UNDEFINED = 0 ++MCAST_INCLUDE = 1 ++MCAST_EXCLUDE = 2 ++IP_PORTRANGE_DEFAULT = 0 ++IP_PORTRANGE_HIGH = 1 ++IP_PORTRANGE_LOW = 2 ++IPCTL_FORWARDING = 1 ++IPCTL_SENDREDIRECTS = 2 ++IPCTL_DEFTTL = 3 ++IPCTL_DEFMTU = 4 ++IPCTL_RTEXPIRE = 5 ++IPCTL_RTMINEXPIRE = 6 ++IPCTL_RTMAXCACHE = 7 ++IPCTL_SOURCEROUTE = 8 ++IPCTL_DIRECTEDBROADCAST = 9 ++IPCTL_INTRQMAXLEN = 10 ++IPCTL_INTRQDROPS = 11 ++IPCTL_STATS = 12 ++IPCTL_ACCEPTSOURCEROUTE = 13 ++IPCTL_FASTFORWARDING = 14 ++IPCTL_KEEPFAITH = 15 ++IPCTL_GIF_TTL = 16 ++IPCTL_MAXID = 17 ++IPV6_SOCKOPT_RESERVED1 = 3 ++IPV6_UNICAST_HOPS = 4 ++IPV6_MULTICAST_IF = 9 ++IPV6_MULTICAST_HOPS = 10 ++IPV6_MULTICAST_LOOP = 11 ++IPV6_JOIN_GROUP = 12 ++IPV6_LEAVE_GROUP = 13 ++IPV6_PORTRANGE = 14 ++ICMP6_FILTER = 18 ++IPV6_CHECKSUM = 26 ++IPV6_V6ONLY = 27 ++IPV6_IPSEC_POLICY = 28 ++IPV6_FAITH = 29 ++IPV6_FW_ADD = 30 ++IPV6_FW_DEL = 31 ++IPV6_FW_FLUSH = 32 ++IPV6_FW_ZERO = 33 ++IPV6_FW_GET = 34 ++IPV6_RTHDRDSTOPTS = 35 ++IPV6_RECVPKTINFO = 36 ++IPV6_RECVHOPLIMIT = 37 ++IPV6_RECVRTHDR = 38 ++IPV6_RECVHOPOPTS = 39 ++IPV6_RECVDSTOPTS = 40 ++IPV6_USE_MIN_MTU = 42 ++IPV6_RECVPATHMTU = 43 ++IPV6_PATHMTU = 44 ++IPV6_PKTINFO = 46 ++IPV6_HOPLIMIT = 47 ++IPV6_NEXTHOP = 48 ++IPV6_HOPOPTS = 49 ++IPV6_DSTOPTS = 50 ++IPV6_RTHDR = 51 ++IPV6_RECVTCLASS = 57 ++IPV6_AUTOFLOWLABEL = 59 ++IPV6_TCLASS = 61 ++IPV6_DONTFRAG = 62 ++IPV6_PREFER_TEMPADDR = 63 ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_DEFAULT_MULTICAST_HOPS = 1 ++IPV6_DEFAULT_MULTICAST_LOOP = 1 ++IPV6_PORTRANGE_DEFAULT = 0 ++IPV6_PORTRANGE_HIGH = 1 ++IPV6_PORTRANGE_LOW = 2 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++IPV6CTL_FORWARDING = 1 ++IPV6CTL_SENDREDIRECTS = 2 ++IPV6CTL_DEFHLIM = 3 ++IPV6CTL_FORWSRCRT = 5 ++IPV6CTL_STATS = 6 ++IPV6CTL_MRTSTATS = 7 ++IPV6CTL_MRTPROTO = 8 ++IPV6CTL_MAXFRAGPACKETS = 9 ++IPV6CTL_SOURCECHECK = 10 ++IPV6CTL_SOURCECHECK_LOGINT = 11 ++IPV6CTL_ACCEPT_RTADV = 12 ++IPV6CTL_KEEPFAITH = 13 ++IPV6CTL_LOG_INTERVAL = 14 ++IPV6CTL_HDRNESTLIMIT = 15 ++IPV6CTL_DAD_COUNT = 16 ++IPV6CTL_AUTO_FLOWLABEL = 17 ++IPV6CTL_DEFMCASTHLIM = 18 ++IPV6CTL_GIF_HLIM = 19 ++IPV6CTL_KAME_VERSION = 20 ++IPV6CTL_USE_DEPRECATED = 21 ++IPV6CTL_RR_PRUNE = 22 ++IPV6CTL_V6ONLY = 24 ++IPV6CTL_RTEXPIRE = 25 ++IPV6CTL_RTMINEXPIRE = 26 ++IPV6CTL_RTMAXCACHE = 27 ++IPV6CTL_USETEMPADDR = 32 ++IPV6CTL_TEMPPLTIME = 33 ++IPV6CTL_TEMPVLTIME = 34 ++IPV6CTL_AUTO_LINKLOCAL = 35 ++IPV6CTL_RIP6STATS = 36 ++IPV6CTL_PREFER_TEMPADDR = 37 ++IPV6CTL_ADDRCTLPOLICY = 38 ++IPV6CTL_USE_DEFAULTZONE = 39 ++IPV6CTL_MAXFRAGS = 41 ++IPV6CTL_MCAST_PMTU = 44 ++IPV6CTL_STEALTH = 45 ++ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47 ++IPV6CTL_MAXID = 48 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return \ ++ +diff --git a/lib-python/2.7/plat-gnukfreebsd9/TYPES.py b/lib-python/2.7/plat-gnukfreebsd9/TYPES.py +new file mode 100644 +index 0000000..4132c8f +--- /dev/null ++++ b/lib-python/2.7/plat-gnukfreebsd9/TYPES.py +@@ -0,0 +1,303 @@ ++# Generated by h2py from /usr/include/sys/types.h ++_SYS_TYPES_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 200809L ++_XOPEN_SOURCE = 700 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_ATFILE_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++__USE_ISOC95 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++_POSIX_C_SOURCE = 200112L ++_POSIX_C_SOURCE = 200809L ++__USE_POSIX_IMPLICITLY = 1 ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN2K8 = 1 ++_ATFILE_SOURCE = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K8 = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_ATFILE = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__USE_FORTIFY_LEVEL = 2 ++__USE_FORTIFY_LEVEL = 1 ++__USE_FORTIFY_LEVEL = 0 ++ ++# Included from bits/predefs.h ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 11 ++__GLIBC_HAVE_LONG_LONG = 1 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __NTH(fct): return fct ++ ++def __NTH(fct): return fct ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++def __bos(ptr): return __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) ++ ++def __bos0(ptr): return __builtin_object_size (ptr, 0) ++ ++def __warnattr(msg): return __attribute__((__warning__ (msg))) ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++__LDBL_COMPAT = 1 ++def __LDBL_REDIR_DECL(name): return \ ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++__USE_EXTERN_INLINES_IN_LIBC = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__S32_TYPE = int ++__SWORD_TYPE = int ++__SLONG32_TYPE = int ++ ++# Included from bits/typesizes.h ++_BITS_TYPESIZES_H = 1 ++__PID_T_TYPE = __S32_TYPE ++__CLOCK_T_TYPE = __S32_TYPE ++__SWBLK_T_TYPE = __S32_TYPE ++__CLOCKID_T_TYPE = __S32_TYPE ++__TIMER_T_TYPE = __S32_TYPE ++__SSIZE_T_TYPE = __SWORD_TYPE ++__FD_SETSIZE = 1024 ++ ++# Included from time.h ++_TIME_H = 1 ++ ++# Included from bits/time.h ++_BITS_TIME_H = 1 ++CLOCKS_PER_SEC = 1000000l ++CLK_TCK = 128 ++CLOCK_REALTIME = 0 ++CLOCK_PROCESS_CPUTIME_ID = 2 ++CLOCK_THREAD_CPUTIME_ID = 3 ++CLOCK_MONOTONIC = 4 ++CLOCK_VIRTUAL = 1 ++CLOCK_PROF = 2 ++CLOCK_UPTIME = 5 ++CLOCK_UPTIME_PRECISE = 7 ++CLOCK_UPTIME_FAST = 8 ++CLOCK_REALTIME_PRECISE = 9 ++CLOCK_REALTIME_FAST = 10 ++CLOCK_MONOTONIC_PRECISE = 11 ++CLOCK_MONOTONIC_FAST = 12 ++CLOCK_SECOND = 13 ++TIMER_RELTIME = 0 ++TIMER_ABSTIME = 1 ++_STRUCT_TIMEVAL = 1 ++CLK_TCK = CLOCKS_PER_SEC ++__clock_t_defined = 1 ++__time_t_defined = 1 ++__clockid_t_defined = 1 ++__timer_t_defined = 1 ++__timespec_defined = 1 ++ ++# Included from xlocale.h ++_XLOCALE_H = 1 ++def __isleap(year): return \ ++ ++__BIT_TYPES_DEFINED__ = 1 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def htobe16(x): return __bswap_16 (x) ++ ++def htole16(x): return (x) ++ ++def be16toh(x): return __bswap_16 (x) ++ ++def le16toh(x): return (x) ++ ++def htobe32(x): return __bswap_32 (x) ++ ++def htole32(x): return (x) ++ ++def be32toh(x): return __bswap_32 (x) ++ ++def le32toh(x): return (x) ++ ++def htobe64(x): return __bswap_64 (x) ++ ++def htole64(x): return (x) ++ ++def be64toh(x): return __bswap_64 (x) ++ ++def le64toh(x): return (x) ++ ++def htobe16(x): return (x) ++ ++def htole16(x): return __bswap_16 (x) ++ ++def be16toh(x): return (x) ++ ++def le16toh(x): return __bswap_16 (x) ++ ++def htobe32(x): return (x) ++ ++def htole32(x): return __bswap_32 (x) ++ ++def be32toh(x): return (x) ++ ++def le32toh(x): return __bswap_32 (x) ++ ++def htobe64(x): return (x) ++ ++def htole64(x): return __bswap_64 (x) ++ ++def be64toh(x): return (x) ++ ++def le64toh(x): return __bswap_64 (x) ++ ++ ++# Included from sys/select.h ++_SYS_SELECT_H = 1 ++ ++# Included from bits/select.h ++def __FD_ZERO(fdsp): return \ ++ ++def __FD_ZERO(set): return \ ++ ++ ++# Included from bits/sigset.h ++_SIGSET_H_types = 1 ++_SIGSET_H_fns = 1 ++def __sigword(sig): return (((sig) - 1) >> 5) ++ ++def __sigemptyset(set): return \ ++ ++def __sigfillset(set): return \ ++ ++def __sigisemptyset(set): return \ ++ ++def __FDELT(d): return ((d) / __NFDBITS) ++ ++FD_SETSIZE = __FD_SETSIZE ++def FD_ZERO(fdsetp): return __FD_ZERO (fdsetp) ++ ++ ++# Included from sys/sysmacros.h ++_SYS_SYSMACROS_H = 1 ++def minor(dev): return ((int)((dev) & (-65281))) ++ ++def gnu_dev_major(dev): return major (dev) ++ ++def gnu_dev_minor(dev): return minor (dev) ++ ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 2 ++SCHED_FIFO = 1 ++SCHED_RR = 3 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++CLONE_SYSVSEM = 0x00040000 ++__defined_schedparam = 1 ++__CPU_SETSIZE = 128 ++def __CPUELT(cpu): return ((cpu) / __NCPUBITS) ++ ++def __CPU_ALLOC_SIZE(count): return \ ++ ++def __CPU_ALLOC(count): return __sched_cpualloc (count) ++ ++def __CPU_FREE(cpuset): return __sched_cpufree (cpuset) ++ diff --git a/debian/patches/plat-linux2-differences b/debian/patches/plat-linux2-differences new file mode 100644 index 0000000..b95f7b1 --- /dev/null +++ b/debian/patches/plat-linux2-differences @@ -0,0 +1,4044 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: plat-linux2's constants vary + +Break the affected files up, and import based on platform.machine() + +Bug-cpython: http://bugs.python.org/issue3990 +Origin: Debian cpython packaging +Author: Thiemo Seufer <ths@networkno.de> +Author: Matthias Klose <doko@debian.org> +Author: Stefano Rivera <stefanor@debian.org> +Last-Update: 2014-09-22 +--- + lib-python/2.7/plat-linux2/DLFCN.py | 88 +--- + lib-python/2.7/plat-linux2/DLFCN_default.py | 83 ++++ + lib-python/2.7/plat-linux2/DLFCN_mips.py | 83 ++++ + lib-python/2.7/plat-linux2/IN.py | 630 +--------------------------- + lib-python/2.7/plat-linux2/IN_alpha.py | 615 +++++++++++++++++++++++++++ + lib-python/2.7/plat-linux2/IN_default.py | 615 +++++++++++++++++++++++++++ + lib-python/2.7/plat-linux2/IN_hppa.py | 615 +++++++++++++++++++++++++++ + lib-python/2.7/plat-linux2/IN_mips.py | 615 +++++++++++++++++++++++++++ + lib-python/2.7/plat-linux2/IN_sparc.py | 615 +++++++++++++++++++++++++++ + 9 files changed, 3263 insertions(+), 696 deletions(-) + create mode 100644 lib-python/2.7/plat-linux2/DLFCN_default.py + create mode 100644 lib-python/2.7/plat-linux2/DLFCN_mips.py + create mode 100644 lib-python/2.7/plat-linux2/IN_alpha.py + create mode 100644 lib-python/2.7/plat-linux2/IN_default.py + create mode 100644 lib-python/2.7/plat-linux2/IN_hppa.py + create mode 100644 lib-python/2.7/plat-linux2/IN_mips.py + create mode 100644 lib-python/2.7/plat-linux2/IN_sparc.py + +diff --git a/lib-python/2.7/plat-linux2/DLFCN.py b/lib-python/2.7/plat-linux2/DLFCN.py +index e23340a..8d8204f 100644 +--- a/lib-python/2.7/plat-linux2/DLFCN.py ++++ b/lib-python/2.7/plat-linux2/DLFCN.py +@@ -1,83 +1,9 @@ +-# Generated by h2py from /usr/include/dlfcn.h +-_DLFCN_H = 1 ++import platform + +-# Included from features.h +-_FEATURES_H = 1 +-__USE_ANSI = 1 +-__FAVOR_BSD = 1 +-_ISOC99_SOURCE = 1 +-_POSIX_SOURCE = 1 +-_POSIX_C_SOURCE = 199506L +-_XOPEN_SOURCE = 600 +-_XOPEN_SOURCE_EXTENDED = 1 +-_LARGEFILE64_SOURCE = 1 +-_BSD_SOURCE = 1 +-_SVID_SOURCE = 1 +-_BSD_SOURCE = 1 +-_SVID_SOURCE = 1 +-__USE_ISOC99 = 1 +-_POSIX_SOURCE = 1 +-_POSIX_C_SOURCE = 2 +-_POSIX_C_SOURCE = 199506L +-__USE_POSIX = 1 +-__USE_POSIX2 = 1 +-__USE_POSIX199309 = 1 +-__USE_POSIX199506 = 1 +-__USE_XOPEN = 1 +-__USE_XOPEN_EXTENDED = 1 +-__USE_UNIX98 = 1 +-_LARGEFILE_SOURCE = 1 +-__USE_XOPEN2K = 1 +-__USE_ISOC99 = 1 +-__USE_XOPEN_EXTENDED = 1 +-__USE_LARGEFILE = 1 +-__USE_LARGEFILE64 = 1 +-__USE_FILE_OFFSET64 = 1 +-__USE_MISC = 1 +-__USE_BSD = 1 +-__USE_SVID = 1 +-__USE_GNU = 1 +-__USE_REENTRANT = 1 +-__STDC_IEC_559__ = 1 +-__STDC_IEC_559_COMPLEX__ = 1 +-__STDC_ISO_10646__ = 200009L +-__GNU_LIBRARY__ = 6 +-__GLIBC__ = 2 +-__GLIBC_MINOR__ = 2 ++architecture = platform.machine() ++if architecture.startswith('mips'): ++ from DLFCN_mips import * ++else: ++ from DLFCN_default import * + +-# Included from sys/cdefs.h +-_SYS_CDEFS_H = 1 +-def __PMT(args): return args +- +-def __P(args): return args +- +-def __PMT(args): return args +- +-def __STRING(x): return #x +- +-__flexarr = [] +-__flexarr = [0] +-__flexarr = [] +-__flexarr = [1] +-def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +- +-def __attribute__(xyz): return +- +-def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) +- +-def __attribute_format_arg__(x): return +- +-__USE_LARGEFILE = 1 +-__USE_LARGEFILE64 = 1 +-__USE_EXTERN_INLINES = 1 +- +-# Included from gnu/stubs.h +- +-# Included from bits/dlfcn.h +-RTLD_LAZY = 0x00001 +-RTLD_NOW = 0x00002 +-RTLD_BINDING_MASK = 0x3 +-RTLD_NOLOAD = 0x00004 +-RTLD_GLOBAL = 0x00100 +-RTLD_LOCAL = 0 +-RTLD_NODELETE = 0x01000 ++del platform, architecture +diff --git a/lib-python/2.7/plat-linux2/DLFCN_default.py b/lib-python/2.7/plat-linux2/DLFCN_default.py +new file mode 100644 +index 0000000..e23340a +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/DLFCN_default.py +@@ -0,0 +1,83 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00004 ++RTLD_GLOBAL = 0x00100 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 +diff --git a/lib-python/2.7/plat-linux2/DLFCN_mips.py b/lib-python/2.7/plat-linux2/DLFCN_mips.py +new file mode 100644 +index 0000000..9fbb22b +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/DLFCN_mips.py +@@ -0,0 +1,83 @@ ++# Generated by h2py from /usr/include/dlfcn.h ++_DLFCN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from bits/dlfcn.h ++RTLD_LAZY = 0x00001 ++RTLD_NOW = 0x00002 ++RTLD_BINDING_MASK = 0x3 ++RTLD_NOLOAD = 0x00008 ++RTLD_GLOBAL = 0x00004 ++RTLD_LOCAL = 0 ++RTLD_NODELETE = 0x01000 +diff --git a/lib-python/2.7/plat-linux2/IN.py b/lib-python/2.7/plat-linux2/IN.py +index ad307f6..360db68 100644 +--- a/lib-python/2.7/plat-linux2/IN.py ++++ b/lib-python/2.7/plat-linux2/IN.py +@@ -1,615 +1,15 @@ +-# Generated by h2py from /usr/include/netinet/in.h +-_NETINET_IN_H = 1 +- +-# Included from features.h +-_FEATURES_H = 1 +-__USE_ANSI = 1 +-__FAVOR_BSD = 1 +-_ISOC99_SOURCE = 1 +-_POSIX_SOURCE = 1 +-_POSIX_C_SOURCE = 199506L +-_XOPEN_SOURCE = 600 +-_XOPEN_SOURCE_EXTENDED = 1 +-_LARGEFILE64_SOURCE = 1 +-_BSD_SOURCE = 1 +-_SVID_SOURCE = 1 +-_BSD_SOURCE = 1 +-_SVID_SOURCE = 1 +-__USE_ISOC99 = 1 +-_POSIX_SOURCE = 1 +-_POSIX_C_SOURCE = 2 +-_POSIX_C_SOURCE = 199506L +-__USE_POSIX = 1 +-__USE_POSIX2 = 1 +-__USE_POSIX199309 = 1 +-__USE_POSIX199506 = 1 +-__USE_XOPEN = 1 +-__USE_XOPEN_EXTENDED = 1 +-__USE_UNIX98 = 1 +-_LARGEFILE_SOURCE = 1 +-__USE_XOPEN2K = 1 +-__USE_ISOC99 = 1 +-__USE_XOPEN_EXTENDED = 1 +-__USE_LARGEFILE = 1 +-__USE_LARGEFILE64 = 1 +-__USE_FILE_OFFSET64 = 1 +-__USE_MISC = 1 +-__USE_BSD = 1 +-__USE_SVID = 1 +-__USE_GNU = 1 +-__USE_REENTRANT = 1 +-__STDC_IEC_559__ = 1 +-__STDC_IEC_559_COMPLEX__ = 1 +-__STDC_ISO_10646__ = 200009L +-__GNU_LIBRARY__ = 6 +-__GLIBC__ = 2 +-__GLIBC_MINOR__ = 2 +- +-# Included from sys/cdefs.h +-_SYS_CDEFS_H = 1 +-def __PMT(args): return args +- +-def __P(args): return args +- +-def __PMT(args): return args +- +-def __STRING(x): return #x +- +-__flexarr = [] +-__flexarr = [0] +-__flexarr = [] +-__flexarr = [1] +-def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +- +-def __attribute__(xyz): return +- +-def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) +- +-def __attribute_format_arg__(x): return +- +-__USE_LARGEFILE = 1 +-__USE_LARGEFILE64 = 1 +-__USE_EXTERN_INLINES = 1 +- +-# Included from gnu/stubs.h +- +-# Included from stdint.h +-_STDINT_H = 1 +- +-# Included from bits/wchar.h +-_BITS_WCHAR_H = 1 +-__WCHAR_MIN = (-2147483647l - 1l) +-__WCHAR_MAX = (2147483647l) +- +-# Included from bits/wordsize.h +-__WORDSIZE = 32 +-def __INT64_C(c): return c ## L +- +-def __UINT64_C(c): return c ## UL +- +-def __INT64_C(c): return c ## LL +- +-def __UINT64_C(c): return c ## ULL +- +-INT8_MIN = (-128) +-INT16_MIN = (-32767-1) +-INT32_MIN = (-2147483647-1) +-INT64_MIN = (-__INT64_C(9223372036854775807)-1) +-INT8_MAX = (127) +-INT16_MAX = (32767) +-INT32_MAX = (2147483647) +-INT64_MAX = (__INT64_C(9223372036854775807)) +-UINT8_MAX = (255) +-UINT16_MAX = (65535) +-UINT64_MAX = (__UINT64_C(18446744073709551615)) +-INT_LEAST8_MIN = (-128) +-INT_LEAST16_MIN = (-32767-1) +-INT_LEAST32_MIN = (-2147483647-1) +-INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) +-INT_LEAST8_MAX = (127) +-INT_LEAST16_MAX = (32767) +-INT_LEAST32_MAX = (2147483647) +-INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) +-UINT_LEAST8_MAX = (255) +-UINT_LEAST16_MAX = (65535) +-UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) +-INT_FAST8_MIN = (-128) +-INT_FAST16_MIN = (-9223372036854775807L-1) +-INT_FAST32_MIN = (-9223372036854775807L-1) +-INT_FAST16_MIN = (-2147483647-1) +-INT_FAST32_MIN = (-2147483647-1) +-INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) +-INT_FAST8_MAX = (127) +-INT_FAST16_MAX = (9223372036854775807L) +-INT_FAST32_MAX = (9223372036854775807L) +-INT_FAST16_MAX = (2147483647) +-INT_FAST32_MAX = (2147483647) +-INT_FAST64_MAX = (__INT64_C(9223372036854775807)) +-UINT_FAST8_MAX = (255) +-UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) +-INTPTR_MIN = (-9223372036854775807L-1) +-INTPTR_MAX = (9223372036854775807L) +-INTPTR_MIN = (-2147483647-1) +-INTPTR_MAX = (2147483647) +-INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) +-INTMAX_MAX = (__INT64_C(9223372036854775807)) +-UINTMAX_MAX = (__UINT64_C(18446744073709551615)) +-PTRDIFF_MIN = (-9223372036854775807L-1) +-PTRDIFF_MAX = (9223372036854775807L) +-PTRDIFF_MIN = (-2147483647-1) +-PTRDIFF_MAX = (2147483647) +-SIG_ATOMIC_MIN = (-2147483647-1) +-SIG_ATOMIC_MAX = (2147483647) +-WCHAR_MIN = __WCHAR_MIN +-WCHAR_MAX = __WCHAR_MAX +-def INT8_C(c): return c +- +-def INT16_C(c): return c +- +-def INT32_C(c): return c +- +-def INT64_C(c): return c ## L +- +-def INT64_C(c): return c ## LL +- +-def UINT8_C(c): return c ## U +- +-def UINT16_C(c): return c ## U +- +-def UINT32_C(c): return c ## U +- +-def UINT64_C(c): return c ## UL +- +-def UINT64_C(c): return c ## ULL +- +-def INTMAX_C(c): return c ## L +- +-def UINTMAX_C(c): return c ## UL +- +-def INTMAX_C(c): return c ## LL +- +-def UINTMAX_C(c): return c ## ULL +- +- +-# Included from bits/types.h +-_BITS_TYPES_H = 1 +-__FD_SETSIZE = 1024 +- +-# Included from bits/pthreadtypes.h +-_BITS_PTHREADTYPES_H = 1 +- +-# Included from bits/sched.h +-SCHED_OTHER = 0 +-SCHED_FIFO = 1 +-SCHED_RR = 2 +-CSIGNAL = 0x000000ff +-CLONE_VM = 0x00000100 +-CLONE_FS = 0x00000200 +-CLONE_FILES = 0x00000400 +-CLONE_SIGHAND = 0x00000800 +-CLONE_PID = 0x00001000 +-CLONE_PTRACE = 0x00002000 +-CLONE_VFORK = 0x00004000 +-__defined_schedparam = 1 +-def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) +- +-IN_CLASSA_NET = (-16777216) +-IN_CLASSA_NSHIFT = 24 +-IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) +-IN_CLASSA_MAX = 128 +-def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) +- +-IN_CLASSB_NET = (-65536) +-IN_CLASSB_NSHIFT = 16 +-IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) +-IN_CLASSB_MAX = 65536 +-def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) +- +-IN_CLASSC_NET = (-256) +-IN_CLASSC_NSHIFT = 8 +-IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) +-def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) +- +-def IN_MULTICAST(a): return IN_CLASSD(a) +- +-def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) +- +-def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) +- +-IN_LOOPBACKNET = 127 +-INET_ADDRSTRLEN = 16 +-INET6_ADDRSTRLEN = 46 +- +-# Included from bits/socket.h +- +-# Included from limits.h +-_LIBC_LIMITS_H_ = 1 +-MB_LEN_MAX = 16 +-_LIMITS_H = 1 +-CHAR_BIT = 8 +-SCHAR_MIN = (-128) +-SCHAR_MAX = 127 +-UCHAR_MAX = 255 +-CHAR_MIN = 0 +-CHAR_MAX = UCHAR_MAX +-CHAR_MIN = SCHAR_MIN +-CHAR_MAX = SCHAR_MAX +-SHRT_MIN = (-32768) +-SHRT_MAX = 32767 +-USHRT_MAX = 65535 +-INT_MAX = 2147483647 +-LONG_MAX = 9223372036854775807L +-LONG_MAX = 2147483647L +-LONG_MIN = (-LONG_MAX - 1L) +- +-# Included from bits/posix1_lim.h +-_BITS_POSIX1_LIM_H = 1 +-_POSIX_AIO_LISTIO_MAX = 2 +-_POSIX_AIO_MAX = 1 +-_POSIX_ARG_MAX = 4096 +-_POSIX_CHILD_MAX = 6 +-_POSIX_DELAYTIMER_MAX = 32 +-_POSIX_LINK_MAX = 8 +-_POSIX_MAX_CANON = 255 +-_POSIX_MAX_INPUT = 255 +-_POSIX_MQ_OPEN_MAX = 8 +-_POSIX_MQ_PRIO_MAX = 32 +-_POSIX_NGROUPS_MAX = 0 +-_POSIX_OPEN_MAX = 16 +-_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX +-_POSIX_NAME_MAX = 14 +-_POSIX_PATH_MAX = 256 +-_POSIX_PIPE_BUF = 512 +-_POSIX_RTSIG_MAX = 8 +-_POSIX_SEM_NSEMS_MAX = 256 +-_POSIX_SEM_VALUE_MAX = 32767 +-_POSIX_SIGQUEUE_MAX = 32 +-_POSIX_SSIZE_MAX = 32767 +-_POSIX_STREAM_MAX = 8 +-_POSIX_TZNAME_MAX = 6 +-_POSIX_QLIMIT = 1 +-_POSIX_HIWAT = _POSIX_PIPE_BUF +-_POSIX_UIO_MAXIOV = 16 +-_POSIX_TTY_NAME_MAX = 9 +-_POSIX_TIMER_MAX = 32 +-_POSIX_LOGIN_NAME_MAX = 9 +-_POSIX_CLOCKRES_MIN = 20000000 +- +-# Included from bits/local_lim.h +- +-# Included from linux/limits.h +-NR_OPEN = 1024 +-NGROUPS_MAX = 32 +-ARG_MAX = 131072 +-CHILD_MAX = 999 +-OPEN_MAX = 256 +-LINK_MAX = 127 +-MAX_CANON = 255 +-MAX_INPUT = 255 +-NAME_MAX = 255 +-PATH_MAX = 4096 +-PIPE_BUF = 4096 +-RTSIG_MAX = 32 +-_POSIX_THREAD_KEYS_MAX = 128 +-PTHREAD_KEYS_MAX = 1024 +-_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 +-PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS +-_POSIX_THREAD_THREADS_MAX = 64 +-PTHREAD_THREADS_MAX = 1024 +-AIO_PRIO_DELTA_MAX = 20 +-PTHREAD_STACK_MIN = 16384 +-TIMER_MAX = 256 +-SSIZE_MAX = LONG_MAX +-NGROUPS_MAX = _POSIX_NGROUPS_MAX +- +-# Included from bits/posix2_lim.h +-_BITS_POSIX2_LIM_H = 1 +-_POSIX2_BC_BASE_MAX = 99 +-_POSIX2_BC_DIM_MAX = 2048 +-_POSIX2_BC_SCALE_MAX = 99 +-_POSIX2_BC_STRING_MAX = 1000 +-_POSIX2_COLL_WEIGHTS_MAX = 2 +-_POSIX2_EXPR_NEST_MAX = 32 +-_POSIX2_LINE_MAX = 2048 +-_POSIX2_RE_DUP_MAX = 255 +-_POSIX2_CHARCLASS_NAME_MAX = 14 +-BC_BASE_MAX = _POSIX2_BC_BASE_MAX +-BC_DIM_MAX = _POSIX2_BC_DIM_MAX +-BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX +-BC_STRING_MAX = _POSIX2_BC_STRING_MAX +-COLL_WEIGHTS_MAX = 255 +-EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX +-LINE_MAX = _POSIX2_LINE_MAX +-CHARCLASS_NAME_MAX = 2048 +-RE_DUP_MAX = (0x7fff) +- +-# Included from bits/xopen_lim.h +-_XOPEN_LIM_H = 1 +- +-# Included from bits/stdio_lim.h +-L_tmpnam = 20 +-TMP_MAX = 238328 +-FILENAME_MAX = 4096 +-L_ctermid = 9 +-L_cuserid = 9 +-FOPEN_MAX = 16 +-IOV_MAX = 1024 +-_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV +-NL_ARGMAX = _POSIX_ARG_MAX +-NL_LANGMAX = _POSIX2_LINE_MAX +-NL_MSGMAX = INT_MAX +-NL_NMAX = INT_MAX +-NL_SETMAX = INT_MAX +-NL_TEXTMAX = INT_MAX +-NZERO = 20 +-WORD_BIT = 16 +-WORD_BIT = 32 +-WORD_BIT = 64 +-WORD_BIT = 16 +-WORD_BIT = 32 +-WORD_BIT = 64 +-WORD_BIT = 32 +-LONG_BIT = 32 +-LONG_BIT = 64 +-LONG_BIT = 32 +-LONG_BIT = 64 +-LONG_BIT = 64 +-LONG_BIT = 32 +-from TYPES import * +-PF_UNSPEC = 0 +-PF_LOCAL = 1 +-PF_UNIX = PF_LOCAL +-PF_FILE = PF_LOCAL +-PF_INET = 2 +-PF_AX25 = 3 +-PF_IPX = 4 +-PF_APPLETALK = 5 +-PF_NETROM = 6 +-PF_BRIDGE = 7 +-PF_ATMPVC = 8 +-PF_X25 = 9 +-PF_INET6 = 10 +-PF_ROSE = 11 +-PF_DECnet = 12 +-PF_NETBEUI = 13 +-PF_SECURITY = 14 +-PF_KEY = 15 +-PF_NETLINK = 16 +-PF_ROUTE = PF_NETLINK +-PF_PACKET = 17 +-PF_ASH = 18 +-PF_ECONET = 19 +-PF_ATMSVC = 20 +-PF_SNA = 22 +-PF_IRDA = 23 +-PF_PPPOX = 24 +-PF_WANPIPE = 25 +-PF_BLUETOOTH = 31 +-PF_MAX = 32 +-AF_UNSPEC = PF_UNSPEC +-AF_LOCAL = PF_LOCAL +-AF_UNIX = PF_UNIX +-AF_FILE = PF_FILE +-AF_INET = PF_INET +-AF_AX25 = PF_AX25 +-AF_IPX = PF_IPX +-AF_APPLETALK = PF_APPLETALK +-AF_NETROM = PF_NETROM +-AF_BRIDGE = PF_BRIDGE +-AF_ATMPVC = PF_ATMPVC +-AF_X25 = PF_X25 +-AF_INET6 = PF_INET6 +-AF_ROSE = PF_ROSE +-AF_DECnet = PF_DECnet +-AF_NETBEUI = PF_NETBEUI +-AF_SECURITY = PF_SECURITY +-AF_KEY = PF_KEY +-AF_NETLINK = PF_NETLINK +-AF_ROUTE = PF_ROUTE +-AF_PACKET = PF_PACKET +-AF_ASH = PF_ASH +-AF_ECONET = PF_ECONET +-AF_ATMSVC = PF_ATMSVC +-AF_SNA = PF_SNA +-AF_IRDA = PF_IRDA +-AF_PPPOX = PF_PPPOX +-AF_WANPIPE = PF_WANPIPE +-AF_BLUETOOTH = PF_BLUETOOTH +-AF_MAX = PF_MAX +-SOL_RAW = 255 +-SOL_DECNET = 261 +-SOL_X25 = 262 +-SOL_PACKET = 263 +-SOL_ATM = 264 +-SOL_AAL = 265 +-SOL_IRDA = 266 +-SOMAXCONN = 128 +- +-# Included from bits/sockaddr.h +-_BITS_SOCKADDR_H = 1 +-def __SOCKADDR_COMMON(sa_prefix): return \ +- +-_SS_SIZE = 128 +-def CMSG_FIRSTHDR(mhdr): return \ +- +- +-# Included from asm/socket.h +- +-# Included from asm/sockios.h +-FIOSETOWN = 0x8901 +-SIOCSPGRP = 0x8902 +-FIOGETOWN = 0x8903 +-SIOCGPGRP = 0x8904 +-SIOCATMARK = 0x8905 +-SIOCGSTAMP = 0x8906 +-SOL_SOCKET = 1 +-SO_DEBUG = 1 +-SO_REUSEADDR = 2 +-SO_TYPE = 3 +-SO_ERROR = 4 +-SO_DONTROUTE = 5 +-SO_BROADCAST = 6 +-SO_SNDBUF = 7 +-SO_RCVBUF = 8 +-SO_KEEPALIVE = 9 +-SO_OOBINLINE = 10 +-SO_NO_CHECK = 11 +-SO_PRIORITY = 12 +-SO_LINGER = 13 +-SO_BSDCOMPAT = 14 +-SO_PASSCRED = 16 +-SO_PEERCRED = 17 +-SO_RCVLOWAT = 18 +-SO_SNDLOWAT = 19 +-SO_RCVTIMEO = 20 +-SO_SNDTIMEO = 21 +-SO_SECURITY_AUTHENTICATION = 22 +-SO_SECURITY_ENCRYPTION_TRANSPORT = 23 +-SO_SECURITY_ENCRYPTION_NETWORK = 24 +-SO_BINDTODEVICE = 25 +-SO_ATTACH_FILTER = 26 +-SO_DETACH_FILTER = 27 +-SO_PEERNAME = 28 +-SO_TIMESTAMP = 29 +-SCM_TIMESTAMP = SO_TIMESTAMP +-SO_ACCEPTCONN = 30 +-SOCK_STREAM = 1 +-SOCK_DGRAM = 2 +-SOCK_RAW = 3 +-SOCK_RDM = 4 +-SOCK_SEQPACKET = 5 +-SOCK_PACKET = 10 +-SOCK_MAX = (SOCK_PACKET+1) +- +-# Included from bits/in.h +-IP_TOS = 1 +-IP_TTL = 2 +-IP_HDRINCL = 3 +-IP_OPTIONS = 4 +-IP_ROUTER_ALERT = 5 +-IP_RECVOPTS = 6 +-IP_RETOPTS = 7 +-IP_PKTINFO = 8 +-IP_PKTOPTIONS = 9 +-IP_PMTUDISC = 10 +-IP_MTU_DISCOVER = 10 +-IP_RECVERR = 11 +-IP_RECVTTL = 12 +-IP_RECVTOS = 13 +-IP_MULTICAST_IF = 32 +-IP_MULTICAST_TTL = 33 +-IP_MULTICAST_LOOP = 34 +-IP_ADD_MEMBERSHIP = 35 +-IP_DROP_MEMBERSHIP = 36 +-IP_RECVRETOPTS = IP_RETOPTS +-IP_PMTUDISC_DONT = 0 +-IP_PMTUDISC_WANT = 1 +-IP_PMTUDISC_DO = 2 +-SOL_IP = 0 +-IP_DEFAULT_MULTICAST_TTL = 1 +-IP_DEFAULT_MULTICAST_LOOP = 1 +-IP_MAX_MEMBERSHIPS = 20 +-IPV6_ADDRFORM = 1 +-IPV6_PKTINFO = 2 +-IPV6_HOPOPTS = 3 +-IPV6_DSTOPTS = 4 +-IPV6_RTHDR = 5 +-IPV6_PKTOPTIONS = 6 +-IPV6_CHECKSUM = 7 +-IPV6_HOPLIMIT = 8 +-IPV6_NEXTHOP = 9 +-IPV6_AUTHHDR = 10 +-IPV6_UNICAST_HOPS = 16 +-IPV6_MULTICAST_IF = 17 +-IPV6_MULTICAST_HOPS = 18 +-IPV6_MULTICAST_LOOP = 19 +-IPV6_JOIN_GROUP = 20 +-IPV6_LEAVE_GROUP = 21 +-IPV6_ROUTER_ALERT = 22 +-IPV6_MTU_DISCOVER = 23 +-IPV6_MTU = 24 +-IPV6_RECVERR = 25 +-IPV6_RXHOPOPTS = IPV6_HOPOPTS +-IPV6_RXDSTOPTS = IPV6_DSTOPTS +-IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP +-IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP +-IPV6_PMTUDISC_DONT = 0 +-IPV6_PMTUDISC_WANT = 1 +-IPV6_PMTUDISC_DO = 2 +-SOL_IPV6 = 41 +-SOL_ICMPV6 = 58 +-IPV6_RTHDR_LOOSE = 0 +-IPV6_RTHDR_STRICT = 1 +-IPV6_RTHDR_TYPE_0 = 0 +- +-# Included from endian.h +-_ENDIAN_H = 1 +-__LITTLE_ENDIAN = 1234 +-__BIG_ENDIAN = 4321 +-__PDP_ENDIAN = 3412 +- +-# Included from bits/endian.h +-__BYTE_ORDER = __LITTLE_ENDIAN +-__FLOAT_WORD_ORDER = __BYTE_ORDER +-LITTLE_ENDIAN = __LITTLE_ENDIAN +-BIG_ENDIAN = __BIG_ENDIAN +-PDP_ENDIAN = __PDP_ENDIAN +-BYTE_ORDER = __BYTE_ORDER +- +-# Included from bits/byteswap.h +-_BITS_BYTESWAP_H = 1 +-def __bswap_constant_16(x): return \ +- +-def __bswap_16(x): return \ +- +-def __bswap_16(x): return __bswap_constant_16 (x) +- +-def __bswap_constant_32(x): return \ +- +-def __bswap_32(x): return \ +- +-def __bswap_32(x): return \ +- +-def __bswap_32(x): return __bswap_constant_32 (x) +- +-def __bswap_constant_64(x): return \ +- +-def __bswap_64(x): return \ +- +-def ntohl(x): return (x) +- +-def ntohs(x): return (x) +- +-def htonl(x): return (x) +- +-def htons(x): return (x) +- +-def ntohl(x): return __bswap_32 (x) +- +-def ntohs(x): return __bswap_16 (x) +- +-def htonl(x): return __bswap_32 (x) +- +-def htons(x): return __bswap_16 (x) +- +-def IN6_IS_ADDR_UNSPECIFIED(a): return \ +- +-def IN6_IS_ADDR_LOOPBACK(a): return \ +- +-def IN6_IS_ADDR_LINKLOCAL(a): return \ +- +-def IN6_IS_ADDR_SITELOCAL(a): return \ +- +-def IN6_IS_ADDR_V4MAPPED(a): return \ +- +-def IN6_IS_ADDR_V4COMPAT(a): return \ +- +-def IN6_IS_ADDR_MC_NODELOCAL(a): return \ +- +-def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ +- +-def IN6_IS_ADDR_MC_SITELOCAL(a): return \ +- +-def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ +- +-def IN6_IS_ADDR_MC_GLOBAL(a): return ++import platform ++ ++architecture = platform.machine() ++if architecture == 'alpha': ++ from IN_alpha import * ++elif architecture.startswith('parisc'): ++ from IN_hppa import * ++elif architecture.startswith('mips'): ++ from IN_mips import * ++elif architecture.startswith('sparc'): ++ from IN_sparc import * ++else: ++ from IN_default import * ++ ++del platform, architecture +diff --git a/lib-python/2.7/plat-linux2/IN_alpha.py b/lib-python/2.7/plat-linux2/IN_alpha.py +new file mode 100644 +index 0000000..a397d51 +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/IN_alpha.py +@@ -0,0 +1,615 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MIN = (-2147483647l - 1l) ++__WCHAR_MAX = (2147483647l) ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ## U ++ ++def UINT16_C(c): return c ## U ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__FD_SETSIZE = 1024 ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 0 ++SCHED_FIFO = 1 ++SCHED_RR = 2 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PID = 0x00001000 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++__defined_schedparam = 1 ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/socket.h ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_LINK_MAX = 8 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_NAME_MAX = 14 ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TIMER_MAX = 32 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from linux/limits.h ++NR_OPEN = 1024 ++NGROUPS_MAX = 32 ++ARG_MAX = 131072 ++CHILD_MAX = 999 ++OPEN_MAX = 256 ++LINK_MAX = 127 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++PATH_MAX = 4096 ++PIPE_BUF = 4096 ++RTSIG_MAX = 32 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = _POSIX_NGROUPS_MAX ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 4096 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 16 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++from TYPES import * ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_AX25 = 3 ++PF_IPX = 4 ++PF_APPLETALK = 5 ++PF_NETROM = 6 ++PF_BRIDGE = 7 ++PF_ATMPVC = 8 ++PF_X25 = 9 ++PF_INET6 = 10 ++PF_ROSE = 11 ++PF_DECnet = 12 ++PF_NETBEUI = 13 ++PF_SECURITY = 14 ++PF_KEY = 15 ++PF_NETLINK = 16 ++PF_ROUTE = PF_NETLINK ++PF_PACKET = 17 ++PF_ASH = 18 ++PF_ECONET = 19 ++PF_ATMSVC = 20 ++PF_SNA = 22 ++PF_IRDA = 23 ++PF_PPPOX = 24 ++PF_WANPIPE = 25 ++PF_BLUETOOTH = 31 ++PF_MAX = 32 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_AX25 = PF_AX25 ++AF_IPX = PF_IPX ++AF_APPLETALK = PF_APPLETALK ++AF_NETROM = PF_NETROM ++AF_BRIDGE = PF_BRIDGE ++AF_ATMPVC = PF_ATMPVC ++AF_X25 = PF_X25 ++AF_INET6 = PF_INET6 ++AF_ROSE = PF_ROSE ++AF_DECnet = PF_DECnet ++AF_NETBEUI = PF_NETBEUI ++AF_SECURITY = PF_SECURITY ++AF_KEY = PF_KEY ++AF_NETLINK = PF_NETLINK ++AF_ROUTE = PF_ROUTE ++AF_PACKET = PF_PACKET ++AF_ASH = PF_ASH ++AF_ECONET = PF_ECONET ++AF_ATMSVC = PF_ATMSVC ++AF_SNA = PF_SNA ++AF_IRDA = PF_IRDA ++AF_PPPOX = PF_PPPOX ++AF_WANPIPE = PF_WANPIPE ++AF_BLUETOOTH = PF_BLUETOOTH ++AF_MAX = PF_MAX ++SOL_RAW = 255 ++SOL_DECNET = 261 ++SOL_X25 = 262 ++SOL_PACKET = 263 ++SOL_ATM = 264 ++SOL_AAL = 265 ++SOL_IRDA = 266 ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++ ++# Included from asm/socket.h ++ ++# Included from asm/sockios.h ++FIOSETOWN = 0x8004667c ++SIOCSPGRP = 0x80047308 ++FIOGETOWN = 0x4004667b ++SIOCGPGRP = 0x40047309 ++SIOCATMARK = 0x40047307 ++SIOCGSTAMP = 0x8906 ++SOL_SOCKET = 0xffff ++SO_DEBUG = 0x0001 ++SO_REUSEADDR = 0x0004 ++SO_TYPE = 0x1008 ++SO_ERROR = 0x1007 ++SO_DONTROUTE = 0x0010 ++SO_BROADCAST = 0x0020 ++SO_SNDBUF = 0x1001 ++SO_RCVBUF = 0x1002 ++SO_KEEPALIVE = 0x0008 ++SO_OOBINLINE = 0x0100 ++SO_NO_CHECK = 11 ++SO_PRIORITY = 12 ++SO_LINGER = 0x0080 ++SO_BSDCOMPAT = 14 ++SO_PASSCRED = 16 ++SO_PEERCRED = 17 ++SO_RCVLOWAT = 0x1010 ++SO_SNDLOWAT = 0x1011 ++SO_RCVTIMEO = 0x1012 ++SO_SNDTIMEO = 0x1013 ++SO_SECURITY_AUTHENTICATION = 19 ++SO_SECURITY_ENCRYPTION_TRANSPORT = 20 ++SO_SECURITY_ENCRYPTION_NETWORK = 21 ++SO_BINDTODEVICE = 25 ++SO_ATTACH_FILTER = 26 ++SO_DETACH_FILTER = 27 ++SO_PEERNAME = 28 ++SO_TIMESTAMP = 29 ++SCM_TIMESTAMP = SO_TIMESTAMP ++SO_ACCEPTCONN = 0x1014 ++SOCK_STREAM = 1 ++SOCK_DGRAM = 2 ++SOCK_RAW = 3 ++SOCK_RDM = 4 ++SOCK_SEQPACKET = 5 ++SOCK_PACKET = 10 ++SOCK_MAX = (SOCK_PACKET+1) ++ ++# Included from bits/in.h ++IP_TOS = 1 ++IP_TTL = 2 ++IP_HDRINCL = 3 ++IP_OPTIONS = 4 ++IP_ROUTER_ALERT = 5 ++IP_RECVOPTS = 6 ++IP_RETOPTS = 7 ++IP_PKTINFO = 8 ++IP_PKTOPTIONS = 9 ++IP_PMTUDISC = 10 ++IP_MTU_DISCOVER = 10 ++IP_RECVERR = 11 ++IP_RECVTTL = 12 ++IP_RECVTOS = 13 ++IP_MULTICAST_IF = 32 ++IP_MULTICAST_TTL = 33 ++IP_MULTICAST_LOOP = 34 ++IP_ADD_MEMBERSHIP = 35 ++IP_DROP_MEMBERSHIP = 36 ++IP_RECVRETOPTS = IP_RETOPTS ++IP_PMTUDISC_DONT = 0 ++IP_PMTUDISC_WANT = 1 ++IP_PMTUDISC_DO = 2 ++SOL_IP = 0 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MAX_MEMBERSHIPS = 20 ++IPV6_ADDRFORM = 1 ++IPV6_PKTINFO = 2 ++IPV6_HOPOPTS = 3 ++IPV6_DSTOPTS = 4 ++IPV6_RTHDR = 5 ++IPV6_PKTOPTIONS = 6 ++IPV6_CHECKSUM = 7 ++IPV6_HOPLIMIT = 8 ++IPV6_NEXTHOP = 9 ++IPV6_AUTHHDR = 10 ++IPV6_UNICAST_HOPS = 16 ++IPV6_MULTICAST_IF = 17 ++IPV6_MULTICAST_HOPS = 18 ++IPV6_MULTICAST_LOOP = 19 ++IPV6_JOIN_GROUP = 20 ++IPV6_LEAVE_GROUP = 21 ++IPV6_ROUTER_ALERT = 22 ++IPV6_MTU_DISCOVER = 23 ++IPV6_MTU = 24 ++IPV6_RECVERR = 25 ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_PMTUDISC_DONT = 0 ++IPV6_PMTUDISC_WANT = 1 ++IPV6_PMTUDISC_DO = 2 ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return __bswap_constant_16 (x) ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return __bswap_constant_32 (x) ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return +diff --git a/lib-python/2.7/plat-linux2/IN_default.py b/lib-python/2.7/plat-linux2/IN_default.py +new file mode 100644 +index 0000000..ad307f6 +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/IN_default.py +@@ -0,0 +1,615 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MIN = (-2147483647l - 1l) ++__WCHAR_MAX = (2147483647l) ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ## U ++ ++def UINT16_C(c): return c ## U ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__FD_SETSIZE = 1024 ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 0 ++SCHED_FIFO = 1 ++SCHED_RR = 2 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PID = 0x00001000 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++__defined_schedparam = 1 ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/socket.h ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_LINK_MAX = 8 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_NAME_MAX = 14 ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TIMER_MAX = 32 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from linux/limits.h ++NR_OPEN = 1024 ++NGROUPS_MAX = 32 ++ARG_MAX = 131072 ++CHILD_MAX = 999 ++OPEN_MAX = 256 ++LINK_MAX = 127 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++PATH_MAX = 4096 ++PIPE_BUF = 4096 ++RTSIG_MAX = 32 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = _POSIX_NGROUPS_MAX ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 4096 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 16 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++from TYPES import * ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_AX25 = 3 ++PF_IPX = 4 ++PF_APPLETALK = 5 ++PF_NETROM = 6 ++PF_BRIDGE = 7 ++PF_ATMPVC = 8 ++PF_X25 = 9 ++PF_INET6 = 10 ++PF_ROSE = 11 ++PF_DECnet = 12 ++PF_NETBEUI = 13 ++PF_SECURITY = 14 ++PF_KEY = 15 ++PF_NETLINK = 16 ++PF_ROUTE = PF_NETLINK ++PF_PACKET = 17 ++PF_ASH = 18 ++PF_ECONET = 19 ++PF_ATMSVC = 20 ++PF_SNA = 22 ++PF_IRDA = 23 ++PF_PPPOX = 24 ++PF_WANPIPE = 25 ++PF_BLUETOOTH = 31 ++PF_MAX = 32 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_AX25 = PF_AX25 ++AF_IPX = PF_IPX ++AF_APPLETALK = PF_APPLETALK ++AF_NETROM = PF_NETROM ++AF_BRIDGE = PF_BRIDGE ++AF_ATMPVC = PF_ATMPVC ++AF_X25 = PF_X25 ++AF_INET6 = PF_INET6 ++AF_ROSE = PF_ROSE ++AF_DECnet = PF_DECnet ++AF_NETBEUI = PF_NETBEUI ++AF_SECURITY = PF_SECURITY ++AF_KEY = PF_KEY ++AF_NETLINK = PF_NETLINK ++AF_ROUTE = PF_ROUTE ++AF_PACKET = PF_PACKET ++AF_ASH = PF_ASH ++AF_ECONET = PF_ECONET ++AF_ATMSVC = PF_ATMSVC ++AF_SNA = PF_SNA ++AF_IRDA = PF_IRDA ++AF_PPPOX = PF_PPPOX ++AF_WANPIPE = PF_WANPIPE ++AF_BLUETOOTH = PF_BLUETOOTH ++AF_MAX = PF_MAX ++SOL_RAW = 255 ++SOL_DECNET = 261 ++SOL_X25 = 262 ++SOL_PACKET = 263 ++SOL_ATM = 264 ++SOL_AAL = 265 ++SOL_IRDA = 266 ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++ ++# Included from asm/socket.h ++ ++# Included from asm/sockios.h ++FIOSETOWN = 0x8901 ++SIOCSPGRP = 0x8902 ++FIOGETOWN = 0x8903 ++SIOCGPGRP = 0x8904 ++SIOCATMARK = 0x8905 ++SIOCGSTAMP = 0x8906 ++SOL_SOCKET = 1 ++SO_DEBUG = 1 ++SO_REUSEADDR = 2 ++SO_TYPE = 3 ++SO_ERROR = 4 ++SO_DONTROUTE = 5 ++SO_BROADCAST = 6 ++SO_SNDBUF = 7 ++SO_RCVBUF = 8 ++SO_KEEPALIVE = 9 ++SO_OOBINLINE = 10 ++SO_NO_CHECK = 11 ++SO_PRIORITY = 12 ++SO_LINGER = 13 ++SO_BSDCOMPAT = 14 ++SO_PASSCRED = 16 ++SO_PEERCRED = 17 ++SO_RCVLOWAT = 18 ++SO_SNDLOWAT = 19 ++SO_RCVTIMEO = 20 ++SO_SNDTIMEO = 21 ++SO_SECURITY_AUTHENTICATION = 22 ++SO_SECURITY_ENCRYPTION_TRANSPORT = 23 ++SO_SECURITY_ENCRYPTION_NETWORK = 24 ++SO_BINDTODEVICE = 25 ++SO_ATTACH_FILTER = 26 ++SO_DETACH_FILTER = 27 ++SO_PEERNAME = 28 ++SO_TIMESTAMP = 29 ++SCM_TIMESTAMP = SO_TIMESTAMP ++SO_ACCEPTCONN = 30 ++SOCK_STREAM = 1 ++SOCK_DGRAM = 2 ++SOCK_RAW = 3 ++SOCK_RDM = 4 ++SOCK_SEQPACKET = 5 ++SOCK_PACKET = 10 ++SOCK_MAX = (SOCK_PACKET+1) ++ ++# Included from bits/in.h ++IP_TOS = 1 ++IP_TTL = 2 ++IP_HDRINCL = 3 ++IP_OPTIONS = 4 ++IP_ROUTER_ALERT = 5 ++IP_RECVOPTS = 6 ++IP_RETOPTS = 7 ++IP_PKTINFO = 8 ++IP_PKTOPTIONS = 9 ++IP_PMTUDISC = 10 ++IP_MTU_DISCOVER = 10 ++IP_RECVERR = 11 ++IP_RECVTTL = 12 ++IP_RECVTOS = 13 ++IP_MULTICAST_IF = 32 ++IP_MULTICAST_TTL = 33 ++IP_MULTICAST_LOOP = 34 ++IP_ADD_MEMBERSHIP = 35 ++IP_DROP_MEMBERSHIP = 36 ++IP_RECVRETOPTS = IP_RETOPTS ++IP_PMTUDISC_DONT = 0 ++IP_PMTUDISC_WANT = 1 ++IP_PMTUDISC_DO = 2 ++SOL_IP = 0 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MAX_MEMBERSHIPS = 20 ++IPV6_ADDRFORM = 1 ++IPV6_PKTINFO = 2 ++IPV6_HOPOPTS = 3 ++IPV6_DSTOPTS = 4 ++IPV6_RTHDR = 5 ++IPV6_PKTOPTIONS = 6 ++IPV6_CHECKSUM = 7 ++IPV6_HOPLIMIT = 8 ++IPV6_NEXTHOP = 9 ++IPV6_AUTHHDR = 10 ++IPV6_UNICAST_HOPS = 16 ++IPV6_MULTICAST_IF = 17 ++IPV6_MULTICAST_HOPS = 18 ++IPV6_MULTICAST_LOOP = 19 ++IPV6_JOIN_GROUP = 20 ++IPV6_LEAVE_GROUP = 21 ++IPV6_ROUTER_ALERT = 22 ++IPV6_MTU_DISCOVER = 23 ++IPV6_MTU = 24 ++IPV6_RECVERR = 25 ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_PMTUDISC_DONT = 0 ++IPV6_PMTUDISC_WANT = 1 ++IPV6_PMTUDISC_DO = 2 ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return __bswap_constant_16 (x) ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return __bswap_constant_32 (x) ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return +diff --git a/lib-python/2.7/plat-linux2/IN_hppa.py b/lib-python/2.7/plat-linux2/IN_hppa.py +new file mode 100644 +index 0000000..71e0b84 +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/IN_hppa.py +@@ -0,0 +1,615 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MIN = (-2147483647l - 1l) ++__WCHAR_MAX = (2147483647l) ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ## U ++ ++def UINT16_C(c): return c ## U ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__FD_SETSIZE = 1024 ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 0 ++SCHED_FIFO = 1 ++SCHED_RR = 2 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PID = 0x00001000 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++__defined_schedparam = 1 ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/socket.h ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_LINK_MAX = 8 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_NAME_MAX = 14 ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TIMER_MAX = 32 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from linux/limits.h ++NR_OPEN = 1024 ++NGROUPS_MAX = 32 ++ARG_MAX = 131072 ++CHILD_MAX = 999 ++OPEN_MAX = 256 ++LINK_MAX = 127 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++PATH_MAX = 4096 ++PIPE_BUF = 4096 ++RTSIG_MAX = 32 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = _POSIX_NGROUPS_MAX ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 4096 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 16 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++from TYPES import * ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_AX25 = 3 ++PF_IPX = 4 ++PF_APPLETALK = 5 ++PF_NETROM = 6 ++PF_BRIDGE = 7 ++PF_ATMPVC = 8 ++PF_X25 = 9 ++PF_INET6 = 10 ++PF_ROSE = 11 ++PF_DECnet = 12 ++PF_NETBEUI = 13 ++PF_SECURITY = 14 ++PF_KEY = 15 ++PF_NETLINK = 16 ++PF_ROUTE = PF_NETLINK ++PF_PACKET = 17 ++PF_ASH = 18 ++PF_ECONET = 19 ++PF_ATMSVC = 20 ++PF_SNA = 22 ++PF_IRDA = 23 ++PF_PPPOX = 24 ++PF_WANPIPE = 25 ++PF_BLUETOOTH = 31 ++PF_MAX = 32 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_AX25 = PF_AX25 ++AF_IPX = PF_IPX ++AF_APPLETALK = PF_APPLETALK ++AF_NETROM = PF_NETROM ++AF_BRIDGE = PF_BRIDGE ++AF_ATMPVC = PF_ATMPVC ++AF_X25 = PF_X25 ++AF_INET6 = PF_INET6 ++AF_ROSE = PF_ROSE ++AF_DECnet = PF_DECnet ++AF_NETBEUI = PF_NETBEUI ++AF_SECURITY = PF_SECURITY ++AF_KEY = PF_KEY ++AF_NETLINK = PF_NETLINK ++AF_ROUTE = PF_ROUTE ++AF_PACKET = PF_PACKET ++AF_ASH = PF_ASH ++AF_ECONET = PF_ECONET ++AF_ATMSVC = PF_ATMSVC ++AF_SNA = PF_SNA ++AF_IRDA = PF_IRDA ++AF_PPPOX = PF_PPPOX ++AF_WANPIPE = PF_WANPIPE ++AF_BLUETOOTH = PF_BLUETOOTH ++AF_MAX = PF_MAX ++SOL_RAW = 255 ++SOL_DECNET = 261 ++SOL_X25 = 262 ++SOL_PACKET = 263 ++SOL_ATM = 264 ++SOL_AAL = 265 ++SOL_IRDA = 266 ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++ ++# Included from asm/socket.h ++ ++# Included from asm/sockios.h ++FIOSETOWN = 0x8901 ++SIOCSPGRP = 0x8902 ++FIOGETOWN = 0x8903 ++SIOCGPGRP = 0x8904 ++SIOCATMARK = 0x8905 ++SIOCGSTAMP = 0x8906 ++SOL_SOCKET = 0xffff ++SO_DEBUG = 0x0001 ++SO_REUSEADDR = 0x0004 ++SO_TYPE = 0x1008 ++SO_ERROR = 0x1007 ++SO_DONTROUTE = 0x0010 ++SO_BROADCAST = 0x0020 ++SO_SNDBUF = 0x1001 ++SO_RCVBUF = 0x1002 ++SO_KEEPALIVE = 0x0008 ++SO_OOBINLINE = 0x0100 ++SO_NO_CHECK = 0x400b ++SO_PRIORITY = 0x400c ++SO_LINGER = 0x0080 ++SO_BSDCOMPAT = 0x400e ++SO_PASSCRED = 0x4010 ++SO_PEERCRED = 0x4011 ++SO_RCVLOWAT = 0x1004 ++SO_SNDLOWAT = 0x1003 ++SO_RCVTIMEO = 0x1006 ++SO_SNDTIMEO = 0x1005 ++SO_SECURITY_AUTHENTICATION = 0x4016 ++SO_SECURITY_ENCRYPTION_TRANSPORT = 0x4017 ++SO_SECURITY_ENCRYPTION_NETWORK = 0x4018 ++SO_BINDTODEVICE = 0x4019 ++SO_ATTACH_FILTER = 0x401a ++SO_DETACH_FILTER = 0x401b ++SO_PEERNAME = 0x2000 ++SO_TIMESTAMP = 0x4012 ++SCM_TIMESTAMP = SO_TIMESTAMP ++SO_ACCEPTCONN = 0x401c ++SOCK_STREAM = 1 ++SOCK_DGRAM = 2 ++SOCK_RAW = 3 ++SOCK_RDM = 4 ++SOCK_SEQPACKET = 5 ++SOCK_PACKET = 10 ++SOCK_MAX = (SOCK_PACKET+1) ++ ++# Included from bits/in.h ++IP_TOS = 1 ++IP_TTL = 2 ++IP_HDRINCL = 3 ++IP_OPTIONS = 4 ++IP_ROUTER_ALERT = 5 ++IP_RECVOPTS = 6 ++IP_RETOPTS = 7 ++IP_PKTINFO = 8 ++IP_PKTOPTIONS = 9 ++IP_PMTUDISC = 10 ++IP_MTU_DISCOVER = 10 ++IP_RECVERR = 11 ++IP_RECVTTL = 12 ++IP_RECVTOS = 13 ++IP_MULTICAST_IF = 32 ++IP_MULTICAST_TTL = 33 ++IP_MULTICAST_LOOP = 34 ++IP_ADD_MEMBERSHIP = 35 ++IP_DROP_MEMBERSHIP = 36 ++IP_RECVRETOPTS = IP_RETOPTS ++IP_PMTUDISC_DONT = 0 ++IP_PMTUDISC_WANT = 1 ++IP_PMTUDISC_DO = 2 ++SOL_IP = 0 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MAX_MEMBERSHIPS = 20 ++IPV6_ADDRFORM = 1 ++IPV6_PKTINFO = 2 ++IPV6_HOPOPTS = 3 ++IPV6_DSTOPTS = 4 ++IPV6_RTHDR = 5 ++IPV6_PKTOPTIONS = 6 ++IPV6_CHECKSUM = 7 ++IPV6_HOPLIMIT = 8 ++IPV6_NEXTHOP = 9 ++IPV6_AUTHHDR = 10 ++IPV6_UNICAST_HOPS = 16 ++IPV6_MULTICAST_IF = 17 ++IPV6_MULTICAST_HOPS = 18 ++IPV6_MULTICAST_LOOP = 19 ++IPV6_JOIN_GROUP = 20 ++IPV6_LEAVE_GROUP = 21 ++IPV6_ROUTER_ALERT = 22 ++IPV6_MTU_DISCOVER = 23 ++IPV6_MTU = 24 ++IPV6_RECVERR = 25 ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_PMTUDISC_DONT = 0 ++IPV6_PMTUDISC_WANT = 1 ++IPV6_PMTUDISC_DO = 2 ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return __bswap_constant_16 (x) ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return __bswap_constant_32 (x) ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return +diff --git a/lib-python/2.7/plat-linux2/IN_mips.py b/lib-python/2.7/plat-linux2/IN_mips.py +new file mode 100644 +index 0000000..514a13e +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/IN_mips.py +@@ -0,0 +1,615 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MIN = (-2147483647l - 1l) ++__WCHAR_MAX = (2147483647l) ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ## U ++ ++def UINT16_C(c): return c ## U ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__FD_SETSIZE = 1024 ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 0 ++SCHED_FIFO = 1 ++SCHED_RR = 2 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PID = 0x00001000 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++__defined_schedparam = 1 ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/socket.h ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_LINK_MAX = 8 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_NAME_MAX = 14 ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TIMER_MAX = 32 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from linux/limits.h ++NR_OPEN = 1024 ++NGROUPS_MAX = 32 ++ARG_MAX = 131072 ++CHILD_MAX = 999 ++OPEN_MAX = 256 ++LINK_MAX = 127 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++PATH_MAX = 4096 ++PIPE_BUF = 4096 ++RTSIG_MAX = 32 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = _POSIX_NGROUPS_MAX ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 4096 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 16 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++from TYPES import * ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_AX25 = 3 ++PF_IPX = 4 ++PF_APPLETALK = 5 ++PF_NETROM = 6 ++PF_BRIDGE = 7 ++PF_ATMPVC = 8 ++PF_X25 = 9 ++PF_INET6 = 10 ++PF_ROSE = 11 ++PF_DECnet = 12 ++PF_NETBEUI = 13 ++PF_SECURITY = 14 ++PF_KEY = 15 ++PF_NETLINK = 16 ++PF_ROUTE = PF_NETLINK ++PF_PACKET = 17 ++PF_ASH = 18 ++PF_ECONET = 19 ++PF_ATMSVC = 20 ++PF_SNA = 22 ++PF_IRDA = 23 ++PF_PPPOX = 24 ++PF_WANPIPE = 25 ++PF_BLUETOOTH = 31 ++PF_MAX = 32 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_AX25 = PF_AX25 ++AF_IPX = PF_IPX ++AF_APPLETALK = PF_APPLETALK ++AF_NETROM = PF_NETROM ++AF_BRIDGE = PF_BRIDGE ++AF_ATMPVC = PF_ATMPVC ++AF_X25 = PF_X25 ++AF_INET6 = PF_INET6 ++AF_ROSE = PF_ROSE ++AF_DECnet = PF_DECnet ++AF_NETBEUI = PF_NETBEUI ++AF_SECURITY = PF_SECURITY ++AF_KEY = PF_KEY ++AF_NETLINK = PF_NETLINK ++AF_ROUTE = PF_ROUTE ++AF_PACKET = PF_PACKET ++AF_ASH = PF_ASH ++AF_ECONET = PF_ECONET ++AF_ATMSVC = PF_ATMSVC ++AF_SNA = PF_SNA ++AF_IRDA = PF_IRDA ++AF_PPPOX = PF_PPPOX ++AF_WANPIPE = PF_WANPIPE ++AF_BLUETOOTH = PF_BLUETOOTH ++AF_MAX = PF_MAX ++SOL_RAW = 255 ++SOL_DECNET = 261 ++SOL_X25 = 262 ++SOL_PACKET = 263 ++SOL_ATM = 264 ++SOL_AAL = 265 ++SOL_IRDA = 266 ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++ ++# Included from asm/socket.h ++ ++# Included from asm/sockios.h ++FIOSETOWN = 0x8004667c ++SIOCSPGRP = 0x80047308 ++FIOGETOWN = 0x4004667b ++SIOCGPGRP = 0x40047309 ++SIOCATMARK = 0x40047307 ++SIOCGSTAMP = 0x8906 ++SOL_SOCKET = 0xffff ++SO_DEBUG = 0x0001 ++SO_REUSEADDR = 0x0004 ++SO_TYPE = 0x1008 ++SO_ERROR = 0x1007 ++SO_DONTROUTE = 0x0010 ++SO_BROADCAST = 0x0020 ++SO_SNDBUF = 0x1001 ++SO_RCVBUF = 0x1002 ++SO_KEEPALIVE = 0x0008 ++SO_OOBINLINE = 0x0100 ++SO_NO_CHECK = 11 ++SO_PRIORITY = 12 ++SO_LINGER = 0x0080 ++SO_BSDCOMPAT = 14 ++SO_PASSCRED = 17 ++SO_PEERCRED = 18 ++SO_RCVLOWAT = 0x1004 ++SO_SNDLOWAT = 0x1003 ++SO_RCVTIMEO = 0x1006 ++SO_SNDTIMEO = 0x1005 ++SO_SECURITY_AUTHENTICATION = 22 ++SO_SECURITY_ENCRYPTION_TRANSPORT = 23 ++SO_SECURITY_ENCRYPTION_NETWORK = 24 ++SO_BINDTODEVICE = 25 ++SO_ATTACH_FILTER = 26 ++SO_DETACH_FILTER = 27 ++SO_PEERNAME = 28 ++SO_TIMESTAMP = 29 ++SCM_TIMESTAMP = SO_TIMESTAMP ++SO_ACCEPTCONN = 0x1009 ++SOCK_STREAM = 2 ++SOCK_DGRAM = 1 ++SOCK_RAW = 3 ++SOCK_RDM = 4 ++SOCK_SEQPACKET = 5 ++SOCK_PACKET = 10 ++SOCK_MAX = (SOCK_PACKET+1) ++ ++# Included from bits/in.h ++IP_TOS = 1 ++IP_TTL = 2 ++IP_HDRINCL = 3 ++IP_OPTIONS = 4 ++IP_ROUTER_ALERT = 5 ++IP_RECVOPTS = 6 ++IP_RETOPTS = 7 ++IP_PKTINFO = 8 ++IP_PKTOPTIONS = 9 ++IP_PMTUDISC = 10 ++IP_MTU_DISCOVER = 10 ++IP_RECVERR = 11 ++IP_RECVTTL = 12 ++IP_RECVTOS = 13 ++IP_MULTICAST_IF = 32 ++IP_MULTICAST_TTL = 33 ++IP_MULTICAST_LOOP = 34 ++IP_ADD_MEMBERSHIP = 35 ++IP_DROP_MEMBERSHIP = 36 ++IP_RECVRETOPTS = IP_RETOPTS ++IP_PMTUDISC_DONT = 0 ++IP_PMTUDISC_WANT = 1 ++IP_PMTUDISC_DO = 2 ++SOL_IP = 0 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MAX_MEMBERSHIPS = 20 ++IPV6_ADDRFORM = 1 ++IPV6_PKTINFO = 2 ++IPV6_HOPOPTS = 3 ++IPV6_DSTOPTS = 4 ++IPV6_RTHDR = 5 ++IPV6_PKTOPTIONS = 6 ++IPV6_CHECKSUM = 7 ++IPV6_HOPLIMIT = 8 ++IPV6_NEXTHOP = 9 ++IPV6_AUTHHDR = 10 ++IPV6_UNICAST_HOPS = 16 ++IPV6_MULTICAST_IF = 17 ++IPV6_MULTICAST_HOPS = 18 ++IPV6_MULTICAST_LOOP = 19 ++IPV6_JOIN_GROUP = 20 ++IPV6_LEAVE_GROUP = 21 ++IPV6_ROUTER_ALERT = 22 ++IPV6_MTU_DISCOVER = 23 ++IPV6_MTU = 24 ++IPV6_RECVERR = 25 ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_PMTUDISC_DONT = 0 ++IPV6_PMTUDISC_WANT = 1 ++IPV6_PMTUDISC_DO = 2 ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return __bswap_constant_16 (x) ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return __bswap_constant_32 (x) ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return +diff --git a/lib-python/2.7/plat-linux2/IN_sparc.py b/lib-python/2.7/plat-linux2/IN_sparc.py +new file mode 100644 +index 0000000..294128c +--- /dev/null ++++ b/lib-python/2.7/plat-linux2/IN_sparc.py +@@ -0,0 +1,615 @@ ++# Generated by h2py from /usr/include/netinet/in.h ++_NETINET_IN_H = 1 ++ ++# Included from features.h ++_FEATURES_H = 1 ++__USE_ANSI = 1 ++__FAVOR_BSD = 1 ++_ISOC99_SOURCE = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 199506L ++_XOPEN_SOURCE = 600 ++_XOPEN_SOURCE_EXTENDED = 1 ++_LARGEFILE64_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++_BSD_SOURCE = 1 ++_SVID_SOURCE = 1 ++__USE_ISOC99 = 1 ++_POSIX_SOURCE = 1 ++_POSIX_C_SOURCE = 2 ++_POSIX_C_SOURCE = 199506L ++__USE_POSIX = 1 ++__USE_POSIX2 = 1 ++__USE_POSIX199309 = 1 ++__USE_POSIX199506 = 1 ++__USE_XOPEN = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_UNIX98 = 1 ++_LARGEFILE_SOURCE = 1 ++__USE_XOPEN2K = 1 ++__USE_ISOC99 = 1 ++__USE_XOPEN_EXTENDED = 1 ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_FILE_OFFSET64 = 1 ++__USE_MISC = 1 ++__USE_BSD = 1 ++__USE_SVID = 1 ++__USE_GNU = 1 ++__USE_REENTRANT = 1 ++__STDC_IEC_559__ = 1 ++__STDC_IEC_559_COMPLEX__ = 1 ++__STDC_ISO_10646__ = 200009L ++__GNU_LIBRARY__ = 6 ++__GLIBC__ = 2 ++__GLIBC_MINOR__ = 2 ++ ++# Included from sys/cdefs.h ++_SYS_CDEFS_H = 1 ++def __PMT(args): return args ++ ++def __P(args): return args ++ ++def __PMT(args): return args ++ ++def __STRING(x): return #x ++ ++__flexarr = [] ++__flexarr = [0] ++__flexarr = [] ++__flexarr = [1] ++def __ASMNAME(cname): return __ASMNAME2 (__USER_LABEL_PREFIX__, cname) ++ ++def __attribute__(xyz): return ++ ++def __attribute_format_arg__(x): return __attribute__ ((__format_arg__ (x))) ++ ++def __attribute_format_arg__(x): return ++ ++__USE_LARGEFILE = 1 ++__USE_LARGEFILE64 = 1 ++__USE_EXTERN_INLINES = 1 ++ ++# Included from gnu/stubs.h ++ ++# Included from stdint.h ++_STDINT_H = 1 ++ ++# Included from bits/wchar.h ++_BITS_WCHAR_H = 1 ++__WCHAR_MIN = (-2147483647l - 1l) ++__WCHAR_MAX = (2147483647l) ++ ++# Included from bits/wordsize.h ++__WORDSIZE = 32 ++def __INT64_C(c): return c ## L ++ ++def __UINT64_C(c): return c ## UL ++ ++def __INT64_C(c): return c ## LL ++ ++def __UINT64_C(c): return c ## ULL ++ ++INT8_MIN = (-128) ++INT16_MIN = (-32767-1) ++INT32_MIN = (-2147483647-1) ++INT64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT8_MAX = (127) ++INT16_MAX = (32767) ++INT32_MAX = (2147483647) ++INT64_MAX = (__INT64_C(9223372036854775807)) ++UINT8_MAX = (255) ++UINT16_MAX = (65535) ++UINT64_MAX = (__UINT64_C(18446744073709551615)) ++INT_LEAST8_MIN = (-128) ++INT_LEAST16_MIN = (-32767-1) ++INT_LEAST32_MIN = (-2147483647-1) ++INT_LEAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_LEAST8_MAX = (127) ++INT_LEAST16_MAX = (32767) ++INT_LEAST32_MAX = (2147483647) ++INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_LEAST8_MAX = (255) ++UINT_LEAST16_MAX = (65535) ++UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) ++INT_FAST8_MIN = (-128) ++INT_FAST16_MIN = (-9223372036854775807L-1) ++INT_FAST32_MIN = (-9223372036854775807L-1) ++INT_FAST16_MIN = (-2147483647-1) ++INT_FAST32_MIN = (-2147483647-1) ++INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) ++INT_FAST8_MAX = (127) ++INT_FAST16_MAX = (9223372036854775807L) ++INT_FAST32_MAX = (9223372036854775807L) ++INT_FAST16_MAX = (2147483647) ++INT_FAST32_MAX = (2147483647) ++INT_FAST64_MAX = (__INT64_C(9223372036854775807)) ++UINT_FAST8_MAX = (255) ++UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) ++INTPTR_MIN = (-9223372036854775807L-1) ++INTPTR_MAX = (9223372036854775807L) ++INTPTR_MIN = (-2147483647-1) ++INTPTR_MAX = (2147483647) ++INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) ++INTMAX_MAX = (__INT64_C(9223372036854775807)) ++UINTMAX_MAX = (__UINT64_C(18446744073709551615)) ++PTRDIFF_MIN = (-9223372036854775807L-1) ++PTRDIFF_MAX = (9223372036854775807L) ++PTRDIFF_MIN = (-2147483647-1) ++PTRDIFF_MAX = (2147483647) ++SIG_ATOMIC_MIN = (-2147483647-1) ++SIG_ATOMIC_MAX = (2147483647) ++WCHAR_MIN = __WCHAR_MIN ++WCHAR_MAX = __WCHAR_MAX ++def INT8_C(c): return c ++ ++def INT16_C(c): return c ++ ++def INT32_C(c): return c ++ ++def INT64_C(c): return c ## L ++ ++def INT64_C(c): return c ## LL ++ ++def UINT8_C(c): return c ## U ++ ++def UINT16_C(c): return c ## U ++ ++def UINT32_C(c): return c ## U ++ ++def UINT64_C(c): return c ## UL ++ ++def UINT64_C(c): return c ## ULL ++ ++def INTMAX_C(c): return c ## L ++ ++def UINTMAX_C(c): return c ## UL ++ ++def INTMAX_C(c): return c ## LL ++ ++def UINTMAX_C(c): return c ## ULL ++ ++ ++# Included from bits/types.h ++_BITS_TYPES_H = 1 ++__FD_SETSIZE = 1024 ++ ++# Included from bits/pthreadtypes.h ++_BITS_PTHREADTYPES_H = 1 ++ ++# Included from bits/sched.h ++SCHED_OTHER = 0 ++SCHED_FIFO = 1 ++SCHED_RR = 2 ++CSIGNAL = 0x000000ff ++CLONE_VM = 0x00000100 ++CLONE_FS = 0x00000200 ++CLONE_FILES = 0x00000400 ++CLONE_SIGHAND = 0x00000800 ++CLONE_PID = 0x00001000 ++CLONE_PTRACE = 0x00002000 ++CLONE_VFORK = 0x00004000 ++__defined_schedparam = 1 ++def IN_CLASSA(a): return ((((in_addr_t)(a)) & (-2147483648)) == 0) ++ ++IN_CLASSA_NET = (-16777216) ++IN_CLASSA_NSHIFT = 24 ++IN_CLASSA_HOST = ((-1) & ~IN_CLASSA_NET) ++IN_CLASSA_MAX = 128 ++def IN_CLASSB(a): return ((((in_addr_t)(a)) & (-1073741824)) == (-2147483648)) ++ ++IN_CLASSB_NET = (-65536) ++IN_CLASSB_NSHIFT = 16 ++IN_CLASSB_HOST = ((-1) & ~IN_CLASSB_NET) ++IN_CLASSB_MAX = 65536 ++def IN_CLASSC(a): return ((((in_addr_t)(a)) & (-536870912)) == (-1073741824)) ++ ++IN_CLASSC_NET = (-256) ++IN_CLASSC_NSHIFT = 8 ++IN_CLASSC_HOST = ((-1) & ~IN_CLASSC_NET) ++def IN_CLASSD(a): return ((((in_addr_t)(a)) & (-268435456)) == (-536870912)) ++ ++def IN_MULTICAST(a): return IN_CLASSD(a) ++ ++def IN_EXPERIMENTAL(a): return ((((in_addr_t)(a)) & (-536870912)) == (-536870912)) ++ ++def IN_BADCLASS(a): return ((((in_addr_t)(a)) & (-268435456)) == (-268435456)) ++ ++IN_LOOPBACKNET = 127 ++INET_ADDRSTRLEN = 16 ++INET6_ADDRSTRLEN = 46 ++ ++# Included from bits/socket.h ++ ++# Included from limits.h ++_LIBC_LIMITS_H_ = 1 ++MB_LEN_MAX = 16 ++_LIMITS_H = 1 ++CHAR_BIT = 8 ++SCHAR_MIN = (-128) ++SCHAR_MAX = 127 ++UCHAR_MAX = 255 ++CHAR_MIN = 0 ++CHAR_MAX = UCHAR_MAX ++CHAR_MIN = SCHAR_MIN ++CHAR_MAX = SCHAR_MAX ++SHRT_MIN = (-32768) ++SHRT_MAX = 32767 ++USHRT_MAX = 65535 ++INT_MAX = 2147483647 ++LONG_MAX = 9223372036854775807L ++LONG_MAX = 2147483647L ++LONG_MIN = (-LONG_MAX - 1L) ++ ++# Included from bits/posix1_lim.h ++_BITS_POSIX1_LIM_H = 1 ++_POSIX_AIO_LISTIO_MAX = 2 ++_POSIX_AIO_MAX = 1 ++_POSIX_ARG_MAX = 4096 ++_POSIX_CHILD_MAX = 6 ++_POSIX_DELAYTIMER_MAX = 32 ++_POSIX_LINK_MAX = 8 ++_POSIX_MAX_CANON = 255 ++_POSIX_MAX_INPUT = 255 ++_POSIX_MQ_OPEN_MAX = 8 ++_POSIX_MQ_PRIO_MAX = 32 ++_POSIX_NGROUPS_MAX = 0 ++_POSIX_OPEN_MAX = 16 ++_POSIX_FD_SETSIZE = _POSIX_OPEN_MAX ++_POSIX_NAME_MAX = 14 ++_POSIX_PATH_MAX = 256 ++_POSIX_PIPE_BUF = 512 ++_POSIX_RTSIG_MAX = 8 ++_POSIX_SEM_NSEMS_MAX = 256 ++_POSIX_SEM_VALUE_MAX = 32767 ++_POSIX_SIGQUEUE_MAX = 32 ++_POSIX_SSIZE_MAX = 32767 ++_POSIX_STREAM_MAX = 8 ++_POSIX_TZNAME_MAX = 6 ++_POSIX_QLIMIT = 1 ++_POSIX_HIWAT = _POSIX_PIPE_BUF ++_POSIX_UIO_MAXIOV = 16 ++_POSIX_TTY_NAME_MAX = 9 ++_POSIX_TIMER_MAX = 32 ++_POSIX_LOGIN_NAME_MAX = 9 ++_POSIX_CLOCKRES_MIN = 20000000 ++ ++# Included from bits/local_lim.h ++ ++# Included from linux/limits.h ++NR_OPEN = 1024 ++NGROUPS_MAX = 32 ++ARG_MAX = 131072 ++CHILD_MAX = 999 ++OPEN_MAX = 256 ++LINK_MAX = 127 ++MAX_CANON = 255 ++MAX_INPUT = 255 ++NAME_MAX = 255 ++PATH_MAX = 4096 ++PIPE_BUF = 4096 ++RTSIG_MAX = 32 ++_POSIX_THREAD_KEYS_MAX = 128 ++PTHREAD_KEYS_MAX = 1024 ++_POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4 ++PTHREAD_DESTRUCTOR_ITERATIONS = _POSIX_THREAD_DESTRUCTOR_ITERATIONS ++_POSIX_THREAD_THREADS_MAX = 64 ++PTHREAD_THREADS_MAX = 1024 ++AIO_PRIO_DELTA_MAX = 20 ++PTHREAD_STACK_MIN = 16384 ++TIMER_MAX = 256 ++SSIZE_MAX = LONG_MAX ++NGROUPS_MAX = _POSIX_NGROUPS_MAX ++ ++# Included from bits/posix2_lim.h ++_BITS_POSIX2_LIM_H = 1 ++_POSIX2_BC_BASE_MAX = 99 ++_POSIX2_BC_DIM_MAX = 2048 ++_POSIX2_BC_SCALE_MAX = 99 ++_POSIX2_BC_STRING_MAX = 1000 ++_POSIX2_COLL_WEIGHTS_MAX = 2 ++_POSIX2_EXPR_NEST_MAX = 32 ++_POSIX2_LINE_MAX = 2048 ++_POSIX2_RE_DUP_MAX = 255 ++_POSIX2_CHARCLASS_NAME_MAX = 14 ++BC_BASE_MAX = _POSIX2_BC_BASE_MAX ++BC_DIM_MAX = _POSIX2_BC_DIM_MAX ++BC_SCALE_MAX = _POSIX2_BC_SCALE_MAX ++BC_STRING_MAX = _POSIX2_BC_STRING_MAX ++COLL_WEIGHTS_MAX = 255 ++EXPR_NEST_MAX = _POSIX2_EXPR_NEST_MAX ++LINE_MAX = _POSIX2_LINE_MAX ++CHARCLASS_NAME_MAX = 2048 ++RE_DUP_MAX = (0x7fff) ++ ++# Included from bits/xopen_lim.h ++_XOPEN_LIM_H = 1 ++ ++# Included from bits/stdio_lim.h ++L_tmpnam = 20 ++TMP_MAX = 238328 ++FILENAME_MAX = 4096 ++L_ctermid = 9 ++L_cuserid = 9 ++FOPEN_MAX = 16 ++IOV_MAX = 1024 ++_XOPEN_IOV_MAX = _POSIX_UIO_MAXIOV ++NL_ARGMAX = _POSIX_ARG_MAX ++NL_LANGMAX = _POSIX2_LINE_MAX ++NL_MSGMAX = INT_MAX ++NL_NMAX = INT_MAX ++NL_SETMAX = INT_MAX ++NL_TEXTMAX = INT_MAX ++NZERO = 20 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 16 ++WORD_BIT = 32 ++WORD_BIT = 64 ++WORD_BIT = 32 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 32 ++LONG_BIT = 64 ++LONG_BIT = 64 ++LONG_BIT = 32 ++from TYPES import * ++PF_UNSPEC = 0 ++PF_LOCAL = 1 ++PF_UNIX = PF_LOCAL ++PF_FILE = PF_LOCAL ++PF_INET = 2 ++PF_AX25 = 3 ++PF_IPX = 4 ++PF_APPLETALK = 5 ++PF_NETROM = 6 ++PF_BRIDGE = 7 ++PF_ATMPVC = 8 ++PF_X25 = 9 ++PF_INET6 = 10 ++PF_ROSE = 11 ++PF_DECnet = 12 ++PF_NETBEUI = 13 ++PF_SECURITY = 14 ++PF_KEY = 15 ++PF_NETLINK = 16 ++PF_ROUTE = PF_NETLINK ++PF_PACKET = 17 ++PF_ASH = 18 ++PF_ECONET = 19 ++PF_ATMSVC = 20 ++PF_SNA = 22 ++PF_IRDA = 23 ++PF_PPPOX = 24 ++PF_WANPIPE = 25 ++PF_BLUETOOTH = 31 ++PF_MAX = 32 ++AF_UNSPEC = PF_UNSPEC ++AF_LOCAL = PF_LOCAL ++AF_UNIX = PF_UNIX ++AF_FILE = PF_FILE ++AF_INET = PF_INET ++AF_AX25 = PF_AX25 ++AF_IPX = PF_IPX ++AF_APPLETALK = PF_APPLETALK ++AF_NETROM = PF_NETROM ++AF_BRIDGE = PF_BRIDGE ++AF_ATMPVC = PF_ATMPVC ++AF_X25 = PF_X25 ++AF_INET6 = PF_INET6 ++AF_ROSE = PF_ROSE ++AF_DECnet = PF_DECnet ++AF_NETBEUI = PF_NETBEUI ++AF_SECURITY = PF_SECURITY ++AF_KEY = PF_KEY ++AF_NETLINK = PF_NETLINK ++AF_ROUTE = PF_ROUTE ++AF_PACKET = PF_PACKET ++AF_ASH = PF_ASH ++AF_ECONET = PF_ECONET ++AF_ATMSVC = PF_ATMSVC ++AF_SNA = PF_SNA ++AF_IRDA = PF_IRDA ++AF_PPPOX = PF_PPPOX ++AF_WANPIPE = PF_WANPIPE ++AF_BLUETOOTH = PF_BLUETOOTH ++AF_MAX = PF_MAX ++SOL_RAW = 255 ++SOL_DECNET = 261 ++SOL_X25 = 262 ++SOL_PACKET = 263 ++SOL_ATM = 264 ++SOL_AAL = 265 ++SOL_IRDA = 266 ++SOMAXCONN = 128 ++ ++# Included from bits/sockaddr.h ++_BITS_SOCKADDR_H = 1 ++def __SOCKADDR_COMMON(sa_prefix): return \ ++ ++_SS_SIZE = 128 ++def CMSG_FIRSTHDR(mhdr): return \ ++ ++ ++# Included from asm/socket.h ++ ++# Included from asm/sockios.h ++FIOSETOWN = 0x8901 ++SIOCSPGRP = 0x8902 ++FIOGETOWN = 0x8903 ++SIOCGPGRP = 0x8904 ++SIOCATMARK = 0x8905 ++SIOCGSTAMP = 0x8906 ++SOL_SOCKET = 0xffff ++SO_DEBUG = 0x0001 ++SO_REUSEADDR = 0x0004 ++SO_TYPE = 0x1008 ++SO_ERROR = 0x1007 ++SO_DONTROUTE = 0x0010 ++SO_BROADCAST = 0x0020 ++SO_SNDBUF = 0x1001 ++SO_RCVBUF = 0x1002 ++SO_KEEPALIVE = 0x0008 ++SO_OOBINLINE = 0x0100 ++SO_NO_CHECK = 0x000b ++SO_PRIORITY = 0x000c ++SO_LINGER = 0x0080 ++SO_BSDCOMPAT = 0x0400 ++SO_PASSCRED = 0x0002 ++SO_PEERCRED = 0x0040 ++SO_RCVLOWAT = 0x0800 ++SO_SNDLOWAT = 0x1000 ++SO_RCVTIMEO = 0x2000 ++SO_SNDTIMEO = 0x4000 ++SO_SECURITY_AUTHENTICATION = 0x5001 ++SO_SECURITY_ENCRYPTION_TRANSPORT = 0x5002 ++SO_SECURITY_ENCRYPTION_NETWORK = 0x5004 ++SO_BINDTODEVICE = 0x000d ++SO_ATTACH_FILTER = 0x001a ++SO_DETACH_FILTER = 0x001b ++SO_PEERNAME = 0x001c ++SO_TIMESTAMP = 0x001d ++SCM_TIMESTAMP = SO_TIMESTAMP ++SO_ACCEPTCONN = 0x8000 ++SOCK_STREAM = 1 ++SOCK_DGRAM = 2 ++SOCK_RAW = 3 ++SOCK_RDM = 4 ++SOCK_SEQPACKET = 5 ++SOCK_PACKET = 10 ++SOCK_MAX = (SOCK_PACKET+1) ++ ++# Included from bits/in.h ++IP_TOS = 1 ++IP_TTL = 2 ++IP_HDRINCL = 3 ++IP_OPTIONS = 4 ++IP_ROUTER_ALERT = 5 ++IP_RECVOPTS = 6 ++IP_RETOPTS = 7 ++IP_PKTINFO = 8 ++IP_PKTOPTIONS = 9 ++IP_PMTUDISC = 10 ++IP_MTU_DISCOVER = 10 ++IP_RECVERR = 11 ++IP_RECVTTL = 12 ++IP_RECVTOS = 13 ++IP_MULTICAST_IF = 32 ++IP_MULTICAST_TTL = 33 ++IP_MULTICAST_LOOP = 34 ++IP_ADD_MEMBERSHIP = 35 ++IP_DROP_MEMBERSHIP = 36 ++IP_RECVRETOPTS = IP_RETOPTS ++IP_PMTUDISC_DONT = 0 ++IP_PMTUDISC_WANT = 1 ++IP_PMTUDISC_DO = 2 ++SOL_IP = 0 ++IP_DEFAULT_MULTICAST_TTL = 1 ++IP_DEFAULT_MULTICAST_LOOP = 1 ++IP_MAX_MEMBERSHIPS = 20 ++IPV6_ADDRFORM = 1 ++IPV6_PKTINFO = 2 ++IPV6_HOPOPTS = 3 ++IPV6_DSTOPTS = 4 ++IPV6_RTHDR = 5 ++IPV6_PKTOPTIONS = 6 ++IPV6_CHECKSUM = 7 ++IPV6_HOPLIMIT = 8 ++IPV6_NEXTHOP = 9 ++IPV6_AUTHHDR = 10 ++IPV6_UNICAST_HOPS = 16 ++IPV6_MULTICAST_IF = 17 ++IPV6_MULTICAST_HOPS = 18 ++IPV6_MULTICAST_LOOP = 19 ++IPV6_JOIN_GROUP = 20 ++IPV6_LEAVE_GROUP = 21 ++IPV6_ROUTER_ALERT = 22 ++IPV6_MTU_DISCOVER = 23 ++IPV6_MTU = 24 ++IPV6_RECVERR = 25 ++IPV6_RXHOPOPTS = IPV6_HOPOPTS ++IPV6_RXDSTOPTS = IPV6_DSTOPTS ++IPV6_ADD_MEMBERSHIP = IPV6_JOIN_GROUP ++IPV6_DROP_MEMBERSHIP = IPV6_LEAVE_GROUP ++IPV6_PMTUDISC_DONT = 0 ++IPV6_PMTUDISC_WANT = 1 ++IPV6_PMTUDISC_DO = 2 ++SOL_IPV6 = 41 ++SOL_ICMPV6 = 58 ++IPV6_RTHDR_LOOSE = 0 ++IPV6_RTHDR_STRICT = 1 ++IPV6_RTHDR_TYPE_0 = 0 ++ ++# Included from endian.h ++_ENDIAN_H = 1 ++__LITTLE_ENDIAN = 1234 ++__BIG_ENDIAN = 4321 ++__PDP_ENDIAN = 3412 ++ ++# Included from bits/endian.h ++__BYTE_ORDER = __LITTLE_ENDIAN ++__FLOAT_WORD_ORDER = __BYTE_ORDER ++LITTLE_ENDIAN = __LITTLE_ENDIAN ++BIG_ENDIAN = __BIG_ENDIAN ++PDP_ENDIAN = __PDP_ENDIAN ++BYTE_ORDER = __BYTE_ORDER ++ ++# Included from bits/byteswap.h ++_BITS_BYTESWAP_H = 1 ++def __bswap_constant_16(x): return \ ++ ++def __bswap_16(x): return \ ++ ++def __bswap_16(x): return __bswap_constant_16 (x) ++ ++def __bswap_constant_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return \ ++ ++def __bswap_32(x): return __bswap_constant_32 (x) ++ ++def __bswap_constant_64(x): return \ ++ ++def __bswap_64(x): return \ ++ ++def ntohl(x): return (x) ++ ++def ntohs(x): return (x) ++ ++def htonl(x): return (x) ++ ++def htons(x): return (x) ++ ++def ntohl(x): return __bswap_32 (x) ++ ++def ntohs(x): return __bswap_16 (x) ++ ++def htonl(x): return __bswap_32 (x) ++ ++def htons(x): return __bswap_16 (x) ++ ++def IN6_IS_ADDR_UNSPECIFIED(a): return \ ++ ++def IN6_IS_ADDR_LOOPBACK(a): return \ ++ ++def IN6_IS_ADDR_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_V4MAPPED(a): return \ ++ ++def IN6_IS_ADDR_V4COMPAT(a): return \ ++ ++def IN6_IS_ADDR_MC_NODELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_SITELOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ ++ ++def IN6_IS_ADDR_MC_GLOBAL(a): return diff --git a/debian/patches/platform-lsbrelease b/debian/patches/platform-lsbrelease new file mode 100644 index 0000000..d5f3204 --- /dev/null +++ b/debian/patches/platform-lsbrelease @@ -0,0 +1,55 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Use /etc/lsb-release to identify the platform + +Author: Matthias Klose <doko@debian.org> +Bug-Ubuntu: https://bugs.launchpad.net/bugs/196526 +Bug-cpython: http://bugs.python.org/issue1322 +Bug-cpython: http://bugs.python.org/issue9514 +Origin: cpython Debian packaging +Last-Update: 2011-12-19 +--- + lib-python/2.7/platform.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + +diff --git a/lib-python/2.7/platform.py b/lib-python/2.7/platform.py +index 55f2fa8..e4dc14a 100755 +--- a/lib-python/2.7/platform.py ++++ b/lib-python/2.7/platform.py +@@ -290,6 +290,10 @@ def _parse_release_file(firstline): + id = l[1] + return '', version, id + ++_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) ++_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) ++_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) ++ + def linux_distribution(distname='', version='', id='', + + supported_dists=_supported_dists, +@@ -314,6 +318,25 @@ def linux_distribution(distname='', version='', id='', + args given as parameters. + + """ ++ # check for the Debian/Ubuntu /etc/lsb-release file first, needed so ++ # that the distribution doesn't get identified as Debian. ++ try: ++ etclsbrel = open("/etc/lsb-release", "rU") ++ for line in etclsbrel: ++ m = _distributor_id_file_re.search(line) ++ if m: ++ _u_distname = m.group(1).strip() ++ m = _release_file_re.search(line) ++ if m: ++ _u_version = m.group(1).strip() ++ m = _codename_file_re.search(line) ++ if m: ++ _u_id = m.group(1).strip() ++ if _u_distname and _u_version: ++ return (_u_distname, _u_version, _u_id) ++ except (EnvironmentError, UnboundLocalError): ++ pass ++ + try: + etc = os.listdir('/etc') + except os.error: diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..a086409 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,24 @@ +version-info +pep3147-core +pep3147-stdlib +pep3147-issue11254 +test_fsync-eatmydata +test_termios +fpic-archs +skip-test_multiprocessing +ctypes-arm +distutils-link +locale-module +platform-lsbrelease +xdg-gvfs-open +plat-gnukfreebsd +plat-linux2-differences +ensurepip-wheels +ensurepip-disabled +multiarch +distutils-install-layout +langpack-gettext +tkinter-import +noise +skip-hurd-deadlock +arm64-gcc-bug diff --git a/debian/patches/skip-hurd-deadlock b/debian/patches/skip-hurd-deadlock new file mode 100644 index 0000000..47c2ac8 --- /dev/null +++ b/debian/patches/skip-hurd-deadlock @@ -0,0 +1,25 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sun, 26 Aug 2018 14:26:45 +0100 +Subject: Skip test that deadlocks on GNU Hurd + +Per Samuel Thibault: + +> That's probably because pypy uses pthread_mutexes (which per POSIX aren't +> interrupted by signals) instead of semaphores, and I guess that's +> because sem_open isn't supported on Hurd yet. +--- + pypy/module/thread/test/test_lock.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pypy/module/thread/test/test_lock.py b/pypy/module/thread/test/test_lock.py +index b56f08e..4fdd57c 100644 +--- a/pypy/module/thread/test/test_lock.py ++++ b/pypy/module/thread/test/test_lock.py +@@ -241,6 +241,7 @@ class AppTestLockSignals(GenericTestThread): + def w_alarm_interrupt(self, sig, frame): + raise KeyboardInterrupt + ++ @py.test.mark.skipif("sys.platform == 'gnu0'") + def test_lock_acquire_interruption(self): + import thread, signal, time + # Mimic receiving a SIGINT (KeyboardInterrupt) with SIGALRM while stuck diff --git a/debian/patches/skip-test_multiprocessing b/debian/patches/skip-test_multiprocessing new file mode 100644 index 0000000..da62a77 --- /dev/null +++ b/debian/patches/skip-test_multiprocessing @@ -0,0 +1,26 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: Disable test_multiprocessing + +It leaves stray processes. + +Forwarded: not-needed +Last-Updated: 2015-02-11 +--- + lib-python/2.7/test/test_multiprocessing.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib-python/2.7/test/test_multiprocessing.py b/lib-python/2.7/test/test_multiprocessing.py +index ba9caec..cf05b6f 100644 +--- a/lib-python/2.7/test/test_multiprocessing.py ++++ b/lib-python/2.7/test/test_multiprocessing.py +@@ -2,6 +2,9 @@ + # Unit tests for the multiprocessing package + # + ++import unittest ++raise unittest.SkipTest('This test leaves stray processes on buildds. ' ++ 'Disabled for now') + ## FIXME: remove when https://bugs.pypy.org/issue1644 is resolved + import sys + if sys.platform.startswith('freebsd'): diff --git a/debian/patches/test_fsync-eatmydata b/debian/patches/test_fsync-eatmydata new file mode 100644 index 0000000..f68c307 --- /dev/null +++ b/debian/patches/test_fsync-eatmydata @@ -0,0 +1,24 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: Skip fsync tests when building with eatmydata + +Author: Stefano Rivera <stefanor@debian.org> +Forwarded: not-needed +Last-Update: 2012-02-06 +--- + lib-python/2.7/test/test_os.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/lib-python/2.7/test/test_os.py b/lib-python/2.7/test/test_os.py +index 6a06340..c4be901 100644 +--- a/lib-python/2.7/test/test_os.py ++++ b/lib-python/2.7/test/test_os.py +@@ -654,6 +654,8 @@ class TestInvalidFD(unittest.TestCase): + except OSError as e: + self.assertEqual(e.errno, errno.EBADF) + else: ++ if f.__name__.endswith('sync'): ++ return # eatmydata won't raise an OSError + self.fail("%r didn't raise an OSError with a bad file descriptor" + % f) + diff --git a/debian/patches/test_termios b/debian/patches/test_termios new file mode 100644 index 0000000..b0b1890 --- /dev/null +++ b/debian/patches/test_termios @@ -0,0 +1,26 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: Support builds on older aufs + +Under aufs on squeeze, tcgetattr can return EINVAL instead of ENOTTY See +https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=2771 + +Forwarded: not-needed +Last-Update: 2013-02-23 +--- + pypy/module/termios/test/test_termios.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pypy/module/termios/test/test_termios.py b/pypy/module/termios/test/test_termios.py +index 4e01f53..20ffb1e 100644 +--- a/pypy/module/termios/test/test_termios.py ++++ b/pypy/module/termios/test/test_termios.py +@@ -144,7 +144,7 @@ class AppTestTermios(object): + fd = os.open('.', 0) + try: + exc = raises(termios.error, termios.tcgetattr, fd) +- assert exc.value.args[0] == errno.ENOTTY ++ assert exc.value.args[0] in (errno.ENOTTY, errno.EINVAL) + finally: + os.close(fd) + diff --git a/debian/patches/tkinter-import b/debian/patches/tkinter-import new file mode 100644 index 0000000..6622cae --- /dev/null +++ b/debian/patches/tkinter-import @@ -0,0 +1,29 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: suggest installation of pypy-tk package + +On failing _tkinter import. + +Author: Matthias Klose <doko@debian.org> +Author: Stefano Rivera <stefanor@debian.org> +Last-Update: 2013-11-15 +--- + lib-python/2.7/lib-tk/Tkinter.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib-python/2.7/lib-tk/Tkinter.py b/lib-python/2.7/lib-tk/Tkinter.py +index 64e9924..cc1de8b 100644 +--- a/lib-python/2.7/lib-tk/Tkinter.py ++++ b/lib-python/2.7/lib-tk/Tkinter.py +@@ -36,7 +36,10 @@ import sys + if sys.platform == "win32": + # Attempt to configure Tcl/Tk without requiring PATH + import FixTk +-import _tkinter # If this fails your Python may not be configured for Tk ++try: ++ import _tkinter # If this fails your Python may not be configured for Tk ++except ImportError, msg: ++ raise ImportError, str(msg) + ', please install the pypy-tk package' + tkinter = _tkinter # b/w compat for export + TclError = _tkinter.TclError + from types import * diff --git a/debian/patches/version-info b/debian/patches/version-info new file mode 100644 index 0000000..cb13493 --- /dev/null +++ b/debian/patches/version-info @@ -0,0 +1,49 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:57 +0200 +Subject: Get version details from the Debian source package + +Rather than VCS. + +Return the Debian package version in sys.version. +Return null strings in sys._mercurial. + +Forwarded: not-needed +Last-Update: 2013-02-23 +--- + pypy/module/sys/version.py | 1 + + rpython/tool/version.py | 10 ++++++++++ + 2 files changed, 11 insertions(+) + +diff --git a/pypy/module/sys/version.py b/pypy/module/sys/version.py +index 317a0c1..6fe5862 100644 +--- a/pypy/module/sys/version.py ++++ b/pypy/module/sys/version.py +@@ -90,6 +90,7 @@ def get_subversion_info(space): + return space.wrap(('PyPy', '', '')) + + def get_repo_info(space): ++ return space.wrap(('PyPy', '', '')) + info = get_repo_version_info(root=pypyroot) + if info: + repo_tag, repo_version = info +diff --git a/rpython/tool/version.py b/rpython/tool/version.py +index a776f7e..245ab9d 100644 +--- a/rpython/tool/version.py ++++ b/rpython/tool/version.py +@@ -17,6 +17,16 @@ def maywarn(err, repo_type='Mercurial'): + def get_repo_version_info(hgexe=None, root=rpythonroot): + '''Obtain version information by invoking the 'hg' or 'git' commands.''' + ++ # Debian: built from a source tarball ++ p = Popen(('dpkg-parsechangelog',), stdout=PIPE, cwd=rpythonroot) ++ if p.wait() != 0: ++ maywarn(p.stderr.read(), 'dpkg-parsechangelog') ++ return default_retval ++ for line in p.stdout.read().split('\n'): ++ if line.split(':', 1)[0].strip() == 'Version': ++ version = line.split(':', 1)[1].strip() ++ return '', version ++ + # Try to see if we can get info from Git if hgexe is not specified. + if not hgexe: + if os.path.isdir(os.path.join(root, '.git')): diff --git a/debian/patches/xdg-gvfs-open b/debian/patches/xdg-gvfs-open new file mode 100644 index 0000000..a2e9dc8 --- /dev/null +++ b/debian/patches/xdg-gvfs-open @@ -0,0 +1,31 @@ +From: Stefano Rivera <stefanor@debian.org> +Date: Sat, 7 Oct 2017 09:38:58 +0200 +Subject: Use xdg-open/gvfs-open in webbrowser + +Bug-cpython: http://bugs.python.org/issue14493 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/971311 +Origin: cpython, http://hg.python.org/cpython/rev/70c58903b52e +Author: Michael Vogt <michael.vogt@ubuntu.com> +--- + lib-python/2.7/webbrowser.py | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/lib-python/2.7/webbrowser.py b/lib-python/2.7/webbrowser.py +index 2389179..645b3e1 100755 +--- a/lib-python/2.7/webbrowser.py ++++ b/lib-python/2.7/webbrowser.py +@@ -453,6 +453,14 @@ class Grail(BaseBrowser): + + def register_X_browsers(): + ++ # use xdg-open if around ++ if _iscommand("xdg-open"): ++ register("xdg-open", None, BackgroundBrowser("xdg-open")) ++ ++ # The default GNOME3 browser ++ if "GNOME_DESKTOP_SESSION_ID" in os.environ and _iscommand("gvfs-open"): ++ register("gvfs-open", None, BackgroundBrowser("gvfs-open")) ++ + # use xdg-open if around + if _iscommand("xdg-open"): + register("xdg-open", None, BackgroundBrowser("xdg-open")) diff --git a/debian/pypy-dev.install b/debian/pypy-dev.install new file mode 100644 index 0000000..a11bd51 --- /dev/null +++ b/debian/pypy-dev.install @@ -0,0 +1,3 @@ +include/PyPy.h /usr/lib/pypy/include/ +pypy/module/cpyext/include/* /usr/lib/pypy/include/ +pypy/module/cpyext/parse/* /usr/lib/pypy/include/ diff --git a/debian/pypy-doc.doc-base b/debian/pypy-doc.doc-base new file mode 100644 index 0000000..f5ec652 --- /dev/null +++ b/debian/pypy-doc.doc-base @@ -0,0 +1,11 @@ +Document: pypy +Title: PyPy Documentation +Abstract: PyPy is a fast, compliant alternative implementation of the Python language. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/pypy-doc/html/index.html +Files: /usr/share/doc/pypy-doc/html/*.html + +Format: Text +Files: /usr/share/doc/pypy-doc/rst/*.txt diff --git a/debian/pypy-doc.docs b/debian/pypy-doc.docs new file mode 100644 index 0000000..21b2bf7 --- /dev/null +++ b/debian/pypy-doc.docs @@ -0,0 +1 @@ +build-docs/html diff --git a/debian/pypy-doc.links b/debian/pypy-doc.links new file mode 100644 index 0000000..83a8136 --- /dev/null +++ b/debian/pypy-doc.links @@ -0,0 +1 @@ +/usr/share/doc/pypy-doc/html/_sources /usr/share/doc/pypy-doc/rst diff --git a/debian/pypy-lib-testsuite.install b/debian/pypy-lib-testsuite.install new file mode 100755 index 0000000..777a6c8 --- /dev/null +++ b/debian/pypy-lib-testsuite.install @@ -0,0 +1,13 @@ +#!/bin/sh +set -euf + +# Some bits of the test suite (that are used by other packages) +# are in the main stdlib package +find lib-python -type f \ + '(' -path '*/test/*' -o -path '*/tests/*' ')' \ + ! '(' -path '*/test/__init__.py' -o -name pystone.py \ + -o -name regrtest.py -o -name test_support.py ')' \ + ! -path '*/test/data/*.txt' \ + ! -path '*/test/data/*.TXT' \ + ! -path '*/test/data/*.xml' \ + -printf '%p\t/usr/lib/pypy/%h\n' diff --git a/debian/pypy-lib-testsuite.lintian-overrides b/debian/pypy-lib-testsuite.lintian-overrides new file mode 100644 index 0000000..593a3c2 --- /dev/null +++ b/debian/pypy-lib-testsuite.lintian-overrides @@ -0,0 +1,6 @@ +# We intentionally set all shebangs to pypy +pypy-lib-testsuite binary: unusual-interpreter +# These images are used by the test suite. +# The entire stdlib is arch-indep, so probably doesn't belong in /usr/lib, but +# it's easier to keep everything together. +pypy-lib-testsuite binary: image-file-in-usr-lib usr/lib/pypy/lib-python/2.7/test/imghdrdata/* diff --git a/debian/pypy-lib-testsuite.postinst b/debian/pypy-lib-testsuite.postinst new file mode 100644 index 0000000..9bd0236 --- /dev/null +++ b/debian/pypy-lib-testsuite.postinst @@ -0,0 +1,24 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + pypycompile -p pypy-lib-testsuite \ + -X '.*/test/bad(syntax|_coding).*\.py' \ + -X '.*/tests/data/py3_test_grammar\.py' + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy-lib-testsuite.prerm b/debian/pypy-lib-testsuite.prerm new file mode 100644 index 0000000..420f499 --- /dev/null +++ b/debian/pypy-lib-testsuite.prerm @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + if which pypyclean >/dev/null 2>&1; then + pypyclean -p pypy-lib-testsuite + fi + ;; + + deconfigure|upgrade) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy-lib.install b/debian/pypy-lib.install new file mode 100755 index 0000000..860ec93 --- /dev/null +++ b/debian/pypy-lib.install @@ -0,0 +1,23 @@ +#!/bin/sh +set -euf + +cat << EOF +debian/runtime.d /usr/lib/pypy +lib-python/conftest.py /usr/lib/pypy/lib-python +lib-python/stdlib-version.* /usr/lib/pypy/lib-python +lib-python/2.7/test/__init__.py /usr/lib/pypy/lib-python/2.7/test +lib-python/2.7/test/pystone.py /usr/lib/pypy/lib-python/2.7/test +lib-python/2.7/test/regrtest.py /usr/lib/pypy/lib-python/2.7/test +lib-python/2.7/test/test_support.py /usr/lib/pypy/lib-python/2.7/test +site-packages/README /usr/lib/pypy/dist-packages +EOF +find lib_pypy -type f \ + ! -name '*.so' \ + ! -name '*.o' \ + ! -name '*.c' \ + ! -path '*/__pycache__/*' \ + ! -path '*/_tkinter/*' \ + -printf '%p\t/usr/lib/pypy/%h\n' +find lib-python/2.7 -type f \ + ! '(' -path '*/test/*' -o -path '*/tests/*' ')' \ + -printf '%p\t/usr/lib/pypy/%h\n' diff --git a/debian/pypy-lib.lintian-overrides b/debian/pypy-lib.lintian-overrides new file mode 100644 index 0000000..01fc6ec --- /dev/null +++ b/debian/pypy-lib.lintian-overrides @@ -0,0 +1,2 @@ +# We intentionally set all shebangs to pypy +pypy-lib binary: unusual-interpreter diff --git a/debian/pypy-tk.install b/debian/pypy-tk.install new file mode 100644 index 0000000..a336a2f --- /dev/null +++ b/debian/pypy-tk.install @@ -0,0 +1,2 @@ +lib_pypy/_tkinter/*.py /usr/lib/pypy/lib_pypy/_tkinter +lib_pypy/_tkinter/tklib_cffi.*.so /usr/lib/pypy/lib_pypy/_tkinter diff --git a/debian/pypy-tk.postinst b/debian/pypy-tk.postinst new file mode 100644 index 0000000..87ad093 --- /dev/null +++ b/debian/pypy-tk.postinst @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + pypycompile /usr/lib/pypy/lib_pypy/_tkinter + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy-tk.prerm b/debian/pypy-tk.prerm new file mode 100644 index 0000000..8556225 --- /dev/null +++ b/debian/pypy-tk.prerm @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +case "$1" in + remove) + if which pypyclean >/dev/null 2>&1; then + pypyclean /usr/lib/pypy/lib_pypy/_tkinter + fi + ;; + + deconfigure|upgrade) + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy.dirs b/debian/pypy.dirs new file mode 100644 index 0000000..ede5dbe --- /dev/null +++ b/debian/pypy.dirs @@ -0,0 +1,2 @@ +/usr/local/lib/pypy2.7/dist-packages +/usr/share/pypy/ns diff --git a/debian/pypy.install b/debian/pypy.install new file mode 100644 index 0000000..dc2403a --- /dev/null +++ b/debian/pypy.install @@ -0,0 +1,6 @@ +debian/scripts/pypyclean /usr/bin +debian/scripts/pypycompile /usr/bin +include/pypy_*.h /usr/lib/pypy/include +lib_pypy/_*.so /usr/lib/pypy/lib_pypy +pypy/goal/libpypy-c.so /usr/lib/pypy/bin +pypy/goal/pypy-c /usr/lib/pypy/bin diff --git a/debian/pypy.links b/debian/pypy.links new file mode 100644 index 0000000..e507ea2 --- /dev/null +++ b/debian/pypy.links @@ -0,0 +1,2 @@ +/usr/lib/pypy/bin/libpypy-c.so /usr/lib/libpypy-c.so +/usr/lib/pypy/bin/pypy-c /usr/bin/pypy diff --git a/debian/pypy.lintian-overrides b/debian/pypy.lintian-overrides new file mode 100644 index 0000000..fa57b0b --- /dev/null +++ b/debian/pypy.lintian-overrides @@ -0,0 +1,3 @@ +# We link to expat and include none of its symbols, but PyPy thinks that its +# constants are embeddable. +pypy binary: embedded-library usr/lib/pypy/bin/libpypy-c.so: expat diff --git a/debian/pypy.manpages b/debian/pypy.manpages new file mode 100644 index 0000000..9232c1b --- /dev/null +++ b/debian/pypy.manpages @@ -0,0 +1 @@ +build-docs/man/pypy.1 diff --git a/debian/pypy.postinst.in b/debian/pypy.postinst.in new file mode 100644 index 0000000..237fece --- /dev/null +++ b/debian/pypy.postinst.in @@ -0,0 +1,65 @@ +#!/bin/sh + +if [ '#ARCH#' = 'i386' ]; then + pypy -c '' 2>/dev/null + if [ $? -eq 132 ]; then + echo "PyPy doesn't appear to support this CPU." >&2 + echo "SSE2 is required." >&2 + exit 1 + fi +fi + +set -e + +hook() { + local action old new + hook=$1 + action=$2 + old_v=$3 + new_v=$4 + old=pypy + new=pypy + echo "running pypy $action hooks for $new_v" + for script in /usr/lib/pypy/runtime.d/*."$hook"; do + [ -x "$script" ] || continue + if ! "$script" "$action" "$old" "$new"; then + echo >&2 "error running pypy $action hook $(basename "$script")" + return 1 + fi + done +} + +case "$1" in + configure) + if [ -n "$2" ] && dpkg --compare-versions "$2" le 2.2; then + # We weren't running pypyclean in prerm in versions before 2.2 + pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy + fi + + pypycompile -p pypy -p 'pypy-lib:#ARCH#' + + old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') + new_version=$(echo "#VERSION#" | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') + if [ "$old_version" != "$new_version" ]; then + hook rtupdate rtupdate "$old_version" "$new_version" || exit 4 + hook rtupdate post-rtupdate "$old_version" "$new_version" || exit 5 + elif [ -n "$2" ] && dpkg --compare-versions "$2" le 4.0.0+dfsg-1; then + # Force a re-byte-compile. PyPy 4.0.0+dfsg-1 had tag pypy-40, but + # 4.0.0+dfsg-2 goes back to pypy-26 #803689 + /usr/lib/pypy/runtime.d/public_modules.rtupdate rtupdate + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy.preinst.in b/debian/pypy.preinst.in new file mode 100644 index 0000000..ba8724f --- /dev/null +++ b/debian/pypy.preinst.in @@ -0,0 +1,44 @@ +#!/bin/sh + +set -e + +hook() { + local action old new + hook=$1 + action=$2 + old_v=$3 + new_v=$4 + old=pypy + new=pypy + echo "running pypy $action hooks for $new_v" + for script in /usr/lib/pypy/runtime.d/*."$hook"; do + [ -x "$script" ] || continue + if ! "$script" "$action" "$old" "$new"; then + echo >&2 "error running pypy $action hook $(basename "$script")" + return 1 + fi + done +} + +case "$1" in + upgrade) + old_version=$(echo $2 | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') + new_version=$(echo #VERSION# | sed 's/\([[:digit:]]*\.[[:digit:]]*\).*/\1/') + if [ "$old_version" != "$new_version" ]; then + hook rtupdate pre-rtupdate "$old_version" "$new_version" || exit 3 + fi + ;; + + install|abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/pypy.prerm.in b/debian/pypy.prerm.in new file mode 100644 index 0000000..8acf255 --- /dev/null +++ b/debian/pypy.prerm.in @@ -0,0 +1,33 @@ +#!/bin/sh + +if [ '#ARCH#' = 'i386' ]; then + pypy -c '' 2>/dev/null + if [ $? -eq 132 ]; then + echo "PyPy doesn't appear to support this CPU." >&2 + echo "SSE2 is required." >&2 + exit 0 + fi +fi + +set -e + +case "$1" in + remove|deconfigure|upgrade) + # We may have to clean up after pypy-lib-testsuite, too, if we're + # removed before it + pypyclean /usr/lib/pypy/lib-python /usr/lib/pypy/lib_pypy + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 +# vim:set et ts=4 sw=4: diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..4bcd581 --- /dev/null +++ b/debian/rules @@ -0,0 +1,101 @@ +#!/usr/bin/make -f + +# Take advantage of PyPy if it's installed +PYTHON=$(shell command -v pypy > /dev/null && echo pypy || echo python2.7) + +# PyPy doesn't harden well, and handles opt and debug itself +BUILDFLAGS_ENV := DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotector,-fortify +BUILDFLAGS_ENV += DEB_CFLAGS_MAINT_STRIP="-O0 -O1 -O2 -O3 -Os -Ofast -g" +export CFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get CFLAGS) +export LDFLAGS = $(shell $(BUILDFLAGS_ENV) dpkg-buildflags --get LDFLAGS) + +# Our multiarch patch expects DEB_HOST_MULTIARCH +include /usr/share/dpkg/architecture.mk + +%: + dh $@ --with sphinxdoc + +override_dh_auto_configure: + # This rule left intentionally empty + +override_dh_auto_build-arch: pypy/goal/pypy-c + $(MAKE) -C pypy/doc man BUILDDIR=$(CURDIR)/build-docs + + # Build cffi modules + debian/scripts/build-cffi-modules.py + debian/scripts/multiarch-extensions.sh + +override_dh_auto_build-indep: + $(MAKE) -C pypy/doc html BUILDDIR=$(CURDIR)/build-docs + +pypy/goal/pypy-c: + debian/scripts/translate.sh --python $(PYTHON) + +ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) +override_dh_auto_test-arch: export TMPDIR = $(CURDIR)/build-tests-tmp +override_dh_auto_test-arch: export HOME = $(TMPDIR) +override_dh_auto_test-arch: + rm -rf $(TMPDIR) build-tests + mkdir $(TMPDIR) build-tests + # Test failures currently ignored + PYTHONPATH=. $(PYTHON) -u testrunner/runner.py \ + --logfile=build-tests/pytest-A.log \ + --config=pypy/pytest-A.cfg \ + --root=pypy || true + TERM=$${TERM:-dumb} $(PYTHON) -u pypy/test_all.py \ + --pypy=pypy/goal/pypy-c \ + --resultlog=build-tests/lib-python.log \ + lib-python || true + pypy/goal/pypy-c -u pypy/test_all.py \ + --resultlog=build-tests/pypy-c.log \ + pypy/module/pypyjit/test_pypy_c || true +endif + +override_dh_auto_install: + debian/scripts/gen-backend-versions.py + +override_dh_fixperms-arch: + debian/scripts/cleanup-lib.sh pypy-lib + find debian/pypy-tk \( -name '*.pyc' -o -name '__pycache__' \) -delete + # Fix interpreters + find debian/pypy-tk \ + -name '*.py' -print0 \ + | xargs -0 sed -i -e '1s|^#!.*python.*|#!/usr/bin/pypy|' + dh_fixperms -a + +override_dh_fixperms-indep: + debian/scripts/cleanup-lib.sh pypy-lib-testsuite + dh_fixperms -i + +override_dh_sphinxdoc-arch: + # dh_sphinxdoc doesn't fail silently when there are no docs + +override_dh_compress: + dh_compress -X.inv -X.txt + +override_dh_installdeb: + set -e; for maintscript in preinst postinst prerm; do \ + sed -e 's/#VERSION#/$(VER)/g' \ + -e 's/#ARCH#/$(shell dpkg-architecture -qDEB_HOST_ARCH)/g' \ + debian/pypy.$$maintscript.in > debian/pypy.$$maintscript; \ + done + dh_installdeb + +HG_REPO ?= https://bitbucket.org/pypy/pypy +REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*hg([0-9]+).*,\1,p') +VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: (.+)\+dfsg-.*,\1,p' | sed -e 's/~//') +get-packaged-orig-source: + @echo "You can build this from a local repo by supplying the HG_REPO variable" + rm -rf pypy-$(VER).orig + hg clone $(HG_REPO) pypy-$(VER).orig +ifeq (,$(REV)) + cd pypy-$(VER).orig && hg up -r release-pypy2.7-v$(VER) +else + cd pypy-$(VER).orig && hg up -r $(REV) +endif + rm -rf pypy-$(VER).orig/.hg* + rm pypy-$(VER).orig/lib-python/2.7/distutils/command/*.exe + rm -rf pypy-$(VER).orig/lib-python/2.7/ensurepip/_bundled/ + tar -cJ --owner root --group root --mode a+rX \ + -f pypy_$(VER)+dfsg.orig.tar.xz pypy-$(VER).orig + rm -rf pypy-$(VER).orig diff --git a/debian/runtime.d/public_modules.rtupdate b/debian/runtime.d/public_modules.rtupdate new file mode 100755 index 0000000..b96e06d --- /dev/null +++ b/debian/runtime.d/public_modules.rtupdate @@ -0,0 +1,14 @@ +#! /bin/sh +set -e + +if [ "$1" = rtupdate ]; then + if which pypyclean >/dev/null 2>&1; then + pypyclean /usr/lib/pypy/dist-packages + fi + if which pypycompile >/dev/null 2>&1; then + pypycompile /usr/lib/pypy/dist-packages + else + echo >&2 "pypycompile not found in $(basename $0) hook." + exit 1 + fi +fi diff --git a/debian/scripts/build-cffi-modules.py b/debian/scripts/build-cffi-modules.py new file mode 100755 index 0000000..f321aa3 --- /dev/null +++ b/debian/scripts/build-cffi-modules.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +import os +import sys +sys.path.insert(0, '.') + +import py.path + +from pypy.tool.build_cffi_imports import create_cffi_import_libraries + + +class FakeOptions(object): + def __getattr__(self, name): + # Build all the modules + if name.startswith('no_'): + return False + + raise AttributeError() + + +os.environ['LD_LIBRARY_PATH'] = 'pypy/goal' +pypy_c = py.path.local('pypy/goal/pypy-c') +options = FakeOptions() +create_cffi_import_libraries(pypy_c, options, '.') diff --git a/debian/scripts/cleanup-lib.sh b/debian/scripts/cleanup-lib.sh new file mode 100755 index 0000000..a1d0e0e --- /dev/null +++ b/debian/scripts/cleanup-lib.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -euxf + +pkg=$1 + +find debian/$pkg \ + -name '*.pyc' -delete +find debian/$pkg \ + -name '__pycache__' -delete + +# Don't need these, and lintian will make a noise about them +find debian/$pkg \( \ + -name 'regen' \ + -o -name '*.bat' \ + -o -name 'fetch_*' \ + -o -name '*.pickle' \ + \) -delete + +# Remove empty directories, because pypyclean will +find debian/$pkg/usr/lib/pypy/lib-python -type d -empty -delete + +# Nothing in the stdlib should be executable +chmod -R a-x+X debian/$pkg/usr/lib/pypy/lib-python/ +if [ "$pkg" = "pypy-lib" ]; then + chmod -R a-x+X debian/$pkg/usr/lib/pypy/lib_pypy/ +fi + +# Fix interpreters +find debian/$pkg \ + -name '*.py' -print0 \ + | xargs -0 sed -i -e '1s|^#!.*python.*|#!/usr/bin/pypy|' diff --git a/debian/scripts/gen-backend-versions.py b/debian/scripts/gen-backend-versions.py new file mode 100755 index 0000000..9dd5fa8 --- /dev/null +++ b/debian/scripts/gen-backend-versions.py @@ -0,0 +1,74 @@ +#!/usr/bin/python + +import codecs +import os +import re +import subprocess + + +def cffi_version(): + with codecs.open('lib_pypy/cffi/__init__.py', encoding='UTF-8') as f: + for line in f: + m = re.match(r'^__version__ = "([0-9.]+)"$', line) + if m: + return m.group(1) + raise Exception('Version not found') + + +def target_version(): + with codecs.open('lib_pypy/cffi/recompiler.py', encoding='UTF-8') as f: + for line in f: + m = re.match(r'^VERSION_CHAR16CHAR32 = (0x[0-9A-F]+)$', line) + if m: + return int(m.group(1), 16) + raise Exception('Version not found') + + +def backend_supported_versions(): + versions = {} + with codecs.open('pypy/module/_cffi_backend/cffi1_module.py', + encoding='UTF-8') as f: + for line in f: + m = re.match(r'^VERSION_(MIN|MAX) *= (0x[0-9A-F]+)$', + line) + if m: + versions[m.group(1)] = int(m.group(2), 16) + if len(versions) == 2: + return versions['MIN'], versions['MAX'] + raise Exception('Versions not found') + + +def pypy_abi(): + if 'pypy' not in subprocess.check_output(('dh_listpackages',)).split(): + return '' + soabi = subprocess.check_output(( + 'pypy/goal/pypy-c', '-c', + 'import sysconfig; print sysconfig.get_config_var("SOABI")')) + return soabi.strip().replace('-', '-abi-') + + +cffi = cffi_version() +versions = backend_supported_versions() +target = target_version() + +subst = { + 'cffi': cffi, + 'min': versions[0], + 'max': versions[1], + 'target': target, +} +with codecs.open('debian/pypy-lib.substvars', 'a', encoding='UTF-8') as f: + f.write('cffi:Provides=pypy-cffi (= {cffi}), ' + 'pypy-cffi-backend-api-min (= {min}), ' + 'pypy-cffi-backend-api-max (= {max}), ' + 'pypy-cffi-backend-api-{target}\n'.format(**subst)) + +with codecs.open('debian/pypy.substvars', 'a', encoding='UTF-8') as f: + f.write('pypy-abi={}\n'.format(pypy_abi())) + +path = 'debian/pypy-lib/usr/share/pypy/dist' +os.makedirs(path) +with codecs.open(os.path.join(path, 'pypy-cffi'), 'w', encoding='UTF-8') as f: + f.write('cffi pypy-cffi-backend-api-min (<= {target}), ' + 'pypy-cffi-backend-api-max (>= {target})\n' + .format(**subst)) diff --git a/debian/scripts/multiarch-extensions.sh b/debian/scripts/multiarch-extensions.sh new file mode 100755 index 0000000..d396eb4 --- /dev/null +++ b/debian/scripts/multiarch-extensions.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +# Rename libraries to fully-qualified multiarch filenames. + +set -euf + +# Skip if we built without multiarch (backport-friendly) +if ! pypy/goal/pypy-c -c 'import sys; sys.exit(0 if hasattr(sys, "_multiarch") else 1)'; then + exit 0 +fi + +find lib_pypy -name '*.so' | while read extension; do + if echo "$extension" | grep -q '\.pypy-[0-9]*[a-z]*\.so'; then + dest="${extension%.so}-${DEB_HOST_MULTIARCH}.so" + mv "$extension" "$dest" + fi +done diff --git a/debian/scripts/pypyclean b/debian/scripts/pypyclean new file mode 100755 index 0000000..83c8907 --- /dev/null +++ b/debian/scripts/pypyclean @@ -0,0 +1,200 @@ +#!/usr/bin/pypy + +import argparse +import collections +import itertools +import os +import shutil +import subprocess +import sys + + +def abort(message): + print >> sys.stderr, message + sys.exit(1) + + +def package_modules(package): + '''Iterate through all python modules in an installed Debian package''' + p = subprocess.Popen(('dpkg', '-L', package), stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + files, stderr = p.communicate() + if p.returncode != 0: + abort('Unable to list files in %s. Is it installed?' % package) + + for fn in files.splitlines(): + if fn.endswith('.py'): + if fn.startswith('/usr/share/doc/'): + continue + yield fn + + +def installed_namespaces(): + '''Return a dictionary of package: frozenset(namespaces)''' + ns_dir = '/usr/share/pypy/ns' + ns_by_pkg = {} + for pkg in os.listdir(ns_dir): + ns_file = os.path.join(ns_dir, pkg) + with open(ns_file) as f: + contents = f.read().decode('utf-8').strip() + namespaces = [line.strip() for line in contents.splitlines()] + ns_by_pkg[pkg] = frozenset(namespaces) + return ns_by_pkg + + +def cleanup_namespaces(package, verbose): + '''Check if a namespace is still being used and, if not: + Remove the __init__.py. + Remove any pycs related to it. + ''' + ns_by_pkg = installed_namespaces() + pkg_namespaces = ns_by_pkg.pop(package, None) + if not pkg_namespaces: + return + foreign_namespaces = reduce(lambda a, b: a | b, ns_by_pkg.values(), set()) + orphan_namespaces = pkg_namespaces - foreign_namespaces + inits_to_remove = [] + for namespace in orphan_namespaces: + init = os.path.join('/usr/lib/pypy/dist-packages', + namespace.replace('.', '/'), + '__init__.py') + if not os.path.exists(init): + print 'Missing namespace init: %s' % init + continue + if os.path.getsize(init) != 0: + print 'Non-empty init, ignoring: %s' % init + continue + inits_to_remove.append(init) + + clean_modules(inits_to_remove, verbose) + for init in inits_to_remove: + os.unlink(init) + + +def cleanup_package_modules(package, verbose): + '''Iterate through all python modules in an installed Debian package that + were in /usr/share/doc/, and previously byte-compiled by + pypy << 6.0.0+dfsg-2. See #904521 + + Can be removed once every pypy library has been re-uploaded, since this was + added. + ''' + p = subprocess.Popen(('dpkg', '-L', package), stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + files, stderr = p.communicate() + if p.returncode != 0: + abort('Unable to list files in %s. Is it installed?' % package) + + modules = [ + fn for fn in files.splitlines() + if fn.startswith('/usr/share/doc/') and fn.endswith('.py')] + + try: + clean_modules(modules, verbose) + except IOError as e: + if e.errno != errno.ENOENT: + raise + + +def find_modules(root): + '''Iterate through all python modules in directory tree root''' + if os.path.isfile(root): + yield root + return + + for dirpath, dirnames, filenames in os.walk(root): + for fn in filenames: + if fn.endswith('.py'): + yield os.path.join(dirpath, fn) + + +def clean_modules(modules, verbose): + '''Remove all .pyc files for every module specified''' + clean = collections.defaultdict(list) + for module in modules: + dir_, basename = os.path.split(module) + clean[dir_].append(os.path.splitext(basename)[0]) + + for dir_, basenames in clean.iteritems(): + pycache = os.path.join(dir_, '__pycache__') + if not os.path.exists(pycache): + continue + + empty = True + for fn in os.listdir(pycache): + if fn.endswith('.pyc') and fn.rsplit('.', 2)[0] in basenames: + if verbose: + print 'Removing %s' % os.path.join(pycache, fn) + os.unlink(os.path.join(pycache, fn)) + else: + empty = False + + if empty: + if verbose: + print 'Pruning %s' % pycache + os.rmdir(pycache) + + +def clean_directories(directories, verbose): + '''Indiscriminately remove __pycache__ directories''' + for root in directories: + for dirpath, dirnames, filenames in os.walk(root): + for dir_ in dirnames: + if dir_ == '__pycache__': + if verbose: + print 'Removing %s' % os.path.join(dirpath, dir_) + shutil.rmtree(os.path.join(dirpath, dir_)) + + +def main(): + parser = argparse.ArgumentParser( + description='Remove byte-compiled files for a package') + parser.add_argument('-p', '--package', metavar='PACKAGE', + action='append', default=[], + help='Debian package to byte-compile ' + '(may be specified multiple times)') + parser.add_argument('directory', nargs='*', + help='Directory tree (or file) to byte-compile') + parser.add_argument('-v', '--verbose', action='store_true', + help='Be more verbose') + parser.add_argument('-q', '--quiet', action='store_true', + help='Be quiet') + args = parser.parse_args() + + if not (args.package or args.directory): + parser.error('Either a package or a directory must be specified') + if args.quiet and args.verbose: + parser.error('--quiet and --verbose cannot both be specified') + + modules_p = set(itertools.chain(*( + package_modules(package) for package in args.package))) + modules_d = set(itertools.chain(*( + find_modules(dir_) for dir_ in args.directory))) + + if args.package and args.directory: + modules = modules_d & modules_p + elif args.package: + modules = modules_p + else: + # Split files from directories, so that we can completely clean any + # specified directories. + modules = set() + directories = set() + for fn in args.directory: + if os.path.isfile(fn) and fn.endswith('.py'): + modules.add(fn) + else: + directories.add(fn) + clean_directories(directories, args.verbose) + + clean_modules(modules, args.verbose) + + for package in args.package: + cleanup_namespaces(package, args.verbose) + cleanup_package_modules(package, args.verbose) + + +if __name__ == '__main__': + main() + +# vim: ft=python diff --git a/debian/scripts/pypycompile b/debian/scripts/pypycompile new file mode 100755 index 0000000..31abe2d --- /dev/null +++ b/debian/scripts/pypycompile @@ -0,0 +1,129 @@ +#!/usr/bin/pypy + +import argparse +import itertools +import os +import re +import py_compile +import subprocess +import sys + + +def abort(message): + print >> sys.stderr, message + sys.exit(1) + + +def package_modules(package): + '''Iterate through all python modules in an installed Debian package''' + p = subprocess.Popen(('dpkg', '-L', package), stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + files, stderr = p.communicate() + if p.returncode != 0: + abort('Unable to list files in %s. Is it installed?' % package) + + for fn in files.splitlines(): + if fn.endswith('.py'): + if fn.startswith('/usr/share/doc/'): + continue + yield fn + + +def find_modules(root): + '''Iterate through all python modules in directory tree root''' + if os.path.isfile(root): + yield root + return + + for dirpath, dirnames, filenames in os.walk(root): + for fn in filenames: + if fn.endswith('.py'): + yield os.path.join(dirpath, fn) + + +def generate_namespace_init(package, verbose): + '''Iterate through a package's ns file. + Create all necessary__init__.pys, and yield them. + ''' + ns_file = os.path.join('/usr/share/pypy/ns', package) + if not os.path.exists(ns_file): + return + with open(ns_file) as f: + contents = f.read().decode('utf-8').strip() + namespaces = [line.strip() for line in contents.splitlines()] + + for namespace in namespaces: + init = os.path.join('/usr/lib/pypy/dist-packages', + namespace.replace('.', '/'), + '__init__.py') + if verbose: + print 'Ensuring %s exists' % init + with open(init, 'w') as f: + pass + yield init + + +def main(): + parser = argparse.ArgumentParser( + description='Byte-compile Python source files in a package, for PyPy') + parser.add_argument('-p', '--package', metavar='PACKAGE', + action='append', default=[], + help='Debian package to byte-compile ' + '(may be specified multiple times)') + parser.add_argument('directory', nargs='*', + help='Directory tree (or file) to byte-compile') + parser.add_argument('-X', '--exclude', metavar='REGEXPR', + action='append', default=[], type=re.compile, + help='Exclude items that match given REGEXPR ' + '(may be specified multiple times)') + parser.add_argument('-v', '--verbose', action='store_true', + help='Be more verbose') + parser.add_argument('-q', '--quiet', action='store_true', + help='Be quiet') + parser.add_argument('-V', metavar='VRANGE', dest='vrange', + help=argparse.SUPPRESS) + parser.add_argument('-O', action='store_true', dest='pyo', + help=argparse.SUPPRESS) + args = parser.parse_args() + + if not (args.package or args.directory): + parser.error('Either a package or a directory must be specified') + if args.quiet and args.verbose: + parser.error('--quiet and --verbose cannot both be specified') + + if args.vrange: + print >> sys.stderr, '-V is ignored in pypycompile' + if args.pyo: + print >> sys.stderr, '-O is ignored in pypycompile' + + modules_p = set(itertools.chain(*( + package_modules(package) for package in args.package))) + modules_d = set(itertools.chain(*( + find_modules(dir_) for dir_ in args.directory))) + + if args.package and args.directory: + modules = modules_d & modules_p + else: + modules = modules_d | modules_p + + for package in args.package: + modules |= set(generate_namespace_init(package, verbose=args.verbose)) + + modules = filter(lambda module: not any(pattern.match(module) + for pattern in args.exclude), + modules) + + for module in modules: + if args.verbose: + print 'Byte-compiling %s' % module + try: + py_compile.compile(module, doraise=True) + except py_compile.PyCompileError as e: + if not args.quiet: + print >> sys.stderr, ('Failed to byte-compile %s: %s' + % (module, e.msg)) + +if __name__ == '__main__': + main() + +# vim: ft=python diff --git a/debian/scripts/timeout-inactive.py b/debian/scripts/timeout-inactive.py new file mode 100755 index 0000000..d865fc8 --- /dev/null +++ b/debian/scripts/timeout-inactive.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python + +import argparse +import re +import signal +import subprocess +import sys +import threading + + +def main(): + p = argparse.ArgumentParser( + description='Run a program, and kill it if it is silent for too long.' + 'After the arguments, specify the program to run prefixed ' + 'with -- .') + p.add_argument('--timeout', type=parse_timeout, + help='Timeout (in seconds, if no unit specified') + + our_args = sys.argv[1:] + cmd = [] + if '--' in our_args: + index = our_args.index('--') + cmd = our_args[index + 1:] + our_args = our_args[:index] + + args = p.parse_args(our_args) + if not cmd: + p.error('No command specified') + + run_cmd(cmd, args.timeout) + + +def parse_timeout(arg): + m = re.match(r'(\d+) *(s(ec(ond)?s?)?|m(in(ute)?s?)?|h((ou)?rs?)?)?', arg) + if not m: + raise argparse.ArgumentTypeError('Un-parseable time') + value = int(m.group(1)) + unit = m.group(2) + if unit: + unit = unit[0] + if unit == 'm': + return value * 60 + if unit == 'h': + return value * 60 * 60 + return value + + +def run_cmd(cmd, timeout): + p = subprocess.Popen(cmd, bufsize=1, stdout=subprocess.PIPE) + watchdog = Watchdog(timeout, p) + watchdog.start() + while True: + line = p.stdout.readline() + watchdog.event.set() + sys.stdout.write(line) + sys.stdout.flush() + if p.poll() != None: + sys.exit(p.returncode) + + +class Watchdog(threading.Thread): + def __init__(self, timeout, process): + super(Watchdog, self).__init__() + self.daemon = True + self.timeout = timeout + self.process = process + self.event = threading.Event() + + def run(self): + while True: + ev = self.event.wait(self.timeout) + if ev is True: + self.event.clear() + else: + sys.stderr.write( + '\nTimed out after {} seconds of inactivity...\n' + .format(self.timeout)) + sys.stderr.flush() + self.process.send_signal(signal.SIGINT) + return + + +if __name__ == '__main__': + main() diff --git a/debian/scripts/translate.sh b/debian/scripts/translate.sh new file mode 100755 index 0000000..ab01086 --- /dev/null +++ b/debian/scripts/translate.sh @@ -0,0 +1,121 @@ +#!/bin/sh +# Determine the translation options and translate + +set -e -u + +usage() { + name=$(basename $0) + echo <<EOF +Usage: $name [options...]" +Options: + --python=PYTHON Use PYTHON to tranlate PyPy + +EOF +} + +PYTHON=python + +while [ $# -ge 1 ]; do + case "$1" in + --python) + PYTHON="$2" + shift + ;; + --help|-h) + usage + exit 0 + ;; + *) + echo "Unkown option: $1" >&2 + usage + exit 1 + ;; + esac + shift +done + +RPYOPTS="--batch --source" +TARGETOPTS="" + +OPT=3 +if echo "$DEB_BUILD_OPTIONS" | egrep -q '\bnoopt\b'; then + OPT=0 +elif dpkg-architecture -iany-i386; then + OPT=jit + #RPYOPTS="$RPYOPTS --jit-backend=x86-without-sse2" +elif dpkg-architecture -iany-amd64; then + # No JIT on x32 + if ! dpkg-architecture -elinux-x32; then + OPT=jit + fi +elif dpkg-architecture -iany-arm; then + # No JIT support for ARMv5 + if ! dpkg-architecture -elinux-armel; then + OPT=jit + fi +elif dpkg-architecture -iany-arm64; then + OPT=jit +elif dpkg-architecture -iany-ppc64el || dpkg-architecture -iany-ppc64; then + OPT=jit +elif dpkg-architecture -iany-s390x; then + OPT=jit +fi +RPYOPTS="$RPYOPTS --opt=$OPT --shared" + +if [ $OPT = 3 ]; then + RPYOPTS="$RPYOPTS --no-profopt" +fi + +CONTINUATION=0 +if dpkg-architecture -iany-i386 \ + || dpkg-architecture -iany-amd64 \ + || dpkg-architecture -iany-arm \ + || dpkg-architecture -iany-arm64 \ + || dpkg-architecture -iany-mips64el \ + || dpkg-architecture -iany-ppc64 \ + || dpkg-architecture -iany-ppc64el \ + || dpkg-architecture -iany-s390x; then + CONTINUATION=1 +fi +if [ $CONTINUATION -eq 0 ]; then + TARGETOPTS="$TARGETOPTS --withoutmod-_continuation" +fi + +if dpkg-architecture --is kfreebsd-any; then + # No support for F_GETPATH + TARGETOPTS="$TARGETOPTS --withoutmod-_vmprof" +fi + +if dpkg-architecture -iany-s390x; then + # Target the oldest s390x supported by upstream + export CFLAGS="$CFLAGS -march=z10" +fi + +if echo "$PYTHON" | grep -Fq pypy; then + if [ $(dpkg-architecture -q DEB_HOST_ARCH_BITS) -eq 32 ]; then + export PYPY_GC_MAX_DELTA=200MB + PYTHON="$PYTHON --jit loop_longevity=300" + fi +fi + +CURDIR=$(pwd) +RPYTHON=$CURDIR/rpython/bin/rpython +TMPDIR=$CURDIR/build-tmp +PYPY_USESSION_BASENAME=debian +C_SRC_DIR=$TMPDIR/usession-$PYPY_USESSION_BASENAME-0/testing_1 +SUB_MAKEFLAGS=$(echo ${DEB_BUILD_OPTIONS:-} | tr ' ' '\n' | sed -ne 's/parallel=/-j/p') + +set -x +export TMPDIR PYPY_USESSION_BASENAME +rm -rf "$TMPDIR" +mkdir "$TMPDIR" + +cd pypy/goal +$PYTHON -u $RPYTHON $RPYOPTS targetpypystandalone $TARGETOPTS 2>&1 +cd "$CURDIR" + +# PyPy captures all make output, so we call it ourselves (--source), to save +# memory and avoid timeouts: +make -C $C_SRC_DIR $SUB_MAKEFLAGS + +cp $C_SRC_DIR/pypy-c $C_SRC_DIR/libpypy-c.so pypy/goal diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..b5ecd3c --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,15 @@ +Test-Command: echo 'print "Hello"' | pypy | grep Hello +Depends: pypy +Restrictions: superficial + +Test-Command: pypy -c 'print "Hello"' | grep Hello +Depends: pypy +Restrictions: superficial + +Test-Command: pypy -c 'import os.path' +Depends: pypy +Restrictions: superficial + +Test-Command: pypy -c 'import Tkinter' +Depends: pypy-tk +Restrictions: superficial diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..17bc660 --- /dev/null +++ b/debian/watch @@ -0,0 +1,6 @@ +version=3 + +# To repack, run debian/rules get-packaged-orig-source +opts=dversionmangle=s/\+dfsg// \ + https://bitbucket.org/pypy/pypy/downloads/ \ + pypy2.7-v([0-9.]+)-src\.tar\.bz2 |