python-defaults-2.7.17/0000755000000000000000000000000013606370103011623 5ustar python-defaults-2.7.17/Makefile0000644000000000000000000000410713305600173013264 0ustar #!/usr/bin/make -f INSTALL ?= install PREFIX ?= /usr/local MANPAGES ?= dh_python2.1 pycompile.1 pyclean.1 clean: make -C tests clean make -C pydist clean find . -name '*.py[co]' -delete rm -f .coverage install-dev: $(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/bin \ $(DESTDIR)$(PREFIX)/share/python/runtime.d \ $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts/ \ $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/ $(INSTALL) -m 755 runtime.d/* $(DESTDIR)$(PREFIX)/share/python/runtime.d/ $(INSTALL) -m 644 autoscripts/* $(DESTDIR)$(PREFIX)/share/debhelper/autoscripts/ $(INSTALL) -m 755 dh_python2 $(DESTDIR)$(PREFIX)/share/python/ $(INSTALL) -m 755 dh_python2.py $(DESTDIR)$(PREFIX)/bin/dh_python2 $(INSTALL) -m 644 python2.pm $(DESTDIR)$(PREFIX)/share/perl5/Debian/Debhelper/Sequence/ install-runtime: $(INSTALL) -m 755 -d $(DESTDIR)$(PREFIX)/share/python/debpython $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 644 debpython/*.py $(DESTDIR)$(PREFIX)/share/python/debpython/ $(INSTALL) -m 755 pycompile $(DESTDIR)$(PREFIX)/bin/ $(INSTALL) -m 755 pyclean $(DESTDIR)$(PREFIX)/bin/ install: install-dev install-runtime dist_fallback: make -C pydist $@ check_versions: @set -e;\ DEFAULT=`sed -rn 's,^DEFAULT = \(([0-9]+)\, ([0-9]+)\),\1.\2,p' debpython/version.py`;\ SUPPORTED=`sed -rn 's,^SUPPORTED = \[\(([0-9]+)\, ([0-9]+)\)\, \(([0-9]+)\, ([0-9]+)\)\],\1.\2 \3.\4,p' debpython/version.py`;\ DEB_DEFAULT=`sed -rn 's,^default-version = python([0-9.]*),\1,p' debian/debian_defaults`;\ DEB_SUPPORTED=`sed -rn 's|^supported-versions = (.*)|\1|p' debian/debian_defaults | sed 's/python//g;s/,//g'`;\ [ "$$DEFAULT" = "$$DEB_DEFAULT" ] || \ (echo "Please update DEFAULT in debpython/version.py ($$DEFAULT vs. $$DEB_DEFAULT)" >/dev/stderr; false);\ [ "$$SUPPORTED" = "$$DEB_SUPPORTED" ] || \ (echo "Please update SUPPORTED in debpython/version.py ($$SUPPORTED vs. $$DEB_SUPPORTED)" >/dev/stderr; false) pdebuild: pdebuild --debbuildopts -I # TESTS nose: nosetests --with-doctest --with-coverage tests: nose make -C tests test%: make -C tests $@ .PHONY: clean tests test% check_versions python-defaults-2.7.17/README.derivatives0000644000000000000000000000273613305600173015036 0ustar How to change a list of supported Python versions? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Open debian/debian_defaults file and change `supported-versions` variable * Open debian/control.in file and edit python-all, python-all-dev and python-all-dbg's Depends line (add or remove pythonX.Y packages) * Open debian/pyversions.py file and edit `_supported_versions` list around line 141 * Open debpython/version.py file and edit `SUPPORTED` list around line 26 How to change default Python version? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Open debian/debian_defaults file and change `default-version` variable * Open debian/rules file and edit `VER` variable (default version), `NVER` (default + 1 version) and `PVER` (default version with "python" prefix) * Open debian/pyversions.py file and edit `debian_default` variable around line 171 * Open debpython/version.py file and edit `DEFAULT` variable around line 27 How to bump minimum required Python version by dh_python2? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Open debpython/depends.py file and edit `MINPYCDEP` variable around line 26 How to regenerate dist_fallback file for dh_python2? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please note that we recommend to extend this file instead (i.e. removing items from it can break other packages' dependencies) * Update pydist/sources.list file to point to your distro/suit * Remove pydist/dist_fallback file * Run `make dist_fallback` python-defaults-2.7.17/autoscripts/0000755000000000000000000000000013305600173014202 5ustar python-defaults-2.7.17/autoscripts/postinst-pycompile0000644000000000000000000000011313305600173020002 0ustar if which pycompile >/dev/null 2>&1; then pycompile -p #PACKAGE# #ARGS# fi python-defaults-2.7.17/autoscripts/preinst-pycentral-clean0000644000000000000000000000035113305600173020667 0ustar # make sure python-central files are removed before new package is installed if [ "$1" = upgrade ] && [ -f /var/lib/pycentral/#PACKAGE#.pkgremove ] then pycentral pkgremove #PACKAGE# rm -f /var/lib/pycentral/#PACKAGE#.pkgremove fi python-defaults-2.7.17/autoscripts/prerm-pyclean0000644000000000000000000000025513305600173016705 0ustar if which pyclean >/dev/null 2>&1; then pyclean -p #PACKAGE# #ARGS# else dpkg -L #PACKAGE# | grep '\.py$' | while read file do rm -f "${file}"[co] >/dev/null done fi python-defaults-2.7.17/debian/0000755000000000000000000000000013632676433013063 5ustar python-defaults-2.7.17/debian/.#changelog.rej0000777000000000000000000000000013632676433021565 2xnox@ottawa.5940:1584011608ustar python-defaults-2.7.17/debian/README.Debian0000644000000000000000000000071613305600173015111 0ustar More documentation and README's for this package can be found in the directory /usr/share/doc/python2.7/ The upstream documentation can be found after installation of the python-doc package in the directory /usr/share/doc/python/html A draft of the "Debian Python Policy", mostly needed for Debian package maintainers can be found in /usr/share/doc/python3 Sometime it will be moved to /usr/share/doc/debian-policy in the debian-policy package. python-defaults-2.7.17/debian/changelog0000644000000000000000000015312213632676433014741 0ustar python-defaults (2.7.17-2ubuntu4) focal; urgency=medium * Correct command-not-found XB-Cnf headers LP: #1867157: - Drop Extra-Commands headers, not needed - Add XB- to ensure Visible-Pkgname actually is included in the binary package heders -- Dimitri John Ledkov Fri, 13 Mar 2020 12:31:23 +0000 python-defaults (2.7.17-2ubuntu3) focal; urgency=medium * No-change rebuild with fixed binutils on arm64. -- Matthias Klose Sat, 08 Feb 2020 11:18:15 +0000 python-defaults (2.7.17-2ubuntu2) focal; urgency=medium * dh_python2: Rewrite shebangs to python2, generate dependencies on python2. -- Matthias Klose Sat, 11 Jan 2020 16:56:51 +0100 python-defaults (2.7.17-2ubuntu1) focal; urgency=medium * Stop building the python, python-dev, python-dbg, python-doc, python-minimal, libpython-dev, libpython-dbg, libpython-stdlib packages. -- Matthias Klose Mon, 06 Jan 2020 12:02:01 +0100 python-defaults (2.7.17-2) unstable; urgency=medium * dh_python2.py: Use python2 in the shebang. Closes: #944894. -- Matthias Klose Mon, 18 Nov 2019 07:36:33 +0100 python-defaults (2.7.17-1) unstable; urgency=medium * Bump version to 2.7.17. * Bump standards version. * Bump debhelper compat for the tests to 9. -- Matthias Klose Thu, 10 Oct 2019 13:32:13 +0200 python-defaults (2.7.16-1) unstable; urgency=medium * Bump version to 2.7.16. -- Matthias Klose Mon, 04 Mar 2019 16:48:56 +0100 python-defaults (2.7.15-4) unstable; urgency=medium [ Matthias Klose ] * Fix some lintian warnings. * Fix typo in dh_python2(1) (Chris Lamb). Closes: #901079. * Bump standards version. * python-minimal: Make the python-central conflict unversioned. Closes: #910234. [ Scott Kitterman ] * Remove myself from uploaders -- Matthias Klose Fri, 18 Jan 2019 11:56:03 +0100 python-defaults (2.7.15-3) unstable; urgency=medium * Fix pyversions -d invocation. Closes: #900983. -- Matthias Klose Thu, 07 Jun 2018 18:57:11 +0200 python-defaults (2.7.15-2) unstable; urgency=medium * Don't install the pyclean and pycompile manpages in python-minimal. * Don't install dh_python2 manpage in python. * Remove unused xsl files, remove unused code in the rules file. -- Matthias Klose Wed, 06 Jun 2018 23:25:58 +0200 python-defaults (2.7.15-1) unstable; urgency=medium * Bump version to 2.7.15. * Split out a set of python2 packages, and let the python packages depend on it. No changes for the "-all" packages. * Update Vcs attributes. * Remove Barry Warsaw as uploader. * Remove the FAQ for Python2. * Remove the Debian Python policy, now found in the python3 package. -- Matthias Klose Wed, 06 Jun 2018 18:35:07 +0200 python-defaults (2.7.15~rc1-1) unstable; urgency=medium * Bump version to 2.7.15~rc1. * debian/control.in (Michael Vogt): - add Cnf-Visible-Pkgname hint to ensure command-not-found recommends installing "python" instead of "python-minimal" when it is missing. -- Matthias Klose Mon, 16 Apr 2018 16:31:18 +0200 python-defaults (2.7.14-4) unstable; urgency=medium * Stop building the python-examples and idle2 packages. * python: Stop shipping the 2to3 symlink (now in the 2to3 package). -- Matthias Klose Wed, 13 Dec 2017 23:39:49 +0100 python-defaults (2.7.14-3) unstable; urgency=medium * Stop using priority extra for the -dbg packages. * pycompile, pyclean, pyversions: Use python2 as the shebang to guard against people fiddling around with the python symlink or having a python3 installed as python in /usr/local. Closes: #864599. LP: #1715062. * Rename the idle package to idle2. idle is now built for python3. * Fix quoting in the prerm-clean autoscript. Closes: #815134. * README.Debian: Reference 2.7 and point to the python3 package for the Debian Python Policy. * Mark python-examples as M-A: foreign. -- Matthias Klose Fri, 08 Dec 2017 10:56:48 +0100 python-defaults (2.7.14-1) unstable; urgency=medium * Bump version to 2.7.14. * python-examples: Fix Multi-Arch warning. * Change policy format from debiandoc SGML to DocBook/XML (W. Martin Borgert). Closes: #872421. -- Matthias Klose Mon, 18 Sep 2017 10:17:15 +0200 python-defaults (2.7.13-2) unstable; urgency=medium [ Matthias Klose ] * Lower priority of packages from standard to optional. [ Scott Kitterman ] * Make another attempt at Django specific binary naming -- Matthias Klose Tue, 24 Jan 2017 14:00:42 +0100 python-defaults (2.7.13-1) unstable; urgency=medium [ Matthias Klose ] * Bump version to 2.7.13. * Mark python-doc as M-A: foreign. * Bump debhelper version. [ Helmut Grohne ] * Fix FTCBFS: Annotate python build dependencies with :any (Closes: #841682) [ Chris Lamb ] * Consistently order python substvars to support reproducibility (Closes: #844111) [ Scott Kitterman ] * Add Django specific binary naming policy to align to current practice. -- Matthias Klose Tue, 20 Dec 2016 11:15:12 +0100 python-defaults (2.7.11-2) unstable; urgency=medium [ Scott Kitterman ] * Python policy updates for Stretch (Many thanks to Ben Finney for all the updates) - Change focus in text to python3 - Remove/deprecate features no longer needed due to only a single Python 2 version - Discuss update process in more detail - Revamp tools section to better align to current practice [ Matthias Klose ] * Update valgrind suppression file. Issue #12612. LP: #1512622. * Rebuild to pick up the GNU triplet change on i386 archs. Addresses: #826128. -- Matthias Klose Fri, 03 Jun 2016 01:29:55 +0200 python-defaults (2.7.11-1) unstable; urgency=medium * Bump version to 2.7.11. * Stop shipping menu files. * Fix some lintian warnings. -- Matthias Klose Wed, 09 Dec 2015 13:07:35 +0100 python-defaults (2.7.9-1) unstable; urgency=medium * Bump version to 2.7.9. -- Matthias Klose Mon, 16 Mar 2015 23:32:04 +0100 python-defaults (2.7.8-4) unstable; urgency=medium [ Barry Warsaw ] * Update policy document to clarify the purpose and use of the wheel files. No actual change in policy is made. -- Scott Kitterman Mon, 02 Mar 2015 15:45:19 -0500 python-defaults (2.7.8-3) unstable; urgency=medium [ Michael Gilbert ] * Make python-minimal a pre-dependency for python (closes: #769106). -- Scott Kitterman Mon, 02 Feb 2015 16:12:38 -0500 python-defaults (2.7.8-2) unstable; urgency=medium [ Matthias Klose ] * Build-depend on python2.7 and dpkg-dev versions to consistently generate the i586-* symlinks. Closes: #758301. [ Piotr Ożarowski ] * dh_python2: add a warning abount missing dh-python in Build-Depends [ Scott Kitterman ] * Minor updates to python policy - Reflect disuse of pyshared directory in favor of /usr/lib/python2.7/ dist-packages since python2.7 is the last and only python version supported (Closes: #763451) - Update python-central information to reflect its removal from Jessie -- Scott Kitterman Fri, 24 Oct 2014 10:58:42 -0400 python-defaults (2.7.8-1) unstable; urgency=medium [ Barry Warsaw ] * Fix typo in policy doc re: wheel package exception list. * Add myself to Uploaders. [ Scott Kitterman ] * Fix error in pydist package relationship regex (Closes: #735163) - Thanks to Rafael Laboissiere for the patch * Switch from using lsb-release to dpkg-vendor to determine distro and drop lsb-release from build-depends (Closes: #751706) - Thanks to Peter Pentchev for the patch * Drop unused build-depends on libhtml-tree-perl * Clarify discussion of requirement to use python:Provides (Closes: #669346) * Add clarification of naming requirements for submocules (Closes: #701192) * Minor cleanups in debian/pyversions.py * Stop automatically regenerating static content (dh_python2 man pages and Python FAQ) and drop build-dep on python-docutils to ease bootstrapping (Closes: #754060) - Add direct build-dep on python-all to replace indirect build-dep * Bump version to 2.7.8 * Drop ancient Breaks on python-csv, python-bz2, and python-email -- Scott Kitterman Fri, 11 Jul 2014 17:10:37 -0400 python-defaults (2.7.6-2) unstable; urgency=medium [ Barry Warsaw ] * Add python policy for Python Wheels. -- Scott Kitterman Wed, 21 May 2014 00:04:16 -0400 python-defaults (2.7.6-1) unstable; urgency=medium * Bump version to 2.7.6. * dh_python2: no longer move files to /usr/share/pyshared, don't create /usr/lib/pyshared symlinks for extensions. * Use UTF-8 encoding for the python policy in HTML format. Closes: #689931. * Add a chapter for the python policy to prefer Python 3 over Python 2. -- Matthias Klose Mon, 12 May 2014 12:16:34 +0200 python-defaults (2.7.5-5) unstable; urgency=low [ Steve Langasek ] * Adjust debpython/depends.py to be multiarch-friendly. [ Piotr Ożarowski ] * Set "Multi-Arch: allowed" in python, python-dev, python-minimal, python-dbg, python-all, python-all-dev, python-all-dbg * Replace /usr/bin/dh_python2 with a Python script that invokes dh-python's dh_python2 if Build-Depends{,-Indep} contains dh-python -- Piotr Ożarowski Thu, 12 Sep 2013 21:25:01 +0200 python-defaults (2.7.5-4) unstable; urgency=low * Add libpython-all-dbg.postinst to convert the doc directory to a symlink on upgrade (Closes: #718736) -- Scott Kitterman Tue, 13 Aug 2013 00:23:58 -0400 python-defaults (2.7.5-3) unstable; urgency=low [ Matthias Klose ] * Fix libpython-all-dbg doc dir symlink. Closes: #712270. [ Piotr Ożarowski ] * Replace /usr/bin/dh_python2 with a shell script that invokes dh-python's dh_python2 if debian/control mentions dh-python * dh_python2: warnings about --install-layout=deb and translating dependencies are just an info now -- Piotr Ożarowski Fri, 02 Aug 2013 08:54:32 +0200 python-defaults (2.7.5-2) unstable; urgency=low * Add dependencies on the new libpython-{stdlib,all-dev,all-dbg} packages. -- Matthias Klose Thu, 13 Jun 2013 15:07:18 +0200 python-defaults (2.7.5-1) unstable; urgency=low [ Matthias Klose ] * Bump version to 2.7.5. * Drop python2.6 as a supported python version. * Bump standards version to 3.9.4. * Start building the libpython-stdlib, libpython-all-dev, libpython-all-dbg packages. * Drop Python 2.6 as a supported Python version. * Fix some lintian warnings. [ Scott Kitterman ] * When X(S)-Python-Version or debian/pyversions is not present, do not describe them as missing, just indicate they are not there -- Matthias Klose Thu, 06 Jun 2013 14:57:03 +0200 python-defaults (2.7.3-13) experimental; urgency=low * Always build the policy files. -- Matthias Klose Thu, 28 Feb 2013 16:46:08 +0100 python-defaults (2.7.3-12) experimental; urgency=low * Move python-docutils to build-depends (from build-depends-indep). -- Matthias Klose Thu, 28 Feb 2013 15:58:09 +0100 python-defaults (2.7.3-11) experimental; urgency=low * Add Multi-Arch: same packages libpython-all-{dev,dbg} (not yet built, python2.6 doesn't have support for multiarch). * python-dbg: Stop providing python-gdbm-dbg, python-tk-dbg. Closes: #700716. * Add a libpython-stdlib package (not yet built). -- Matthias Klose Thu, 28 Feb 2013 14:43:06 +0100 python-defaults (2.7.3-10) experimental; urgency=low * Build dependency packages as architecture dependent packages. * Make python, python-{minimal,dev,dbg} Multi-Arch: allowed. * Build Multi-Arch: any packages libpython-{dev,dbg} packages providing $(DEB_HOST_GNU_TYPE/DEB_HOST_MULTIARCH)-python-config symlinks. * Provide python2 symlinks. -- Matthias Klose Wed, 12 Dec 2012 00:25:00 +0100 python-defaults (2.7.3-5) unstable; urgency=low * Drop Python 2.6 as a supported Python version. -- Matthias Klose Mon, 06 May 2013 02:48:48 +0200 python-defaults (2.7.3-4) unstable; urgency=low [ Dmitry Shachnev ] * Revert previous prerm/postrm changes: - prerm is never called as `prerm purge`. - configuration files shouldn't be deleted on package remove. -- Scott Kitterman Fri, 08 Feb 2013 16:26:12 -0500 python-defaults (2.7.3-3) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - no longer sensitive to trailing slash in private dir names (closes: #686358) - ignore /usr/bin/python3 shebangs in all packages, not just in python3-* ones - generates correct "python (<< 2.X)" dependencies for packages with private Python extensions (typo fixed) * pyversions.py: fix parsing DEBPYTHON_SUPPORTED env. variable (versions should be separated using comma, as in debian_defaults config file) [ Dmitry Shachnev ] * debian/python.{pre,post}rm.in: Handle purge command the same way as remove (thanks to Mitsuya Shibata for the bug report) -- Piotr Ożarowski Sun, 21 Oct 2012 22:40:55 +0200 python-defaults (2.7.3-2) unstable; urgency=low * dh_python2: ignore empty files while trying to normalize shebangs (Closes: #680793) * Fix lack of python-imaging in pydist/dist_fallback - Add python-imaging override to pydist/generate_fallback_list.py - pydist/dist_fallback: Regenerate to add python-imaging (which wasn't recognized before due to .pth file) along with a few automatic adjustments -- Piotr Ożarowski Thu, 26 Jul 2012 23:03:32 +0200 python-defaults (2.7.3-1) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - remove even more \.so.* dangling symlinks, thanks to Stefano Rivera for providing a test case - rewrite shebangs by default (disable via --no-shebang-rewrite), examples: + "/usr/bin/env python*" → "/usr/bin/python*" + "/usr/local/bin/python foo" → "/usr/bin/python foo" + "/usr/bin/python2" → "/usr/bin/python" - new --shebang option to replace all shebangs in bin dirs (example: --shebang /usr/bin/python2.6) - no longer generates python2.X | python2.Y depenendies for public modules (Closes: 625740) - translate Python version numbers into Debian ones for those require.txt items that have a pydist file with (uscan like) rules or PEP386 flag (Closes: #653740) * Improve dh_python2 manpage a bit, add information about cleaning debug packages (Closes: #653741) * pyversions, dh_python2, pycompile: allow to override system's list of supported Python versions via DEBPYTHON_SUPPORTED and default Python version via DEBPYTHON_DEFAULT env. variables * Debhelper's python2 sequence now inserts dh_python2 before dh_installinit (closes: 670418) [ Scott Kitterman ] * Bump upstream version to match current unstable/wheezy python2.7 version -- Piotr Ożarowski Sat, 30 Jun 2012 20:23:59 +0200 python-defaults (2.7.3~rc2-1) unstable; urgency=low [ Scott Kitterman ] * Bump minimum debhelper version to 8 so all tests will run - dh_python2 tests 1 - 5 require dh 7 and test 6 needs dh 8 * Move idle.xpm symlink from python to idle and add Breaks/Replaces * Move /usr/bin/pyversions from python to python-minimal since that's where the actual script it's a symlink to lives, add Breaks/Replaces * Bump standards version to 3.9.3 without further change * Correct Python package names with hyphens in them being ignored (Closes: #657665) * Drop -n from /usr/bin/idle invocations in debian/idle.desktop and debian/idle.menu (Closes: #482156) * Update Python policy - Describe addition of /usr/bin/python2 due to upstream changes - Remove redundant text on Python provides and clarify when they should be used - Update description of functionality related to X-Python-Version for Wheezy - Update X/XS-Python-Versions to also include X-Python-Version examples - Add appropriage Breaks/Replaces * Bump upstream version to match current unstable/wheezy python2.7 version [ Piotr Ożarowski ] * dh_python2, pyversions: make comparison of X(S)-Python-Version field names case-insensitive (Closes: #676224) -- Scott Kitterman Tue, 05 Jun 2012 22:43:11 -0400 python-defaults (2.7.2-10) unstable; urgency=low [ Matthias Klose ] * dh_python2: For argparse eggs, generate dependencies of the form "python (>= 2.7) | python-argparse". Closes: #653644, #657119. * Regenerate pydist/dist_fallback. [ Piotr Ożarowski ] * pycompile: fix -O option * dh_python2: do not try to add python2.X dependency if private dir works with all Python versions -- Matthias Klose Tue, 24 Jan 2012 11:49:24 +0100 python-defaults (2.7.2-9) unstable; urgency=low * Generate correct dependencies if private directory supports one Python version only (closes: #644573) -- Piotr Ożarowski Sat, 08 Oct 2011 17:16:46 +0200 python-defaults (2.7.2-8) unstable; urgency=high * Fix update-manager Breaks (Closes: #644491) -- Scott Kitterman Thu, 06 Oct 2011 15:48:06 -0500 python-defaults (2.7.2-7) unstable; urgency=low * Adjust version numbers for upload to unstable. * python: Break update-manager (<= 0.200.5-1). -- Matthias Klose Tue, 27 Sep 2011 18:21:42 +0200 python-defaults (2.7.2-6) experimental; urgency=low [ Scott Kitterman ] * Fixed typo in python-policy (thanks to Jakub Wilk) [ Piotr Ożarowski ] * dh_python2: - handle private dir paths without leading slash - add python to Depends if unversioned python shebang is detected in private directory - dist_fallback: add /usr/share/python-support/package/ to paths searched for Egg metadata; add "wsgiref" and "python" fallbacks - do not try to remove .so.foo symlinks twice (if files were listed in an unfortunate order) -- Piotr Ożarowski Sat, 24 Sep 2011 16:36:29 +0200 python-defaults (2.7.2-5) experimental; urgency=low [ Piotr Ożarowski ] * dh_python2: - generates rtupdate scripts for private directories that compile files from given package only, add --compile-all to dh_python2's call if you want the old behaviour (i.e. compile also files (plugins?) provided by other packages, which do not use a helper/bytecompile them) - add --no-dbg-cleaning option (to disable removing files from debug packages) - fix handling "distname[features]" in debpython.pydist.guess_dependency (closes: 636255) * pyclean now accepts --package and private dir argument at the same time [ Scott Kitterman ] * debpyhton/pydist: Incorporate patch from Jonathan Lange to stop printing to stderr (LP: #812960) * Add Piotr Ożarowski back to Uploaders -- Scott Kitterman Mon, 08 Aug 2011 10:28:50 -0400 python-defaults (2.7.2-4) experimental; urgency=low [ Piotr Ożarowski ] * dh_python2: - no longer moves .so.foo files to pyshared dir (closes: 635316) - replaces .so symlinks with .so.foo files in dist-packages [ Scott Kitterman ] * Drop python2 symlink pending further discussion (closes: 634967) * Update recent Python policy changes based on feedback from Debian Python -- Scott Kitterman Wed, 27 Jul 2011 10:15:38 -0400 python-defaults (2.7.2-3) experimental; urgency=low * python: Provide python profiler. * Provide a python2 symlink according to PEP 394. * Bump standards version. * Fix some lintian warnings. * Add 2to3.1 manual page symlink. -- Matthias Klose Sun, 10 Jul 2011 20:57:27 +0200 python-defaults (2.7.2-2) experimental; urgency=low [ Piotr Ożarowski ] * dh_python2: - no longer generates maintainer scripts that invoke pycentral's pkgremove script, use --clean-pycentral if you want the old behaviour - egg-info directories are parsed even if cleaning the name was necessary (thanks to Arnaud Fontaine for the patch) - private directory names with apostrophes are escaped properly in maintainer script's -X arguments (thanks to Jakub Wilk for the patch) - deal with original symlinks more carefully (closes: 627969, thanks to Leonid Borisenko for the original patch) - add --ignore-shebangs option that will disable translating shebangs into Debian dependencies - add --ignore-namespace option that will disable handling Egg-info's namespace_packages.txt (AKA namespace feature) - PyDist: update dist_fallback file (with atypical Debian package names) - disable PyDist feature if dh sequencer is invoked --with pydeb (closes: 630502, thanks to Gediminas Paulauskas for the original patch) - warn if public Python extension is linked to libpython2.X, fail if it's linked to a wrong version - warn if both XS-Python-Version and X-Python-Version are defined - private dirs: if there is more than one Python version parsed from shebangs, byte-compile the dir with default Python version (or the one requested via X-Python-Version) instead od failing. Add dependency for each (supported) interpreter detected in shebangs - /usr/share/pyshared is not added to the package if empty (closes: 623909) - dh_python2's manpage updated (among other changes, no longer advertises python:Breaks - closes: 631397, describes .pyinstall and .pyremove files) - remove setuptools from requires.txt (it is replaced with python-pkg-resources Debian dependency) - "--namespace foo" no longer triggers .../dist-packages/bar/foo/__init__.py creation, use "--namespace bar.foo" instead [ Scott Kitterman ] * Python policy: - Add deprecation information about python-central and python-support - Clarify Python module and package descriptions -- Scott Kitterman Thu, 07 Jul 2011 01:06:08 -0400 python-defaults (2.7.2-1) experimental; urgency=low [ Piotr Ożarowski ] * dh_python2: generate more strict dependencies for packages with private extensions (closes: #625760) [ Scott Kitterman ] * Set python2.7 as default for testing in experimental - Update version references in patching file debian/control, control.in, debian_defaults, python.postinst.in, python.preinst.in, pyversions.py, and rules -- Scott Kitterman Tue, 31 May 2011 07:44:33 -0400 python-defaults (2.6.6-14) unstable; urgency=low [ Piotr Ożarowski ] * python.mk: add py_builddir macro. $(call py_builddir, 2.6) returns "build/lib.linux-x86_64-2.6" on amd64 * dh_python2, pycompile, pyclean: add "namespace" feature: dh_python2 parses Egg's namespace_packages.txt files (in addition to --namespace command line argument(s)) and drops empty __init__.py files from binary package. pycompile will regenerates them at install time and pyclean will remove them at uninstall time (if they're no longer used in installed packages * Remove myself from Uploaders [ Scott Kitterman ] * Upload to Unstable (adds Python 2.7 as a supported Python in Unstable) * Drop python2.5 as a supported Python version - Update debian/debian_defaults - Update debpython/version.py - Update debian/control.in * Update copyright years for dh_python2, pycompile, pyclean and debpython in debian/copyright -- Scott Kitterman Fri, 15 Apr 2011 00:04:07 -0400 python-defaults (2.6.6-13) experimental; urgency=low * Add python2.7 as a supported Python version. * python-all{,-dev,-dbg}: Depend on the 2.7 packages. * Run the rtinstall script, when 2.7 became a supported version (2.6.6-13) and python2.7 is installed. * Python-minimal Breaks python-support (<< 1.0.12) -- Scott Kitterman Mon, 21 Mar 2011 10:53:42 -0400 python-defaults (2.6.6-12) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - use Depends: python (<< 2.X), python (>= 2.Y) rather than Breaks in packages with public modules (after a discussion on debian-devel mailing list) - do not try to check dangling symlinks's shebang (closes: 619005) [ Scott Kitterman ] * Start Python Policy updates for Wheezy: - Document current practice to not provide /usr/bin/python2 - Strengthen warning aginst using /usr/bin/env python - Update paths section for python2.7 and python3 - Deprecate XB-Python-Version - Clarify use of {python:Provides} - Clarify that build-dependencies on -dev packages should not be used except when required * Upload to unstable: - Drop python2.7 from supported versions, not ready for Python transition yet -- Scott Kitterman Mon, 21 Mar 2011 10:22:06 -0400 python-defaults (2.6.6-11) experimental; urgency=low * dh_python2 and pycompile: read /usr/share/python/debian_defaults to get default Python version and a list of supported Python versions * dh_python2: - fix parsing .pyinstall files (a space between file name and module name is now required) - replace a file with a symlink also if there's a matching one in pyshared directory already - add support for DH_OPTIONS env. variable - fix checking shebangs in private directories (executable bit wasn't checked correctly) - add test4 to test handling private directories - make egg-info files/dirs searches case insensitive (closes: #614910) * pycompile: - --exclude now works with private dirs - use /usr/bin/pythonX.Y rather than pythonX.Y (to avoid /usr/local interpreters) * rewrite dh_python2.1, pycompile.1 and pyclean.1 manpages in ReStructured Text, add quick guide for maintainers to dh_python2 manpage -- Piotr Ożarowski Mon, 28 Feb 2011 20:28:05 +0100 python-defaults (2.6.6-10) experimental; urgency=low * dh_python2: fix moving files from old debug locations (due to typo) * python-minimal now Breaks python-support << 1.0.12 (Python 2.7 support was added in 1.0.12) * pycompile: skip dangling symlinks -- Piotr Ożarowski Mon, 10 Jan 2011 23:05:47 +0100 python-defaults (2.6.6-9) experimental; urgency=low * dh_python2: fix a crash in packages with private extension (closes: 607555) - test3 added (to test architecture dependent packages) -- Piotr Ożarowski Sun, 19 Dec 2010 20:27:23 +0100 python-defaults (2.6.6-8) experimental; urgency=low * Fix typo in minimum required python version for packages generated with dh_python2 -- Piotr Ożarowski Sun, 19 Dec 2010 14:57:58 +0100 python-defaults (2.6.6-7) experimental; urgency=high * pycompile: - Don't over-optimize, check the timestamps of byte-code files. - Add options -f/--force, -O. - Copy stdout/stderr of py_compile processes in case of error. - Propagate the exit value of the py_compile processes. - Update manual page. * Bump depends to require the fixed pycompile for dh_python2 based package builds. * Don't touch the standard python library in rtupdate scripts. -- Matthias Klose Sun, 12 Dec 2010 17:46:13 +0100 python-defaults (2.6.6-6) experimental; urgency=low * dh_python2: - make the error message about missing extension more clear (and more verbose in --verbose mode) - install files listed in debian/pkg.pyinstall file as public modules for all requested Python versions (use dh_install's package.install files for private modules) - remove public modules listed in debian/pkg.pyremove (glob.glob pattern and version range can be used in both .pyinstall and .pyremove files) - create symlinks for files installed into /usr/share/pyshared/ if there are no other public modules available * pycompile: - `pycompile $DESTDIR/usr/lib/python*` will recognize public site-packages directories and use the right interpreter instead of raising KeyError - do not try to check if interpreter is present when version range is empty -- Piotr Ożarowski Wed, 01 Dec 2010 19:43:50 +0100 python-defaults (2.6.6-5) experimental; urgency=low * pycompile: if installed Python is requested via -V option, use it even if it's not in a list of supported Python versions (closes: 600529) -- Piotr Ożarowski Sun, 17 Oct 2010 23:22:22 +0200 python-defaults (2.6.6-4) experimental; urgency=low * Add python2.7 as a supported Python version. * python-all{,-dev,-dbg}: Depend on the 2.7 packages. * Run the rtinstall script, when 2.7 became a supported version (2.6.6-4) and python2.7 is installed. -- Matthias Klose Sat, 16 Oct 2010 11:58:31 +0200 python-defaults (2.6.6-3+squeeze5) unstable; urgency=low * dh_python2: fix moving files from old debug locations * pycompile: skip dangling symlinks to fix upgrade problem introduced in -3+squeeze3 (closes: 607988) -- Piotr Ożarowski Tue, 11 Jan 2011 22:14:56 +0100 python-defaults (2.6.6-3+squeeze4) unstable; urgency=medium * dh_python2: fix a crash in packages with private extension (closes: 607555) -- Piotr Ożarowski Sun, 19 Dec 2010 21:12:38 +0100 python-defaults (2.6.6-3+squeeze3) unstable; urgency=medium * pycompile: - Don't over-optimize, check the timestamps of byte-code files. - Add options -f/--force, -O. - Propagate the exit value of the py_compile processes. - Update manual page. * Bump depends to require the fixed pycompile for dh_python2 based package builds. * Don't touch the standard python library in rtupdate scripts. -- Matthias Klose Sun, 12 Dec 2010 22:23:03 +0100 python-defaults (2.6.6-3+squeeze2) unstable; urgency=low * pycompile: - `pycompile $DESTDIR/usr/lib/python*` will recognize public site-packages directories and use the right interpreter instead of raising KeyError - do not try to check if interpreter is present when version range is empty (closes: 605356) -- Piotr Ożarowski Tue, 30 Nov 2010 19:57:51 +0100 python-defaults (2.6.6-3+squeeze1) unstable; urgency=medium * pycompile: if installed Python is requested via -V option, use it even if it's not in a list of supported Python versions -- Piotr Ożarowski Mon, 18 Oct 2010 19:04:55 +0200 python-defaults (2.6.6-3) unstable; urgency=low * Upload to unstable * dh_python2: egg renaming fixed -- Piotr Ożarowski Wed, 22 Sep 2010 23:03:15 +0200 python-defaults (2.6.6-2) experimental; urgency=low [ Piotr Ożarowski ] * Add README.derivatives (source package) * dh_python2: - add dist_fallback file with a list of Python distribution name and Debian package name pairs (to be used as a fall back source for PyDist feature) - if dist_fallback and `dpkg -S` fails to find the right package name, fall back to package name recommended by Debian Python Policy (use debian/pydist-overrides file to override) - disable PyDist feature if dh_pydeb is in debian/rules * Use versioned interpreter name rather than "python" only in python-minimal.postinst (closes: 595826) [ Matthias Klose ] * python.mk (py_libdir): Return /usr/lib/python3/dist-packages for 3.x versions. * python.mk (py_pkgname): New macro to refer the package name depending on the python version. -- Piotr Ożarowski Sun, 12 Sep 2010 18:41:04 +0200 python-defaults (2.6.6-1) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: typo in --help output fixed (thanks to Adam D. Barratt) * Bump python-minimal's Breaks of python2.5-minimal to << 2.5.5-7 (due to missing runpy module) * Set the right minimum required python package version in packages with private modules [ Scott Kitterman ] * debian/python-policy.sgml and debian/pyversions.py fix typos (thanks to Adam D. Barratt) [ Matthias Klose ] * Bump version to 2.6.6. -- Piotr Ożarowski Tue, 31 Aug 2010 19:09:30 +0200 python-defaults (2.6.5-13) unstable; urgency=low [ Scott Kitterman ] * Python policy changes for X-Python-Version and X-Python3-Version - Minimum changes for Squeeze * In pyversions, do not silently ignore Python 3 versions * Add support for X-Python-Version to match X-Python3-Version [ Piotr Ożarowski ] * Fix documentation typo in pycompile/pycompile.1 * dh_python2: - pass shallow=False to cmpfiles to make sure only exactly the same files are moved to pyshared - add support for X-Python-Version -- Piotr Ożarowski Fri, 13 Aug 2010 22:39:37 +0200 python-defaults (2.6.5-12) unstable; urgency=low * pycompile: do not hang if interpreters are not started in the same order as they're used (LP: #613675) * Add manpage for dh_python2, pycompile and pyclean * Standards-Version bumped to 3.9.1 (no other changes required) -- Piotr Ożarowski Thu, 05 Aug 2010 19:15:52 -0400 python-defaults (2.6.5-11) unstable; urgency=medium * Add README.PyDist to python-doc package * pycompile: compile public module for the right Python version (really closes: 590224) * dh_python2: rename --depend to --depends, --recommend to --recommends and --suggest to --suggests -- Piotr Ożarowski Tue, 27 Jul 2010 21:25:54 +0200 python-defaults (2.6.5-10) unstable; urgency=medium * dh_python2: - add --depend, --recommend and --suggest command line options (use it if requires.txt doesn't contain dependency that package needs) - add {/usr,}/sbin to the list of directories with checked shebangs * pycompile: do not exit before all background byte compilation is finished (closes: 590224) -- Piotr Ożarowski Sun, 25 Jul 2010 12:34:56 +0200 python-defaults (2.6.5-9) unstable; urgency=low [ Piotr Ożarowski ] * pyclean, pycompile: use .communicate() instead of .wait() to avoid hanging `dpkg -L PACKAGE` in few situations * dh_python2: follow Distribute and replace all non-alphanumeric characters with underscore in distribution name [ Matthias Klose ] * Require python (>= 2.6.5-9~) in generated dependencies to use the fixed pycompile. -- Piotr Ożarowski Mon, 19 Jul 2010 20:27:50 +0200 python-defaults (2.6.5-8) unstable; urgency=low * Revert: - python-minimal: Provide symlink to binary and manpage for /usr/bin/python2. This interpreter name is not created in the upstream sources. python should be used instead. -- Matthias Klose Sat, 17 Jul 2010 13:10:06 +0200 python-defaults (2.6.5-7) unstable; urgency=low * pyversions.py: fall back to the list of supported Python versions if debian/pyversions doesn't exist (as in -5, closes: 588820, thanks to Vincent Legout) -- Piotr Ożarowski Mon, 12 Jul 2010 19:15:17 +0200 python-defaults (2.6.5-6) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - invoke `pycentral pkgremove PACKAGE` in preinst if upgrading from python-central based packages - block python package transitions via ${python:Breaks} or ${python:Depends} (Breaks will be used if available) - recognize more requires.txt patterns in debpython.pydist * pyversions.py: - print error message if file cannot be opened (closes: 521508, thanks to Carl Chenet for the original patch) - print nice error message if computed set of supported versions is empty (closes: 583392) * debian/rules: do not ignore errors (two more `set -e`s added, closes: 397499) * python-doc now suggests python-examples (closes: #585774) * python package doesn't conflict with python2.1 and python2.3 anymore (2.1 and 2.3 are no longer in Debian) * Standards-Version bumped to 3.9.0: - some packages moved from Conflicts to versioned Breaks - Homepage field added [ Scott Kitterman ] * Merge changes back from Ubuntu package: - Tighten ${binary:Version} depends relationships to "=" - python: Add an unversioned `2to3' binary - python-minimal: Provide symlink to binary and manpage for /usr/bin/python2 (Closes: #566266) * Update hard coded fallbacks in debian/pyversions.py to add python2.6 to supported versions and to make it the default version -- Piotr Ożarowski Sun, 11 Jul 2010 17:08:19 +0200 python-defaults (2.6.5-5) unstable; urgency=medium * Use Python's compileall module instead of pycompile to byte-compile debpython module as logging module is not available in pythonX.Y-minimal package (Closes: 586743) -- Piotr Ożarowski Tue, 22 Jun 2010 10:46:48 +0200 python-defaults (2.6.5-4) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - fix parsing "XS-Python-Version: X.Y" - ignore everything after ", >= 3" in XS-Python-Version * Add python-minimal.{postinst,prerm} files to handle .py files byte-compilation [ Scott Kitterman ] * Additonal Python 3 related policy changes: - Clarify that helper specific policy does not apply to Python 3 -- Piotr Ożarowski Mon, 21 Jun 2010 23:50:22 +0200 python-defaults (2.6.5-3) unstable; urgency=low * Remove '-V' option from pyclean call in runtime.d/public_modules.rtremove * Add ${misc:Depends} to Depends in all binary packages * Add Vcs-Browser field * Add some lintian overrides (for false positives) - bump minimum required debhelper version to 6.0.7 (due to dh_lintian) -- Piotr Ożarowski Fri, 18 Jun 2010 10:25:59 +0200 python-defaults (2.6.5-2) unstable; urgency=low [ Piotr Ożarowski ] * dh_python2: - create extension symlinks in /usr/lib/pyshared/pythonX.Y - add support for debian/pydist-overrides - add dh sequence file (use "--with python2" in debian/rules) - some bugs fixed - moved from python-dev to python package * Support for Python3 removed in dh_python2, pycompile and pyclean (moved to python3-defaults) * debian/copyright: Add a note about dh_python2, pycompile, pyclean and the debpython package. * Add myself to Uploaders [ Scott Kitterman ] * debian/pyversions.py: Exclude python3 versions from results - those are handled by py3versions in python3-defaults * Update debian/copyright from LICENSE in python2.6 (Closes: #446671) * Update debian/python-policy.sgml to cover py3versions, py(3)versions as the only defined interface for determining supported/default python versions in Debian, and run time separation of python and python3 as two distinct systems * In debian/python-policy.sgml specify the correct debian/control paragraphs for XS/XB-Python-Version (Closes: #567941) - Thanks to Loïc Minier for the patch [ Matthias Klose ] * Depend on python2.6 version including the fix for issue #8223. * Don't allow installation of a mix of defaults packages for different python versions. Closes: #583683. -- Matthias Klose Thu, 17 Jun 2010 23:47:08 +0200 python-defaults (2.6.5-1) experimental; urgency=low [ Matthias Klose ] * Bump version to 2.6.5. * Make python2.6 the default Python version. * Build a python-doc package. * python: Update the valgrind file to 2.6. [ Piotr Ozarowski ] * python-minimal: Install pycompile and pyclean binaries. * Add lsb-release to Build-Depends * Add dh_python2 stuff -- Matthias Klose Fri, 14 May 2010 18:50:21 +0200 python-defaults (2.5.4-9) unstable; urgency=low * python-all-dev: Fix typo in dependency list. Closes: #566278. -- Matthias Klose Fri, 22 Jan 2010 18:38:31 +0100 python-defaults (2.5.4-6) unstable; urgency=low * Add python2.6 as a supported Python version. * python-all{,-dev,-dbg}: Depend on the 2.6 packages. * Run the rtinstall script, when 2.5 became a supported version (2.4.4-3) and python2.5 is installed. * Run the rtinstall script, when 2.6 became a supported version (2.5.4-6) and python2.6 is installed. Closes: #565952. * Fix reference to list of modules in the python-minimal package. Closes: #558403. -- Matthias Klose Sun, 17 Jan 2010 01:38:21 +0100 python-defaults (2.5.4-5) unstable; urgency=low * Fix typos from policy update (Closes: #561091, #561093) * Drop python2.4 as a supported Python - Remove python2.4 depends and update descriptions for python-all, python-all-dev, and python-all-dbg - Drop python2.4 from supported versions and add to old and unsupported versions - Update pyversions.py to drop python2.4 from the supported list * Correct path to Konsole Python desktop file (Closes: #381659) -- Scott Kitterman Wed, 23 Dec 2009 19:59:15 -0500 python-defaults (2.5.4-4) unstable; urgency=low [ Scott Kitterman ] * Update Python Policy to match current packaging practice: - Major overall update. - Remove extraneous paragraph from Provides section. (Closes: #415213) - Remove obsolete mentions of dh_python. (Closes: #527009) - Fix policy typo. (Closes: #523226) - Add pointer to doc of the site module for site-specific paths. (Closes: #287197) - Correct package dependency rules (Closes: #379455) * Move debhelper from build-depends-indep to build-depends to satisfy clean requirements. * Drop unneeded build-depends-indep on python. * Bump standards version to 3.8.3. * Drop deprecated dh_desktop from debian/rules. * Move dbg packages to section debug. * Make python-all-dbg priority extra. * Remove redundant debian/FAQ.html. * Update (= ${Source-Version}) depends to (>= ${binary:Version}). * Correct Idle depends and description (Closes: #482163). * Update python version reference in README.Debian (Closes: #494068). * Update Debian menu section for idle. * Fix capitalization of Python in the python-dev descriptions. * Add myself to uploaders. [ Matthias Klose ] * python-{dev,dbg}-dev: Add bogus dependencies on python to work around lintian's broken usr-share-doc-symlink-without-dependency check. -- Scott Kitterman Mon, 14 Dec 2009 06:03:32 -0500 python-defaults (2.5.4-2) unstable; urgency=high * python-all*: Tighten the dependencies on the python-* packages. -- Matthias Klose Thu, 26 Feb 2009 12:44:47 +0000 python-defaults (2.5.4-1) unstable; urgency=medium * Depend on python2.5-2.5.4. * python: Install /usr/share/python/python.mk, helper functions for getting the python library dir and install args for distutils installs. * Accept initial blank line in debian/control when parsing version information. -- Matthias Klose Wed, 25 Feb 2009 02:19:09 +0000 python-defaults (2.5.2-3) unstable; urgency=low * python: Provide python-ctypes and python-wsgiref. -- Matthias Klose Sat, 01 Nov 2008 09:15:19 +0100 python-defaults (2.5.2-2) unstable; urgency=low * python: Provide python-plistlib. * python-minimal: Recommend python (suggested by Neil McGovern). -- Matthias Klose Sat, 26 Jul 2008 02:37:00 +0200 python-defaults (2.5.2-1) unstable; urgency=low * Maintainer upload; asking the Release Team to better coordinate things. Being in contact with two members of the release team for two or three weeks when to upload without getting in the way of other transitions, an unannounced upload of a third member of this team is at least surprising. * debian/python.postinst.in: Fix the bug introduced in the NMU, run the rtupdate hooks when upgrading from a version < 2.5.2-1. Closes: #476095. -- Matthias Klose Thu, 17 Apr 2008 20:32:59 +0200 python-defaults (2.5.2-0.1) unstable; urgency=low * NMU by the Release Team not to lose the sweet spot for the Python transition. * Make python2.5 the default Python version. -- Adeodato Simó Sun, 13 Apr 2008 11:29:32 +0200 python-defaults (2.4.4-6) unstable; urgency=low * python.postinst: Fix cleanup of temporary files. Closes: #424703, #424704. -- Matthias Klose Thu, 17 May 2007 08:17:16 +0200 python-defaults (2.4.4-5) unstable; urgency=low * Run the python2.5 rtinstall hooks, if python2.5 was already installed as an unsupported version. -- Matthias Klose Wed, 16 May 2007 21:19:51 +0200 python-defaults (2.4.4-4) unstable; urgency=low * New package python-all-dbg. -- Matthias Klose Fri, 04 May 2007 06:56:27 +0200 python-defaults (2.4.4-3) unstable; urgency=low * Add python2.5 as a supported python version. * Depend on python2.4 packages (>= 2.4.4-4), built for ldbl128 on alpha, powerpc, s390, sparc. * python-all*: Depend on python2.5 packages (>= 2.4.5-1), built for ldbl128 on alpha, powerpc, s390, sparc. * Merge pyversions.py changes from python-central. * Merge changes from Ubuntu: - Add a sanity check, that /usr/bin/python points to the default python version. Users tend to modify this symlink, which then breaks stuff in obscure ways. Ubuntu #75557, closes: #418002. - python-dbg: Provide python-gdbm-dbg, python-tk-dbg, link to README.debug, SpecialBuilds.txt.gz. - python-dev: Add an unversioned python-config binary (backport from python2.5 (appears in python2.4 2.4.4-4). - Robustify building the faq html pages. - Make the suggestions of various packages versioned. * Update the upstream FAQ. -- Matthias Klose Fri, 4 May 2007 06:05:12 +0200 python-defaults (2.4.4-2) unstable; urgency=medium * python-all{,-dev}: Drop dependencies on python2.3{,-dev}. -- Matthias Klose Sat, 16 Dec 2006 15:42:21 +0100 python-defaults (2.4.4-1) unstable; urgency=medium * Depend on the 2.4.4 versions of the packages. * Sync pyversions.py with python-central. * Move 2.3 to old-versions, from supported-versions. * Add 2.5 to unsupported-versions. -- Matthias Klose Sun, 29 Oct 2006 11:06:39 +0100 python-defaults (2.4.3-11) unstable; urgency=low * Add a conflict to python-central (<< 0.5.5). -- Matthias Klose Sun, 13 Aug 2006 19:32:59 +0000 python-defaults (2.4.3-10) unstable; urgency=low * Upload to unstable. Closes: #347440, #360851. * Let the preinst fail on the first failing pre-rtupdate hook, after running the corresponding failed-pre-rtupdate hook. * Reflect renaming of the docutils binaries. Closes: #377601. * Update the upstream FAQ. -- Matthias Klose Sat, 12 Aug 2006 20:28:30 +0200 python-defaults (2.4.3-9) experimental; urgency=low * Fix syntax error in python.preinst. Closes: #381673. -- Matthias Klose Sun, 6 Aug 2006 12:39:34 +0000 python-defaults (2.4.3-8) experimental; urgency=low * idle: Depend on python-tk, add desktop and menu files. -- Matthias Klose Sat, 5 Aug 2006 18:38:31 +0000 python-defaults (2.4.3-7) experimental; urgency=low * Update pyversions.py from 2.3.5-11. * Fix pyversions(1), -r takes exactly one parameter. * idle: Remove the dependency on idle-pythonX.Y, add start script and man page. -- Matthias Klose Sat, 5 Aug 2006 17:34:43 +0000 python-defaults (2.4.3-6) experimental; urgency=low * Remove python's dependency on python-central. Closes: #372658. * On upgrade of the runtime to a new major version, call the hooks (executable files) in /usr/share/python/runtime.d/*.rtupdate. - in python.preinst, call the script with parameters pre-rtupdate . run all hooks, then return exit with the correct exit status. - in python.postinst, call the script with parameters rtupdate . run all hooks, then return exit with the correct exit status. - in python.postinst, call the script with parameters post-rtupdate . run all hooks, then return exit with the correct exit status. * pyversions -r: If the XS-Python-Version field cannot be found in debian/control, fall back to debian/pyversions for the version information. Return with an error code, if the intersection of the versions in debian/pyversions and the supported python versions is empty. Fall back to the supported versions if no version information can be found. Based on a patch from Raphael Hertzog. * Reflect renaming of the docutils binaries. Closes: #377601. -- Matthias Klose Sat, 5 Aug 2006 17:54:43 +0200 python-defaults (2.4.3-5) experimental; urgency=low * Tighten dependencies between packages built from this source. A versioned dependency on python-all / python-all-dev is enough to depend on the same version of python / python-dev. * python: Conflict with python-central (<< 0.4.17). * python: Depend on a python2.4 built for the updated Python policy. * python: Conflict with a python2.3 using the old Python policy. -- Matthias Klose Fri, 16 Jun 2006 18:15:00 +0200 python-defaults (2.4.3-4) experimental; urgency=low * Include version 0.4.1.0 of the python policy. * Fix 'pyversions -i'. -- Matthias Klose Tue, 13 Jun 2006 09:44:22 +0200 python-defaults (2.4.3-3) experimental; urgency=low * Point to the draft of the reworked Python policy. * Fix 'pyversions -r current' (Raphael Hertzog). -- Matthias Klose Mon, 12 Jun 2006 13:40:52 +0200 python-defaults (2.4.3-02) experimental; urgency=low * Really do not build python-doc. -- Matthias Klose Sun, 11 Jun 2006 23:25:02 +0000 python-defaults (2.4.3-01) experimental; urgency=low * Do not build the python-doc package from this source. -- Matthias Klose Sun, 11 Jun 2006 23:59:17 +0200 python-defaults (2.4.3-0) experimental; urgency=low * Upload to experimental. * Do not build the python-tk and python-gdbm packages from this source. * Let the -all packages depend on the default packages (closes: #365219). * Add /usr/share/python/debian_defaults for some default values (i.e. the supported python versions). * Add /etc/python/debian_config for byte-compilation options. * Add a pyversions script to give information about python versions and parse the XS-Python-Version attribute. -- Matthias Klose Sun, 11 Jun 2006 12:57:03 +0000 python-defaults (2.4.2-1) unstable; urgency=low * Change the default python version to 2.4. * Depend on python-central. -- Matthias Klose Thu, 12 Jan 2006 01:16:10 +0000 python-defaults (2.3.5-4) unstable; urgency=low * Add a package python-minimal. This package still depends on python2.3, will depend on python2.4-minimal when changing the default python version. * Add two dependency packages python-all and python-all-dev. These packages are used as build dependencies to determine the set of python version and implementations, which should be / currently are supported. Currently it depends on python2.3 and python2.4. Future versions may add an updated version of jython and ironpython. * Update FAQ. -- Matthias Klose Thu, 12 Jan 2006 00:32:32 +0100 python-defaults (2.3.5-3) unstable; urgency=low * Add python-dbg package. * debian/control.in: idle enhances python. -- Matthias Klose Sun, 19 Jun 2005 13:49:16 +0200 python-defaults (2.3.5-2) unstable; urgency=low * Add valgrind support file /usr/lib/valgrind/python.supp (closes: #291128). * python-doc: Add an conflict/replace to older python packages. Closes: #297266. -- Matthias Klose Sat, 19 Mar 2005 22:49:29 +0100 python-defaults (2.3.5-1) unstable; urgency=low * Depend on python-2.3.5 packages. * Update FAQ. * python suggests python-profiler. -- Matthias Klose Sat, 12 Feb 2005 19:26:48 +0100 python-defaults (2.3.4-6) unstable; urgency=low * Add an 'Enhances: konsole' to the python package (closes: #286161). -- Matthias Klose Sun, 16 Jan 2005 12:53:58 +0100 python-defaults (2.3.4-5) unstable; urgency=low * Add conflict/replaces to ooold python-base package (closes: #279035). -- Matthias Klose Sun, 14 Nov 2004 11:44:14 +0100 python-defaults (2.3.4-4) unstable; urgency=low * Regenerate control file after adding python-docutils build dependency. Closes: #270177. -- Matthias Klose Mon, 6 Sep 2004 07:19:49 +0200 python-defaults (2.3.4-3sid) unstable; urgency=low * Add build dependency on python-docutils (closes: #266550). -- Matthias Klose Wed, 18 Aug 2004 12:30:37 +0200 python-defaults (2.3.4-3) testing-proposed-updates; urgency=low * Unmodified 2.3.4-3sid, destination sarge, fixing build failure. -- Matthias Klose Fri, 20 Aug 2004 18:24:25 +0200 python-defaults (2.3.4-2sid) unstable; urgency=low * Add pdb and pdb.1 symlinks. * Update FAQ. -- Matthias Klose Tue, 17 Aug 2004 16:17:06 +0200 python-defaults (2.3.4-1) unstable; urgency=low * Depend on python-2.3.4 packages. * Update FAQ. -- Matthias Klose Mon, 10 May 2004 06:58:24 +0200 python-defaults (2.3.3-7) unstable; urgency=low * Fix symlinks to proposed policy files (closes: #234874). -- Matthias Klose Thu, 26 Feb 2004 22:28:07 +0100 python-defaults (2.3.3-6) unstable; urgency=low * Build the default packages from a separate source package to ease migration between python versions. * Update to the proposed python-policy: byte-compile using -E. -- Matthias Klose Wed, 4 Feb 2004 23:16:35 +0100 python-defaults-2.7.17/debian/compat0000644000000000000000000000000213305600173014242 0ustar 9 python-defaults-2.7.17/debian/control0000644000000000000000000002126313632675667014502 0ustar Source: python-defaults Section: python Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Matthias Klose Uploaders: Piotr Ożarowski Build-Depends: debhelper (>= 9~), dpkg-dev (>= 1.17.11), python2.7:any (>= 2.7.17~rc1-1~), lsb-release, python-all:any, python2.7:any (>= 2.7.17~rc1-1~), Standards-Version: 4.4.1 Homepage: https://www.python.org/ Vcs-Git: https://salsa.debian.org/cpython-team/python-defaults.git Vcs-Browser: https://salsa.debian.org/cpython-team/python-defaults Package: python-all Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), python2.7 (>= 2.7.2-3) Description: package depending on all supported Python2 runtime versions The package currently depends on python2.7, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 runtimes. Package: python-all-dev Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), python-all (= ${binary:Version}), libpython-all-dev (= ${binary:Version}), python2-dev (= ${binary:Version}), python2.7-dev (>= 2.7-7) Description: package depending on all supported Python2 development packages The package currently depends on python2.7-dev, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 development packages. Package: python-all-dbg Architecture: any Multi-Arch: allowed Section: debug Depends: ${misc:Depends}, python2 (= ${binary:Version}), python-all (= ${binary:Version}), libpython-all-dbg (= ${binary:Version}), python2-dbg (= ${binary:Version}), python2.7-dbg (>= 2.7-7) Description: package depending on all supported Python2 debugging packages The package currently depends on python2.7-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 debug packages. Package: libpython-all-dev Architecture: any Multi-Arch: same Section: libdevel Depends: libpython2-dev (= ${binary:Version}), ${misc:Depends}, libpython2.7-dev Description: package depending on all supported Python2 development packages The package currently depends on libpython2.7-dev, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 development packages. Package: libpython-all-dbg Architecture: any Multi-Arch: same Section: debug Depends: libpython2-dbg (= ${binary:Version}), ${misc:Depends}, libpython2.7-dbg Description: package depending on all supported Python2 debugging packages The package currently depends on libpython2.7-dbg, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 debug packages. Package: python2 Architecture: any Multi-Arch: allowed Priority: optional Pre-Depends: python2-minimal (= ${binary:Version}) Depends: ${misc:Depends}, python2.7 (>= 2.7.17~rc1-1~), libpython2-stdlib (= ${binary:Version}) Suggests: python2-doc (= ${binary:Version}), python-tk (>= 2.7.17~rc1-1~) Conflicts: python-central (<< 0.5.5) Breaks: update-manager-core (<< 0.200.5-2), python (<< 2.7.15-2) Replaces: python-dev (<< 2.6.5-2), python (<< 2.7.15-2) Provides: python-email, python-ctypes, python-wsgiref, python-importlib, python-profiler Description: interactive high-level object-oriented language (Python2 version) Python2, the high-level, interactive object oriented language, includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. . This package is a dependency package, which depends on Debian's Python2 version (currently v2.7). Package: python2-minimal Architecture: any Multi-Arch: allowed Priority: optional Depends: ${misc:Depends}, python2.7-minimal (>= 2.7.17~rc1-1~), dpkg (>= 1.13.20) Recommends: python2 Conflicts: python-central (<< 0.5.5) Breaks: python (<= 2.7.3-1~), python-dev (<< 2.6), python-dbg (<< 2.6), python-all (<< 2.6), python-all-dev (<< 2.6), python-all-dbg (<< 2.6), python-examples (<< 2.6), idle (<< 2.6), python2.5-minimal (<< 2.5.5-7), python2.6-minimal (<< 2.6.5~rc2-2), python3.1-minimal (<< 3.1.2~rc1-2), python-support (<< 1.0.10ubuntu2), python-minimal (<< 2.7.15-2) Replaces: python (<= 2.7.3-1~), python-minimal (<< 2.7.15-2) Description: minimal subset of the Python2 language This package contains the interpreter and some essential modules. It's used in the boot process for some basic tasks. See /usr/share/doc/python2.7-minimal/README.Debian for a list of the modules contained in this package. XB-Cnf-Visible-Pkgname: python2 Package: python2-dev Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), libpython2-dev (= ${binary:Version}), python2.7-dev (>= 2.7.17~rc1-1~) Breaks: python-dev (<< 2.7.15-2) Replaces: python-dev (<< 2.7.15-2) Description: header files and a static library for Python2 Header files, a static library and development tools for building Python2 modules, extending the Python2 interpreter or embedding Python2 in applications. . This package is a dependency package, which depends on Debian's Python2 version (currently v2.7). Package: libpython2-dev Architecture: any Multi-Arch: same Section: libdevel Depends: libpython2.7-dev (>= 2.7.17~rc1-1~), ${misc:Depends} Breaks: libpython-dev (<< 2.7.15-2) Replaces: libpython-dev (<< 2.7.15-2) Description: header files and a static library for Python2 Header files, a static library and development tools for building Python2 modules, extending the Python2 interpreter or embedding Python2 in applications. . This package is a dependency package, which depends on Debian's Python2 version (currently v2.7). Package: libpython2-stdlib Architecture: any Multi-Arch: same Priority: optional Depends: libpython2.7-stdlib (>= 2.7.17~rc1-1~), ${misc:Depends} Breaks: libpython-stdlib (<< 2.7.15-2) Replaces: libpython-stdlib (<< 2.7.15-2) Description: interactive high-level object-oriented language (Python2) Python2, the high-level, interactive object oriented language, includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. . This package is a dependency package, which depends on Debian's Python2 version (currently v2.7). Package: python2-doc Section: doc Architecture: all Multi-Arch: foreign Depends: ${misc:Depends}, python2.7-doc (>= 2.7.17~rc1-1~) Suggests: python2 (= ${binary:Version}) Breaks: python-doc (<< 2.7.15-2) Replaces: python-doc (<< 2.7.15-2) Description: documentation for the high-level object-oriented language Python2 This is the official set of documentation for the interactive high-level object-oriented language Python2 (v2.7). All documents are provided in HTML format, some in info format. The package consists of nine documents: . * Tutorial * Python Library Reference * Macintosh Module Reference * Python Language Reference * Extending and Embedding Python * Python/C API Reference * Installing Python Modules * Documenting Python * Distributing Python Modules . This package is a dependency package, which depends on Debian's Python2 version (currently v2.7). Package: python2-dbg Architecture: any Multi-Arch: allowed Section: debug Depends: ${misc:Depends}, python2 (= ${binary:Version}), libpython2-dbg (= ${binary:Version}), python2.7-dbg (>= 2.7.17~rc1-1~) Breaks: python-dbg (<< 2.7.15-2) Replaces: python-dbg (<< 2.7.15-2) Description: debug build of the Python2 interpreter (version 2.7) Python2 interpreter configured with --pydebug. Dynamically loaded modules are searched in /usr/lib/python2.7/lib-dynload/debug first. Package: libpython2-dbg Architecture: any Multi-Arch: same Section: debug Depends: libpython2.7-dbg (>= 2.7.17~rc1-1~), ${misc:Depends} Breaks: libpython-dbg (<< 2.7.15-2) Replaces: libpython-dbg (<< 2.7.15-2) Description: debug build of the Python2 interpreter (version 2.7) Python2 interpreter configured with --pydebug. Dynamically loaded modules are searched in /usr/lib/python2.7/lib-dynload/debug first. python-defaults-2.7.17/debian/control.in0000644000000000000000000002101613632675672015077 0ustar Source: python-defaults Section: python Priority: optional Maintainer: Matthias Klose Uploaders: Piotr Ożarowski Build-Depends: debhelper (>= 9~), @bd_i586@, lsb-release, python-all:any, @PVER@:any (>= @PREVVER@), Standards-Version: 4.4.1 Homepage: https://www.python.org/ Vcs-Git: https://salsa.debian.org/cpython-team/python-defaults.git Vcs-Browser: https://salsa.debian.org/cpython-team/python-defaults Package: python-all Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), python2.7 (>= 2.7.2-3) Description: package depending on all supported Python2 runtime versions The package currently depends on python2.7, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 runtimes. Package: python-all-dev Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), python-all (= ${binary:Version}), libpython-all-dev (= ${binary:Version}), python2-dev (= ${binary:Version}), python2.7-dev (>= 2.7-7) Description: package depending on all supported Python2 development packages The package currently depends on python2.7-dev, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 development packages. Package: python-all-dbg Architecture: any Multi-Arch: allowed Section: debug Depends: ${misc:Depends}, python2 (= ${binary:Version}), python-all (= ${binary:Version}), libpython-all-dbg (= ${binary:Version}), python2-dbg (= ${binary:Version}), python2.7-dbg (>= 2.7-7) Description: package depending on all supported Python2 debugging packages The package currently depends on python2.7-dbg, in the future, dependencies on jython (Python for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 debug packages. Package: libpython-all-dev Architecture: any Multi-Arch: same Section: libdevel Depends: libpython2-dev (= ${binary:Version}), ${misc:Depends}, libpython2.7-dev Description: package depending on all supported Python2 development packages The package currently depends on libpython2.7-dev, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 development packages. Package: libpython-all-dbg Architecture: any Multi-Arch: same Section: debug Depends: libpython2-dbg (= ${binary:Version}), ${misc:Depends}, libpython2.7-dbg Description: package depending on all supported Python2 debugging packages The package currently depends on libpython2.7-dbg, in the future, dependencies on jython (Python2 for a JVM) and ironpython (Python2 for Mono) may be added. . This package is a dependency package used as a build dependency for other packages to avoid hardcoded dependencies on specific Python2 debug packages. Package: python2 Architecture: any Multi-Arch: allowed Priority: optional Pre-Depends: python2-minimal (= ${binary:Version}) Depends: ${misc:Depends}, @PVER@ (>= @PREVVER@), libpython2-stdlib (= ${binary:Version}) Suggests: python2-doc (= ${binary:Version}), python-tk (>= @PREVVER@) Conflicts: python-central (<< 0.5.5) Breaks: update-manager-core (<< 0.200.5-2), python (<< 2.7.15-2) Replaces: python-dev (<< 2.6.5-2), python (<< 2.7.15-2) Provides: python-email, python-ctypes, python-wsgiref, python-importlib, python-profiler Description: interactive high-level object-oriented language (Python2 version) Python2, the high-level, interactive object oriented language, includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. . This package is a dependency package, which depends on Debian's Python2 version (currently v@VER@). Package: python2-minimal Architecture: any Multi-Arch: allowed Priority: optional Depends: ${misc:Depends}, @PVER@-minimal (>= @PREVVER@), dpkg (>= 1.13.20) Recommends: python2 Conflicts: python-central (<< 0.5.5) Breaks: python (<= 2.7.3-1~), python-dev (<< 2.6), python-dbg (<< 2.6), python-all (<< 2.6), python-all-dev (<< 2.6), python-all-dbg (<< 2.6), python-examples (<< 2.6), idle (<< 2.6), python2.5-minimal (<< 2.5.5-7), python2.6-minimal (<< 2.6.5~rc2-2), python3.1-minimal (<< 3.1.2~rc1-2), python-support (<< 1.0.10ubuntu2), python-minimal (<< 2.7.15-2) Replaces: python (<= 2.7.3-1~), python-minimal (<< 2.7.15-2) Description: minimal subset of the Python2 language This package contains the interpreter and some essential modules. It's used in the boot process for some basic tasks. See /usr/share/doc/@PVER@-minimal/README.Debian for a list of the modules contained in this package. XB-Cnf-Visible-Pkgname: python2 Package: python2-dev Architecture: any Multi-Arch: allowed Depends: ${misc:Depends}, python2 (= ${binary:Version}), libpython2-dev (= ${binary:Version}), @PVER@-dev (>= @PREVVER@) Breaks: python-dev (<< 2.7.15-2) Replaces: python-dev (<< 2.7.15-2) Description: header files and a static library for Python2 Header files, a static library and development tools for building Python2 modules, extending the Python2 interpreter or embedding Python2 in applications. . This package is a dependency package, which depends on Debian's Python2 version (currently v@VER@). Package: libpython2-dev Architecture: any Multi-Arch: same Section: libdevel Depends: lib@PVER@-dev (>= @PREVVER@), ${misc:Depends} Breaks: libpython-dev (<< 2.7.15-2) Replaces: libpython-dev (<< 2.7.15-2) Description: header files and a static library for Python2 Header files, a static library and development tools for building Python2 modules, extending the Python2 interpreter or embedding Python2 in applications. . This package is a dependency package, which depends on Debian's Python2 version (currently v@VER@). Package: libpython2-stdlib Architecture: any Multi-Arch: same Priority: optional Depends: libpython@VER@-stdlib (>= @PREVVER@), ${misc:Depends} Breaks: libpython-stdlib (<< 2.7.15-2) Replaces: libpython-stdlib (<< 2.7.15-2) Description: interactive high-level object-oriented language (Python2) Python2, the high-level, interactive object oriented language, includes an extensive class library with lots of goodies for network programming, system administration, sounds and graphics. . This package is a dependency package, which depends on Debian's Python2 version (currently v@VER@). Package: python2-doc Section: doc Architecture: all Multi-Arch: foreign Depends: ${misc:Depends}, python@VER@-doc (>= @PREVVER@) Suggests: python2 (= ${binary:Version}) Breaks: python-doc (<< 2.7.15-2) Replaces: python-doc (<< 2.7.15-2) Description: documentation for the high-level object-oriented language Python2 This is the official set of documentation for the interactive high-level object-oriented language Python2 (v@VER@). All documents are provided in HTML format, some in info format. The package consists of nine documents: . * Tutorial * Python Library Reference * Macintosh Module Reference * Python Language Reference * Extending and Embedding Python * Python/C API Reference * Installing Python Modules * Documenting Python * Distributing Python Modules . This package is a dependency package, which depends on Debian's Python2 version (currently v@VER@). Package: python2-dbg Architecture: any Multi-Arch: allowed Section: debug Depends: ${misc:Depends}, python2 (= ${binary:Version}), libpython2-dbg (= ${binary:Version}), python@VER@-dbg (>= @PREVVER@) Breaks: python-dbg (<< 2.7.15-2) Replaces: python-dbg (<< 2.7.15-2) Description: debug build of the Python2 interpreter (version @VER@) Python2 interpreter configured with --pydebug. Dynamically loaded modules are searched in /usr/lib/python@VER@/lib-dynload/debug first. Package: libpython2-dbg Architecture: any Multi-Arch: same Section: debug Depends: lib@PVER@-dbg (>= @PREVVER@), ${misc:Depends} Breaks: libpython-dbg (<< 2.7.15-2) Replaces: libpython-dbg (<< 2.7.15-2) Description: debug build of the Python2 interpreter (version @VER@) Python2 interpreter configured with --pydebug. Dynamically loaded modules are searched in /usr/lib/python@VER@/lib-dynload/debug first. python-defaults-2.7.17/debian/copyright0000644000000000000000000003713213305600173015005 0ustar This is the Debian GNU/Linux prepackaged version of the Python programming language. Python was written by Guido van Rossum and others. This package was put together by Klee Dienes from sources from ftp.python.org:/pub/python, based on the Debianization by the previous maintainers Bernd S. Brentrup and Bruce Perens. Current maintainer is Matthias Klose until the final 2.3 version is released. Copyright notice (as found in LICENSE in the original source). -------------------------------------------------------------- A. HISTORY OF THE SOFTWARE ========================== Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands as a successor of a language called ABC. Guido remains Python's principal author, although it includes many contributions from others. In 1995, Guido continued his work on Python at the Corporation for National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) in Reston, Virginia where he released several versions of the software. In May 2000, Guido and the Python core development team moved to BeOpen.com to form the BeOpen PythonLabs team. In October of the same year, the PythonLabs team moved to Digital Creations (now Zope Corporation, see http://www.zope.com). In 2001, the Python Software Foundation (PSF, see http://www.python.org/psf/) was formed, a non-profit organization created specifically to own Python-related Intellectual Property. Zope Corporation is a sponsoring member of the PSF. All Python releases are Open Source (see http://www.opensource.org for the Open Source Definition). Historically, most, but not all, Python releases have also been GPL-compatible; the table below summarizes the various releases. Release Derived Year Owner GPL- from compatible? (1) 0.9.0 thru 1.2 1991-1995 CWI yes 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes 1.6 1.5.2 2000 CNRI no 2.0 1.6 2000 BeOpen.com no 1.6.1 1.6 2001 CNRI yes (2) 2.1 2.0+1.6.1 2001 PSF no 2.0.1 2.0+1.6.1 2001 PSF yes 2.1.1 2.1+2.0.1 2001 PSF yes 2.2 2.1.1 2001 PSF yes 2.1.2 2.1.1 2002 PSF yes 2.1.3 2.1.2 2002 PSF yes 2.2.1 2.2 2002 PSF yes 2.2.2 2.2.1 2002 PSF yes 2.2.3 2.2.2 2003 PSF yes 2.3 2.2.2 2002-2003 PSF yes 2.3.1 2.3 2002-2003 PSF yes 2.3.2 2.3.1 2002-2003 PSF yes 2.3.3 2.3.2 2002-2003 PSF yes 2.3.4 2.3.3 2004 PSF yes 2.3.5 2.3.4 2005 PSF yes 2.4 2.3 2004 PSF yes 2.4.1 2.4 2005 PSF yes 2.4.2 2.4.1 2005 PSF yes 2.4.3 2.4.2 2006 PSF yes 2.4.4 2.4.3 2006 PSF yes 2.5 2.4 2006 PSF yes 2.5.1 2.5 2007 PSF yes 2.5.2 2.5.1 2008 PSF yes 2.5.3 2.5.2 2008 PSF yes 2.6 2.5 2008 PSF yes 2.6.1 2.6 2008 PSF yes 2.6.2 2.6.1 2009 PSF yes 2.6.3 2.6.2 2009 PSF yes 2.6.4 2.6.3 2009 PSF yes 2.6.5 2.6.4 2010 PSF yes Footnotes: (1) GPL-compatible doesn't mean that we're distributing Python under the GPL. All Python licenses, unlike the GPL, let you distribute a modified version without making your changes open source. The GPL-compatible licenses make it possible to combine Python with other software that is released under the GPL; the others don't. (2) According to Richard Stallman, 1.6.1 is not GPL-compatible, because its license has a choice of law clause. According to CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 is "not incompatible" with the GPL. Thanks to the many outside volunteers who have worked under Guido's direction to make these releases possible. B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON =============================================================== 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, 2007, 2008, 2009, 2010 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. dh_python2, pycompile, pyclean and debpython module: ==================================================== Copyright © 2010,2011 Piotr Ożarowski 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. python-defaults-2.7.17/debian/debian_defaults0000644000000000000000000000052713305600173016104 0ustar [DEFAULT] # the default python version default-version = python2.7 # all supported python versions supported-versions = python2.7 # formerly supported python versions old-versions = python2.3, python2.4, python2.5, python2.6 # unsupported versions, including older versions unsupported-versions = python2.3, python2.4, python2.5, python2.6 python-defaults-2.7.17/debian/idle.10000644000000000000000000000473413305600173014053 0ustar .TH IDLE 1 "21 September 2004" .SH NAME \fBIDLE\fP \- An Integrated DeveLopment Environment for Python .SH SYNTAX .B idle [ \fI-dins\fP ] [ \fI-t title\fP ] [ \fIfile\fP ...] .PP .B idle [ \fI-dins\fP ] [ \fI-t title\fP ] ( \fI-c cmd\fP | \fI-r file\fP ) [ \fIarg\fP ...] .PP .B idle [ \fI-dins\fP ] [ \fI-t title\fP ] - [ \fIarg\fP ...] .SH DESCRIPTION This manual page documents briefly the .BR idle command. This manual page was written for Debian because the original program does not have a manual page. For more information, refer to IDLE's help menu. .PP .B IDLE is an Integrated DeveLopment Environment for Python. IDLE is based on Tkinter, Python's bindings to the Tk widget set. Features are 100% pure Python, multi-windows with multiple undo and Python colorizing, a Python shell window subclass, a debugger. IDLE is cross-platform, i.e. it works on all platforms where Tk is installed. .LP .SH OPTIONS .TP .B \-h .PD Print this help message and exit. .TP .B \-n .PD Run IDLE without a subprocess (see Help/IDLE Help for details). .PP The following options will override the IDLE 'settings' configuration: .TP .B \-e .PD Open an edit window. .TP .B \-i .PD Open a shell window. .PP The following options imply \-i and will open a shell: .TP .B \-c cmd .PD Run the command in a shell, or .TP .B \-r file .PD Run script from file. .PP .TP .B \-d .PD Enable the debugger. .TP .B \-s .PD Run $IDLESTARTUP or $PYTHONSTARTUP before anything else. .TP .B \-t title .PD Set title of shell window. .PP A default edit window will be bypassed when \-c, \-r, or \- are used. .PP [arg]* and [file]* are passed to the command (\-c) or script (\-r) in sys.argv[1:]. .SH EXAMPLES .TP idle .PD Open an edit window or shell depending on IDLE's configuration. .TP idle foo.py foobar.py .PD Edit the files, also open a shell if configured to start with shell. .TP idle \-est "Baz" foo.py .PD Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell window with the title "Baz". .TP idle \-c "import sys; print sys.argv" "foo" .PD Open a shell window and run the command, passing "\-c" in sys.argv[0] and "foo" in sys.argv[1]. .TP idle \-d \-s \-r foo.py "Hello World" .PD Open a shell window, run a startup script, enable the debugger, and run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in sys.argv[1]. .TP echo "import sys; print sys.argv" | idle - "foobar" .PD Open a shell window, run the script piped in, passing '' in sys.argv[0] and "foobar" in sys.argv[1]. .SH SEE ALSO python(1). .SH AUTHORS Various. python-defaults-2.7.17/debian/idle.py0000755000000000000000000000013313305600173014333 0ustar #! /usr/bin/python from idlelib.PyShell import main if __name__ == '__main__': main() python-defaults-2.7.17/debian/idle2.desktop0000644000000000000000000000033313305600173015435 0ustar [Desktop Entry] Name=IDLE Comment=Integrated Development Environment for Python Exec=/usr/bin/idle Icon=/usr/share/pixmaps/idle.xpm Terminal=false Type=Application Categories=Application;Development; StartupNotify=true python-defaults-2.7.17/debian/idle2.lintian-overrides0000644000000000000000000000030713305600173017423 0ustar # icon file available in a dependent package. idle2 binary: menu-icon-missing # yes, we already have idle3, and idle pointing to it idle2 binary: dependency-on-python-version-marked-for-end-of-life python-defaults-2.7.17/debian/libpython-all-dbg.postinst0000644000000000000000000000027413305600173020164 0ustar #! /bin/sh set -e DOCDIR=/usr/share/doc/libpython-all-dbg DOCLINK=libpython-dbg if [ -d $DOCDIR ] && [ ! -L $DOCDIR ]; then rmdir $DOCDIR ln -s $DOCLINK $DOCDIR fi #DEBHELPER# python-defaults-2.7.17/debian/python-dev.dirs0000644000000000000000000000001113305600173016014 0ustar /usr/bin python-defaults-2.7.17/debian/python-minimal.dirs0000644000000000000000000000001113305600173016664 0ustar /usr/bin python-defaults-2.7.17/debian/python.desktop0000644000000000000000000000021313305606320015754 0ustar [Desktop Entry] Type=KonsoleApplication Name=Python2 Interpreter Comment=Python2 Exec=/usr/bin/python2 Icon=/usr/share/pixmaps/python2.xpm python-defaults-2.7.17/debian/python.lintian-overrides0000644000000000000000000000033013305600173017741 0ustar # this is the only package that can depend on it python binary: depends-on-python-minimal # we rely on our patched python library, don't pick up a local version python binary: command-with-path-in-maintainer-script python-defaults-2.7.17/debian/python.mk0000644000000000000000000000415513305600173014723 0ustar # some macros useful for packaging python packages # to include it unconditionally: # include /usr/share/python/python.mk # # to include it conditionally, and have the packaging working with earlier releases # and backports: # -include /usr/share/python/python.mk # ifeq (,$(py_sitename)) # py_sitename = site-packages # py_libdir = /usr/lib/python$(subst python,,$(1))/site-packages # py_sitename_sh = $(py_sitename) # py_libdir_sh = $(py_libdir) # endif # py_sitename: name of the site-packages/dist-packages directory depending # on the python version. Call as: $(call py_sitename, ). # Don't use this in shell snippets inside loops. py_sitename = $(if $(filter $(subst python,,$(1)), 2.3 2.4 2.5),site,dist)-packages # py_libdir: absolute path to the default python library for third party # stuff. Call as: $(call py_libdir, ). # Don't use this in shell snippets inside loops. py_libdir = /usr/lib/python$(strip $(if $(findstring 3.,$(subst python,,$(1))),3,$(subst python,,$(1))))/$(py_sitename) # py_pkgname: package name corresponding to the python version. # Call as: $(call py_pkgname, , ). py_pkgname = $(if $(findstring 3.,$(2)),$(subst python-,python3-,$(1)),$(1)) # distutils' build directory py_builddir = $(shell python$(strip $(subst python,,$(1))) -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)') # The same macros for use inside loops in shell snippets py_sitename_sh = $$(basename $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())')) py_libdir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils import sysconfig; print(sysconfig.get_python_lib())') py_builddir_sh = $$(_py_=$(strip $(1)); python$${_py_\#python*} -c 'from distutils.command.build import build; from distutils.core import Distribution; b = build(Distribution()); b.finalize_options(); print(b.build_platlib)') # Arguments to pass to setup.py install py_setup_install_args = --install-layout=deb python-defaults-2.7.17/debian/python.postinst.in0000644000000000000000000001132113305600173016575 0ustar #! /bin/sh set -e new_config_file() { cat > /etc/python/debian_config <<-EOF [DEFAULT] # how to byte-compile (comma separated: standard, optimize) byte-compile = standard EOF } case "$1" in configure) [ -d /etc/python ] || mkdir /etc/python [ -f /etc/python/debian_config ] || new_config_file # run the rtinstall script, when 2.5 became a supported version if [ -x /usr/bin/python2.5 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.4.4-3; then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.5..." fi version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.5 "$2" "$version" done fi # run the rtinstall script, when 2.6 became a supported version if [ -x /usr/bin/python2.6 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.5.4-6; then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.6..." fi version=$(dpkg -s python2.6-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.6 "$2" "$version" done fi # run the rtinstall script, when 2.7 became a supported version if [ -x /usr/bin/python2.7 ] && [ -n "$2" ] && dpkg --compare-versions $2 lt 2.6.6-13; then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.7..." fi version=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.7 "$2" "$version" done fi if [ -n "$2" ] && dpkg --compare-versions $2 lt 2.7.2-7~; then oldv=$(echo $2 | sed 's/^\(...\).*/\1/') if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "running python rtupdate hooks for @PVER@..." fi for hook in /usr/share/python/runtime.d/*.rtupdate; do [ -x $hook ] || continue if ! $hook rtupdate python$oldv @PVER@; then hb=$(basename $hook .rtupdate) echo >&2 "error running python rtupdate hook $hb" errors=yes fi done [ -z "$errors" ] || exit 4 if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "running python post-rtupdate hooks for @PVER@..." fi for hook in /usr/share/python/runtime.d/*.rtupdate; do [ -x $hook ] || continue if ! $hook post-rtupdate python$oldv @PVER@; then hb=$(basename $hook .rtupdate) echo >&2 "error running python post-rtupdate hook $hb" errors=yes fi done [ -z "$errors" ] || exit 5 fi if [ -f /var/lib/python/python2.5_already_installed ] \ && [ ! -f /var/lib/python/python2.5_installed ] then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.5..." fi oldversion=$(cat /var/lib/python/python2.5_already_installed) newversion=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.5 "$oldversion" "$newversion" done fi rm -f /var/lib/python/python2.5_already_installed if [ -f /var/lib/python/python2.6_already_installed ] \ && [ ! -f /var/lib/python/python2.6_installed ] then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.6..." fi oldversion=$(cat /var/lib/python/python2.6_already_installed) newversion=$(dpkg -s python2.6-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.6 "$oldversion" "$newversion" done fi rm -f /var/lib/python/python2.6_already_installed if [ -f /var/lib/python/python2.7_already_installed ] \ && [ ! -f /var/lib/python/python2.7_installed ] then if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "Linking and byte-compiling packages for runtime python2.7..." fi oldversion=$(cat /var/lib/python/python2.7_already_installed) newversion=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}') for hook in /usr/share/python/runtime.d/*.rtinstall; do [ -x $hook ] || continue $hook rtinstall python2.7 "$oldversion" "$newversion" done fi rm -f /var/lib/python/python2.7_already_installed rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null || true esac #DEBHELPER# python-defaults-2.7.17/debian/python.postrm.in0000644000000000000000000000012113305600173016232 0ustar #! /bin/sh set -e case "$1" in purge) rm -rf /etc/python esac #DEBHELPER# python-defaults-2.7.17/debian/python.preinst.in0000644000000000000000000000436113305600173016404 0ustar #! /bin/sh set -e # remove the python alternatives before installing our own python link update-alternatives --auto /usr/bin/python >/dev/null 2>&1 || true update-alternatives --remove python /usr/bin/python1.5 || true update-alternatives --remove python /usr/bin/python2.1 || true update-alternatives --remove python /usr/bin/python2.2 || true [ -L /usr/share/doc/python/html ] || rm -rf /usr/share/doc/python/html case "$1" in upgrade) if dpkg --compare-versions $2 lt 2.6.1-1~; then oldv=$(echo $2 | sed 's/^\(...\).*/\1/') if [ "$DEBIAN_FRONTEND" != noninteractive ]; then echo "running python pre-rtupdate hooks for @PVER@..." fi for hook in /usr/share/python/runtime.d/*.rtupdate; do [ -x $hook ] || continue if ! $hook pre-rtupdate python$oldv @PVER@; then hb=$(basename $hook .rtupdate) echo >&2 "error running python pre-rtupdate hook $hb" echo >&2 "running python failed-pre-rtupdate hook $hb" $hook failed-pre-rtupdate python$oldv @PVER@ errors=yes break fi done [ -z "$errors" ] || exit 3 fi # 2.4.4-5 is the first version, which adds python2.5 as supported # version; need to run an rtinstall python2.5 in the postinst. if dpkg --compare-versions $2 lt 2.4.4-5 && [ -x /usr/bin/python2.5 ]; then version=$(dpkg -s python2.5-minimal | awk '/^Version:/ {print $2}') mkdir -p /var/lib/python echo "$version" > /var/lib/python/python2.5_already_installed fi # 2.5.4-6 is the first version, which adds python2.6 as supported # version; need to run an rtinstall python2.6 in the postinst. if dpkg --compare-versions $2 lt 2.5.4-6 && [ -x /usr/bin/python2.6 ]; then version=$(dpkg -s python2.6-minimal | awk '/^Version:/ {print $2}') mkdir -p /var/lib/python echo "$version" > /var/lib/python/python2.6_already_installed fi # 2.6.6-13 is now the first version, which adds python2.7 as supported # version; need to run an rtinstall python2.7 in the postinst. if dpkg --compare-versions $2 lt 2.6.6-13 && [ -x /usr/bin/python2.7 ]; then version=$(dpkg -s python2.7-minimal | awk '/^Version:/ {print $2}') mkdir -p /var/lib/python echo "$version" > /var/lib/python/python2.7_already_installed fi esac #DEBHELPER# python-defaults-2.7.17/debian/python.prerm.in0000644000000000000000000000015113305600173016036 0ustar #! /bin/sh set -e case "$1" in remove) rm -f /usr/share/python/pyversions.py[co] esac #DEBHELPER# python-defaults-2.7.17/debian/python2-dev.dirs0000644000000000000000000000001113305606320016076 0ustar /usr/bin python-defaults-2.7.17/debian/python2-doc.docs0000644000000000000000000000002613305606320016062 0ustar pydist/README.PyDist* python-defaults-2.7.17/debian/python2-minimal.dirs0000644000000000000000000000001113305606320016746 0ustar /usr/bin python-defaults-2.7.17/debian/python2-minimal.manpages0000644000000000000000000000002613305606320017606 0ustar pyclean.1 pycompile.1 python-defaults-2.7.17/debian/python2-minimal.postinst.in0000644000000000000000000000013013305606320020277 0ustar #! /bin/sh set -e python@VER@ -m compileall /usr/share/python/ >/dev/null #DEBHELPER# python-defaults-2.7.17/debian/python2-minimal.prerm0000644000000000000000000000012113305606320017134 0ustar #! /bin/sh set -e find /usr/share/python/ -name '*.py[oc]' -delete #DEBHELPER# python-defaults-2.7.17/debian/python2.desktop0000644000000000000000000000021313305606320016036 0ustar [Desktop Entry] Type=KonsoleApplication Name=Python2 Interpreter Comment=Python2 Exec=/usr/bin/python2 Icon=/usr/share/pixmaps/python2.xpm python-defaults-2.7.17/debian/python2.install0000644000000000000000000000005013305606320016032 0ustar pydist/dist_fallback /usr/share/python/ python-defaults-2.7.17/debian/python2.lintian-overrides0000644000000000000000000000033013305606320020023 0ustar # this is the only package that can depend on it python binary: depends-on-python-minimal # we rely on our patched python library, don't pick up a local version python binary: command-with-path-in-maintainer-script python-defaults-2.7.17/debian/python2.manpages0000644000000000000000000000001513305606320016160 0ustar dh_python2.1 python-defaults-2.7.17/debian/pyversions0000755000000000000000000000015213305600173015211 0ustar #! /usr/bin/python2 import sys sys.path[0:0] = ['/usr/share/python'] import pyversions pyversions.main() python-defaults-2.7.17/debian/pyversions.10000644000000000000000000000225413305600173015352 0ustar .TH PYVERSIONS .SH NAME pyversions \- print python version information .SH SYNOPSIS .PP .B pyversions .I [-h] [-v] [] .SH DESCRIPTION .PP .B pyversions prints information about installed, supported python runtimes, the default runtime, and parses the information of the PythonVersion fields in the package control file. .SH OPTIONS .TP .I -d, --default Show the default python version. .TP .I -s, --supported Show the supported python versions. .TP .I -r, --requested [|] Reads the value of the .B XS-Python-Version field in the source section of a control file and shows all matching python versions. The parameter is interpreted as a version string, if it is not the name of a file. If the XS-Python-Version field is missing, get the version information from debian/pyversions. Without any parameter, it will fall back to list the supported Python versions after checking debian/control and debian/pyversions. .TP .I -i, --installed Show the installed supported python versions. .TP .I -v, --version Limit the output to the version numbers of the python versions. .TP .I -h, --help Print a help text. .SH SEE ALSO Python policy. .SH AUTHOR Matthias Klose python-defaults-2.7.17/debian/pyversions.py0000644000000000000000000003541013306262105015642 0ustar #! /usr/bin/python2 import os, re, sys try: SetType = set except NameError: import sets SetType = sets.Set set = sets.Set _defaults = None def read_default(name=None): global _defaults from ConfigParser import SafeConfigParser, NoOptionError if not _defaults: if os.path.exists('/usr/share/python/debian_defaults'): config = SafeConfigParser() try: config.readfp(file('/usr/share/python/debian_defaults')) except IOError, msg: print msg sys.exit(1) _defaults = config if _defaults and name: try: value = _defaults.get('DEFAULT', name) except NoOptionError: raise ValueError return value return None def parse_versions(vstring, add_exact=False): import operator operators = { None: operator.eq, '=': operator.eq, '>=': operator.ge, '<=': operator.le, '<<': operator.lt } vinfo = {} exact_versions = set([]) version_range = set(supported_versions(version_only=True) + old_versions(version_only=True)) relop_seen = False for field in vstring.split(','): field = field.strip() if field == 'all': vinfo['all'] = 'all' continue if field in ('current', 'current_ext'): vinfo['current'] = field continue vinfo.setdefault('versions', set()) ve = re.compile('(>=|<=|<<|=)? *(\d\.\d)$') m = ve.match(field) try: if not m: raise ValueError('error parsing Python-Version attribute') op, v = m.group(1), m.group(2) vmaj, vmin = v.split('.') # Don't silently ignore Python 3 versions. if int(vmaj) > 2: raise ValueError('error parsing Python-Version attribute, Python 3 version found') if op in (None, '='): exact_versions.add(v) else: relop_seen = True filtop = operators[op] version_range = [av for av in version_range if filtop(av ,v)] except Exception: raise ValueError, 'error parsing Python-Version attribute' if add_exact: if exact_versions: vinfo['vexact'] = exact_versions if 'versions' in vinfo: if relop_seen: vinfo['versions'] = set(version_range) else: del vinfo['versions'] else: if 'versions' in vinfo: vinfo['versions'] = exact_versions if relop_seen: vinfo['versions'] = exact_versions.union(version_range) return vinfo _old_versions = None def old_versions(version_only=False): global _old_versions if not _old_versions: try: value = read_default('old-versions') _old_versions = [s.strip() for s in value.split(',')] except ValueError: _old_versions = [] if version_only: return [v[6:] for v in _old_versions] else: return _old_versions _unsupported_versions = None def unsupported_versions(version_only=False): global _unsupported_versions if not _unsupported_versions: try: value = read_default('unsupported-versions') _unsupported_versions = [s.strip() for s in value.split(',')] except ValueError: _unsupported_versions = [] if version_only: return [v[6:] for v in _unsupported_versions] else: return _unsupported_versions _supported_versions = ["python%s" % ver.strip() for ver in os.environ.get('DEBPYTHON_SUPPORTED', '').split(',') if ver.strip()] def supported_versions(version_only=False): global _supported_versions if not _supported_versions: try: value = read_default('supported-versions') _supported_versions = [s.strip() for s in value.split(',')] except ValueError: cmd = ['/usr/bin/apt-cache', '--no-all-versions', 'show', 'python-all'] try: import subprocess p = subprocess.Popen(cmd, bufsize=1, shell=False, stdout=subprocess.PIPE) fd = p.stdout except ImportError: fd = os.popen(' '.join(cmd)) depends = None for line in fd: if line.startswith('Depends:'): depends = line.split(':', 1)[1].strip().split(',') fd.close() if depends: depends = [re.sub(r'\s*(\S+)[ (]?.*', r'\1', s) for s in depends] _supported_versions = depends if not _supported_versions: # last resort: python-minimal not installed, apt-cache # not available, hard code the value, #394084 _supported_versions = ['python2.6', 'python2.7'] if version_only: return [v[6:] for v in _supported_versions] else: return _supported_versions _default_version = "python%s" % os.environ.get('DEBPYTHON_DEFAULT', '') if _default_version == 'python': _default_version = None def default_version(version_only=False): global _default_version if not _default_version: try: _default_version = link = os.readlink('/usr/bin/python2') except OSError: _default_version = None try: cmd = ['/usr/bin/python2', '-c', 'import sys; print sys.version[:3]'] import subprocess p = subprocess.Popen(cmd, bufsize=1, shell=False, stdout=subprocess.PIPE) fd = p.stdout except ImportError: fd = os.popen("/usr/bin/python2 -c 'import sys; print sys.version[:3]'") line = fd.readline().strip() fd.close() if re.match(r'\d\.\d$', line): _default_version = 'python' + line # consistency check try: debian_default = read_default('default-version') except ValueError: debian_default = "python2.7" if not _default_version in (debian_default, os.path.join('/usr/bin', debian_default)): raise ValueError, "/usr/bin/python2 does not match the python2 default version. It must be reset to point to %s" % debian_default _default_version = debian_default if version_only: return _default_version[6:] else: return _default_version def requested_versions(vstring, version_only=False): versions = None vinfo = parse_versions(vstring, add_exact=True) supported = supported_versions(version_only=True) if len(vinfo) == 1: if 'all' in vinfo: versions = supported elif 'current' in vinfo: versions = [default_version(version_only=True)] elif 'vexact' in vinfo: versions = vinfo['vexact'] else: versions = vinfo['versions'].intersection(supported) elif 'all' in vinfo and 'current' in vinfo: raise ValueError, "both `current' and `all' in version string" elif 'all' in vinfo: if 'versions' in vinfo: versions = vinfo['versions'].intersection(supported) else: versions = set(supported) if 'vexact' in vinfo: versions.update(vinfo['vexact']) elif 'current' in vinfo: current = default_version(version_only=True) if not current in vinfo['versions']: raise ValueError, "`current' version not in supported versions" versions = [current] elif 'versions' in vinfo or 'vexact' in vinfo: versions = set() if 'versions' in vinfo: versions = vinfo['versions'].intersection(supported) if 'vexact' in vinfo: versions.update(vinfo['vexact']) else: raise ValueError, 'No Python versions in version string' if not versions: raise ValueError('computed set of supported versions is empty') if version_only: return versions else: return ['python%s' % v for v in versions] def installed_versions(version_only=False): import glob supported = supported_versions() versions = [os.path.basename(s) for s in glob.glob('/usr/bin/python[0-9].[0-9]') if os.path.basename(s) in supported] versions.sort() if version_only: return [v[6:] for v in versions] else: return versions class ControlFileValueError(ValueError): pass class MissingVersionValueError(ValueError): pass def extract_pyversion_attribute(fn, pkg): """read the debian/control file, extract the X-Python-Version or XS-Python-Version field; check that XB-Python-Version exists for the package.""" version = None sversion = None section = None try: fp = file(fn, 'r') except IOError, msg: print "Cannot open %s: %s" % (fn, msg) sys.exit(2) for line in fp: line = line.strip() if line == '': if section == None: continue if pkg == 'Source': break section = None elif line.startswith('Source:'): section = 'Source' elif line.startswith('Package: ' + pkg): section = pkg elif line.lower().startswith(('xs-python-version:', 'x-python-version:')): if section != 'Source': raise ValueError, \ 'attribute X(S)-Python-Version not in Source section' sversion = line.split(':', 1)[1].strip() elif line.lower().startswith('xb-python-version:'): if section == pkg: version = line.split(':', 1)[1].strip() if section == None: raise ControlFileValueError, 'not a control file' if pkg == 'Source': if sversion == None: raise MissingVersionValueError, \ 'no X(S)-Python-Version in control file' return sversion if version == None: raise MissingVersionValueError, \ 'no XB-Python-Version for package `%s' % pkg return version # compatibility functions to parse debian/pyversions def version_cmp(ver1,ver2): v1=[int(i) for i in ver1.split('.')] v2=[int(i) for i in ver2.split('.')] return cmp(v1,v2) def requested_versions_bis(vstring, version_only=False): versions = [] py_supported_short = supported_versions(version_only=True) for item in vstring.split(','): v=item.split('-') if len(v)>1: if not v[0]: v[0] = py_supported_short[0] if not v[1]: v[1] = py_supported_short[-1] for ver in py_supported_short: try: if version_cmp(ver,v[0]) >= 0 \ and version_cmp(ver,v[1]) <= 0: versions.append(ver) except ValueError: pass else: if v[0] in py_supported_short: versions.append(v[0]) versions.sort(version_cmp) if not versions: raise ValueError, 'empty set of versions' if not version_only: versions=['python'+i for i in versions] return versions def extract_pyversion_attribute_bis(fn): vstring = file(fn).readline().rstrip('\n') return vstring def main(): from optparse import OptionParser usage = '[-v] [-h] [-d|--default] [-s|--supported] [-i|--installed] [-r|--requested |]' parser = OptionParser(usage=usage) parser.add_option('-d', '--default', help='print the default python version', action='store_true', dest='default') parser.add_option('-s', '--supported', help='print the supported python versions', action='store_true', dest='supported') parser.add_option('-r', '--requested', help='print the python versions requested by a build; the argument is either the name of a control file or the value of the X(S)-Python-Version attribute', action='store_true', dest='requested') parser.add_option('-i', '--installed', help='print the installed supported python versions', action='store_true', dest='installed') parser.add_option('-v', '--version', help='print just the version number(s)', default=False, action='store_true', dest='version_only') opts, args = parser.parse_args() program = os.path.basename(sys.argv[0]) if opts.default and len(args) == 0: try: print default_version(opts.version_only) except ValueError, msg: print "%s:" % program, msg sys.exit(1) elif opts.supported and len(args) == 0: print ' '.join(supported_versions(opts.version_only)) elif opts.installed and len(args) == 0: print ' '.join(installed_versions(opts.version_only)) elif opts.requested and len(args) <= 1: if len(args) == 0: versions = 'debian/control' else: versions = args[0] try: if os.path.isfile(versions): fn = versions try: vstring = extract_pyversion_attribute(fn, 'Source') vs = requested_versions(vstring, opts.version_only) except ControlFileValueError: sys.stderr.write("%s: not a control file: %s, " \ % (program, fn)) sys.exit(1) except MissingVersionValueError: fn = os.path.join(os.path.dirname(fn), 'pyversions') sys.stderr.write("%s: missing X(S)-Python-Version in control file, fall back to %s\n" \ % (program, fn)) try: vstring = extract_pyversion_attribute_bis(fn) vs = requested_versions_bis(vstring, opts.version_only) except IOError: sys.stderr.write("%s: missing debian/pyversions file, fall back to supported versions\n" \ % program) vs = supported_versions(opts.version_only) except ValueError, e: sys.stderr.write("%s: %s\n" % (program, e)) sys.exit(4) else: vs = requested_versions(versions, opts.version_only) print ' '.join(vs) except ValueError, msg: sys.stderr.write("%s: %s\n" % (program, msg)) sys.exit(1) else: sys.stderr.write("usage: %s %s\n" % (program, usage)) sys.exit(1) if __name__ == '__main__': main() python-defaults-2.7.17/debian/rules0000755000000000000000000002364413604611701014136 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. export SHELL = /bin/bash # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) changelog_values := $(shell dpkg-parsechangelog \ | awk '/^(Version|Source):/ {print $$2}') PKGSOURCE := $(word 1, $(changelog_values)) PKGVERSION := $(word 2, $(changelog_values)) distribution := $(shell dpkg-vendor --query Vendor) distrelease := $(shell lsb_release -cs) export VER=2.7 export NVER=2.8 export PVER=python2.7 PREVVER := $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog) # first version with Multi-Arch: allowed PREVVER := 2.7.17~rc1-1~ # not yet allowed ma_allowed = yes ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric precise quantal raring saucy trusty)) bd_i586 = dpkg-dev (>= 1.17.11), python2.7:any (>= 2.7.17~rc1-1~) endif PWD := $(shell pwd) d := debian/tmp scriptdir = usr/share/lib/python$(VER) scriptdir = usr/share/python$(VER) scriptdir = usr/lib/python$(VER) rst2html = rst2html with_doc = yes ifneq ($(with_doc),yes) NOPKGS = -Npython-doc endif build: stamp-build build-arch: stamp-build build-indep: stamp-build stamp-build: touch stamp-build control-file: sed -e "s/@PVER@/$(PVER)/g" \ -e "s/@NVER@/$(NVER)/g" \ -e "s/@VER@/$(VER)/g" \ -e "s/@PREVVER@/$(PREVVER)/g" \ -e "s/@bd_i586@/$(bd_i586)/g" \ debian/control.tmp ifeq ($(distribution),Ubuntu) ifneq (,$(findstring ubuntu, $(PKGVERSION))) m='Ubuntu Developers '; \ sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \ debian/control.tmp endif endif [ -e debian/control ] \ && cmp -s debian/control debian/control.tmp \ && rm -f debian/control.tmp && exit 0; \ mv debian/control.tmp debian/control MANPAGES ?= dh_python2.1 pycompile.1 pyclean.1 %.1: %.rst rst2man $< > $@ # Manually run this rule if there is a need to update the dh_python2 man pages make-man: $(MANPAGES) cd pydist && \ rst2html README.PyDist > README.PyDist.html clean: control-file dh_testdir dh_testroot rm -f stamp-* rm -f patch-stamp* set -e;\ for f in debian/*.in; do \ f2=`echo $$f | sed "s,PVER,$(PVER),g;s/VER/$(VER)/g;s,\.in$$,,"`; \ if [ $$f2 != debian/control ]; then \ rm -f $$f2; \ fi; \ done rm -f debian/*.py[co] make clean dh_clean stamp-control: : # We have to prepare the various control files set -e;\ for f in debian/*.in; do \ f2=`echo $$f | sed "s,PVER,$(PVER),g;s/VER/$(VER)/g;s,\.in$$,,"`; \ if [ $$f2 != debian/control ]; then \ sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g" \ -e "s/@PRIORITY@/$(PRIORITY)/g" \ -e "s,@SCRIPTDIR@,/$(scriptdir),g" \ <$$f >$$f2; \ fi; \ done install: build stamp-dh_python stamp-install stamp-install: stamp-build control-file stamp-control dh_testdir dh_testroot # dh_installdirs -ppython usr/share/doc/python dh_install touch stamp-install stamp-dh_python: dh_testdir dh_testroot dh_installdirs -make check_versions DESTDIR=debian/python2 PREFIX=/usr make install-dev DESTDIR=debian/python2-minimal PREFIX=/usr make install-runtime # disabled by default, run manually if you want to update it # (requires apt-file and network connection) #make -C pydist dist_fallback touch $@ # Build architecture-independent files here. binary-indep: build install dh_testdir -i dh_testroot -i dh_installman -i ifeq ($(with_doc),yes) dh_installdocs -ppython2-doc debian/README.Debian dh_installchangelogs -ppython2-doc mkdir -p debian/python2-doc/usr/share/doc/python2 ln -sf ../python$(VER)-doc/html \ debian/python2-doc/usr/share/doc/python2/html mkdir -p debian/python2-doc/usr/share/doc/python2-doc ln -sf ../python$(VER)-doc/html \ debian/python2-doc/usr/share/doc/python2-doc/html endif # dh_installdebconf -i $(NOPKGS) dh_lintian -i dh_installdocs -i $(NOPKGS) --all debian/README.Debian dh_installchangelogs -i $(NOPKGS) dh_compress -i $(NOPKGS) dh_fixperms -i $(NOPKGS) dh_installdeb -i $(NOPKGS) dh_gencontrol -i $(NOPKGS) dh_md5sums -i $(NOPKGS) dh_builddeb -i $(NOPKGS) # Build architecture-dependent files here. binary-arch: build install dh_testdir -a dh_testroot -a dh_installman -a : # provide the python2 and python2.1 defaults mkdir -p debian/python2-minimal/usr/bin ln -sf python$(VER) debian/python2-minimal/usr/bin/python2 mkdir -p debian/python2-minimal/usr/share/man/man1 ln -sf python$(VER).1.gz \ debian/python2-minimal/usr/share/man/man1/python2.1.gz : # mkdir -p debian/python2-minimal/usr/share/python cp -p debian/debian_defaults \ debian/python2-minimal/usr/share/python/ install -m 755 debian/pyversions.py \ debian/python2-minimal/usr/share/python/ install -m 644 debian/pyversions.1 \ debian/python2-minimal/usr/share/man/man1/ dh_link -ppython2-minimal /usr/share/python/pyversions.py /usr/bin/pyversions mkdir -p debian/python2/usr/bin ln -sf pydoc$(VER) debian/python2/usr/bin/pydoc2 ln -sf pygettext$(VER) debian/python2/usr/bin/pygettext2 ln -sf pdb$(VER) debian/python2/usr/bin/pdb2 mkdir -p debian/python2/usr/share/python install -m 644 debian/python.mk \ debian/python2/usr/share/python/ mkdir -p debian/python2/usr/share/man/man1 ln -sf pydoc$(VER).1.gz \ debian/python2/usr/share/man/man1/pydoc2.1.gz ln -sf pygettext$(VER).1.gz \ debian/python2/usr/share/man/man1/pygettext2.1.gz ln -sf pdb$(VER).1.gz \ debian/python2/usr/share/man/man1/pdb2.1.gz mkdir -p debian/python2/usr/share/pixmaps ln -sf python$(VER).xpm debian/python2/usr/share/pixmaps/python2.xpm mkdir -p debian/python2/usr/share/apps/konsole cp -p debian/python2.desktop debian/python2/usr/share/apps/konsole/ : # provide the python2-config default mkdir -p debian/python2-dev/usr/bin ln -sf python$(VER)-config debian/python2-dev/usr/bin/python2-config mkdir -p debian/python2-dev/usr/share/man/man1 ln -sf python$(VER)-config.1.gz \ debian/python2-dev/usr/share/man/man1/python2-config.1.gz : # provide pkgconfig defaults mkdir -p debian/python2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig ln -sf python-$(VER).pc debian/python2-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python2.pc mkdir -p debian/python2-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig ln -sf python-$(VER)-dbg.pc debian/python2-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python2-dbg.pc : # provide the python2-dbg and python2-dbg.1 defaults mkdir -p debian/python2-dbg/usr/bin ln -sf python$(VER)-dbg debian/python2-dbg/usr/bin/python2-dbg ln -sf python$(VER)-dbg-config debian/python2-dbg/usr/bin/python2-dbg-config mkdir -p debian/python2-dbg/usr/share/man/man1 ln -sf python$(VER)-dbg.1.gz \ debian/python2-dbg/usr/share/man/man1/python2-dbg.1.gz ln -sf python$(VER)-dbg-config.1.gz \ debian/python2-dbg/usr/share/man/man1/python2-dbg-config.1.gz mkdir -p debian/python2-dbg/usr/share/doc/python2 ln -sf ../python$(VER)/SpecialBuilds.txt.gz \ debian/python2-dbg/usr/share/doc/python2/SpecialBuilds.txt.gz ln -sf ../python$(VER)/README.debug \ debian/python2-dbg/usr/share/doc/python2/README.debug mkdir -p debian/python2/usr/lib/valgrind cp -p debian/valgrind-python.supp \ debian/python2/usr/lib/valgrind/python2.supp : # provide the DEB_HOST_GNU_TYPE/DEB_HOST_MULTIRACH python2-config defaults mkdir -p debian/libpython2-dev/usr/bin ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config \ debian/libpython2-dev/usr/bin/$(DEB_HOST_MULTIARCH)-python2-config mkdir -p debian/libpython2-dev/usr/share/man/man1 ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-config.1.gz \ debian/libpython2-dev/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python2-config.1.gz ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config \ debian/libpython2-dev/usr/bin/$(DEB_HOST_GNU_TYPE)-python2-config ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-config.1.gz \ debian/libpython2-dev/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python2-config.1.gz endif mkdir -p debian/libpython2-dbg/usr/bin ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config \ debian/libpython2-dbg/usr/bin/$(DEB_HOST_MULTIARCH)-python2-dbg-config mkdir -p debian/libpython2-dbg/usr/share/man/man1 ln -sf $(DEB_HOST_MULTIARCH)-python$(VER)-dbg-config.1.gz \ debian/libpython2-dbg/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-python2-dbg-config.1.gz ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config \ debian/libpython2-dbg/usr/bin/$(DEB_HOST_GNU_TYPE)-python2-dbg-config ln -sf $(DEB_HOST_GNU_TYPE)-python$(VER)-dbg-config.1.gz \ debian/libpython2-dbg/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-python2-dbg-config.1.gz endif dh_lintian -a dh_installdocs -a $(NOPKGS) --all debian/README.Debian dh_installchangelogs -a $(NOPKGS) for p in dbg dev; do \ p=python2-$$p; \ rm -rf debian/$$p/usr/share/doc/$$p; \ ln -sf python2 debian/$$p/usr/share/doc/$$p; \ done for p in all all-dev all-dbg; do \ p=python-$$p; \ rm -rf debian/$$p/usr/share/doc/$$p; \ ln -sf python2 debian/$$p/usr/share/doc/$$p; \ done rm -rf debian/libpython-all-dev/usr/share/doc/libpython-all-dev ln -sf libpython2-dev debian/libpython-all-dev/usr/share/doc/libpython-all-dev rm -rf debian/libpython-all-dbg/usr/share/doc/libpython-all-dbg ln -sf libpython2-dbg debian/libpython-all-dbg/usr/share/doc/libpython-all-dbg dh_compress -a $(NOPKGS) dh_fixperms -a $(NOPKGS) dh_installdeb -a $(NOPKGS) dh_gencontrol -a $(NOPKGS) dh_md5sums -a $(NOPKGS) dh_builddeb -a $(NOPKGS) # Build architecture-dependent files here. binary-arch: build install # nothing to do binary: binary-indep binary-arch .PHONY: control-file configure build clean binary-indep binary-arch binary install # Local Variables: # mode: makefile # end: python-defaults-2.7.17/debian/source.lintian-overrides0000644000000000000000000000106013305600173017721 0ustar # this source package provides these packages so it cannot depend on them python-defaults source: dbg-package-missing-depends python-all-dbg python-defaults source: dbg-package-missing-depends python-dbg python-defaults source: dbg-package-missing-depends libpython-all-dbg python-defaults source: dbg-package-missing-depends libpython-dbg # it's upstream software, just splitted out. python-defaults source: native-package-with-dash-version # yes, that's going to be away as the second-last package ... python-defaults source: python-foo-but-no-python3-foo python-defaults-2.7.17/debian/valgrind-python.supp0000644000000000000000000001734513305600173017114 0ustar # # This is a valgrind suppression file that should be used when using valgrind. # # --------------------------------------------------------------------------- # Debian note: # The file Misc/valgrind-python.supp is placed in an modified form into the # directory /usr/lib/valgrind as python.supp. There's no need to to add it # with the --suppressions option. # The unmodified file is found in /usr/share/doc/python2.6/ # # The python2.6-dbg build has been compiled with -DPy_USING_MEMORY_DEBUGGER # so you can safely comment out the suppressions for PyObject_Free and # PyObject_Realloc. # --------------------------------------------------------------------------- # Here's an example of running valgrind: # # cd python/dist/src # valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \ # ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network # # You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER # to use the preferred suppressions with Py_ADDRESS_IN_RANGE. # # If you do not want to recompile Python, you can uncomment # suppressions for PyObject_Free and PyObject_Realloc. # # See /usr/share/doc/python2.6/README.valgrind for more information. # all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif { ADDRESS_IN_RANGE/Invalid read of size 4 Memcheck:Addr4 fun:Py_ADDRESS_IN_RANGE } { ADDRESS_IN_RANGE/Invalid read of size 4 Memcheck:Value4 fun:Py_ADDRESS_IN_RANGE } { ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64) Memcheck:Value8 fun:Py_ADDRESS_IN_RANGE } { ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value Memcheck:Cond fun:Py_ADDRESS_IN_RANGE } # # Leaks (including possible leaks) # Hmmm, I wonder if this masks some real leaks. I think it does. # Will need to fix that. # { Suppress leaking the GIL. Happens once per process, see comment in ceval.c. Memcheck:Leak fun:malloc fun:PyThread_allocate_lock fun:PyEval_InitThreads } { Suppress leaking the GIL after a fork. Memcheck:Leak fun:malloc fun:PyThread_allocate_lock fun:PyEval_ReInitThreads } { Suppress leaking the autoTLSkey. This looks like it shouldn't leak though. Memcheck:Leak fun:malloc fun:PyThread_create_key fun:_PyGILState_Init fun:Py_InitializeEx fun:Py_Main } { Hmmm, is this a real leak or like the GIL? Memcheck:Leak fun:malloc fun:PyThread_ReInitTLS } { Handle PyMalloc confusing valgrind (possibly leaked) Memcheck:Leak fun:realloc fun:_PyObject_GC_Resize fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING } { Handle PyMalloc confusing valgrind (possibly leaked) Memcheck:Leak fun:malloc fun:_PyObject_GC_New fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING } { Handle PyMalloc confusing valgrind (possibly leaked) Memcheck:Leak fun:malloc fun:_PyObject_GC_NewVar fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING } # # Non-python specific leaks # { Handle pthread issue (possibly leaked) Memcheck:Leak fun:calloc fun:allocate_dtv fun:_dl_allocate_tls_storage fun:_dl_allocate_tls } { Handle pthread issue (possibly leaked) Memcheck:Leak fun:memalign fun:_dl_allocate_tls_storage fun:_dl_allocate_tls } ###{ ### ADDRESS_IN_RANGE/Invalid read of size 4 ### Memcheck:Addr4 ### fun:PyObject_Free ###} ### ###{ ### ADDRESS_IN_RANGE/Invalid read of size 4 ### Memcheck:Value4 ### fun:PyObject_Free ###} ### ###{ ### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 ### Memcheck:Addr8 ### fun:PyObject_Free ###} ### ###{ ### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 ### Memcheck:Value8 ### fun:PyObject_Free ###} ### ###{ ### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value ### Memcheck:Cond ### fun:PyObject_Free ###} ###{ ### ADDRESS_IN_RANGE/Invalid read of size 4 ### Memcheck:Addr4 ### fun:PyObject_Realloc ###} ### ###{ ### ADDRESS_IN_RANGE/Invalid read of size 4 ### Memcheck:Value4 ### fun:PyObject_Realloc ###} ### ###{ ### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 ### Memcheck:Addr8 ### fun:PyObject_Realloc ###} ### ###{ ### ADDRESS_IN_RANGE/Use of uninitialised value of size 8 ### Memcheck:Value8 ### fun:PyObject_Realloc ###} ### ###{ ### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value ### Memcheck:Cond ### fun:PyObject_Realloc ###} ### ### All the suppressions below are for errors that occur within libraries ### that Python uses. The problems to not appear to be related to Python's ### use of the libraries. ### { Generic ubuntu ld problems Memcheck:Addr8 obj:/lib/ld-2.4.so obj:/lib/ld-2.4.so obj:/lib/ld-2.4.so obj:/lib/ld-2.4.so } { Generic gentoo ld problems Memcheck:Cond obj:/lib/ld-2.3.4.so obj:/lib/ld-2.3.4.so obj:/lib/ld-2.3.4.so obj:/lib/ld-2.3.4.so } { DBM problems, see test_dbm Memcheck:Param write(buf) fun:write obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 fun:dbm_close } { DBM problems, see test_dbm Memcheck:Value8 fun:memmove obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 fun:dbm_store fun:dbm_ass_sub } { DBM problems, see test_dbm Memcheck:Cond obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 fun:dbm_store fun:dbm_ass_sub } { DBM problems, see test_dbm Memcheck:Cond fun:memmove obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 obj:/usr/lib/libdb1.so.2 fun:dbm_store fun:dbm_ass_sub } { GDBM problems, see test_gdbm Memcheck:Param write(buf) fun:write fun:gdbm_open } { ZLIB problems, see test_gzip Memcheck:Cond obj:/lib/libz.so.1.2.3.3 obj:/lib/libz.so.1.2.3.3 fun:deflate } { Avoid problems w/readline doing a putenv and leaking on exit Memcheck:Leak fun:malloc fun:xmalloc fun:sh_set_lines_and_columns fun:_rl_get_screen_size fun:_rl_init_terminal_io obj:/lib/libreadline.so.6.1 fun:rl_initialize } ### ### These occur from somewhere within the SSL, when running ### test_socket_sll. They are too general to leave on by default. ### ###{ ### somewhere in SSL stuff ### Memcheck:Cond ### fun:memset ###} ###{ ### somewhere in SSL stuff ### Memcheck:Value4 ### fun:memset ###} ### ###{ ### somewhere in SSL stuff ### Memcheck:Cond ### fun:MD5_Update ###} ### ###{ ### somewhere in SSL stuff ### Memcheck:Value4 ### fun:MD5_Update ###} # # All of these problems come from using test_socket_ssl # { from test_socket_ssl Memcheck:Cond fun:BN_bin2bn } { from test_socket_ssl Memcheck:Cond fun:BN_num_bits_word } { from test_socket_ssl Memcheck:Value4 fun:BN_num_bits_word } { from test_socket_ssl Memcheck:Cond fun:BN_mod_exp_mont_word } { from test_socket_ssl Memcheck:Cond fun:BN_mod_exp_mont } { from test_socket_ssl Memcheck:Param write(buf) fun:write obj:/usr/lib/libcrypto.so.0.9.8 } { from test_socket_ssl Memcheck:Cond fun:RSA_verify } { from test_socket_ssl Memcheck:Value4 fun:RSA_verify } { from test_socket_ssl Memcheck:Value4 fun:DES_set_key_unchecked } { from test_socket_ssl Memcheck:Value4 fun:DES_encrypt2 } { from test_socket_ssl Memcheck:Cond obj:/usr/lib/libssl.so.0.9.8 } { from test_socket_ssl Memcheck:Value4 obj:/usr/lib/libssl.so.0.9.8 } { from test_socket_ssl Memcheck:Cond fun:BUF_MEM_grow_clean } { from test_socket_ssl Memcheck:Cond fun:memcpy fun:ssl3_read_bytes } { from test_socket_ssl Memcheck:Cond fun:SHA1_Update } { from test_socket_ssl Memcheck:Value4 fun:SHA1_Update } python-defaults-2.7.17/debpython/0000755000000000000000000000000013606363306013626 5ustar python-defaults-2.7.17/debpython/__init__.py0000644000000000000000000000000013305600173015715 0ustar python-defaults-2.7.17/debpython/debhelper.py0000644000000000000000000002117613305600173016131 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. import logging from os import makedirs, chmod from os.path import exists, join, dirname log = logging.getLogger(__name__) class DebHelper(object): """Reinvents the wheel / some dh functionality (Perl is ugly ;-P)""" def __init__(self, options): self.options = options self.packages = {} self.python_version = None source_section = True binary_package = None pkgs = options.package skip_pkgs = options.no_package try: fp = open('debian/control', 'r') except IOError: raise Exception('cannot find debian/control file') xspv = xpv = False for line in fp: if not line.strip(): source_section = False binary_package = None continue if binary_package: if binary_package.startswith('python3'): continue if pkgs and binary_package not in pkgs: continue if skip_pkgs and binary_package in skip_pkgs: continue if line.startswith('Architecture:'): arch = line[13:].strip() # TODO: if arch doesn't match current architecture: #del self.packages[binary_package] self.packages[binary_package]['arch'] = arch continue elif line.startswith('Package:'): binary_package = line[8:].strip() if binary_package.startswith('python3'): log.debug('skipping Python 3.X package: %s', binary_package) continue if pkgs and binary_package not in pkgs: continue if skip_pkgs and binary_package in skip_pkgs: continue self.packages[binary_package] = {'substvars': {}, 'autoscripts': {}, 'rtupdates': [], 'arch': 'any'} elif line.startswith('Source:'): self.source_name = line[7:].strip() elif source_section: if line.lower().startswith('xs-python-version:'): xspv = True if not self.python_version: self.python_version = line[18:].strip() if line.lower().startswith('x-python-version:'): xpv = True self.python_version = line[17:].strip() if xspv and xpv: log.error('Please remove XS-Python-Version from debian/control') log.debug('source=%s, binary packages=%s', self.source_name, \ self.packages.keys()) def addsubstvar(self, package, name, value): """debhelper's addsubstvar""" self.packages[package]['substvars'].setdefault(name, []).append(value) def autoscript(self, package, when, template, args): """debhelper's autoscript""" self.packages[package]['autoscripts'].setdefault(when, {})\ .setdefault(template, []).append(args) def add_rtupdate(self, package, value): self.packages[package]['rtupdates'].append(value) def save_autoscripts(self): for package, settings in self.packages.iteritems(): autoscripts = settings.get('autoscripts') if not autoscripts: continue for when, templates in autoscripts.iteritems(): fn = "debian/%s.%s.debhelper" % (package, when) if exists(fn): data = open(fn, 'r').read() else: data = '' new_data = '' for tpl_name, args in templates.iteritems(): for i in args: # try local one first (useful while testing dh_python2) fpath = join(dirname(__file__), '..', "autoscripts/%s" % tpl_name) if not exists(fpath): fpath = "/usr/share/debhelper/autoscripts/%s" % tpl_name tpl = open(fpath, 'r').read() if self.options.compile_all and args: # TODO: should args be checked to contain dir name? tpl = tpl.replace('#PACKAGE#', '') else: tpl = tpl.replace('#PACKAGE#', package) tpl = tpl.replace('#ARGS#', i) if tpl not in data and tpl not in new_data: new_data += "\n%s" % tpl if new_data: data += "\n# Automatically added by dh_python2:" +\ "%s\n# End automatically added section\n" % new_data fp = open(fn, 'w') fp.write(data) fp.close() def save_substvars(self): for package, settings in self.packages.iteritems(): substvars = settings.get('substvars') if not substvars: continue fn = "debian/%s.substvars" % package if exists(fn): data = open(fn, 'r').read() else: data = '' for name, values in substvars.iteritems(): p = data.find("%s=" % name) if p > -1: # parse the line and remove it from data e = data[p:].find('\n') line = data[p + len("%s=" % name):\ p + e if e > -1 else None] items = [i.strip() for i in line.split(',') if i] if e > -1 and data[p + e:].strip(): data = "%s\n%s" % (data[:p], data[p + e:]) else: data = data[:p] else: items = [] for j in values: if j not in items: items.append(j) if items: if data: data += '\n' data += "%s=%s\n" % (name, ', '.join(items)) data = data.replace('\n\n', '\n') if data: fp = open(fn, 'w') fp.write(data) fp.close() def save_rtupdate(self): for package, settings in self.packages.iteritems(): pkg_arg = '' if self.options.compile_all else "-p %s" % package values = settings.get('rtupdates') if not values: continue d = "debian/%s/usr/share/python/runtime.d" % package if not exists(d): makedirs(d) fn = "%s/%s.rtupdate" % (d, package) if exists(fn): data = open(fn, 'r').read() else: data = "#! /bin/sh\nset -e" for dname, args in values: cmd = 'if [ "$1" = rtupdate ]; then' +\ "\n\tpyclean %s %s" % (pkg_arg, dname) +\ "\n\tpycompile %s %s %s\nfi" % (pkg_arg, args, dname) if cmd not in data: data += "\n%s" % cmd if data: fp = open(fn, 'w') fp.write(data) fp.close() chmod(fn, 0755) def save(self): self.save_substvars() self.save_autoscripts() self.save_rtupdate() python-defaults-2.7.17/debpython/depends.py0000644000000000000000000001605713606362652015636 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. import logging from debpython.pydist import parse_pydep, guess_dependency from debpython.version import DEFAULT, SUPPORTED, debsorted, vrepr, vrange_str # minimum version required for pycompile/pyclean MINPYCDEP = 'python2:any (>= 2.6.6-7~)' log = logging.getLogger(__name__) class Dependencies(object): """Store relations (dependencies, etc.) between packages.""" def __init__(self, package): self.package = package self.depends = [] self.recommends = [] self.suggests = [] self.enhances = [] self.breaks = [] self.rtscripts = [] def export_to(self, dh): """Fill in debhelper's substvars.""" for i in sorted(self.depends): dh.addsubstvar(self.package, 'python:Depends', i) for i in sorted(self.recommends): dh.addsubstvar(self.package, 'python:Recommends', i) for i in sorted(self.suggests): dh.addsubstvar(self.package, 'python:Suggests', i) for i in sorted(self.enhances): dh.addsubstvar(self.package, 'python:Enhances', i) for i in sorted(self.breaks): dh.addsubstvar(self.package, 'python:Breaks', i) for i in self.rtscripts: dh.add_rtupdate(self.package, i) def __str__(self): return "D=%s; R=%s; S=%s; E=%s, B=%s; RT=%s" % (self.depends, \ self.recommends, self.suggests, self.enhances, \ self.breaks, self.rtscripts) def depend(self, value): if value and value not in self.depends: self.depends.append(value) def recommend(self, value): if value and value not in self.recommends: self.recommends.append(value) def suggest(self, value): if value and value not in self.suggests: self.suggests.append(value) def enhance(self, value): if value and value not in self.enhances: self.enhances.append(value) def break_(self, value): if value and value not in self.breaks: self.breaks.append(value) def rtscript(self, value): if value not in self.rtscripts: self.rtscripts.append(value) def parse(self, stats, options): log.debug('generating dependencies for package %s', self.package) pub_vers = sorted(stats['public_vers'].union(stats['ext'])) if pub_vers: dbgpkg = self.package.endswith('-dbg') tpl = 'python2-dbg' if dbgpkg else 'python2' minv = pub_vers[0] maxv = pub_vers[-1] # generating "python2.X | python2.Y | python2.Z" dependencies # disabled (see #625740): #if dbgpkg: # tpl2 = 'python%d.%d-dbg' #else: # tpl2 = 'python%d.%d' #self.depend(' | '.join(tpl2 % i for i in debsorted(pub_vers))) # additional Depends to block python package transitions if minv <= DEFAULT: self.depend("%s (>= %d.%d)" % \ (tpl, minv[0], minv[1])) if maxv >= DEFAULT: self.depend("%s (<< %d.%d)" % \ (tpl, maxv[0], maxv[1] + 1)) # make sure pycompile binary is available if stats['compile']: self.depend(MINPYCDEP) for interpreter, version in stats['shebangs']: self.depend("%s:any" % interpreter) for private_dir, details in stats['private_dirs'].iteritems(): versions = list(v for i, v in details.get('shebangs', []) if v) for v in versions: if v in SUPPORTED: self.depend("python%d.%d:any" % v) else: log.info('dependency on python%s (from shebang) ignored' ' - it\'s not supported anymore', vrepr(v)) # /usr/bin/python shebang → add python to Depends if any(True for i, v in details.get('shebangs', []) if v is None): self.depend('python2:any') if details.get('compile', False): self.depend(MINPYCDEP) args = '' vr = options.vrange if len(versions) == 1: # only one version from shebang args += "-V %s" % vrepr(versions[0]) elif vr: # if there are no hardcoded versions in shebang or there # are scripts for different Python versions: compile with # default Python version (or the one requested via X-P-V) args += "-V %s" % vrange_str(vr) if vr == (None, None): pass elif vr[0] == vr[1]: self.depend("python%s:any" % vrepr(vr[0])) else: if vr[0]: # minimum version specified self.depend("python2:any (>= %s)" % vrepr(vr[0])) if vr[1]: # maximum version specified self.depend("python:any (<< %d.%d)" % \ (vr[1][0], vr[1][1] + 1)) for pattern in options.regexpr or []: args += " -X '%s'" % pattern.replace("'", r"'\''") self.rtscript((private_dir, args)) if options.guess_deps: for fn in stats['requires.txt']: # TODO: should options.recommends and options.suggests be # removed from requires.txt? for i in parse_pydep(fn): self.depend(i) # add dependencies from --depends for item in options.depends or []: self.depend(guess_dependency(item)) # add dependencies from --recommends for item in options.recommends or []: self.recommend(guess_dependency(item)) # add dependencies from --suggests for item in options.suggests or []: self.suggest(guess_dependency(item)) log.debug(self) python-defaults-2.7.17/debpython/files.py0000644000000000000000000000575613305600173015307 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. import logging from os import walk from os.path import abspath, isfile, join from subprocess import Popen, PIPE log = logging.getLogger(__name__) def from_directory(dname, extensions=('.py',)): """Generate *.py file names available in given directory.""" extensions = tuple(extensions) # .endswith doesn't like list if isinstance(dname, (list, tuple)): for item in dname: for fn in from_directory(item): yield fn elif isfile(dname) and dname.endswith(extensions): yield dname else: for root, dirs, file_names in walk(abspath(dname)): for fn in file_names: if fn.endswith(extensions): yield join(root, fn) def from_package(package_name, extensions=('.py',)): """Generate *.py file names available in given package.""" extensions = tuple(extensions) # .endswith doesn't like list process = Popen("/usr/bin/dpkg -L %s" % package_name,\ shell=True, stdout=PIPE) stdout, stderr = process.communicate() if process.returncode != 0: raise Exception("cannot get content of %s" % package_name) for line in stdout.splitlines(): if line.endswith(extensions): yield line def filter_directory(files, dname): """Generate *.py file names that match given directory.""" for fn in files: if fn.startswith(dname): yield fn def filter_public(files, versions): """Generate *.py file names that match given versions.""" versions_str = set("%d.%d" % i for i in versions) for fn in files: if fn.startswith('/usr/lib/python') and \ fn[15:18] in versions_str: yield fn def filter_out_ext(files, extensions): """Removes files with matching extensions from given generator.""" for fn in files: if not fn.endswith(extensions): yield fn python-defaults-2.7.17/debpython/namespace.py0000644000000000000000000001372513305600173016134 0ustar # -*- coding: UTF-8 -*- # Copyright © 2011-2012 Piotr Ożarowski # # 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. from __future__ import with_statement import logging from os import environ, listdir, remove, rmdir from os.path import dirname, exists, join, getsize, split from subprocess import Popen, PIPE from debpython.pydist import PUBLIC_DIR_RE from debpython.tools import memoize, sitedir log = logging.getLogger(__name__) def parse(fpaths, other=None): """Parse namespace_packages.txt files.""" result = set(other or []) for fpath in fpaths: with open(fpath, 'r') as fp: for line in fp: if line: result.add(line.strip()) return result @memoize def load(package=None): """Return a set of namespaces to regenerate/clean. :param package: limit namespaces to the ones needed by given package """ fpaths = None # DESTDIR is used in tests nsdir = "%s/usr/share/python/ns/" % environ.get('DESTDIR', '') if package: # only one package is processed, no need to load all files fpath = join(nsdir, package) if exists(fpath): fpaths = [fpath] else: # load all files if exists(nsdir): fpaths = [join(nsdir, i) for i in listdir(nsdir)] if fpaths: result = set(i.replace('.', '/') for i in parse(fpaths)) else: result = set() return result def add_namespace_files(files, package=None, action=None): """Add __init__.py files to given generator.""" if action is not None: namespaces = load(package) already_processed = set() removal_candidates = set() for fn in files: yield fn if action is None: continue dpath = dirname(fn) if dpath not in already_processed: already_processed.add(dpath) m = PUBLIC_DIR_RE.match(dpath) if m: public_dir = m.group() while dpath != public_dir: ns_dir = dpath[len(public_dir) + 1:] if ns_dir in namespaces: fpath = join(dpath, '__init__.py') if action is True: try: open(fpath, 'a').close() except Exception: log.error('cannot create %s', fpath) else: yield fpath else: # action is False # postpone it due to dpkg -S call removal_candidates.add(fpath) already_processed.add(dpath) dpath = split(dpath)[0] # now deal with to-be-removed namespace candidates (dpkg -S is expensive) # dpgk -S is used just to be safe (in case some other package is providing # __init__.py file although it's in /usr/share/python/ns dir) if action is False and removal_candidates: process = Popen("/usr/bin/dpkg -S %s 2>/dev/null" % \ ' '.join(removal_candidates), shell=True, stdout=PIPE) # FIXME: len(search_string) > 131072 stdout, stderr = process.communicate() for line in stdout.splitlines(): ns = line.split(': ', 1)[1] if ns in removal_candidates: removal_candidates.remove(ns) for fpath in removal_candidates: try: remove(fpath) except (IOError, OSError), e: log.error('cannot remove %s', fpath) log.debug(e) else: yield fpath def remove_from_package(package, namespaces, versions): """Remove empty __init__.py files for requested namespaces.""" if not isinstance(namespaces, set): namespaces = set(namespaces) keep = set() for ns in namespaces: for version in versions: fpath = join(sitedir(version, package), *ns.split('.')) fpath = join(fpath, '__init__.py') if not exists(fpath): continue if getsize(fpath) != 0: log.warning('file not empty, cannot share %s namespace', ns) keep.add(ns) break # return a set of namespaces that should be handled by pycompile/pyclean result = namespaces - keep # remove empty __init__.py files, if available for ns in result: for version in versions: dpath = join(sitedir(version, package), *ns.split('.')) fpath = join(dpath, '__init__.py') if exists(fpath): remove(fpath) if not listdir(dpath): rmdir(dpath) # clean pyshared dir as well dpath = join('debian', package, 'usr/share/pyshared', *ns.split('.')) fpath = join(dpath, '__init__.py') if exists(fpath): remove(fpath) if not listdir(dpath): rmdir(dpath) return result python-defaults-2.7.17/debpython/option.py0000644000000000000000000000353613305600173015507 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. import re import optparse from copy import copy from debpython.version import parse_vrange def parse_version_range(option, opt, value): try: return parse_vrange(value) except ValueError: raise optparse.OptionValueError("version range is invalid: %s" % value) def compile_regexpr(option, opt, value): try: pattern = re.compile(value) except Exception: raise optparse.OptionValueError('regular expression is not valid') return pattern class Option(optparse.Option): TYPES = optparse.Option.TYPES + ('version_range', 'regexpr') TYPE_CHECKER = copy(optparse.Option.TYPE_CHECKER) TYPE_CHECKER['version_range'] = parse_version_range TYPE_CHECKER['regexpr'] = compile_regexpr python-defaults-2.7.17/debpython/pydist.py0000644000000000000000000002425013305600173015507 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. from __future__ import with_statement import logging import os import re from os.path import exists, isdir, join from string import maketrans from subprocess import PIPE, Popen from debpython.version import vrepr, getver, get_requested_versions from debpython.tools import memoize log = logging.getLogger(__name__) PUBLIC_DIR_RE = re.compile(r'.*?/usr/lib/python(\d.\d+)/(site|dist)-packages') PYDIST_RE = re.compile(r""" (?P[A-Za-z][A-Za-z0-9_.\-]*) # Python distribution name \s* (?P(?:-?\d\.\d+(?:-(?:\d\.\d+)?)?)?) # version range \s* (?P(?:[a-z][^;]*)?) # Debian dependency (?: # optional upstream version -> Debian version translator ;\s* (?PPEP386)? # PEP-386 mode \s* (?P(?:s|tr|y).*)? # translator rules )? """, re.VERBOSE) REQUIRES_RE = re.compile(r''' (?P[A-Za-z][A-Za-z0-9_.]*) # Python distribution name \s* (?P(?:\[[^\]]*\])?) # ignored for now \s* (?: # optional minimum/maximum version (?P<=?|>=?|==|!=) \s* (?P(\w|[-.])+) )? ''', re.VERBOSE) def validate(fpath): """Check if pydist file looks good.""" with open(fpath) as fp: for line in fp: line = line.strip('\r\n') if line.startswith('#') or not line: continue if not PYDIST_RE.match(line): log.error('invalid pydist data in file %s: %s', \ fpath.rsplit('/', 1)[-1], line) return False return True @memoize def load(dname='/usr/share/python/dist/', fname='debian/pydist-overrides', fbname='/usr/share/python/dist_fallback'): """Load iformation about installed Python distributions.""" if exists(fname): to_check = [fname] # first one! else: to_check = [] if isdir(dname): to_check.extend(join(dname, i) for i in os.listdir(dname)) if exists(fbname): # fall back generated at python-defaults build time to_check.append(fbname) # last one! result = {} for fpath in to_check: with open(fpath) as fp: for line in fp: line = line.strip('\r\n') if line.startswith('#') or not line: continue dist = PYDIST_RE.search(line) if not dist: raise Exception('invalid pydist line: %s (in %s)' % (line, fpath)) dist = dist.groupdict() name = safe_name(dist['name']) dist['versions'] = get_requested_versions(dist['vrange']) dist['dependency'] = dist['dependency'].strip() if dist['rules']: dist['rules'] = dist['rules'].split(';') else: dist['rules'] = [] result.setdefault(name, []).append(dist) return result def guess_dependency(req, version=None): log.debug('trying to guess dependency for %s (python=%s)', req, vrepr(version) if version else None) if isinstance(version, basestring): version = getver(version) # some upstreams have weird ideas for distribution name... name, rest = re.compile('([^!><= \[]+)(.*)').match(req).groups() req = safe_name(name) + rest data = load() req_d = REQUIRES_RE.match(req) if not req_d: log.info('please ask dh_python2 author to fix REQUIRES_RE ' 'or your upstream author to fix requires.txt') raise Exception('requirement is not valid: %s' % req) req_d = req_d.groupdict() name = req_d['name'] details = data.get(name.lower()) if details: for item in details: if version and version not in item.get('versions', version): # rule doesn't match version, try next one continue if not item['dependency']: return # this requirement should be ignored if item['dependency'].endswith(')'): # no need to translate versions if version is hardcoded in # Debian dependency return item['dependency'] if req_d['version'] and (item['standard'] or item['rules']) and\ req_d['operator'] not in (None, '=='): v = _translate(req_d['version'], item['rules'], item['standard']) return "%s (%s %s)" % (item['dependency'], req_d['operator'], v) else: return item['dependency'] # try dpkg -S query = "'*/%s-?*\.egg-info'" % ci_regexp(safe_name(name)) # TODO: .dist-info if version: query = "%s | grep '/python%s/\|/pyshared/'" % \ (query, vrepr(version)) else: query = "%s | grep '/python2\../\|/pyshared/'" % query log.debug("invoking dpkg -S %s", query) process = Popen("/usr/bin/dpkg -S %s" % query, \ shell=True, stdout=PIPE, stderr=PIPE) stdout, stderr = process.communicate() if process.returncode == 0: result = set() for line in stdout.split('\n'): if not line.strip(): continue result.add(line.split(':')[0]) if len(result) > 1: log.error('more than one package name found for %s dist', name) else: return result.pop() else: log.debug('dpkg -S did not find package for %s: %s', name, stderr) # fall back to python-distname pname = sensible_pname(name) log.info('Cannot find installed package that provides %s. ' 'Using %s as package name. Please add "%s correct_package_name" ' 'line to debian/pydist-overrides to override it if this is incorrect.', name, pname, safe_name(name)) return pname def parse_pydep(fname): public_dir = PUBLIC_DIR_RE.match(fname) if public_dir: ver = public_dir.group(1) else: ver = None result = [] modified = optional_section = False processed = [] with open(fname, 'r') as fp: lines = [i.strip() for i in fp.readlines()] for line in lines: if not line or line.startswith('#'): processed.append(line) continue if line.startswith('['): optional_section = True if optional_section: processed.append(line) continue dependency = guess_dependency(line, ver) if dependency: result.append(dependency) if 'setuptools' in line.lower(): # TODO: or dependency in recommends\ # or dependency in suggests modified = True else: processed.append(line) else: processed.append(line) if modified: with open(fname, 'w') as fp: fp.writelines(i + '\n' for i in processed) return result def safe_name(name): """Emulate distribute's safe_name.""" return re.compile('[^A-Za-z0-9.]+').sub('_', name).lower() def sensible_pname(egg_name): """Guess Debian package name from Egg name.""" egg_name = safe_name(egg_name).replace('_', '-') if egg_name.startswith('python-'): egg_name = egg_name[7:] return "python-%s" % egg_name.lower() def ci_regexp(name): """Return case insensitive dpkg -S regexp.""" return ''.join("[%s%s]" % (i.upper(), i) if i.isalpha() else i for i in name.lower()) PRE_VER_RE = re.compile(r'[-.]?(alpha|beta|rc|dev|a|b|c)') GROUP_RE = re.compile(r'\$(\d+)') def _pl2py(pattern): """Convert Perl RE patterns used in uscan to Python's >>> print _pl2py('foo$3') foo\g<3> """ return GROUP_RE.sub(r'\\g<\1>', pattern) def _translate(version, rules, standard): """Translate Python version into Debian one. >>> _translate('1.C2betac', ['s/c//gi'], None) '1.2beta' >>> _translate('5-fooa1.2beta3-fooD', ... ['s/^/1:/', 's/-foo//g', 's:([A-Z]):+$1:'], 'PEP386') '1:5~a1.2~beta3+D' >>> _translate('x.y.x.z', ['tr/xy/ab/', 'y,z,Z,'], None) 'a.b.a.Z' """ for rule in rules: # uscan supports s, tr and y operations if rule.startswith(('tr', 'y')): # Note: no support for escaped separator in the pattern pos = 1 if rule.startswith('y') else 2 tmp = rule[pos + 1:].split(rule[pos]) version = version.translate(maketrans(tmp[0], tmp[1])) elif rule.startswith('s'): # uscan supports: g, u and x flags tmp = rule[2:].split(rule[1]) pattern = re.compile(tmp[0]) count = 1 if tmp[2:]: flags = tmp[2] if 'g' in flags: count = 0 if 'i' in flags: pattern = re.compile(tmp[0], re.I) version = pattern.sub(_pl2py(tmp[1]), version, count) else: log.warn('unknown rule ignored: %s', rule) if standard == 'PEP386': version = PRE_VER_RE.sub('~\g<1>', version) return version python-defaults-2.7.17/debpython/tools.py0000644000000000000000000002374713606363306015355 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. from __future__ import with_statement import codecs import logging import os import re from cPickle import dumps from glob import glob from os.path import exists, isdir, join, split from shutil import rmtree from subprocess import PIPE, Popen from debpython.version import RANGE_PATTERN, getver, get_requested_versions log = logging.getLogger(__name__) EGGnPTH_RE = re.compile(r'(.*?)(-py\d\.\d(?:-[^.]*)?)?(\.egg-info|\.pth)$') SHEBANG_RE = re.compile(r'^#!\s*(.*?/bin/.*?)(python(2\.\d+)?(?:-dbg)?)(?:\s(.*))?[$\r\n].*') SHAREDLIB_RE = re.compile(r'NEEDED.*libpython(\d\.\d)') INSTALL_RE = re.compile(r""" (?P.+?) # file pattern (?:\s+ # optional Python module name: (?P[A-Za-z][A-Za-z0-9_.]*)? )? \s* # optional version range: (?P%s)?$ """ % RANGE_PATTERN, re.VERBOSE) REMOVE_RE = re.compile(r""" (?P.+?) # file pattern \s* # optional version range: (?P%s)?$ """ % RANGE_PATTERN, re.VERBOSE) def sitedir(version, package=None, gdb=False): """Return path to site-packages directory. >>> sitedir((2, 5)) '/usr/lib/python2.5/site-packages/' >>> sitedir((2, 7), 'python-foo', True) 'debian/python-foo/usr/lib/debug/usr/lib/python2.7/dist-packages/' """ if isinstance(version, basestring): version = tuple(int(i) for i in version.split('.')) if version >= (2, 6): path = "/usr/lib/python%d.%d/dist-packages/" % version else: path = "/usr/lib/python%d.%d/site-packages/" % version if gdb: path = "/usr/lib/debug%s" % path if package: path = "debian/%s%s" % (package, path) return path def relpath(target, link): """Return relative path. >>> relpath('/usr/share/python-foo/foo.py', '/usr/bin/foo', ) '../share/python-foo/foo.py' """ t = target.split('/') l = link.split('/') while l[0] == t[0]: del l[0], t[0] return '/'.join(['..'] * (len(l) - 1) + t) def relative_symlink(target, link): """Create relative symlink.""" return os.symlink(relpath(target, link), link) def fix_shebang(fpath, replacement=None): """Normalize file's shebang. :param replacement: new shebang command (path to interpreter and options) """ try: with open(fpath) as fp: fcontent = fp.readlines() if not fcontent: log.debug('fix_shebang: ignoring empty file: %s', fpath) return None except IOError: log.error('cannot open %s', fpath) return False match = SHEBANG_RE.match(fcontent[0]) if not match: return None if not replacement: path, interpreter, version, argv = match.groups() if path != '/usr/bin': # f.e. /usr/local/* or */bin/env replacement = "/usr/bin/%s" % interpreter if interpreter == 'python': replacement = '/usr/bin/python2' if interpreter == 'python2': replacement = '/usr/bin/python2' if replacement and argv: replacement += " %s" % argv if replacement: log.info('replacing shebang in %s (%s)', fpath, fcontent[0]) # do not catch IOError here, the file is zeroed at this stage so it's # better to fail dh_python2 with open(fpath, 'w') as fp: fp.write("#! %s\n" % replacement) fp.writelines(fcontent[1:]) return True def shebang2pyver(fpath): """Check file's shebang. :rtype: tuple :returns: pair of Python interpreter string and Python version """ try: with open(fpath) as fp: data = fp.read(32) match = SHEBANG_RE.match(data) if not match: return None res = match.groups() if res[1:3] != (None, None): if res[2]: return res[1], getver(res[2]) return res[1], None except IOError: log.error('cannot open %s', fpath) def so2pyver(fpath): """Return libpython version file is linked to or None. :rtype: tuple :returns: Python version """ cmd = "readelf -Wd '%s'" % fpath process = Popen(cmd, stdout=PIPE, shell=True) match = SHAREDLIB_RE.search(process.stdout.read()) if match: return getver(match.groups()[0]) def clean_egg_name(name): """Remove Python version and platform name from Egg files/dirs. >>> clean_egg_name('python_pipeline-0.1.3_py3k-py3.1.egg-info') 'python_pipeline-0.1.3_py3k.egg-info' >>> clean_egg_name('Foo-1.2-py2.7-linux-x86_64.egg-info') 'Foo-1.2.egg-info' """ match = EGGnPTH_RE.match(name) if match and match.group(2) is not None: return ''.join(match.group(1, 3)) return name class memoize(object): def __init__(self, func): self.func = func self.cache = {} def __call__(self, *args, **kwargs): key = dumps((args, kwargs)) if key not in self.cache: self.cache[key] = self.func(*args, **kwargs) return self.cache[key] def pyinstall(package, vrange): """Install local files listed in pkg.pyinstall files as public modules.""" status = True srcfpath = "./debian/%s.pyinstall" % package if not exists(srcfpath): return status versions = get_requested_versions(vrange) for line in codecs.open(srcfpath, encoding='utf-8'): if not line or line.startswith('#'): continue details = INSTALL_RE.match(line) if not details: status = False log.warn('%s.pyinstall: unrecognized line: %s', package, line) continue details = details.groupdict() if details['module']: details['module'] = details['module'].replace('.', '/') myvers = versions & get_requested_versions(details['vrange']) if not myvers: log.debug('%s.pyinstall: no matching versions for line %s', package, line) continue files = glob(details['pattern']) if not files: status = False log.error('%s.pyinstall: file not found: %s', package, details['pattern']) continue for fpath in files: fpath = fpath.lstrip('/.') if details['module']: dstname = join(details['module'], split(fpath)[1]) elif fpath.startswith('debian/'): dstname = fpath[7:] else: dstname = fpath for version in myvers: dstfpath = join(sitedir(version, package), dstname) dstdir = split(dstfpath)[0] if not exists(dstdir): try: os.makedirs(dstdir) except Exception: log.error('cannot create %s directory', dstdir) return False if exists(dstfpath): try: os.remove(dstfpath) except Exception: status = False log.error('cannot replace %s file', dstfpath) continue try: os.link(fpath, dstfpath) except Exception: status = False log.error('cannot copy %s file to %s', fpath, dstdir) return status def pyremove(package, vrange): """Remove public modules listed in pkg.pyremove file.""" status = True srcfpath = "./debian/%s.pyremove" % package if not exists(srcfpath): return status versions = get_requested_versions(vrange) for line in codecs.open(srcfpath, encoding='utf-8'): if not line or line.startswith('#'): continue details = REMOVE_RE.match(line) if not details: status = False log.warn('%s.pyremove: unrecognized line: %s', package, line) continue details = details.groupdict() myvers = versions & get_requested_versions(details['vrange']) if not myvers: log.debug('%s.pyremove: no matching versions for line %s', package, line) continue for version in myvers: files = glob(sitedir(version, package) + details['pattern']) if not files: log.debug('%s.pyremove: nothing to remove: python%d.%d, %s', package, version, details['pattern']) continue for fpath in files: if isdir(fpath): try: rmtree(fpath) except Exception, e: status = False log.error(e) else: try: os.remove(fpath) except (IOError, OSError), e: status = False log.error(e) return status python-defaults-2.7.17/debpython/version.py0000644000000000000000000002302513305600173015657 0ustar # -*- coding: UTF-8 -*- # Copyright © 2010-2012 Piotr Ożarowski # # 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. import logging import re from ConfigParser import SafeConfigParser from os import environ from os.path import exists, dirname, join from types import GeneratorType # will be overriden via debian_defaults file few lines later SUPPORTED = [(2, 7),] DEFAULT = (2, 7) RANGE_PATTERN = r'(-)?(\d\.\d+)(?:(-)(\d\.\d+)?)?' RANGE_RE = re.compile(RANGE_PATTERN) log = logging.getLogger(__name__) # try to read debian_defaults and get a list of supported Python versions and # the default one from there _supported = environ.get('DEBPYTHON_SUPPORTED') _default = environ.get('DEBPYTHON_DEFAULT') if not _supported or not _default: _config = SafeConfigParser() _config.read('/usr/share/python/debian_defaults') if not _default: _default = _config.get('DEFAULT', 'default-version')[6:] if not _supported: _supported = _config.get('DEFAULT', 'supported-versions')\ .replace('python', '') try: DEFAULT = tuple(int(i) for i in _default.split('.')) except Exception: log.exception('cannot read debian_defaults') try: SUPPORTED = tuple(tuple(int(j) for j in i.strip().split('.')) for i in _supported.split(',')) except Exception: log.exception('cannot read debian_defaults') def get_requested_versions(vrange=None, available=None): """Return a set of requested and supported Python versions. :param available: if set to `True`, return installed versions only, if set to `False`, return requested versions that are not installed. By default returns all requested versions. :type available: bool >>> sorted(get_requested_versions([(2, 5), (3, 0)])) [(2, 7)] >>> sorted(get_requested_versions('')) == sorted(SUPPORTED) True >>> sorted(get_requested_versions([None, None])) == sorted(SUPPORTED) True >>> get_requested_versions([(5, 0), None]) set([]) """ if isinstance(vrange, basestring): vrange = parse_vrange(vrange) if not vrange or list(vrange) == [None, None]: versions = set(SUPPORTED) else: minv = (0, 0) if vrange[0] is None else vrange[0] maxv = (99, 99) if vrange[1] is None else vrange[1] if minv == maxv: versions = set((minv,) if minv in SUPPORTED else tuple()) else: versions = set(v for v in SUPPORTED if minv <= v < maxv) if available: versions = set(v for v in versions if exists("/usr/bin/python%d.%d" % v)) elif available is False: versions = set(v for v in versions if not exists("/usr/bin/python%d.%d" % v)) return versions def parse_vrange(value): """Return minimum and maximum Python version from given range. >>> parse_vrange('2.4-') ((2, 4), None) >>> parse_vrange('2.4-2.6') ((2, 4), (2, 6)) >>> parse_vrange('2.4-3.0') ((2, 4), (3, 0)) >>> parse_vrange('-2.7') (None, (2, 7)) >>> parse_vrange('2.5') ((2, 5), (2, 5)) >>> parse_vrange('') == parse_vrange('-') == (None, None) True """ if value in ('', '-'): return None, None match = RANGE_RE.match(value) if not match: raise ValueError("version range is invalid: %s" % value) groups = match.groups() if list(groups).count(None) == 3: # only one version is allowed minv = tuple(int(i) for i in groups[1].split('.')) return minv, minv minv = maxv = None if groups[0]: # maximum version only maxv = groups[1] else: minv = groups[1] maxv = groups[3] minv = tuple(int(i) for i in minv.split('.')) if minv else None maxv = tuple(int(i) for i in maxv.split('.')) if maxv else None if maxv and minv and minv > maxv: raise ValueError("version range is invalid: %s" % value) return minv, maxv def parse_pycentral_vrange(value): """Parse XS-Python-Version. >>> parse_pycentral_vrange('current') == (DEFAULT, DEFAULT) True >>> parse_pycentral_vrange('all') (None, None) >>> parse_pycentral_vrange('all, >= 2.4') ((2, 4), None) >>> parse_pycentral_vrange('all, << 3.0') (None, (3, 0)) >>> parse_pycentral_vrange('2.6') ((2, 6), (2, 6)) >>> parse_pycentral_vrange('2.5, 2.6') ((2, 5), None) >>> parse_pycentral_vrange('>= 2.6.3') ((2, 6), None) """ get = lambda x: get_requested_versions(parse_vrange(x)) current = False minv = maxv = None hardcoded = set() for item in value.split(','): item = item.strip() if item == 'all': continue elif item == 'current': current = True continue match = re.match('>=\s*([\d\.]+)', item) if match: minv = "%.3s" % match.group(1) continue match = re.match('<<\s*([\d\.]+)', item) if match: maxv = "%.3s" % match.group(1) continue match = re.match('^[\d\.]+$', item) if match: hardcoded.add("%.3s" % match.group(0)) if len(hardcoded) == 1: ver = hardcoded.pop() return getver(ver), getver(ver) if not minv and hardcoded: # yeah, no maxv! minv = sorted(hardcoded)[0] if current: versions = sorted(get("%s-%s" % (minv if minv else '', maxv if maxv else ''))) if not versions: raise ValueError("version range doesn't match installed Python versions: %s" % value) # not really what "current" means... if DEFAULT in versions: return DEFAULT, DEFAULT else: return versions[0], versions[0] return getver(minv) if minv else None, \ getver(maxv) if maxv else None def vrange_str(vrange): """Return version range string from given range. >>> vrange_str(((2, 4), None)) '2.4-' >>> vrange_str(((2, 4), (2, 6))) '2.4-2.6' >>> vrange_str(((2, 4), (3, 0))) '2.4-3.0' >>> vrange_str((None, (2, 7))) '-2.7' >>> vrange_str(((2, 5), (2, 5))) '2.5' >>> vrange_str((None, None)) '-' """ if vrange[0] is vrange[1] is None: return '-' if vrange[0] == vrange[1]: return '.'.join(str(i) for i in vrange[0]) elif vrange[0] is None: return '-' + '.'.join(str(i) for i in vrange[1]) elif vrange[1] is None: return '.'.join(str(i) for i in vrange[0]) + '-' else: return "%s-%s" % ('.'.join(str(i) for i in vrange[0]), '.'.join(str(i) for i in vrange[1])) def vrepr(value): """ >>> vrepr(([2, 7], [3, 2])) ['2.7', '3.2'] >>> vrepr(('2.6', '3.1')) ['2.6', '3.1'] >>> vrepr('2.7') '2.7' >>> vrepr((2, 7)) '2.7' """ if isinstance(value, basestring): return value elif not isinstance(value, (GeneratorType, set))\ and isinstance(value[0], int): return '.'.join(str(i) for i in value) result = [] for version in value: if isinstance(version, basestring): result.append(version) else: result.append('.'.join(str(i) for i in version)) return result def getver(value): """Return pair of integers that represent version. >>> getver('2.5') (2, 5) >>> getver('2.6.4') (2, 6) >>> getver(None) '' """ if not value: return '' return tuple(int(i) for i in value.split('.', 2))[:2] def debsorted(versions, return_str=None): """Return sorted list of versions starting with default Python version (if available) then list of suppored versions greater than default one followed by reversed list of older versions. List of versions sorted this way can be used in Depends field. :param vrepr: return string represenatations of versions, by default the same format is used as in :param:`versions` >>> debsorted([(2, 6), (3, 1), (2, 5), (2, 4), (2, 7)])[0] == DEFAULT True >>> debsorted(('2.4', '3.2', '2.6', '2.7'))[-1] (2, 4) >>> debsorted(set([(2, 1), (2, 2)])) [(2, 2), (2, 1)] >>> debsorted([(2, 1), (2, 2)], return_str=True) ['2.2', '2.1'] """ result = [] old_versions = [] for version in sorted(versions): if isinstance(version, basestring): version = getver(version) if version < DEFAULT: old_versions.append(version) else: result.append(version) result.extend(reversed(old_versions)) if return_str and result: return vrepr(result) return result python-defaults-2.7.17/dh_python20000755000000000000000000007461013606367140013646 0ustar #! /usr/bin/python2 # -*- coding: UTF-8 -*- vim: et ts=4 sw=4 # Copyright © 2010-2012 Piotr Ożarowski # # 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. from __future__ import with_statement import logging import os import re import sys from filecmp import dircmp, cmpfiles, cmp as fcmp from optparse import OptionParser, SUPPRESS_HELP from os.path import isabs, isdir, islink, exists, join, normpath, realpath,\ split from shutil import rmtree, copy as fcopy from stat import ST_MODE, S_IXUSR, S_IXGRP, S_IXOTH from debpython.debhelper import DebHelper from debpython.depends import Dependencies from debpython.version import SUPPORTED, DEFAULT, \ debsorted, getver, vrepr, parse_pycentral_vrange, \ get_requested_versions, parse_vrange, vrange_str import debpython.namespace as ns from debpython.pydist import validate as validate_pydist, \ PUBLIC_DIR_RE from debpython.tools import sitedir, relative_symlink, \ fix_shebang, shebang2pyver, \ so2pyver, clean_egg_name, \ pyinstall, pyremove from debpython.option import Option # initialize script logging.basicConfig(format='%(levelname).1s: %(module)s:%(lineno)d: ' '%(message)s') log = logging.getLogger(__name__) os.umask(022) EGGnPTH_RE = re.compile(r'(.*?)(-py\d\.\d+)?(.*?)(\.egg-info|\.pth)$') # naming conventions used in the file: # * version - tuple of integers # * ver - string representation of version # * vrange - version range, pair of max and min versions # * fn - file name (without path) # * fpath - file path ### FILES ###################################################### def fix_locations(package): """Move files to the right location.""" found_versions = {} for version in SUPPORTED: ver = vrepr(version) to_check = [i % ver for i in (\ 'usr/local/lib/python%s/site-packages', 'usr/local/lib/python%s/dist-packages', 'var/lib/python-support/python%s', 'usr/lib/pymodules/python%s')] if version >= (2, 6): to_check.append("usr/lib/python%s/site-packages" % ver) dstdir = sitedir(version, package) for location in to_check: srcdir = "debian/%s/%s" % (package, location) if isdir(srcdir): if ver in found_versions: log.error('files for version %s ' 'found in two locations:\n %s\n %s', ver, location, found_versions[ver]) exit(2) log.info('Python %s should install files in %s. ' 'Did you forget "--install-layout=deb"?', ver, sitedir(version)) if not isdir(dstdir): os.makedirs(dstdir) # TODO: what about relative symlinks? log.debug('moving files from %s to %s', srcdir, dstdir) os.renames(srcdir, dstdir) found_versions[ver] = location # do the same with debug locations dbg_to_check = ['usr/lib/debug/%s' % i for i in to_check] dbg_to_check.append("usr/lib/debug/usr/lib/pyshared/python%s" % ver) dstdir = sitedir(version, package, gdb=True) for location in dbg_to_check: srcdir = "debian/%s/%s" % (package, location) if isdir(srcdir): if not isdir(dstdir): os.makedirs(dstdir) log.debug('moving files from %s to %s', srcdir, dstdir) os.renames(srcdir, dstdir) ### SHARING FILES ############################################## def share(package, stats, options): """Move files to /usr/share/pyshared/ if possible.""" if package.endswith('-dbg'): # nothing to share in debug packages return pubvers = debsorted(i for i in stats['public_vers'] if i[0] == 2) if len(pubvers) > 1: for pos, version1 in enumerate(pubvers): dir1 = sitedir(version1, package) for version2 in pubvers[pos + 1:]: dir2 = sitedir(version2, package) dc = dircmp(dir1, dir2) share_2x(dir1, dir2, dc) elif len(pubvers) == 1: # don't install into pyshared anymore pass if options.guess_versions and pubvers: for version in get_requested_versions(options.vrange): if version not in pubvers: log.debug('guessing files for Python %s', vrepr(version)) versions_without_ext = debsorted(set(pubvers) -\ stats['ext']) if not versions_without_ext: log.error('extension for python%s is missing. ' 'Build extensions for all supported Python ' 'versions (`pyversions -vr`) or adjust ' 'X-Python-Version field or pass ' '--no-guessing-versions to dh_python2', vrepr(version)) exit(3) srcver = versions_without_ext[0] if srcver in stats['public_vers']: stats['public_vers'].add(version) share_2x(sitedir(srcver, package), sitedir(version, package)) # remove duplicates stats['requires.txt'] = set(realpath(i) for i in stats['requires.txt']) stats['nsp.txt'] = set(realpath(i) for i in stats['nsp.txt']) def move_to_pyshared(dir1): # dir1 starts with debian/packagename/usr/lib/pythonX.Y/*-packages/ debian, package, path = dir1.split('/', 2) dstdir = join(debian, package, 'usr/share/pyshared/', \ '/'.join(dir1.split('/')[6:])) fext = lambda fname: fname.rsplit('.', 1)[-1] for i in os.listdir(dir1): fpath1 = join(dir1, i) if isdir(fpath1) and not islink(fpath1): if any(fn for fn in os.listdir(fpath1) if fext(fn) != 'so'): # at least one file that is not an extension move_to_pyshared(join(dir1, i)) else: if fext(i) == 'so': continue fpath2 = join(dstdir, i) if not exists(fpath2): if not exists(dstdir): os.makedirs(dstdir) if islink(fpath1): fpath1_target = os.readlink(fpath1) if isabs(fpath1_target): os.symlink(fpath1_target, fpath2) else: fpath1_target = normpath(join(dir1, fpath1_target)) relative_symlink(fpath1_target, fpath2) os.remove(fpath1) else: os.rename(fpath1, fpath2) relative_symlink(fpath2, fpath1) def create_ext_links(dir1): """Create extension symlinks in /usr/lib/pyshared/pythonX.Y. These symlinks are used to let dpkg detect file conflicts with python-support and python-central packages. """ debian, package, path = dir1.split('/', 2) python, _, module_subpath = path[8:].split('/', 2) dstdir = join(debian, package, 'usr/lib/pyshared/', python, module_subpath) for i in os.listdir(dir1): fpath1 = join(dir1, i) if isdir(fpath1): create_ext_links(fpath1) elif i.rsplit('.', 1)[-1] == 'so': fpath2 = join(dstdir, i) if exists(fpath2): continue if not exists(dstdir): os.makedirs(dstdir) relative_symlink(fpath1, join(dstdir, i)) def create_public_links(dir1, vrange, root=''): """Create public module symlinks for given directory.""" debian, package, path = dir1.split('/', 2) versions = get_requested_versions(vrange) for fn in os.listdir(dir1): fpath1 = join(dir1, fn) if isdir(fpath1): create_public_links(fpath1, vrange, join(root, fn)) else: for version in versions: dstdir = join(sitedir(version, package), root) if not exists(dstdir): os.makedirs(dstdir) relative_symlink(fpath1, join(dstdir, fn)) def share_2x(dir1, dir2, dc=None): """Move common files to pyshared and create symlinks in original locations.""" debian, package, path = dir2.split('/', 2) # dir1 starts with debian/packagename/usr/lib/pythonX.Y/*-packages/ dstdir = join(debian, package, 'usr/share/pyshared/', \ '/'.join(dir1.split('/')[6:])) if not exists(dstdir) and not islink(dir1): os.makedirs(dstdir) if dc is None: # guess/copy mode if not exists(dir2): os.makedirs(dir2) common_dirs = [] common_files = [] for i in os.listdir(dir1): subdir1 = join(dir1, i) if isdir(subdir1) and not islink(subdir1): common_dirs.append([i, None]) else: # directories with .so files will be blocked earlier common_files.append(i) elif islink(dir1): # skip this symlink in pyshared # (dpkg has problems with symlinks anyway) common_dirs = [] common_files = [] else: common_dirs = dc.subdirs.iteritems() common_files = dc.common_files # dircmp returns common names only, lets check files more carefully... common_files = cmpfiles(dir1, dir2, common_files, shallow=False)[0] for fn in common_files: if 'so' in fn.split('.'): # foo.so, bar.so.0.1.2, etc. # in unlikely case where extensions are exactly the same continue fpath1 = join(dir1, fn) fpath2 = join(dir2, fn) fpath3 = join(dstdir, fn) # do not touch symlinks created by previous loop or other tools if dc and not islink(fpath1): # replace with a link to pyshared if not exists(fpath3): os.rename(fpath1, fpath3) relative_symlink(fpath3, fpath1) elif fcmp(fpath3, fpath1, shallow=False): os.remove(fpath1) relative_symlink(fpath3, fpath1) if dc is None: # guess/copy mode if islink(fpath1): # ralative links will work as well, it's always the same level os.symlink(os.readlink(fpath1), fpath2) else: if exists(fpath3): # cannot share it, pyshared contains another copy fcopy(fpath1, fpath2) else: # replace with a link to pyshared os.rename(fpath1, fpath3) relative_symlink(fpath3, fpath1) relative_symlink(fpath3, fpath2) elif exists(fpath2) and exists(fpath3) and \ fcmp(fpath2, fpath3, shallow=False): os.remove(fpath2) relative_symlink(fpath3, fpath2) for dn, dc in common_dirs: share_2x(join(dir1, dn), join(dir2, dn), dc) ### PACKAGE DETAILS ############################################ def scan(package, dname=None, options=None): """Gather statistics about Python files in given package.""" r = {'requires.txt': set(), 'nsp.txt': set(), 'shebangs': set(), 'public_vers': set(), 'private_dirs': {}, 'compile': False, 'ext': set()} dbg_package = package.endswith('-dbg') if not dname: proot = "debian/%s" % package if dname is False: private_to_check = [] else: private_to_check = [i % package for i in ('usr/lib/%s', 'usr/lib/games/%s', 'usr/share/%s', 'usr/share/games/%s')] else: # scan private directory *only* dname = dname.strip('/') proot = join('debian', package, dname) private_to_check = [dname] for root, dirs, file_names in os.walk(proot): # ignore Python 3.X locations if '/usr/lib/python3' in root or\ '/usr/local/lib/python3' in root: # warn only once if root[root.find('/lib/python'):].count('/') == 2: log.warning('Python 3.x location detected, ' 'please use dh_python3: %s', root) continue bin_dir = private_dir = None public_dir = PUBLIC_DIR_RE.match(root) if public_dir: version = getver(public_dir.group(1)) if root.endswith('-packages'): r['public_vers'].add(version) else: # TODO: find a way to specify Python version private # extension was build for version = False for i in private_to_check: if root.startswith(join('debian', package, i)): private_dir = '/' + i break else: # i.e. not public_dir and not private_dir if len(root.split('/', 6)) < 6 and (\ root.endswith('/sbin') or root.endswith('/bin') or\ root.endswith('/usr/games')): # /(s)bin or /usr/(s)bin or /usr/games bin_dir = root # handle some EGG related data (.egg-info dirs) for name in dirs: if name.endswith('.egg-info'): if dbg_package and options.clean_dbg_pkg: rmtree(join(root, name)) dirs.remove(name) continue clean_name = clean_egg_name(name) if clean_name != name: log.info('renaming %s to %s', name, clean_name) os.rename(join(root, name), join(root, clean_name)) dirs[dirs.index(name)] = clean_name if root.endswith('.egg-info'): if 'requires.txt' in file_names: r['requires.txt'].add(join(root, 'requires.txt')) if 'namespace_packages.txt' in file_names: r['nsp.txt'].add(join(root, 'namespace_packages.txt')) continue # check files for fn in sorted(file_names): # sorted() to make sure .so files are handled before .so.foo fpath = join(root, fn) if not exists(fpath): # could be removed while handling .so symlinks if islink(fpath) and '.so.' in split(fpath)[-1]: # dangling symlink to (now removed/renamed) .so file # which wasn't removed yet (see test3's quux.so.0) log.info('removing symlink: %s', fpath) os.remove(fpath) continue fext = fn.rsplit('.', 1)[-1] if fext in ('pyc', 'pyo'): os.remove(fpath) continue if public_dir: if fext == 'so' and islink(fpath): dstfpath = fpath links = set() while islink(dstfpath): links.add(dstfpath) dstfpath = join(root, os.readlink(dstfpath)) if exists(dstfpath) and '.so.' in split(dstfpath)[-1]: # rename .so.$FOO symlinks, remove other ones for lpath in links: log.info('removing symlink: %s', lpath) os.remove(lpath) log.info('renaming %s to %s', dstfpath, fn) os.rename(dstfpath, fpath) if dbg_package and options.clean_dbg_pkg and \ fext not in ('so', 'h'): os.remove(join(root, fn)) continue elif private_dir: if exists(fpath): mode = os.stat(fpath)[ST_MODE] if mode & S_IXUSR or mode & S_IXGRP or mode & S_IXOTH: if (options.no_shebang_rewrite or \ fix_shebang(fpath, options.shebang)) and \ not options.ignore_shebangs: res = shebang2pyver(fpath) if res: r['private_dirs'].setdefault(private_dir, {})\ .setdefault('shebangs', set()).add(res) if public_dir or private_dir: if fext == 'so': so_version = so2pyver(join(root, fn)) if so_version: if public_dir: if version != so_version: log.error('extension linked to libpython%s ' 'and shipped in python%s\'s dist-' 'packages: %s', vrepr(so_version), vrepr(version), fn) exit(7) log.warn('public extension linked with ' 'libpython%s: %s', vrepr(so_version), fn) elif not version: version = so_version (r if public_dir else r['private_dirs'].setdefault(private_dir, {}))\ .setdefault('ext', set()).add(version) continue elif fext == 'py': (r if public_dir else r['private_dirs'].setdefault(private_dir, {}))\ ['compile'] = True continue # .egg-info files if fn.endswith('.egg-info'): clean_name = clean_egg_name(fn) if clean_name != fn: log.info('renaming %s to %s', fn, clean_name) os.rename(join(root, fn), join(root, clean_name)) continue # search for scripts in bin dirs if bin_dir: if (options.no_shebang_rewrite or \ fix_shebang(fpath, options.shebang)) and \ not options.ignore_shebangs: res = shebang2pyver(fpath) if res: r['shebangs'].add(res) if dbg_package and options.clean_dbg_pkg: # remove empty directories in -dbg packages proot = proot + '/usr/lib' for root, dirs, file_names in os.walk(proot, topdown=False): if '-packages/' in root and not file_names: try: os.rmdir(root) except Exception: pass log.debug("package %s details = %s", package, r) return r ################################################################ def main(): log.warn('Please add dh-python package to Build-Depends') usage = '%prog -p PACKAGE [-V [X.Y][-][A.B]] DIR [-X REGEXPR]\n' parser = OptionParser(usage, version='%prog 2.1', option_class=Option) parser.add_option('--no-guessing-versions', action='store_false', dest='guess_versions', default=True, help='disable guessing other supported Python versions') parser.add_option('--no-guessing-deps', action='store_false', dest='guess_deps', default=True, help='disable guessing dependencies') parser.add_option('--skip-private', action='store_true', default=False, help='don\'t check private directories') parser.add_option('-v', '--verbose', action='store_true', default=False, help='turn verbose mode on') # arch=False->arch:all only, arch=True->arch:any only, None->all of them parser.add_option('-i', '--indep', action='store_false', dest='arch', default=None, help='act on architecture independent packages') parser.add_option('-a', '-s', '--arch', action='store_true', dest='arch', help='act on architecture dependent packages') parser.add_option('-q', '--quiet', action='store_false', dest='verbose', help='be quiet') parser.add_option('-p', '--package', action='append', help='act on the package named PACKAGE') parser.add_option('-N', '--no-package', action='append', help='do not act on the specified package') parser.add_option('--compile-all', action='store_true', default=False, help='compile all files from given private directory in postinst, ' 'not just the ones provided by the package') parser.add_option('-V', type='version_range', dest='vrange', help='specify list of supported Python versions. ' +\ 'See pycompile(1) for examples') parser.add_option('-X', '--exclude', action='append', dest='regexpr', help='exclude items that match given REGEXPR. You may use this option ' 'multiple times to build up a list of things to exclude.') parser.add_option('--depends', action='append', help='translate given requirements into Debian dependencies ' 'and add them to ${python:Depends}. ' 'Use it for missing items in requires.txt.') parser.add_option('--recommends', action='append', help='translate given requirements into Debian ' 'dependencies and add them to ${python:Recommends}') parser.add_option('--suggests', action='append', help='translate given requirements into Debian ' 'dependencies and add them to ${python:Suggests}') parser.add_option('--namespace', action='append', dest='namespaces', help='recreate __init__.py files for given namespaces at install time') parser.add_option('--clean-pycentral', action='store_true', default=False, help='generate maintainer script that will remove pycentral files') parser.add_option('--shebang', default='/usr/bin/python2', help='use given command as shebang in scripts') parser.add_option('--ignore-shebangs', action='store_true', default=False, help='do not translate shebangs into Debian dependencies') parser.add_option('--ignore-namespace', action='store_true', default=False, help="ignore Egg's namespace_packages.txt file and --namespace option") parser.add_option('--no-dbg-cleaning', action='store_false', dest='clean_dbg_pkg', default=True, help='do not remove files from debug packages') parser.add_option('--no-shebang-rewrite', action='store_true', default=False, help='do not rewrite shebangs') # ignore some debhelper options: parser.add_option('-O', help=SUPPRESS_HELP) options, args = parser.parse_args(sys.argv[1:] + \ os.environ.get('DH_OPTIONS', '').split()) # regexpr option type is not used so lets check patterns here for pattern in options.regexpr or []: # fail now rather than at runtime try: pattern = re.compile(pattern) except Exception: log.error('regular expression is not valid: %s', pattern) exit(1) if not options.vrange and exists('debian/pyversions'): log.debug('parsing version range from debian/pyversions') with open('debian/pyversions') as fp: for line in fp: line = line.strip() if line and not line.startswith('#'): options.vrange = parse_vrange(line) break # disable PyDist if dh_pydeb is used if options.guess_deps: try: rules = open('debian/rules', 'r').read() except IOError: log.warning('cannot open debian/rules file') else: if re.search('\n\s*dh_pydeb', rules) or \ re.search('\n\s*dh\s+[^#]*--with[^#]+pydeb', rules): log.warning('dh_pydeb detected, PyDist feature disabled') options.guess_deps = False if not args: private_dir = None else: private_dir = args[0] if not private_dir.startswith('/'): # handle usr/share/foo dirs (without leading slash) private_dir = '/' + private_dir # TODO: support more than one private dir at the same time (see :meth:scan) if options.skip_private: private_dir = False if options.verbose or os.environ.get('DH_VERBOSE') == '1': log.setLevel(logging.DEBUG) log.debug('argv: %s', sys.argv) log.debug('options: %s', options) log.debug('args: %s', args) dh = DebHelper(options) if not options.vrange and dh.python_version: options.vrange = parse_pycentral_vrange(dh.python_version) for package, pdetails in dh.packages.iteritems(): if options.arch is False and pdetails['arch'] != 'all' or \ options.arch is True and pdetails['arch'] == 'all': continue log.debug('processing package %s...', package) if not private_dir: if not pyinstall(package, options.vrange): exit(4) if not pyremove(package, options.vrange): exit(5) fix_locations(package) stats = scan(package, private_dir, options) if not private_dir: share(package, stats, options) pyshared_dir = "debian/%s/usr/share/pyshared/" % package if not stats['public_vers'] and exists(pyshared_dir): create_public_links(pyshared_dir, options.vrange) stats['public_vers'] = get_requested_versions(options.vrange) stats['compile'] = True dependencies = Dependencies(package) dependencies.parse(stats, options) if stats['public_vers']: dh.addsubstvar(package, 'python:Versions', \ ', '.join(sorted(vrepr(stats['public_vers'])))) ps = package.split('-', 1) if len(ps) > 1 and ps[0] == 'python': dh.addsubstvar(package, 'python:Provides', \ ', '.join("python%s-%s" % (i, ps[1])\ for i in sorted(vrepr(stats['public_vers'])))) pyclean_added = False # invoke pyclean only once in maintainer script if stats['compile']: if options.clean_pycentral: dh.autoscript(package, 'preinst', 'preinst-pycentral-clean', '') dh.autoscript(package, 'postinst', 'postinst-pycompile', '') dh.autoscript(package, 'prerm', 'prerm-pyclean', '') pyclean_added = True for pdir, details in stats['private_dirs'].iteritems(): if not details.get('compile'): continue if not pyclean_added: dh.autoscript(package, 'prerm', 'prerm-pyclean', '') pyclean_added = True args = pdir ext_for = details.get('ext') if ext_for is None: # no extension shebangs = list(v for i, v in details.get('shebangs', []) if v) if not options.ignore_shebangs and len(shebangs) == 1: # only one version from shebang args += " -V %s" % vrepr(shebangs[0]) elif options.vrange and options.vrange != (None, None): args += " -V %s" % vrange_str(options.vrange) elif False in ext_for: # at least one extension's version not detected if options.vrange and '-' not in vrange_str(options.vrange): ver = vrange_str(options.vrange) else: # try shebang or default Python version ver = (list(v for i, v in details.get('shebangs', []) if v) or [None])[0] or DEFAULT ver = vrepr(ver) dependencies.depend("python%s" % ver) args += " -V %s" % vrepr(ver) else: version = ext_for.pop() args += " -V %s" % vrepr(version) dependencies.depend("python%d.%d" % version) for pattern in options.regexpr or []: args += " -X '%s'" % pattern.replace("'", r"'\''") dh.autoscript(package, 'postinst', 'postinst-pycompile', args) dependencies.export_to(dh) pydist_file = join('debian', "%s.pydist" % package) if exists(pydist_file): if not validate_pydist(pydist_file): log.warning("%s.pydist file is invalid", package) else: dstdir = join('debian', package, 'usr/share/python/dist/') if not exists(dstdir): os.makedirs(dstdir) fcopy(pydist_file, join(dstdir, package)) # namespace feature - recreate __init__.py files at install time if options.ignore_namespace: nsp = None else: nsp = ns.parse(stats['nsp.txt'], options.namespaces) # note that pycompile/pyclean is already added to maintainer scripts # and it should remain there even if __init__.py was the only .py file if nsp: try: nsp = ns.remove_from_package(package, nsp, stats['public_vers']) except (IOError, OSError), e: log.error('cannot remove __init__.py from package: %s', e) exit(6) if nsp: dstdir = join('debian', package, 'usr/share/python/ns/') if not exists(dstdir): os.makedirs(dstdir) with open(join(dstdir, package), 'a') as fp: fp.writelines("%s\n" % i for i in nsp) pyshared = join('debian', package, 'usr/share/pyshared/') if isdir(pyshared) and not os.listdir(pyshared): # remove empty pyshared directory os.rmdir(pyshared) dh.save() if __name__ == '__main__': main() python-defaults-2.7.17/dh_python2.10000644000000000000000000002161013306544014013764 0ustar .\" Man page generated from reStructuredText. . .TH DH_PYTHON2 1 "" "" "" .SH NAME dh_python2 \- calculates Python dependencies, adds maintainer scripts to byte compile files, etc. . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 dh_python2 \-p PACKAGE [\-V [X.Y][\-][A.B]] DIR_OR_FILE [\-X REGEXPR] .UNINDENT .UNINDENT .SH DESCRIPTION .SS QUICK GUIDE FOR MAINTAINERS .INDENT 0.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 if necessary, describe supported Python versions via X\-Python\-Version field in debian/control, .IP \(bu 2 build\-depend on python or python\-all or python\-all\-dev (>= 2.6.6\-3~), .IP \(bu 2 build module/application using its standard build system, remember to build extensions for all supported Python versions (loop over \fBpyversions \-vr\fP), .IP \(bu 2 install files to the \fIstandard\fP locations, add \fI\-\-install\-layout=deb\fP to setup.py\(aqs install command if your package is using distutils, .IP \(bu 2 add \fIpython2\fP to dh\(aqs \-\-with option, or: .IP \(bu 2 \fIinclude /usr/share/cdbs/1/class/python\-distutils.mk\fP in debian/rules and depend on \fIcdbs (>= 0.4.90)\fP, or: .IP \(bu 2 call \fBdh_python2\fP in the \fIbinary\-*\fP target, .IP \(bu 2 add \fI${python:Depends}\fP to Depends .UNINDENT .UNINDENT .UNINDENT .SS NOTES .sp In order to support more than one Python version in the same binary package, dh_python2 (unlike dh_pycentral and dh_pysupport) creates symlinks to all supported Python versions at build time. It means binNMU (or sourceful upload in case of architecture independent packages) is required once a list of supported Python version is changed. It\(aqs faster and more robust than its competitors, though. .SS dependencies .sp dh_python2 tries to translate Python dependencies from requires.txt file to Debian dependencies. Use debian/pydist\-overrides or \-\-no\-guessing\-deps option to override it if the guess is incorrect. If you want dh_python2 to generate more strict dependencies (f.e. to avoid ABI problems) create debian/python\-foo.pydist file. See /usr/share/doc/python\-doc/README.PyDist (provided by python\-doc package) for more information. If the pydist file contains PEP386 flag or set of (uscan like) rules, dh_python2 will make the dependency versioned (version requirements are ignored by default). .SS namespace feature .sp dh_python2 parses Egg\(aqs namespace_packages.txt files (in addition to \-\-namespace command line argument(s)) and drops empty __init__.py files from binary package. pycompile will regenerate them at install time and pyclean will remove them at uninstall time (if they\(aqre no longer used in installed packages). It\(aqs still a good idea to provide __init__.py file in one of binary packages (even if all other packages use this feature). .SS private dirs .sp \fI/usr/share/foo\fP, \fI/usr/share/games/foo\fP, \fI/usr/lib/foo\fP and \fI/usr/lib/games/foo\fP private directories are scanned for Python files by default (where \fIfoo\fP is binary package name). If your package is shipping Python files in some other directory, add another dh_python2 call in debian/rules with directory name as an argument \- you can use different set of options in this call. If you need to change options (f.e. a list of supported Python versions) for a private directory that is checked by default, invoke dh_python2 with \-\-skip\-private option and add another call with a path to this directory and new options. .SS debug packages .sp In binary packages which name ends with \fI\-dbg\fP, all files in \fI/usr/lib/python2.X/{site,dist}\-packages/\fP directory that have extensions different than \fIso\fP or \fIh\fP are removed by default. Use \-\-no\-dbg\-cleaning option to disable this feature. .SS pyinstall files .sp Files listed in debian/pkg.pyinstall file will be installed as public modules for all requested Python versions (dh_install doesn\(aqt know about python\(aqs site\- vs. dist\-packages issue). .sp Syntax: \fBpath/to/file [VERSION_RANGE] [NAMESPACE]\fP .sp debian directory is automatically removed from the path, so you can place your files in debian/ directory and install them from this location (if you want to install them in "debian" namespace, set NAMESPACE to debian). If NAMESPACE is set, all listed files will be installed in .../dist\-packages/NAMESPACE/ directory. .INDENT 0.0 .TP .B Examples: .INDENT 7.0 .IP \(bu 2 \fBfoo.py\fP installs .../dist\-packages/foo.py for all supported Python versions .IP \(bu 2 \fBfoo/bar.py 2.6\-\fP installs .../dist\-packages/foo/bar.py for versions >= 2.6 .IP \(bu 2 \fBfoo/bar.py spam\fP installs .../dist\-packages/spam/bar.py .IP \(bu 2 \fBdebian/*.py spam.egg 2.5\fP installs .../python2.5/site\-packages/spam/egg/*.py files .UNINDENT .UNINDENT .SS pyremove files .sp If you want to remove some files installed by build system (from all supported Python versions or only from a subset of these versions), add them to debian/pkg.pyremove file. .INDENT 0.0 .TP .B Examples: .INDENT 7.0 .IP \(bu 2 \fB*.pth\fP removes .pth files from .../dist\-packages/ .IP \(bu 2 \fBbar/baz.py 2.5\fP removes .../python2.5/site\-packages/bar/baz.py .UNINDENT .UNINDENT .SS overriding supported / default Python versions .sp If you want to override system\(aqs list of supported Python versions or the default one (f.e. to build a package that includes symlinks for older version of Python or compile .py files only for given interpreter version), you can do that via \fIDEBPYTHON_SUPPORTED\fP and/or \fIDEBPYTHON_DEFAULT\fP env. variables. .sp Example: \fB2.5,2.7\fP limits the list of supported Python versions to Python 2.5 and Python 2.7. .SH OPTIONS .INDENT 0.0 .TP .B \-\-version show program\(aqs version number and exit .TP .B \-h\fP,\fB \-\-help show help message and exit .TP .B \-\-no\-guessing\-versions disable guessing other supported Python versions .TP .B \-\-no\-guessing\-deps disable guessing dependencies .TP .B \-\-no\-dbg\-cleaning do not remove any files from debug packages .TP .B \-\-no\-shebang\-rewrite do not rewrite shebangs .TP .B \-\-skip\-private don\(aqt check private directories .TP .B \-v\fP,\fB \-\-verbose turn verbose mode on .TP .B \-i\fP,\fB \-\-indep act on architecture independent packages .TP .B \-a\fP,\fB \-\-arch act on architecture dependent packages .TP .B \-q\fP,\fB \-\-quiet be quiet .TP .BI \-p \ PACKAGE\fP,\fB \ \-\-package\fB= PACKAGE act on the package named PACKAGE .TP .BI \-N \ NO_PACKAGE\fP,\fB \ \-\-no\-package\fB= NO_PACKAGE do not act on the specified package .TP .BI \-V \ VRANGE specify list of supported Python versions. See pycompile(1) for examples .TP .BI \-X \ REGEXPR\fP,\fB \ \-\-exclude\fB= REGEXPR exclude items that match given REGEXPR. You may use this option multiple times to build up a list of things to exclude. .TP .B \-\-compile\-all compile all files from given private directory in postinst/rtupdate not just the ones provided by the package (i.e. do not pass the \-\-package parameter to pycompile/pyclean) .TP .BI \-\-depends\fB= DEPENDS translate given requirements into Debian dependencies and add them to ${python:Depends}. Use it for missing items in requires.txt .TP .BI \-\-recommends\fB= RECOMMENDS translate given requirements into Debian dependencies and add them to ${python:Recommends} .TP .BI \-\-suggests\fB= SUGGESTS translate given requirements into Debian dependencies and add them to ${python:Suggests} .TP .B \-\-namespace use this option (multiple time if necessary) if namespace_packages.txt is not complete .TP .B \-\-ignore\-namespace ignore Egg\(aqs namespace declaration and \-\-namespace option. This option will disable removing (and recreating at install time) empty __init__.py files. Removing namespace_packages.txt from egg\-info directory has the same effect. .TP .B \-\-clean\-pycentral generate maintainer script that will remove byte code generated by python\-central helper .TP .BI \-\-shebang\fB= COMMAND use given command as shebang in scripts .TP .B \-\-ignore\-shebangs do not translate shebangs into Debian dependencies .UNINDENT .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 /usr/share/doc/python/python\-policy.txt.gz .IP \(bu 2 /usr/share/doc/python\-doc/README.PyDist (python\-doc package) .IP \(bu 2 pycompile(1), pyclean(1) .IP \(bu 2 dh_python3(1), py3compile(1), py3clean(1) .IP \(bu 2 Wiki page about converting package to dh_python2: \fI\%http://wiki.debian.org/Python/TransitionToDHPython2\fP .UNINDENT .SH AUTHOR Piotr Ożarowski, 2012-2013 .\" Generated by docutils manpage writer. . python-defaults-2.7.17/dh_python2.py0000755000000000000000000000204113564435551014267 0ustar #! /usr/bin/python2 from os.path import exists from subprocess import call from sys import argv from re import compile OLD = '/usr/share/python/dh_python2' NEW = '/usr/share/dh-python/dh_python2' has_dhpython = compile(r'(^|:|\s|,)dh-python($|\s|,|\()').search binary = OLD if exists(NEW) and exists('debian/control'): with open('debian/control', 'r') as fp: inside = False for line in fp: if not line: break line_lower = line.lower() if inside: if line.startswith((' ', "\t")): if has_dhpython(line): binary = NEW break continue elif line.startswith('#'): continue inside = False if line_lower.startswith(('build-depends:', 'build-depends-indep:')): if has_dhpython(line): binary = NEW break inside = True argv[0] = binary exit(call(argv)) python-defaults-2.7.17/dh_python2.rst0000644000000000000000000001720013306544014014434 0ustar ============ dh_python2 ============ ----------------------------------------------------------------------------------- calculates Python dependencies, adds maintainer scripts to byte compile files, etc. ----------------------------------------------------------------------------------- :Manual section: 1 :Author: Piotr Ożarowski, 2012-2013 SYNOPSIS ======== dh_python2 -p PACKAGE [-V [X.Y][-][A.B]] DIR_OR_FILE [-X REGEXPR] DESCRIPTION =========== QUICK GUIDE FOR MAINTAINERS --------------------------- * if necessary, describe supported Python versions via X-Python-Version field in debian/control, * build-depend on python or python-all or python-all-dev (>= 2.6.6-3~), * build module/application using its standard build system, remember to build extensions for all supported Python versions (loop over ``pyversions -vr``), * install files to the *standard* locations, add `--install-layout=deb` to setup.py's install command if your package is using distutils, * add `python2` to dh's --with option, or: * `include /usr/share/cdbs/1/class/python-distutils.mk` in debian/rules and depend on `cdbs (>= 0.4.90)`, or: * call ``dh_python2`` in the `binary-*` target, * add `${python:Depends}` to Depends NOTES ----- In order to support more than one Python version in the same binary package, dh_python2 (unlike dh_pycentral and dh_pysupport) creates symlinks to all supported Python versions at build time. It means binNMU (or sourceful upload in case of architecture independent packages) is required once a list of supported Python version is changed. It's faster and more robust than its competitors, though. dependencies ~~~~~~~~~~~~ dh_python2 tries to translate Python dependencies from requires.txt file to Debian dependencies. Use debian/pydist-overrides or --no-guessing-deps option to override it if the guess is incorrect. If you want dh_python2 to generate more strict dependencies (f.e. to avoid ABI problems) create debian/python-foo.pydist file. See /usr/share/doc/python-doc/README.PyDist (provided by python-doc package) for more information. If the pydist file contains PEP386 flag or set of (uscan like) rules, dh_python2 will make the dependency versioned (version requirements are ignored by default). namespace feature ~~~~~~~~~~~~~~~~~ dh_python2 parses Egg's namespace_packages.txt files (in addition to --namespace command line argument(s)) and drops empty __init__.py files from binary package. pycompile will regenerate them at install time and pyclean will remove them at uninstall time (if they're no longer used in installed packages). It's still a good idea to provide __init__.py file in one of binary packages (even if all other packages use this feature). private dirs ~~~~~~~~~~~~ `/usr/share/foo`, `/usr/share/games/foo`, `/usr/lib/foo` and `/usr/lib/games/foo` private directories are scanned for Python files by default (where `foo` is binary package name). If your package is shipping Python files in some other directory, add another dh_python2 call in debian/rules with directory name as an argument - you can use different set of options in this call. If you need to change options (f.e. a list of supported Python versions) for a private directory that is checked by default, invoke dh_python2 with --skip-private option and add another call with a path to this directory and new options. debug packages ~~~~~~~~~~~~~~ In binary packages which name ends with `-dbg`, all files in `/usr/lib/python2.X/{site,dist}-packages/` directory that have extensions different than `so` or `h` are removed by default. Use --no-dbg-cleaning option to disable this feature. pyinstall files ~~~~~~~~~~~~~~~ Files listed in debian/pkg.pyinstall file will be installed as public modules for all requested Python versions (dh_install doesn't know about python's site- vs. dist-packages issue). Syntax: ``path/to/file [VERSION_RANGE] [NAMESPACE]`` debian directory is automatically removed from the path, so you can place your files in debian/ directory and install them from this location (if you want to install them in "debian" namespace, set NAMESPACE to debian). If NAMESPACE is set, all listed files will be installed in .../dist-packages/NAMESPACE/ directory. Examples: * ``foo.py`` installs .../dist-packages/foo.py for all supported Python versions * ``foo/bar.py 2.6-`` installs .../dist-packages/foo/bar.py for versions >= 2.6 * ``foo/bar.py spam`` installs .../dist-packages/spam/bar.py * ``debian/*.py spam.egg 2.5`` installs .../python2.5/site-packages/spam/egg/\*.py files pyremove files ~~~~~~~~~~~~~~ If you want to remove some files installed by build system (from all supported Python versions or only from a subset of these versions), add them to debian/pkg.pyremove file. Examples: * ``*.pth`` removes .pth files from .../dist-packages/ * ``bar/baz.py 2.5`` removes .../python2.5/site-packages/bar/baz.py overriding supported / default Python versions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want to override system's list of supported Python versions or the default one (f.e. to build a package that includes symlinks for older version of Python or compile .py files only for given interpreter version), you can do that via `DEBPYTHON_SUPPORTED` and/or `DEBPYTHON_DEFAULT` env. variables. Example: ``2.5,2.7`` limits the list of supported Python versions to Python 2.5 and Python 2.7. OPTIONS ======= --version show program's version number and exit -h, --help show help message and exit --no-guessing-versions disable guessing other supported Python versions --no-guessing-deps disable guessing dependencies --no-dbg-cleaning do not remove any files from debug packages --no-shebang-rewrite do not rewrite shebangs --skip-private don't check private directories -v, --verbose turn verbose mode on -i, --indep act on architecture independent packages -a, --arch act on architecture dependent packages -q, --quiet be quiet -p PACKAGE, --package=PACKAGE act on the package named PACKAGE -N NO_PACKAGE, --no-package=NO_PACKAGE do not act on the specified package -V VRANGE specify list of supported Python versions. See pycompile(1) for examples -X REGEXPR, --exclude=REGEXPR exclude items that match given REGEXPR. You may use this option multiple times to build up a list of things to exclude. --compile-all compile all files from given private directory in postinst/rtupdate not just the ones provided by the package (i.e. do not pass the --package parameter to pycompile/pyclean) --depends=DEPENDS translate given requirements into Debian dependencies and add them to ${python:Depends}. Use it for missing items in requires.txt --recommends=RECOMMENDS translate given requirements into Debian dependencies and add them to ${python:Recommends} --suggests=SUGGESTS translate given requirements into Debian dependencies and add them to ${python:Suggests} --namespace use this option (multiple time if necessary) if namespace_packages.txt is not complete --ignore-namespace ignore Egg's namespace declaration and --namespace option. This option will disable removing (and recreating at install time) empty __init__.py files. Removing namespace_packages.txt from egg-info directory has the same effect. --clean-pycentral generate maintainer script that will remove byte code generated by python-central helper --shebang=COMMAND use given command as shebang in scripts --ignore-shebangs do not translate shebangs into Debian dependencies SEE ALSO ======== * /usr/share/doc/python/python-policy.txt.gz * /usr/share/doc/python-doc/README.PyDist (python-doc package) * pycompile(1), pyclean(1) * dh_python3(1), py3compile(1), py3clean(1) * Wiki page about converting package to dh_python2: http://wiki.debian.org/Python/TransitionToDHPython2 python-defaults-2.7.17/pyclean0000755000000000000000000001003413305600173013201 0ustar #! /usr/bin/python2 # -*- coding: UTF-8 -*- vim: et ts=4 sw=4 # # Copyright © 2010-2012 Piotr Ożarowski # # 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. import logging import optparse import sys from os import environ, remove from os.path import exists sys.path.insert(1, '/usr/share/python/') from debpython import files as dpf from debpython.namespace import add_namespace_files # initialize script logging.basicConfig(format='%(levelname).1s: %(module)s:%(lineno)d: ' '%(message)s') log = logging.getLogger(__name__) """TODO: move it to manpage Examples: pyclean -p python-mako # all .py[co] files from the package pyclean /usr/lib/python2.6/dist-packages # python2.6 """ def destroyer(): # ;-) """Removes every .py[co] file associated to received .py file.""" def find_files_to_remove(pyfile): for filename in ("%sc" % pyfile, "%so" % pyfile): if exists(filename): yield filename counter = 0 try: while True: pyfile = (yield) for filename in find_files_to_remove(pyfile): try: log.debug('removing %s', filename) remove(filename) counter += 1 except (IOError, OSError), e: log.error('cannot remove %s', filename) log.debug(e) except GeneratorExit: log.info("removed files: %s", counter) def main(): usage = '%prog [-p PACKAGE] [DIR_OR_FILE]' parser = optparse.OptionParser(usage, version='%prog 1.0') parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='turn verbose more one') parser.add_option('-q', '--quiet', action='store_false', dest='verbose', default=False, help='be quiet') parser.add_option('-p', '--package', help='specify Debian package name to clean') options, args = parser.parse_args() if options.verbose or environ.get('PYCLEAN_DEBUG') == '1': log.setLevel(logging.DEBUG) log.debug('argv: %s', sys.argv) log.debug('options: %s', options) log.debug('args: %s', args) else: log.setLevel(logging.WARNING) d = destroyer() d.next() # initialize coroutine if not options.package and not args: parser.print_usage() exit(1) if options.package: log.info('cleaning package %s', options.package) pfiles = dpf.from_package(options.package, extensions=('.py', '.so')) pfiles = add_namespace_files(pfiles, options.package, action=False) pfiles = set(dpf.filter_out_ext(pfiles, ('.so',))) if args: log.info('cleaning directories: %s', args) files = dpf.from_directory(args, extensions=('.py', '.so')) files = add_namespace_files(files, action=False) files = set(dpf.filter_out_ext(files, ('.so',))) if options.package: files = files & pfiles else: files = pfiles for filename in files: d.send(filename) if __name__ == '__main__': main() python-defaults-2.7.17/pyclean.10000644000000000000000000000246213305600173013343 0ustar .\" Man page generated from reStructuredText. . .TH PYCLEAN 1 "" "" "" .SH NAME pyclean \- removes .pyc and .pyo files . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 pyclean [\-p PACKAGE | DIR_OR_FILE] .UNINDENT .UNINDENT .SH OPTIONS .INDENT 0.0 .TP .B \-\-version show program\(aqs version number and exit .TP .B \-h\fP,\fB \-\-help show this help message and exit .TP .B \-v\fP,\fB \-\-verbose turn verbose more one .TP .B \-q\fP,\fB \-\-quiet be quiet .TP .BI \-p \ PACKAGE\fP,\fB \ \-\-package\fB= PACKAGE specify Debian package name to clean (combining with DIR_OR_FILE will additionally limit list of files) .UNINDENT .SH AUTHOR Piotr Ożarowski, 2012-201 .\" Generated by docutils manpage writer. . python-defaults-2.7.17/pyclean.rst0000644000000000000000000000102413305600173014004 0ustar ========= pyclean ========= --------------------------- removes .pyc and .pyo files --------------------------- :Manual section: 1 :Author: Piotr Ożarowski, 2012-201 SYNOPSIS ======== pyclean [-p PACKAGE | DIR_OR_FILE] OPTIONS ======= --version show program's version number and exit -h, --help show this help message and exit -v, --verbose turn verbose more one -q, --quiet be quiet -p PACKAGE, --package=PACKAGE specify Debian package name to clean (combining with DIR_OR_FILE will additionally limit list of files) python-defaults-2.7.17/pycompile0000755000000000000000000002716713305600173013566 0ustar #! /usr/bin/python2 # -*- coding: utf-8 -*- vim: et ts=4 sw=4 # # Copyright © 2010-2012 Piotr Ożarowski # Copyright © 2010 Canonical Ltd # # 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. from __future__ import with_statement import logging import optparse import os import sys from os import environ, listdir from os.path import exists, isdir, islink, join from subprocess import PIPE, STDOUT, Popen sys.path.insert(1, '/usr/share/python/') from debpython.version import SUPPORTED, debsorted, vrepr, \ get_requested_versions, parse_vrange, getver from debpython import files as dpf from debpython.namespace import add_namespace_files from debpython.option import Option, compile_regexpr from debpython.pydist import PUBLIC_DIR_RE from debpython.tools import memoize # initialize script logging.basicConfig(format='%(levelname).1s: %(module)s:%(lineno)d: ' '%(message)s') log = logging.getLogger(__name__) STDINS = {} WORKERS = {} """TODO: move it to manpage Examples: pycompile -p python-mako # package's public files pycompile -p foo /usr/share/foo # package's private files pycompile -p foo -V 2.6- /usr/share/foo # private files, Python >= 2.6 pycompile -V 2.6 /usr/lib/python2.6/dist-packages # python2.6 only pycompile -V 2.6 /usr/lib/foo/bar.py # python2.6 only """ ### EXCLUDES ################################################### @memoize def get_exclude_patterns_from_dir(name='/usr/share/python/bcep/'): """Return patterns for files that shouldn't be bytecompiled.""" if not isdir(name): return [] result = [] for fn in listdir(name): with file(join(name, fn), 'r') as lines: for line in lines: type_, vrange, dname, pattern = line.split('|', 3) vrange = parse_vrange(vrange) versions = get_requested_versions(vrange, available=True) if not versions: # pattern doesn't match installed Python versions continue pattern = pattern.rstrip('\n') if type_ == 're': pattern = compile_regexpr(None, None, pattern) result.append((type_, versions, dname, pattern)) return result def get_exclude_patterns(directory='/', patterns=None, versions=None): """Return patterns for files that shouldn't be compiled in given dir.""" if versions is not None: # make sure it's a set (debsorted returns a list) versions = set(versions) if patterns: if versions is None: versions = set(SUPPORTED) patterns = [('re', versions, directory, i) for i in patterns] else: patterns = [] for type_, vers, dname, pattern in get_exclude_patterns_from_dir(): # skip patterns that do not match requested directory if not dname.startswith(directory[:len(dname)]): continue # skip patterns that do not match requested versions if versions and not versions & vers: continue patterns.append((type_, vers, dname, pattern)) return patterns def filter_files(files, e_patterns, compile_versions): """Generate (file, versions_to_compile) pairs.""" for fn in files: valid_versions = set(compile_versions) # all by default for type_, vers, dname, pattern in e_patterns: if type_ == 'dir' and fn.startswith(dname): valid_versions = valid_versions - vers elif type_ == 're' and pattern.match(fn): valid_versions = valid_versions - vers # move to the next file if all versions were removed if not valid_versions: break if valid_versions: public_dir = PUBLIC_DIR_RE.match(fn) if public_dir: yield fn, set([getver(public_dir.group(1))]) else: yield fn, valid_versions ### COMPILE #################################################### def py_compile(version, optimize, workers): if not isinstance(version, basestring): version = vrepr(version) cmd = "/usr/bin/python%s%s -m py_compile -" \ % (version, ' -O' if optimize else '') process = Popen(cmd, bufsize=1, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True) workers[version] = process # keep the reference for .communicate() stdin = process.stdin while True: filename = (yield) stdin.write(filename + '\n') def compile(files, versions, force, optimize, e_patterns=None): global STDINS, WORKERS # start Python interpreters that will handle byte compilation for version in versions: if version not in STDINS: coroutine = py_compile(version, optimize, WORKERS) coroutine.next() STDINS[version] = coroutine # byte compile files for fn, versions_to_compile in filter_files(files, e_patterns, versions): cfn = fn + 'o' if optimize else 'c' if not exists(fn): # pycentral's hook should clean it later if islink(fn): log.warn('dangling symlink skipped: %s (%s)', fn, os.readlink(fn)) continue if exists(cfn) and not force: ftime = os.stat(fn).st_mtime try: ctime = os.stat(cfn).st_mtime except os.error: ctime = 0 if ctime > ftime: continue for version in versions_to_compile: try: pipe = STDINS[version] except KeyError: # `pycompile /usr/lib/` invoked, add missing worker pipe = py_compile(version, optimize, WORKERS) pipe.next() STDINS[version] = pipe pipe.send(fn) ################################################################ def main(): usage = '%prog [-V [X.Y][-][A.B]] DIR_OR_FILE [-X REGEXPR]\n' + \ ' %prog -p PACKAGE' parser = optparse.OptionParser(usage, version='%prog 1.0', option_class=Option) parser.add_option('-v', '--verbose', action='store_true', dest='verbose', help='turn verbose mode on') parser.add_option('-q', '--quiet', action='store_false', dest='verbose', default=False, help='be quiet') parser.add_option('-f', '--force', action='store_true', dest='force', default=False, help='force rebuild even if timestamps are up-to-date') parser.add_option('-O', action='store_true', dest='optimize', default=False, help="byte-compile to .pyo files") parser.add_option('-p', '--package', help='specify Debian package name whose files should be bytecompiled') parser.add_option('-V', type='version_range', dest='vrange', help="""force private modules to be bytecompiled with Python version from given range, regardless of the default Python version in the system. If there are no other options, bytecompile all public modules for installed Python versions that match given range. VERSION_RANGE examples: '2.5' (version 2.5 only), '2.5-' (version 2.5 or newer), '2.5-2.7' (version 2.5 or 2.6), '-3.0' (all supported 2.X versions)""") parser.add_option('-X', '--exclude', action='append', dest='regexpr', type='regexpr', help='exclude items that match given REGEXPR. You may use this option \ multiple times to build up a list of things to exclude.') (options, args) = parser.parse_args() if options.verbose or environ.get('PYCOMPILE_DEBUG') == '1': log.setLevel(logging.DEBUG) log.debug('argv: %s', sys.argv) log.debug('options: %s', options) log.debug('args: %s', args) else: log.setLevel(logging.WARN) if options.regexpr and not args: parser.error('--exclude option works with private directories ' 'only, please use /usr/share/python/bcep to specify ' 'public modules to skip') if options.vrange and options.vrange[0] == options.vrange[1] and\ options.vrange != (None, None) and\ exists("/usr/bin/python%d.%d" % options.vrange[0]): # specific version requested, use it even if it's not in SUPPORTED versions = set(options.vrange[:1]) else: versions = get_requested_versions(options.vrange, available=True) if not versions: log.error('Requested versions are not installed') exit(3) if options.package and args: # package's private directories # get requested Python version compile_versions = debsorted(versions)[:1] log.debug('compile versions: %s', versions) pkg_files = tuple(dpf.from_package(options.package)) for item in args: e_patterns = get_exclude_patterns(item, options.regexpr, \ compile_versions) if not exists(item): log.warn('No such file or directory: %s', item) else: log.debug('byte compiling %s using Python %s', item, compile_versions) files = dpf.filter_directory(pkg_files, item) compile(files, compile_versions, options.force, options.optimize, e_patterns) elif options.package: # package's public modules # no need to limit versions here, version is hardcoded in path or # via -V option e_patterns = get_exclude_patterns() files = dpf.from_package(options.package, extensions=('.py', '.so')) files = dpf.filter_public(files, versions) files = add_namespace_files(files, options.package, action=True) files = dpf.filter_out_ext(files, ('.so',)) compile(files, versions, options.force, options.optimize, e_patterns) elif args: # other directories/files versions = debsorted(versions)[:1] for item in args: e_patterns = get_exclude_patterns(item, options.regexpr, versions) files = dpf.from_directory(item, extensions=('.py', '.so')) files = add_namespace_files(files, action=True) files = dpf.filter_out_ext(files, ('.so',)) compile(files, versions, options.force, options.optimize, e_patterns) else: parser.print_usage() exit(1) # wait for all processes to finish rv = 0 for process in WORKERS.itervalues(): child_output, child_unused = process.communicate() if process.returncode not in (None, 0): # FIXME: find out the package the file belongs to sys.stderr.write(child_output) rv = process.returncode if rv != 0: rv += 100 exit(rv) if __name__ == '__main__': main() python-defaults-2.7.17/pycompile.10000644000000000000000000000452613305600173013714 0ustar .\" Man page generated from reStructuredText. . .TH PYCOMPILE 1 "" "" "" .SH NAME pycompile \- byte compile Python source files . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 pycompile [\-V [X.Y][\-][A.B]] DIR_OR_FILE [\-X REGEXPR] .sp pycompile \-p PACKAGE .UNINDENT .UNINDENT .SH DESCRIPTION .sp Wrapper around Python standard library\(aqs py_compile module to byte\-compile Python files. .SH OPTIONS .INDENT 0.0 .TP .B \-\-version show program\(aqs version number and exit .TP .B \-h\fP,\fB \-\-help show this help message and exit .TP .B \-f\fP,\fB \-\-force force rebuild of byte\-code files even if timestamps are up\-to\-date .TP .B \-O byte\-compile to .pyo files .TP .B \-q\fP,\fB \-\-quiet be quiet .TP .B \-v\fP,\fB \-\-verbose turn verbose mode on .TP .BI \-p \ PACKAGE\fP,\fB \ \-\-package\fB= PACKAGE specify Debian package name whose files should be bytecompiled (combining with DIR_OR_FILE will additionally limit list of files) .TP .BI \-V \ VRANGE force private modules to be bytecompiled with Python version from given range, regardless of the default Python version in the system. If there are no other options, bytecompile all public modules for installed Python versions that match given range. VERSION_RANGE examples: .INDENT 7.0 .INDENT 3.5 .INDENT 0.0 .IP \(bu 2 \fB2.5\fP version 2.5 only .IP \(bu 2 \fB2.5\-\fP version 2.5 or newer .IP \(bu 2 \fB2.5\-2.7\fP version 2.5 or 2.6 .IP \(bu 2 \fB\-3.0\fP all supported 2.X versions .UNINDENT .UNINDENT .UNINDENT .TP .BI \-X \ REGEXPR\fP,\fB \ \-\-exclude\fB= REGEXPR exclude items that match given REGEXPR. You may use this option multiple times to build up a list of things to exclude .UNINDENT .SH AUTHOR Piotr Ożarowski, 2012-2013 .\" Generated by docutils manpage writer. . python-defaults-2.7.17/pycompile.rst0000644000000000000000000000263313305600173014361 0ustar ========== pycompile ========== -------------------------------- byte compile Python source files -------------------------------- :Manual section: 1 :Author: Piotr Ożarowski, 2012-2013 SYNOPSIS ======== pycompile [-V [X.Y][-][A.B]] DIR_OR_FILE [-X REGEXPR] pycompile -p PACKAGE DESCRIPTION =========== Wrapper around Python standard library's py_compile module to byte-compile Python files. OPTIONS ======= --version show program's version number and exit -h, --help show this help message and exit -f, --force force rebuild of byte-code files even if timestamps are up-to-date -O byte-compile to .pyo files -q, --quiet be quiet -v, --verbose turn verbose mode on -p PACKAGE, --package=PACKAGE specify Debian package name whose files should be bytecompiled (combining with DIR_OR_FILE will additionally limit list of files) -V VRANGE force private modules to be bytecompiled with Python version from given range, regardless of the default Python version in the system. If there are no other options, bytecompile all public modules for installed Python versions that match given range. VERSION_RANGE examples: * ``2.5`` version 2.5 only * ``2.5-`` version 2.5 or newer * ``2.5-2.7`` version 2.5 or 2.6 * ``-3.0`` all supported 2.X versions -X REGEXPR, --exclude=REGEXPR exclude items that match given REGEXPR. You may use this option multiple times to build up a list of things to exclude python-defaults-2.7.17/pydist/0000755000000000000000000000000013305600173013136 5ustar python-defaults-2.7.17/pydist/Makefile0000644000000000000000000000024513305600173014577 0ustar #!/usr/bin/make -f clean: rm -rf cache #rm -f dist_fallback dist_fallback: sources.list python ./generate_fallback_list.py --skip-sensible-names .PHONY: clean python-defaults-2.7.17/pydist/README.PyDist0000644000000000000000000000355413305600173015240 0ustar ============ PyDist files ============ DISTNAME [VRANGE] [DEPENDENCY][; [PEP386] [RULES]] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PyDist files help tools like dh_python2 to translate Python dependencies (from setup.py's install_requires or egg's requires.txt file) to Debian dependencies. Required fields: ~~~~~~~~~~~~~~~~ DISTNAME ```````` Python distribution name (you can find it at the beginning of .egg-info file/directory name that your package provides). Examples: * SQLAlchemy * Jinja2 * numpy Optional fields: ~~~~~~~~~~~~~~~~ VRANGE `````` Python version or version range the line applies to. Examples: * 2.6 (Python 2.6 only) * 2.5- (Python 2.5 and newer) * 2.5-2.7 (Python 2.5 or 2.6) * -2.7 (Python 2.6 or older) DEPENDENCY `````````` Debian dependency, multiple packages or versions are allowed. If not set, given Python distribution name will be ignored. Examples: * python-mako * python-jinja2 | python (>= 2.6) * python-sqlalchemy (>= 0.5), python-sqlalchemy (<< 0.6) PEP386 `````` Standards flag: upstream uses versioning schema described in PEP 386. RULES ````` Rules needed to translate upstream version to Debian one. If PEP386 is set, its rules will be applied later. Multiple rules are allowed, separate them with a space. Examples: * s/^/2:/ * s/alpha/~alpha/ s/^/1:/ Notes: ~~~~~~ You can use multiple lines if binary package provides more than one Python distribution or if you want to specify different dependencies for each Python version or version range. If you use dh_python2, it will install debian/binary_package_name.pydist file to /usr/share/python/dist/binary_package_name automatically. Complete examples: ~~~~~~~~~~~~~~~~~~ * SQLAlchemy python-sqlalchemy (>= 0.5), python-sqlalchemy (<< 0.6) * Mako python-mako; PEP386 * foo -2.5 python-oldfoo; s/^/3:/ * foo 2.5- python-foo; PEP386 * Bar 2.6- .. vim: ft=rst python-defaults-2.7.17/pydist/README.PyDist.html0000644000000000000000000002404613305600173016202 0ustar PyDist files

PyDist files

DISTNAME [VRANGE] [DEPENDENCY][; [PEP386] [RULES]]

PyDist files help tools like dh_python2 to translate Python dependencies (from setup.py's install_requires or egg's requires.txt file) to Debian dependencies.

Required fields:

DISTNAME

Python distribution name (you can find it at the beginning of .egg-info file/directory name that your package provides).

Examples:
  • SQLAlchemy
  • Jinja2
  • numpy

Optional fields:

VRANGE

Python version or version range the line applies to.

Examples:
  • 2.6 (Python 2.6 only)
  • 2.5- (Python 2.5 and newer)
  • 2.5-2.7 (Python 2.5 or 2.6)
  • -2.7 (Python 2.6 or older)

DEPENDENCY

Debian dependency, multiple packages or versions are allowed. If not set, given Python distribution name will be ignored.

Examples:
  • python-mako
  • python-jinja2 | python (>= 2.6)
  • python-sqlalchemy (>= 0.5), python-sqlalchemy (<< 0.6)

PEP386

Standards flag: upstream uses versioning schema described in PEP 386.

RULES

Rules needed to translate upstream version to Debian one. If PEP386 is set, its rules will be applied later. Multiple rules are allowed, separate them with a space.

Examples:
  • s/^/2:/
  • s/alpha/~alpha/ s/^/1:/

Notes:

You can use multiple lines if binary package provides more than one Python distribution or if you want to specify different dependencies for each Python version or version range.

If you use dh_python2, it will install debian/binary_package_name.pydist file to /usr/share/python/dist/binary_package_name automatically.

Complete examples:

  • SQLAlchemy python-sqlalchemy (>= 0.5), python-sqlalchemy (<< 0.6)
  • Mako python-mako; PEP386
  • foo -2.5 python-oldfoo; s/^/3:/
  • foo 2.5- python-foo; PEP386
  • Bar 2.6-
python-defaults-2.7.17/pydist/dist_fallback0000644000000000000000000004056113305600173015651 0ustar python python setuptools python-pkg-resources wsgiref python (>= 2.5) | python-wsgiref argparse python (>= 2.7) | python-argparse pil python-imaging AddOns python-peak.util BatchModify trac-batchmodify BitTornado bittornado BitTorrent bittorrent Bitten trac-bitten-slave BytecodeAssembler python-peak.util BzrPipeline bzr-pipeline BzrTools bzrtools Calendar_and_Contacts_Server calendarserver CedarBackup2 cedar-backup2 CherryPy python-cherrypy3 CherryTree cherrytree ClusterShell clustershell Codeville codeville ControlAula controlaula CoverageTestRunner python-coverage-test-runner DITrack ditrack DebTorrent debtorrent DecoratorTools python-peak.util.decorators DiaVisViewPlugin trac-diavisview Djapian python-django-djapian Doconce doconce Dosage dosage DouF00 douf00 Editra editra Extremes python-peak.util Fabric fabric FeinCMS python-django-feincms Flask_WTF python-flaskext.wtf GaussSum gausssum GeoIP_Python python-geoip GitPython python-git HarvestMan harvestman ISO8583_Module python-iso8583 Ibid ibid JCC jcc Loom bzr-loom MAT mat Magic_file_extensions python-magic Mirage mirage Mnemosyne mnemosyne Model_Builder model-builder MySQL_python python-mysqldb Nautilus_scripts_manager nautilus-scripts-manager Nulog nulog OdtExportPlugin trac-odtexport PEAK_Rules python-peak.rules PIDA pida Photon photon Plywood plywood Postr postr PreludeEasy python-prelude PsychoPy psychopy Pwman3 pwman3 PyAIML python-aiml PyBluez python-bluez PyCAPTCHA python-captcha PyCoCuMa pycocuma PyFFTW3 python-fftw PyHamcrest python-hamcrest PyMca pymca PyMetrics pymetrics PyNAST pynast PyOpenGL python-opengl PyProtocols python-protocols PyRoom pyroom PySFML python-sfml PyStemmer python-stemmer PyWavelets python-pywt PyWebDAV python-webdav PyYAML python-yaml Py_ python-py++ Pygmy pygmy Pymacs pymacs Pyste libboost-python1.49-dev PythonDaap python-daap QuantLib_Python quantlib-python Quixote python-quixote1 Ren_Py python-renpy Roadmap_Plugin trac-roadmap RunSnakeRun runsnakerun ScientificPython python-scientific Shinken shinken-core Sonata sonata South python-django-south SymbolType python-peak.util Symbolic python-swiginac TcosConfigurator tcos-configurator The_FreeSmartphone_Framework_Daemon fso-frameworkd TileCache tilecache TileStache tilestache Trac trac TracAccountManager trac-accountmanager TracAnnouncer trac-announcer TracAuthOpenId trac-authopenid TracBzr trac-bzr TracCustomFieldAdmin trac-customfieldadmin TracDateField trac-datefieldplugin TracGit trac-git TracHTTPAuth trac-httpauth TracMasterTickets trac-mastertickets TracMercurial trac-mercurial TracPrivateTickets trac-privatetickets TracSpamFilter trac-spamfilter TracSubTicketsPlugin trac-subtickets TracTags trac-tags TracVirtualTicketPermissions trac-virtualticketpermissions TracWikiPrintPlugin trac-wikiprint TracWysiwyg trac-wysiwyg TracXMLRPC trac-xmlrpc Trac_jsGantt trac-jsgantt Turtle_Art turtleart UNKNOWN python-pdfrw UnknownHorizons unknown-horizons VirtualMailManager vmm WikiTableMacro trac-wikitablemacro Wikkid wikkid WordPress_Library python-wordpresslib X_Tile x-tile ZODB3 python-zodb _tifffile tifffile activity_log_manager activity-log-manager adns_python python-adns agtl agtl alembic alembic allmydata_tahoe tahoe-lafs apache_libcloud python-libcloud apparmor apparmor-utils apt_clone apt-clone apt_p2p apt-p2p apt_xapian_index apt-xapian-index aptfs aptfs aptoncd aptoncd arandr arandr archivemail archivemail archmage archmage arista arista atheist atheist autokey autokey-common beautifulsoup4 python-bs4 bicyclerepair bicyclerepair bley bley bookletimposer bookletimposer bpython bpython buildbot buildbot buildbot_slave buildbot-slave burn burn bzr python-bzrlib bzr_builddeb bzr-builddeb bzr_cia cia-clients bzr_cvsps_import bzr-cvsps-import bzr_dbus bzr-dbus bzr_email bzr-email bzr_etckeeper etckeeper bzr_fastimport bzr-fastimport bzr_git bzr-git bzr_grep bzr-grep bzr_gtk bzr-gtk bzr_rewrite bzr-rewrite bzr_search bzr-search bzr_stats bzr-stats bzr_svn bzr-svn bzr_upload bzr-upload bzr_xmloutput bzr-xmloutput cappuccino cappuccino carbon graphite-carbon cardstories cardstories cfget cfget chirp chirp chm2pdf chm2pdf cm config-manager cmdtest cmdtest cpuset cpuset cvs2svn cvs2svn d_feet d-feet d_rats d-rats datapm datapm dblatex dblatex dctrl2xml dctrl2xml debpartial_mirror debpartial-mirror deluge deluge-common devscripts devscripts dicompyler dicompyler dissy dissy djagios djagios django_ajax_selects django-ajax-selects django_filter django-filter django_openid_auth python-django-auth-openid django_tables2 django-tables django_tastypie python-tastypie djextdirect python-django-extdirect dkimpy python-dkim dot2tex dot2tex driconf driconf dtrx dtrx duplicity duplicity dvcs_autosync dvcs-autosync eficas eficas elisa python-moovida elisa_plugin_amazon moovida-plugins-bad elisa_plugin_amp moovida-plugins-bad elisa_plugin_avahi moovida-plugins-bad elisa_plugin_base moovida-plugins-good elisa_plugin_coherence moovida-plugins-bad elisa_plugin_daap moovida-plugins-bad elisa_plugin_database moovida-plugins-bad elisa_plugin_discogs moovida-plugins-bad elisa_plugin_dvd moovida-plugins-bad elisa_plugin_elisa_updater moovida-plugins-bad elisa_plugin_filtered_shares moovida-plugins-bad elisa_plugin_flickr moovida-plugins-ugly elisa_plugin_gnome moovida-plugins-good elisa_plugin_gstreamer moovida-plugins-bad elisa_plugin_hal moovida-plugins-good elisa_plugin_http_client moovida-plugins-bad elisa_plugin_ipod moovida-plugins-bad elisa_plugin_lastfm moovida-plugins-bad elisa_plugin_lirc moovida-plugins-ugly elisa_plugin_osso moovida-plugins-bad elisa_plugin_pigment moovida-plugins-bad elisa_plugin_poblesec moovida-plugins-bad elisa_plugin_rss moovida-plugins-bad elisa_plugin_search moovida-plugins-bad elisa_plugin_shoutcast moovida-plugins-ugly elisa_plugin_smbwin32 moovida-plugins-bad elisa_plugin_themoviedb moovida-plugins-bad elisa_plugin_thetvdb moovida-plugins-bad elisa_plugin_winremote moovida-plugins-bad elisa_plugin_winscreensaver moovida-plugins-good elisa_plugin_wmd moovida-plugins-bad elisa_plugin_youtube moovida-plugins-ugly epigrass epigrass epoptes epoptes espeak_gui espeak-gui euca2ools euca2ools explorer bzr-explorer flashbake flashbake flickrfs flickrfs fontypython fontypython frescobaldi frescobaldi fts fts fts_clacks fts-clacks fts_fai fts-fai-ldap fts_ltsp fts-ltsp-ldap fts_opsi fts-opsi funkload funkload fuse_python python-fuse fusil fusil fuss_launcher fuss-launcher galternatives galternatives gameclock gameclock gaphor gaphor gastablesgui gastables gbp git-buildpackage gdevilspie gdevilspie gdmodule python-gd genbackupdata genbackupdata getmail getmail4 geximon geximon git_review git-review github_cli github-cli giws giws gjots2 gjots2 glipper glipper globs globs glue glue-sprite gmobilemedia gmobilemedia gnome_activity_journal gnome-activity-journal gnome_app_install gnome-codec-install gnomecatalog gnomecatalog gnuplot_py python-gnuplot go2 go2 gozerbot gozerbot gozerplugs gozerbot-plugins gpodder gpodder gquilt gquilt graphviz trac-graphviz gunicorn gunicorn gvb gvb gwrite gwrite gyp gyp hgnested mercurial-nested hgsvn hgsvn hitchhhiker hitchhiker hotwire hotwire httpcode httpcode httpie httpie hyde hyde ibus_tegaki ibus-tegaki icalview trac-icalviewplugin identicurse identicurse imposm.parser python-imposm-parser iotop iotop ipython ipython isoquery isoquery jack jack jsb jsonbot juju juju kedpm kedpm keepnote keepnote key_mon key-mon keymapper keymapper kiki kiki lastfmsubmitd lastfmsubmitd lazygal lazygal legit legit libtpclient_py python-tp-client libtpproto_py python-tp-netlib lio lio-utils llnl_babel python-sidl llnl_babel_sidl_sidlx python-sidl loggerhead loggerhead londonlaw londonlaw lptools lptools lshell lshell ludev_t ludevit lybniz lybniz mayavi mayavi2 mcomix mcomix mecab_python python-mecab mercurial mercurial-common mic mic2 mimms mimms mingc python-ming mini_dinstall mini-dinstall miro miro mitmproxy mitmproxy mod_python libapache2-mod-python moin python-moinmoin moosic moosic mozilla_devscripts mozilla-devscripts mpDris mpdris museek_python_bindings python-museek musiclibrarian musiclibrarian mysql_utilities mysql-utilities nautilus_pastebin nautilus-pastebin neso tryton-neso netsnmp_python libsnmp-python nfoview nfoview nglister nglister nml nml nsscache nsscache nxt_python python-nxt obMenu obmenu obnam obnam oboinus oboinus offlineimap offlineimap oidua oidua ooo2dbk ooo2dbk ooolib_python python-ooolib openbmap_logger openbmap-logger openoffice_python python-openoffice openshot openshot openstack.common python-openstack-common osc osc pYsearch python-yahoo pbundler pbundler pdfposter pdfposter pdfshuffler pdfshuffler pep8 pep8 perroquet perroquet pgxnclient pgxnclient photofilmstrip photofilmstrip pithos pithos pkpgcounter pkpgcounter playitslowly playitslowly pondus pondus prelude_correlator prelude-correlator prelude_notify prelude-notify preprocess preprocess presage_dbus_service presage-dbus prewikka prewikka prioritized_methods python-peak.rules proteus tryton-proteus prover9_mace4 prover9-mace4 pssh pssh ptex2tex ptex2tex puddletag puddletag purity_ng purity-ng pyExcelerator python-excelerator pyFAI pyfai pyLibravatar python-libravatar pyOpenSSL python-openssl pyPortMidi python-pypm py_Asterisk python-asterisk py_pypcap python-pypcap py_rrdtool python-rrdtool py_sendfile python-sendfile pyacidobasic python-acidobasic pyacoustid python-acoustid pyalsaaudio python-alsaaudio pybloom python-bloomfilter pybridge pybridge pybtex pybtex pybugz bugz pychecker pychecker pychess pychess pychm python-chm pycrypto python-crypto pydicom python-dicom pydns python-dns pyenchant python-enchant pyepr python-epr pyfacebook python-facebook pyflakes pyflakes pygdchart python-gdchart2 pygopherd pygopherd pygpgme python-gpgme pygpiv python-gpiv pygrib python-grib pyliblo python-liblo pyliblzma python-lzma pylibpcap python-libpcap pylint pylint pylogsparser python-logsparser pymecavideo python-mecavideo pymilter python-milter pymol pymol pymucipher python-museek pymvpa python-mvpa pymvpa2 python-mvpa2 pyneighborhood pyneighborhood pynids python-nids pynifti python-nifti pyogg python-ogg pyp pyp pyparallel python-parallel pyppd pyppd pyprompter pyprompter pyremctl python-remctl pyrit pyrit pyrite_publisher pyrite-publisher pysane python-imaging-sane pysatellites python-satellites pyserial python-serial pysnmp python-pysnmp4 pysnmp_apps python-pysnmp4-apps pysnmp_mibs python-pysnmp4-mibs pysparse python-sparse pyspf python-spf pyspi python-at-spi pysqlite python-pysqlite1.1 pystatgrab python-statgrab pysubnettree python-subnettree pysurfer python-surfer pytagsfs pytagsfs pytcpwrap python-tcpwrap python2_biggles python-pybiggles python_djvulibre python-djvu python_e_dbus python-edbus python_graph_core python-pygraph python_graph_dot python-pygraph python_libgearman python-gearman.libgearman python_libpisock python-pisock python_logging_extra python-loggingx python_memcached python-memcache python_policyd_spf postfix-policyd-spf-python python_yapps yapps2 pythontracer pythontracer pytidylib python-tidylib pytimechart pytimechart pytrainer pytrainer pytz python-tz pyusb python-usb pyweblib python-weblib pyxdg python-xdg pyzmq python-zmq pyzor pyzor qbzr qbzr qct qct qmtest qmtest qpid_python python-qpid qpid_qmf python-qpid-extras-qmf qpid_tools qpid-tools quisk quisk quodlibet exfalso qweborf qweborf rabbitvcs rabbitvcs-core radiotray radiotray ranger ranger rapid_spring rapid-spring rawdog rawdog rdiff_backup rdiff-backup rebuildd rebuildd recaptcha_client python-recaptcha relational_gui relational relational_pyside relational relational_readline relational-cli remuco remuco-base repoze.what.plugins.sql python-repoze.what-plugins repoze.what.plugins.xml python-repoze.what-plugins repoze.what_pylons python-repoze.what-plugins repoze.what_quickstart python-repoze.what-plugins repoze.who.plugins.ldap python-repoze.who-plugins repoze.who.plugins.openid python-repoze.who-plugins repoze.who.plugins.sa python-repoze.who-plugins repoze.who_friendlyform python-repoze.who-plugins repoze.who_testutil python-repoze.who-plugins roundup roundup rpl rpl rst2pdf rst2pdf rubber rubber salt salt-common scikit_learn python-sklearn scikits_image python-skimage screenlets screenlets seivot seivot sensitivetickets trac-sensitivetickets servefile servefile shedskin shedskin slapos.core slapos-client slimit slimit smart python-smartpm snimpy snimpy spambayes spambayes spectacle spectacle specto specto sphinxcontrib_actdiag python-sphinxcontrib.actdiag sphinxcontrib_blockdiag python-sphinxcontrib.blockdiag sphinxcontrib_issuetracker python-sphinxcontrib.issuetracker sphinxcontrib_nwdiag python-sphinxcontrib.nwdiag sphinxcontrib_seqdiag python-sphinxcontrib.seqdiag sphinxcontrib_spelling python-sphinxcontrib.spelling spyder python-spyderlib sqlalchemy_migrate python-migrate startupmanager startupmanager stgit stgit summain summain supervisor supervisor supybot supybot svnmailer svnmailer synaptiks kde-config-touchpad tailor tailor targetcli targetcli tcm lio-utils tcosconfig tcosconfig tegaki_pygtk python-tegaki-gtk tegaki_python python-tegaki tegaki_tools python-tegakitools tegaki_train tegaki-train tgext.crud python-tgext.admin tilelite tilelite tinyeartrainer tinyeartrainer tortoisehg tortoisehg transifex_client transifex-client translate_toolkit translate-toolkit trash_cli trash-cli trimage trimage tritium tritium tryton tryton-client trytond tryton-server trytond_account tryton-modules-account trytond_account_be tryton-modules-account-be trytond_account_de_skr03 tryton-modules-account-de-skr03 trytond_account_invoice tryton-modules-account-invoice trytond_account_invoice_history tryton-modules-account-invoice-history trytond_account_invoice_line_standalone tryton-modules-account-invoice-line-standalone trytond_account_product tryton-modules-account-product trytond_account_statement tryton-modules-account-statement trytond_analytic_account tryton-modules-analytic-account trytond_analytic_invoice tryton-modules-analytic-invoice trytond_analytic_purchase tryton-modules-analytic-purchase trytond_analytic_sale tryton-modules-analytic-sale trytond_calendar tryton-modules-calendar trytond_calendar_classification tryton-modules-calendar-classification trytond_calendar_scheduling tryton-modules-calendar-scheduling trytond_calendar_todo tryton-modules-calendar-todo trytond_company tryton-modules-company trytond_company_work_time tryton-modules-company-work-time trytond_country tryton-modules-country trytond_currency tryton-modules-currency trytond_dashboard tryton-modules-dashboard trytond_google_maps tryton-modules-google-maps trytond_ldap_authentication tryton-modules-ldap-authentication trytond_ldap_connection tryton-modules-ldap-connection trytond_party tryton-modules-party trytond_party_siret tryton-modules-party-siret trytond_party_vcarddav tryton-modules-party-vcarddav trytond_product tryton-modules-product trytond_product_cost_fifo tryton-modules-product-cost-fifo trytond_product_cost_history tryton-modules-product-cost-history trytond_product_price_list tryton-modules-product-price-list trytond_project tryton-modules-project trytond_project_plan tryton-modules-project-plan trytond_project_revenue tryton-modules-project-revenue trytond_purchase tryton-modules-purchase trytond_purchase_invoice_line_standalone tryton-modules-purchase-invoice-line-standalone trytond_sale tryton-modules-sale trytond_sale_opportunity tryton-modules-sale-opportunity trytond_sale_price_list tryton-modules-sale-price-list trytond_stock tryton-modules-stock trytond_stock_forecast tryton-modules-stock-forecast trytond_stock_inventory_location tryton-modules-stock-inventory-location trytond_stock_location_sequence tryton-modules-stock-location-sequence trytond_stock_product_location tryton-modules-stock-product-location trytond_stock_supply tryton-modules-stock-supply trytond_stock_supply_day tryton-modules-stock-supply-day trytond_timesheet tryton-modules-timesheet ttb ttb turpial turpial tw.forms python-toscawidgets txLibravatar python-twisted-libravatar ubuntu_dev_tools ubuntu-dev-tools ufw ufw unattended_upgrades unattended-upgrades unittest_xml_reporting python-xmlrunner urlscan urlscan vamos undertaker vboxapi virtualbox virtaal virtaal virtinst virtinst virtualbricks virtualbricks virtualenvwrapper virtualenvwrapper wammu wammu web.py python-webpy weboob python-weboob-core whyteboard whyteboard wikipediafs wikipediafs winpdb winpdb wxPython_common python-wxgtk2.8 wxgeometrie wxgeometrie xgflib xgridfit xml_marshaller python-xmlmarshaller xmldiff xmldiff xmms2tray xmms2tray yagtd yagtd yokadi yokadi yum_metadata_parser python-sqlitecachec zenmap zenmap zeroinstall_injector zeroinstall-injector zim zim zinnia_python python-zinnia python-defaults-2.7.17/pydist/generate_fallback_list.py0000755000000000000000000000605213305600173020162 0ustar #! /usr/bin/python # -*- coding: UTF-8 -*- # Copyright © 2010 Piotr Ożarowski # # 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. import os import sys from subprocess import Popen, PIPE skip_sensible_names = True if '--skip-sensible-names' in sys.argv else False os.chdir(os.path.dirname(__file__)) if os.path.isdir('../debpython'): sys.path.append('..') else: sys.path.append('/usr/share/python/debpython/') from debpython.pydist import sensible_pname if not os.path.isdir('cache'): process = Popen('apt-file -s sources.list -c cache update', shell=True) process.communicate() if process.returncode != 0: sys.stderr.write('Cannot download APT data files') exit(1) # find .egg-info files/directories process = Popen('apt-file -s sources.list -c cache find -x ' '"/usr/((share/pyshared)|(lib/python2\.[0-9]/((site)|(dist))-packages)|(share/python-support/[^/]+))/[^/]*\.egg-info"', shell=True, stdout=PIPE) stdout, stderr = process.communicate() if process.returncode != 0: sys.stderr.write('Cannot find packages with Egg metadata') exit(2) processed = set() result = [] for line in stdout.splitlines(): pname, path = line.split(': ', 1) if pname == 'python-setuptools': continue egg_name = [i.split('-', 1)[0] for i in path.split('/')\ if i.endswith('.egg-info')][0] if egg_name.endswith('.egg'): egg_name = egg_name[:-4] if skip_sensible_names and sensible_pname(egg_name) == pname: continue if egg_name not in processed: processed.add(egg_name) result.append("%s %s\n" % (egg_name, pname)) #result.append("%s %s\t%s\n" % (egg_name, pname, path)) result.sort() fp = open('dist_fallback', 'w') fp.write('python python\n') fp.write('setuptools python-pkg-resources\n') fp.write('wsgiref python (>= 2.5) | python-wsgiref\n') fp.write('argparse python (>= 2.7) | python-argparse\n') # wasn't recognized due to .pth file (egg-info is in PIL/ and not in *-packages/) fp.write('pil python-imaging\n') fp.writelines(result) python-defaults-2.7.17/pydist/sources.list0000644000000000000000000000014413305600173015515 0ustar deb http://ftp.debian.org/debian/ unstable main deb-src http://ftp.debian.org/debian/ unstable main python-defaults-2.7.17/python2.pm0000644000000000000000000000034713305600173013567 0ustar #! /usr/bin/perl # debhelper sequence file for dh_python2 use warnings; use strict; use Debian::Debhelper::Dh_Lib; insert_before("dh_installinit", "dh_python2"); remove_command("dh_pycentral"); remove_command("dh_pysupport"); 1 python-defaults-2.7.17/runtime.d/0000755000000000000000000000000013305600173013527 5ustar python-defaults-2.7.17/runtime.d/public_modules.rtinstall0000755000000000000000000000056713305600173020506 0ustar #! /bin/sh set -e VERSION=${2#python} case "$VERSION" in 2.[45]) sitedir=/usr/lib/python$VERSION/site-packages;; *) sitedir=/usr/lib/python$VERSION/dist-packages esac if which python >/dev/null 2>&1 && which pycompile >/dev/null 2>&1; then pycompile -V $VERSION $sitedir else echo >&2 "python or pycompile not found in $(basename $0) hook." exit 1 fi python-defaults-2.7.17/runtime.d/public_modules.rtremove0000755000000000000000000000047413305600173020332 0ustar #! /bin/sh set -e VERSION=${2#python} case "$VERSION" in 2.[45]) sitedir=/usr/lib/python$VERSION/site-packages;; *) sitedir=/usr/lib/python$VERSION/dist-packages esac if which python >/dev/null 2>&1 && which pyclean >/dev/null 2>&1; then pyclean $sitedir else find $sitedir -name '*.py[co]' -delete fi python-defaults-2.7.17/tests/0000755000000000000000000000000013305600173012764 5ustar python-defaults-2.7.17/tests/Makefile0000644000000000000000000000054213305600173014425 0ustar #!/usr/bin/make -f # enable or disable tests here: TESTS := test1 test2 test3 test4 test5 test6 test7 all: $(TESTS) test%: make -C t$* run make -C t$* check clean-test%: make -C t$* clean clean: $(TESTS:%=clean-%) rm -f *\.dsc *\.tar\.gz *\.build *\.changes *\.deb @find . -prune -name '*.egg-info' -exec rm -rf '{}' ';' || true .PHONY: clean python-defaults-2.7.17/tests/common.mk0000644000000000000000000000057213305600173014611 0ustar #!/usr/bin/make -f export DEBPYTHON_DEFAULT ?= $(shell sed -rne 's,^default-version = python(.*),\1,p' ../../debian/debian_defaults) export DEBPYTHON_SUPPORTED ?= $(shell sed -rne '/^supported-versions/{s/^supported-versions = (.*)/\1/g;s/python//gp}' ../../debian/debian_defaults) all: run check run: clean dpkg-buildpackage -b -us -uc clean-common: ./debian/rules clean python-defaults-2.7.17/tests/t1/0000755000000000000000000000000013305600173013310 5ustar python-defaults-2.7.17/tests/t1/Makefile0000644000000000000000000000133513305600173014752 0ustar #!/usr/bin/make -f include ../common.mk DPY=$(DEBPYTHON_DEFAULT) check: grep -q "Depends: .*python-mako" debian/python-foo/DEBIAN/control grep -q 'python-foo (>= 2:0.1~rc2)' debian/python-foo/DEBIAN/control ifneq (,$(findstring 2.6,$(DEBPYTHON_SUPPORTED))) test -f debian/python-foo/usr/lib/python2.6/dist-packages/foo/__init__.py endif test ! -f debian/python-foo/usr/lib/python2.6/dist-packages/foo/spam.py grep -q "Depends: .*python (<<" debian/python-foo/DEBIAN/control [ "`readlink debian/python-foo/usr/lib/python$(DPY)/dist-packages/foo/absolute_link_to_tmp`" = "/tmp" ] [ "`readlink debian/python-foo/usr/lib/python$(DPY)/dist-packages/foo/link_to_parent_dir`" = ".." ] clean: clean-common rm -rf lib/Foo.egg-info python-defaults-2.7.17/tests/t1/debian/0000755000000000000000000000000013547613275014551 5ustar python-defaults-2.7.17/tests/t1/debian/changelog0000644000000000000000000000020113305600173016375 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sat, 27 Feb 2010 20:42:17 +0100 python-defaults-2.7.17/tests/t1/debian/compat0000644000000000000000000000000213547613275015747 0ustar 9 python-defaults-2.7.17/tests/t1/debian/control0000644000000000000000000000103613305600173016135 0ustar Source: foo Section: python Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python-all Standards-Version: 3.9.0 XS-Python-Version: >= 2.4 Package: python-foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Recommends: ${python:Recommends} Suggests: ${python:Suggests} Enhances: ${python:Enhances} Breaks: foo, ${python:Breaks} Provides: ${python:Provides} XB-Python-Version: ${python:Versions} Description: foo to rule them all exemple package #1 python-defaults-2.7.17/tests/t1/debian/copyright0000644000000000000000000000015413305600173016465 0ustar The Debian packaging is © 2010, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t1/debian/pydist-overrides0000644000000000000000000000016213305600173017770 0ustar Mako python-mako (>= 0.2) SQLAlchemy python-sqlalchemy (>= 0.6) Foo python-foo; PEP386 s/^/2:/ Bar python-bar Baz python-defaults-2.7.17/tests/t1/debian/python-foo.pyinstall0000644000000000000000000000003013305600173020566 0ustar debian/spam.py foo 2.5- python-defaults-2.7.17/tests/t1/debian/python-foo.pyremove0000644000000000000000000000003513305600173020422 0ustar foo/spam.py 2.6 foo/bar 2.7- python-defaults-2.7.17/tests/t1/debian/rules0000755000000000000000000000074013305600173015613 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_pysupport: find debian/ -name jquery.js -exec \ ln -fs /usr/share/javascript/jquery/jquery.js '{}' \; find debian/ -name foo -type d -exec \ ln -s /tmp/ '{}/absolute_link_to_tmp' \; find debian/ -name foo -type d -exec \ ln -s .. '{}/link_to_parent_dir' \; DH_VERBOSE=1 ../../dh_python2\ --depends 'SQLAlchemy >= 0.6.1'\ --recommends Mako\ --suggests 'Foo >= 0.1rc2'\ --suggests 'bar >= 1.0' python-defaults-2.7.17/tests/t1/debian/source/0000755000000000000000000000000013305600173016032 5ustar python-defaults-2.7.17/tests/t1/debian/source/format0000644000000000000000000000001513305600173017241 0ustar 3.0 (native) python-defaults-2.7.17/tests/t1/debian/spam.py0000644000000000000000000000001513305600173016040 0ustar print 'SPAM' python-defaults-2.7.17/tests/t1/lib/0000755000000000000000000000000013305600173014056 5ustar python-defaults-2.7.17/tests/t1/lib/foo/0000755000000000000000000000000013305600173014641 5ustar python-defaults-2.7.17/tests/t1/lib/foo/__init__.py0000644000000000000000000000006213305600173016750 0ustar print("you just imported foo from %s" % __file__) python-defaults-2.7.17/tests/t1/lib/foo/bar/0000755000000000000000000000000013305600173015405 5ustar python-defaults-2.7.17/tests/t1/lib/foo/bar/__init__.py0000644000000000000000000000006613305600173017520 0ustar print("you just imported foo.bar from %s" % __file__) python-defaults-2.7.17/tests/t1/lib/foo/baz.py0000644000000000000000000000006613305600173015771 0ustar print("you just imported foo.baz from %s" % __file__) python-defaults-2.7.17/tests/t1/lib/foo/jquery.js0000777000000000000000000000000013305600173026047 2/usr/share/javascript/jquery/jquery.jsustar python-defaults-2.7.17/tests/t1/setup.py0000644000000000000000000000113613305600173015023 0ustar #! /usr/bin/python # -*- coding: UTF-8 -*- try: from setuptools import setup, find_packages except ImportError: exit() setup(name='Foo', version=0.1, description="Foo to rule them all", long_description="TODO", keywords='foo bar baz', author='Piotr Ożarowski', author_email='piotr@debian.org', url='http://www.debian.org/', license='MIT', package_dir={'': 'lib'}, packages=find_packages('lib/'), package_data = {'foo': ['jquery.js']}, zip_safe=False, install_requires = ['Mako', 'SQLAlchemy >=0.5', 'Baz [extras]'], ) python-defaults-2.7.17/tests/t2/0000755000000000000000000000000013305600173013311 5ustar python-defaults-2.7.17/tests/t2/Makefile0000644000000000000000000000052113305600173014747 0ustar #!/usr/bin/make -f include ../common.mk DPY=$(DEBPYTHON_DEFAULT) clean: clean-common check: test -f debian/python-foo/usr/lib/python$(DPY)/dist-packages/foo.py test -f debian/python-foo/usr/lib/python$(DPY)/dist-packages/bar/bar.py grep -q pycompile debian/python-foo/DEBIAN/postinst grep -q pyclean debian/python-foo/DEBIAN/prerm python-defaults-2.7.17/tests/t2/__init__.py0000644000000000000000000000003113305600173015414 0ustar print("I'm __init__.py") python-defaults-2.7.17/tests/t2/bar.py0000644000000000000000000000002113305600173014420 0ustar print("I'm bar") python-defaults-2.7.17/tests/t2/debian/0000755000000000000000000000000013547613275014552 5ustar python-defaults-2.7.17/tests/t2/debian/changelog0000644000000000000000000000020113305600173016376 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sat, 27 Feb 2010 20:42:17 +0100 python-defaults-2.7.17/tests/t2/debian/compat0000644000000000000000000000000213547613275015750 0ustar 9 python-defaults-2.7.17/tests/t2/debian/control0000644000000000000000000000072513305600173016142 0ustar Source: foo Section: python Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python-all Standards-Version: 3.9.1 XS-Python-Version: >= 2.1 Package: python-foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Recommends: ${python:Recommends} Suggests: ${python:Suggests} Enhances: ${python:Enhances} Breaks: ${python:Breaks} Description: foo to rule them all exemple package #2 python-defaults-2.7.17/tests/t2/debian/copyright0000644000000000000000000000015413305600173016466 0ustar The Debian packaging is © 2010, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t2/debian/install0000644000000000000000000000014113305600173016120 0ustar foo.py /usr/share/pyshared/ __init__.py /usr/share/pyshared/bar/ bar.py /usr/share/pyshared/bar/ python-defaults-2.7.17/tests/t2/debian/rules0000755000000000000000000000020513305600173015610 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_pysupport: DH_VERBOSE=1 ../../dh_python2 clean: dh_clean python-defaults-2.7.17/tests/t2/debian/source/0000755000000000000000000000000013305600173016033 5ustar python-defaults-2.7.17/tests/t2/debian/source/format0000644000000000000000000000001513305600173017242 0ustar 3.0 (native) python-defaults-2.7.17/tests/t2/foo.py0000644000000000000000000000002113305600173014437 0ustar print("I'm foo") python-defaults-2.7.17/tests/t2/setup.py0000644000000000000000000000000013305600173015011 0ustar python-defaults-2.7.17/tests/t3/0000755000000000000000000000000013305600173013312 5ustar python-defaults-2.7.17/tests/t3/Makefile0000644000000000000000000000204313305600173014751 0ustar #!/usr/bin/make -f include ../common.mk DPY=$(DEBPYTHON_DEFAULT) check: grep -q "pycompile -p python-foo /usr/lib/python-foo -V $(DPY)"\ debian/python-foo/DEBIAN/postinst test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so test ! -f debian/python-foo/usr/share/pyshared/foo/bar.so test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/spam.so test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/spam.so.0.1 test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1 test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1.2 test -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0 test ! -L debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0 test ! -f debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 clean: clean-common rm -rf lib/Foo.egg-info build python-defaults-2.7.17/tests/t3/debian/0000755000000000000000000000000013547613275014553 5ustar python-defaults-2.7.17/tests/t3/debian/changelog0000644000000000000000000000020113305600173016377 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sun, 19 Dec 2010 19:40:33 +0100 python-defaults-2.7.17/tests/t3/debian/compat0000644000000000000000000000000213547613275015751 0ustar 9 python-defaults-2.7.17/tests/t3/debian/control0000644000000000000000000000105513305600173016140 0ustar Source: foo Section: python Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~), python-all-dev Standards-Version: 3.9.1 X-Python-Version: >= 2.6 Package: python-foo Architecture: any Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends} Recommends: ${python:Recommends} Suggests: ${python:Suggests} Enhances: ${python:Enhances} Breaks: ${python:Breaks} Provides: ${python:Provides} XB-Python-Version: ${python:Versions} Description: foo to rule them all exemple package #3 - Python extension python-defaults-2.7.17/tests/t3/debian/copyright0000644000000000000000000000015413305600173016467 0ustar The Debian packaging is © 2010, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t3/debian/install0000644000000000000000000000011713305600173016124 0ustar # private module in architecture dependent dir lib/foo.py /usr/lib/python-foo/ python-defaults-2.7.17/tests/t3/debian/rules0000755000000000000000000000275113305600173015621 0ustar #!/usr/bin/make -f DPY=$(shell PYTHONPATH=../../ python -c 'import debpython.version as v; print(v.vrepr(v.DEFAULT))') %: dh $@ --buildsystem=python_distutils override_dh_pysupport: # install also as private extension dh_install debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so \ /usr/lib/python-foo/ # ... and under versioned name with a symlink cp debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so \ debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/spam.so.0 dh_link /usr/lib/python${DPY}/dist-packages/foo/spam.so.0 \ /usr/lib/python${DPY}/dist-packages/foo/spam.so # ... and with multiple symlinks cp debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so \ debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1.2 dh_link /usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1.2 \ /usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1 dh_link /usr/lib/python${DPY}/dist-packages/foo/baz.so.0.1 \ /usr/lib/python${DPY}/dist-packages/foo/baz.so # ... second style of multiple symlinks cp debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/bar.so \ debian/python-foo/usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 dh_link /usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 \ /usr/lib/python${DPY}/dist-packages/foo/quux.so.0 dh_link /usr/lib/python${DPY}/dist-packages/foo/quux.so.0.0.0 \ /usr/lib/python${DPY}/dist-packages/foo/quux.so # ... and complex multiple symlinks DH_VERBOSE=1 ../../dh_python2 python-defaults-2.7.17/tests/t3/debian/source/0000755000000000000000000000000013305600173016034 5ustar python-defaults-2.7.17/tests/t3/debian/source/format0000644000000000000000000000001513305600173017243 0ustar 3.0 (native) python-defaults-2.7.17/tests/t3/lib/0000755000000000000000000000000013305600173014060 5ustar python-defaults-2.7.17/tests/t3/lib/__init__.py0000644000000000000000000000000013305600173016157 0ustar python-defaults-2.7.17/tests/t3/lib/bar.c0000644000000000000000000000000013305600173014756 0ustar python-defaults-2.7.17/tests/t3/lib/foo.py0000644000000000000000000000011013305600173015205 0ustar import foo.bar class Foo(object): def __init__(self): pass python-defaults-2.7.17/tests/t3/setup.py0000755000000000000000000000061313305600173015027 0ustar #!/usr/bin/env python from distutils.core import setup, Extension setup(name="distutils-test", version = "0.1", author="jbailey", author_email="jbailey@debian.org", url="http://www.python.org/sigs/distutils-sig/", ext_modules=[Extension('foo/bar', ['lib/bar.c'])], #py_modules=['package'], packages = ["foo"], package_dir = {'foo': 'lib'} ) python-defaults-2.7.17/tests/t4/0000755000000000000000000000000013305600173013313 5ustar python-defaults-2.7.17/tests/t4/Makefile0000644000000000000000000000077113305600173014760 0ustar #!/usr/bin/make -f include ../common.mk clean: clean-common check: grep -q python2.6 debian/foo/usr/share/foo/foo.py ifneq (,$(findstring 2.6,$(DEBPYTHON_SUPPORTED))) grep -q Depends:.*python2.6 debian/foo/DEBIAN/control endif #grep -q python2.5 debian/foo/usr/share/bar/bar.py #grep -q Depends:.*python2.5 debian/foo/DEBIAN/control grep -q python2.4 debian/foo/usr/share/foo/baz.py test ! -x debian/foo/usr/share/foo/baz.py grep -q Depends:.*python2.4 debian/foo/DEBIAN/control && false || true python-defaults-2.7.17/tests/t4/bar.py0000755000000000000000000000004613305600173014434 0ustar #!/usr/bin/python2.5 print("I'm bar") python-defaults-2.7.17/tests/t4/baz.py0000644000000000000000000000006713305600173014444 0ustar #!/usr/bin/python2.4 print("I'm baz - not executable") python-defaults-2.7.17/tests/t4/debian/0000755000000000000000000000000013547613275014554 5ustar python-defaults-2.7.17/tests/t4/debian/changelog0000644000000000000000000000020113305600173016400 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sat, 27 Feb 2010 20:42:17 +0100 python-defaults-2.7.17/tests/t4/debian/compat0000644000000000000000000000000213547613275015752 0ustar 9 python-defaults-2.7.17/tests/t4/debian/control0000644000000000000000000000066213305600173016144 0ustar Source: foo Section: misc Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python Standards-Version: 3.9.1 Package: foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Recommends: ${python:Recommends} Suggests: ${python:Suggests} Enhances: ${python:Enhances} Description: example 4 - private directory exemple package #4 - private directory python-defaults-2.7.17/tests/t4/debian/copyright0000644000000000000000000000015413305600173016470 0ustar The Debian packaging is © 2011, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t4/debian/install0000644000000000000000000000010513305600173016122 0ustar foo.py /usr/share/foo/ bar.py /usr/share/bar/ baz.py /usr/share/foo/ python-defaults-2.7.17/tests/t4/debian/rules0000755000000000000000000000026313305600173015616 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_pysupport: DH_VERBOSE=1 ../../dh_python2 DH_VERBOSE=1 ../../dh_python2 /usr/share/bar clean: dh_clean python-defaults-2.7.17/tests/t4/debian/source/0000755000000000000000000000000013305600173016035 5ustar python-defaults-2.7.17/tests/t4/debian/source/format0000644000000000000000000000001513305600173017244 0ustar 3.0 (native) python-defaults-2.7.17/tests/t4/foo.py0000755000000000000000000000004613305600173014453 0ustar #!/usr/bin/python2.6 print("I'm foo") python-defaults-2.7.17/tests/t4/setup.py0000644000000000000000000000000013305600173015013 0ustar python-defaults-2.7.17/tests/t5/0000755000000000000000000000000013305600173013314 5ustar python-defaults-2.7.17/tests/t5/Makefile0000644000000000000000000000261613305600173014761 0ustar #!/usr/bin/make -f include ../common.mk clean: clean-common check: # test dh_python2 test -f debian/python-foo/usr/share/pyshared/keep_this_one/__init__.py test ! -f debian/python-foo/usr/share/pyshared/remove_this_one/__init__.py test ! -f debian/python-foo/usr/share/pyshared/foo/__init__.py grep -q remove_this_one debian/python-foo/usr/share/python/ns/python-foo grep -q foo debian/python-foo/usr/share/python/ns/python-foo grep -q bar.baz debian/python-foo/usr/share/python/ns/python-foo grep -q keep_this_one debian/python-foo/usr/share/python/ns/python-foo && false || true grep -q "pycompile -p python-foo" debian/python-foo/DEBIAN/postinst grep -q "pyclean -p python-foo" debian/python-foo/DEBIAN/prerm # test pycompile DESTDIR=debian/python-foo/ ../../pycompile -v debian/python-foo/usr/lib/ set -e; for i in remove_this_one bar bar/baz;\ do [ "`ls debian/python-foo/usr/lib/python2.*/*-packages/$$i/__init__.py | wc -l`" != '0' ];\ [ "`ls debian/python-foo/usr/lib/python2.*/*-packages/$$i/__init__.pyc | wc -l`" != '0' ];\ done # test pyclean DESTDIR=debian/python-foo/ ../../pyclean -v debian/python-foo/usr/lib/ set -e; for i in remove_this_one bar bar/baz;\ do [ "`ls debian/python-foo/usr/lib/python2.*/*-packages/$$i/__init__.py 2>/dev/null || true | wc -l`" = 0 ];\ [ "`ls debian/python-foo/usr/lib/python2.*/*-packages/$$i/__init__.pyc 2>/dev/null || true | wc -l`" = 0 ];\ done python-defaults-2.7.17/tests/t5/debian/0000755000000000000000000000000013547613275014555 5ustar python-defaults-2.7.17/tests/t5/debian/changelog0000644000000000000000000000020113305600173016401 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sun, 27 Mar 2011 21:09:27 +0200 python-defaults-2.7.17/tests/t5/debian/compat0000644000000000000000000000000213547613275015753 0ustar 9 python-defaults-2.7.17/tests/t5/debian/control0000644000000000000000000000070013305600173016136 0ustar Source: foo Section: python Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python Standards-Version: 3.9.1 Package: python-foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Description: example 5 - namespace feature exemple package #5 - dropping __init__.py file from binary package and recreating it at install time (and removing at in remove time) python-defaults-2.7.17/tests/t5/debian/copyright0000644000000000000000000000015413305600173016471 0ustar The Debian packaging is © 2011, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t5/debian/dirs0000644000000000000000000000020313305600173015415 0ustar /usr/share/pyshared/bar/baz /usr/share/pyshared/foo.egg-info /usr/share/pyshared/keep_this_one /usr/share/pyshared/remove_this_one python-defaults-2.7.17/tests/t5/debian/rules0000755000000000000000000000075013305600173015620 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_auto_build: override_dh_auto_install: set -e;\ cd debian/python-foo/usr/share/pyshared/;\ echo "keep_this_one\nremove_this_one" > foo.egg-info/namespace_packages.txt;\ echo "True" > keep_this_one/__init__.py;\ touch remove_this_one/__init__.py remove_this_one/foo.py bar/baz/spam.py override_dh_pysupport: DH_VERBOSE=1 ../../dh_python2 --namespace foo --namespace bar.baz --namespace bar clean: dh_clean python-defaults-2.7.17/tests/t5/debian/source/0000755000000000000000000000000013305600173016036 5ustar python-defaults-2.7.17/tests/t5/debian/source/format0000644000000000000000000000001513305600173017245 0ustar 3.0 (native) python-defaults-2.7.17/tests/t6/0000755000000000000000000000000013305600173013315 5ustar python-defaults-2.7.17/tests/t6/Makefile0000644000000000000000000000153413305600173014760 0ustar #!/usr/bin/make -f include ../common.mk clean: clean-common check: # python2.4 hardcoded via `dh_python2 -V 2.4` grep -q Depends:.*python2.4 debian/foo/DEBIAN/control grep -q '\-V 2.4 /usr/share/baz24' debian/foo/usr/share/python/runtime.d/foo.rtupdate grep -q '/usr/share/baz24 \-V 2.4' debian/foo/DEBIAN/postinst # python2.5 due to X-Python-Version: 2.5 grep -q Depends:.*python2.5 debian/foo/DEBIAN/control grep -q '\-V 2.5 /usr/share/bar25' debian/foo/usr/share/python/runtime.d/foo.rtupdate grep -q '/usr/share/bar25 \-V 2.5' debian/foo/DEBIAN/postinst # python2.6 hardcoded via shebang ifneq (,$(findstring 2.6,$(DEBPYTHON_SUPPORTED))) grep -q Depends:.*python2.6 debian/foo/DEBIAN/control grep -q '\-V 2.6 /usr/share/foo' debian/foo/usr/share/python/runtime.d/foo.rtupdate grep -q '/usr/share/foo \-V 2.6' debian/foo/DEBIAN/postinst endif python-defaults-2.7.17/tests/t6/bar.py0000755000000000000000000000004313305600173014433 0ustar #!/usr/bin/python print("I'm bar") python-defaults-2.7.17/tests/t6/baz.py0000644000000000000000000000004313305600173014440 0ustar #!/usr/bin/python print("I'm baz") python-defaults-2.7.17/tests/t6/debian/0000755000000000000000000000000013547613275014556 5ustar python-defaults-2.7.17/tests/t6/debian/changelog0000644000000000000000000000020113305600173016402 0ustar foo (0.1.1) unstable; urgency=low * Initial release -- Piotr Ożarowski Sat, 08 Oct 2011 17:13:03 +0200 python-defaults-2.7.17/tests/t6/debian/compat0000644000000000000000000000000213547613275015754 0ustar 9 python-defaults-2.7.17/tests/t6/debian/control0000644000000000000000000000116513305600173016145 0ustar Source: foo Section: misc Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python Standards-Version: 3.9.1 X-Python-Version: 2.5 Package: foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Recommends: ${python:Recommends} Suggests: ${python:Suggests} Enhances: ${python:Enhances} Description: example 6 - private directory with hardcoded Python version exemple package #6 - private directories that support: * python2.4 hardcoded via `dh_python2 -V 2.4` * python2.5 due to X-Python-Version: 2.5 * python2.6 hardcoded via shebang python-defaults-2.7.17/tests/t6/debian/copyright0000644000000000000000000000015413305600173016472 0ustar The Debian packaging is © 2011, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t6/debian/install0000644000000000000000000000022513305600173016127 0ustar foo.py /usr/share/foo/ spam.py /usr/share/foo/ bar.py /usr/share/bar25/ spam.py /usr/share/bar25/ baz.py /usr/share/baz24/ spam.py /usr/share/baz24/ python-defaults-2.7.17/tests/t6/debian/rules0000755000000000000000000000035413305600173015621 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_pysupport: DH_VERBOSE=1 ../../dh_python2 DH_VERBOSE=1 ../../dh_python2 /usr/share/bar25 DH_VERBOSE=1 ../../dh_python2 /usr/share/baz24 -V 2.4 clean: dh_clean python-defaults-2.7.17/tests/t6/debian/source/0000755000000000000000000000000013305600173016037 5ustar python-defaults-2.7.17/tests/t6/debian/source/format0000644000000000000000000000001513305600173017246 0ustar 3.0 (native) python-defaults-2.7.17/tests/t6/foo.py0000755000000000000000000000004613305600173014455 0ustar #!/usr/bin/python2.6 print("I'm foo") python-defaults-2.7.17/tests/t6/setup.py0000644000000000000000000000000013305600173015015 0ustar python-defaults-2.7.17/tests/t6/spam.py0000644000000000000000000000001613305600173014624 0ustar print('spam') python-defaults-2.7.17/tests/t7/0000755000000000000000000000000013305600173013316 5ustar python-defaults-2.7.17/tests/t7/Makefile0000644000000000000000000000142013305600173014753 0ustar #!/usr/bin/make -f include ../common.mk clean: clean-common check: # python2.4 hardcoded via `dh_python2 -shebang ...python2.4` grep -q '\-V 2.4 /usr/share/baz24' debian/foo/usr/share/python/runtime.d/foo.rtupdate grep -q '/usr/share/baz24 \-V 2.4' debian/foo/DEBIAN/postinst grep -q '#! /usr/bin/python2.4 -OO' debian/foo/usr/share/baz24/baz.py # python2.6 hardcoded via shebang grep -q '\-V 2.6 /usr/share/foo' debian/foo/usr/share/python/runtime.d/foo.rtupdate grep -q '/usr/share/foo \-V 2.6' debian/foo/DEBIAN/postinst # /env removed from shebang grep -q '#! /usr/bin/python' debian/foo/usr/share/bar/bar.py # /local removed from shebang grep -q '#! /usr/bin/python' debian/foo/usr/share/foo/baz.py grep -q '#! /usr/bin/python2.6' debian/foo/usr/share/foo/foo.py python-defaults-2.7.17/tests/t7/bar.py0000755000000000000000000000004713305600173014440 0ustar #!/usr/bin/env python "env in shebang" python-defaults-2.7.17/tests/t7/baz.py0000755000000000000000000000006013305600173014443 0ustar #!/usr/local/bin/python "/usr/local in shebang" python-defaults-2.7.17/tests/t7/debian/0000755000000000000000000000000013547613275014557 5ustar python-defaults-2.7.17/tests/t7/debian/changelog0000644000000000000000000000017713305600173016417 0ustar foo (1.0) unstable; urgency=low * Initial release -- Piotr Ożarowski Sun, 10 Jun 2012 14:09:45 +0200 python-defaults-2.7.17/tests/t7/debian/compat0000644000000000000000000000000213547613275015755 0ustar 9 python-defaults-2.7.17/tests/t7/debian/control0000644000000000000000000000052213305600173016142 0ustar Source: foo Section: misc Priority: optional Maintainer: Piotr Ożarowski Build-Depends: debhelper (>= 7.0.50~) Build-Depends-Indep: python Standards-Version: 3.9.3 Package: foo Architecture: all Depends: ${python:Depends}, ${misc:Depends} Description: example 7 - shebangs exemple package #7 - shebang related tests python-defaults-2.7.17/tests/t7/debian/copyright0000644000000000000000000000015413305600173016473 0ustar The Debian packaging is © 2012, Piotr Ożarowski and is licensed under the MIT License. python-defaults-2.7.17/tests/t7/debian/install0000644000000000000000000000025013305600173016126 0ustar foo.py /usr/share/foo/ baz.py /usr/share/foo/ spam.py /usr/share/foo/ bar.py /usr/share/bar/ spam.py /usr/share/bar/ baz.py /usr/share/baz24/ spam.py /usr/share/baz24/ python-defaults-2.7.17/tests/t7/debian/rules0000755000000000000000000000040613305600173015620 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=python_distutils override_dh_pysupport: DH_VERBOSE=1 ../../dh_python2 DH_VERBOSE=1 ../../dh_python2 /usr/share/bar DH_VERBOSE=1 ../../dh_python2 /usr/share/baz24 --shebang '/usr/bin/python2.4 -OO' clean: dh_clean python-defaults-2.7.17/tests/t7/debian/source/0000755000000000000000000000000013305600173016040 5ustar python-defaults-2.7.17/tests/t7/debian/source/format0000644000000000000000000000001513305600173017247 0ustar 3.0 (native) python-defaults-2.7.17/tests/t7/foo.py0000755000000000000000000000011313305600173014451 0ustar #!/usr/local/bin/python2.6 "/usr/local/bin/python2.6 hardcoded in shebang" python-defaults-2.7.17/tests/t7/setup.py0000644000000000000000000000000013305600173015016 0ustar python-defaults-2.7.17/tests/t7/spam.py0000644000000000000000000000001613305600173014625 0ustar print('spam')