[Python-modules-commits] r21357 - in packages/python-virtualenv/trunk/debian (8 files)

stefanor at users.alioth.debian.org stefanor at users.alioth.debian.org
Sun Apr 22 15:28:04 UTC 2012


    Date: Sunday, April 22, 2012 @ 15:28:01
  Author: stefanor
Revision: 21357

* New upstream release. (LP: #986227)
* system-python.patch: Use /usr/bin/python in the shebang
  (Closes: #663228, LP: #737734)
* cleanup_tmpdirs.patch: Cleanup temporary working directories
  (Closes: #661272)
  - rebuild_script.patch: Include rebuild_script.py. The tmpdir patch
    touches some embedded files.
  - Rebuild virtualenv.py during package build.
* Bumped standards version to 3.9.3 (no changes needed).
* Add myself to Uploaders.
* Wrap long lists in debian/control.

Added:
  packages/python-virtualenv/trunk/debian/patches/cleanup_tmpdirs.patch
  packages/python-virtualenv/trunk/debian/patches/rebuild_script.patch
  packages/python-virtualenv/trunk/debian/patches/system-python.patch
Modified:
  packages/python-virtualenv/trunk/debian/changelog
  packages/python-virtualenv/trunk/debian/control
  packages/python-virtualenv/trunk/debian/install
  packages/python-virtualenv/trunk/debian/patches/series
  packages/python-virtualenv/trunk/debian/rules

Modified: packages/python-virtualenv/trunk/debian/changelog
===================================================================
--- packages/python-virtualenv/trunk/debian/changelog	2012-04-22 11:39:55 UTC (rev 21356)
+++ packages/python-virtualenv/trunk/debian/changelog	2012-04-22 15:28:01 UTC (rev 21357)
@@ -1,9 +1,22 @@
-python-virtualenv (1.7.1.2-1) precise; urgency=low
+python-virtualenv (1.7.1.2-1) UNRELEASED; urgency=low
 
-  * New upstream release.
+  [ Clint Byrum ]
+  * New upstream release. (LP: #986227)
   * d/p/pep3147-dist-packges.patch - Dropped, applied upstream
   * d/p/remove_syspath0_on_reinvoke.patch - Dropped, applied upstream
 
+  [ Stefano Rivera ]
+  * system-python.patch: Use /usr/bin/python in the shebang
+    (Closes: #663228, LP: #737734)
+  * cleanup_tmpdirs.patch: Cleanup temporary working directories
+    (Closes: #661272)
+    - rebuild_script.patch: Include rebuild_script.py. The tmpdir patch
+      touches some embedded files.
+    - Rebuild virtualenv.py during package build.
+  * Bumped standards version to 3.9.3 (no changes needed).
+  * Add myself to Uploaders.
+  * Wrap long lists in debian/control.
+
  -- Clint Byrum <clint at ubuntu.com>  Fri, 20 Apr 2012 11:25:47 -0700
 
 python-virtualenv (1.7-1) unstable; urgency=low

Modified: packages/python-virtualenv/trunk/debian/control
===================================================================
--- packages/python-virtualenv/trunk/debian/control	2012-04-22 11:39:55 UTC (rev 21356)
+++ packages/python-virtualenv/trunk/debian/control	2012-04-22 15:28:01 UTC (rev 21357)
@@ -3,20 +3,27 @@
 Priority: optional
 X-Python-Version: >= 2.5
 Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
-Uploaders: Carl Chenet <chaica at ohmytux.com>, Jeff Licquia <licquia at debian.org>
+Uploaders:
+ Carl Chenet <chaica at ohmytux.com>,
+ Jeff Licquia <licquia at debian.org>,
+ Stefano Rivera <stefanor at debian.org>
 Homepage: http://pypi.python.org/pypi/virtualenv
 Vcs-Svn: svn://svn.debian.org/svn/python-modules/packages/python-virtualenv/trunk/
 Vcs-Browser: http://svn.debian.org/wsvn/python-modules/packages/python-virtualenv/trunk/
 Build-Depends: debhelper (>= 7.0.50~), python (>= 2.6.6-3)
 Build-Depends-Indep: python-setuptools
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
 
 Package: python-virtualenv
 Architecture: all
-Depends: ${misc:Depends}, ${python:Depends}, python-pkg-resources, python-setuptools
+Depends:
+ python-pkg-resources,
+ python-setuptools,
+ ${misc:Depends},
+ ${python:Depends}
 Recommends: python-pip (>= 0.7.2)
 Description: Python virtual environment creator
  The virtualenv utility creates virtual Python instances, each invokable
  with its own Python executable.  Each instance can have different sets
- of modules, installable via easy_install.  Virtual Python instances can 
+ of modules, installable via easy_install.  Virtual Python instances can
  also be created without root access.

Modified: packages/python-virtualenv/trunk/debian/install
===================================================================
--- packages/python-virtualenv/trunk/debian/install	2012-04-22 11:39:55 UTC (rev 21356)
+++ packages/python-virtualenv/trunk/debian/install	2012-04-22 15:28:01 UTC (rev 21357)
@@ -1,3 +1,3 @@
+scripts/virtualenv /usr/bin/
+virtualenv_support/*.egg /usr/share/python-virtualenv/
 virtualenv_support/*.tar.gz /usr/share/python-virtualenv/
-virtualenv_support/*.egg /usr/share/python-virtualenv/
-scripts/virtualenv /usr/bin/

Added: packages/python-virtualenv/trunk/debian/patches/cleanup_tmpdirs.patch
===================================================================
--- packages/python-virtualenv/trunk/debian/patches/cleanup_tmpdirs.patch	                        (rev 0)
+++ packages/python-virtualenv/trunk/debian/patches/cleanup_tmpdirs.patch	2012-04-22 15:28:01 UTC (rev 21357)
@@ -0,0 +1,43 @@
+Description: Cleanup temporary directory created with mkdtemp()
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://github.com/pypa/virtualenv/pull/231
+Bug-Debian: http://bugs.debian.org/661272
+Date:   Sat Feb 25 22:07:41 2012 +0200
+
+--- a/virtualenv.py
++++ b/virtualenv.py
+@@ -568,6 +568,8 @@
+     finally:
+         logger.indent -= 2
+         logger.end_progress()
++        if cwd is not None:
++            shutil.rmtree(cwd)
+         if os.getcwd() != old_chdir:
+             os.chdir(old_chdir)
+         if is_jython and os._name == 'nt':
+--- a/virtualenv_embedded/distribute_setup.py
++++ b/virtualenv_embedded/distribute_setup.py
+@@ -14,6 +14,7 @@
+ This file can also be run as a script to install or upgrade setuptools.
+ """
+ import os
++import shutil
+ import sys
+ import time
+ import fnmatch
+@@ -86,6 +87,7 @@
+             log.warn('See the error message above.')
+     finally:
+         os.chdir(old_wd)
++        shutil.rmtree(tmpdir)
+ 
+ 
+ def _build_egg(egg, tarball, to_dir):
+@@ -110,6 +112,7 @@
+ 
+     finally:
+         os.chdir(old_wd)
++        shutil.rmtree(tmpdir)
+     # returning the result
+     log.warn(egg)
+     if not os.path.exists(egg):

Added: packages/python-virtualenv/trunk/debian/patches/rebuild_script.patch
===================================================================
--- packages/python-virtualenv/trunk/debian/patches/rebuild_script.patch	                        (rev 0)
+++ packages/python-virtualenv/trunk/debian/patches/rebuild_script.patch	2012-04-22 15:28:01 UTC (rev 21357)
@@ -0,0 +1,79 @@
+Description: Include the tool to rebuild the embedded parts of virtualenv.py
+ It's part of the upstream git repository, but was left out of the tarball.
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: https://github.com/pypa/virtualenv/pull/256
+
+--- /dev/null
++++ b/bin/rebuild-script.py
+@@ -0,0 +1,71 @@
++#!/usr/bin/env python
++"""
++Helper script to rebuild virtualenv.py from virtualenv_support
++"""
++
++import re
++import os
++import sys
++
++here = os.path.dirname(__file__)
++script = os.path.join(here, '..', 'virtualenv.py')
++
++file_regex = re.compile(
++    r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)',
++    re.S)
++file_template = '##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
++
++def rebuild():
++    f = open(script, 'rb')
++    content = f.read()
++    f.close()
++    parts = []
++    last_pos = 0
++    match = None
++    for match in file_regex.finditer(content):
++        parts.append(content[last_pos:match.start()])
++        last_pos = match.end()
++        filename = match.group(1)
++        varname = match.group(2)
++        data = match.group(3)
++        print('Found reference to file %s' % filename)
++        pathname = os.path.join(here, '..', 'virtualenv_embedded', filename)
++        f = open(pathname, 'rb')
++        c = f.read()
++        f.close()
++        new_data = c.encode('zlib').encode('base64')
++        if new_data == data:
++            print('  Reference up to date (%s bytes)' % len(c))
++            parts.append(match.group(0))
++            continue
++        print('  Content changed (%s bytes -> %s bytes)' % (
++            zipped_len(data), len(c)))
++        new_match = file_template % dict(
++            filename=filename,
++            varname=varname,
++            data=new_data)
++        parts.append(new_match)
++    parts.append(content[last_pos:])
++    new_content = ''.join(parts)
++    if new_content != content:
++        sys.stdout.write('Content updated; overwriting... ')
++        f = open(script, 'wb')
++        f.write(new_content)
++        f.close()
++        print('done.')
++    else:
++        print('No changes in content')
++    if match is None:
++        print('No variables were matched/found')
++
++def zipped_len(data):
++    if not data:
++        return 'no data'
++    try:
++        return len(data.decode('base64').decode('zlib'))
++    except:
++        return 'unknown'
++
++if __name__ == '__main__':
++    rebuild()
++    

Modified: packages/python-virtualenv/trunk/debian/patches/series
===================================================================
--- packages/python-virtualenv/trunk/debian/patches/series	2012-04-22 11:39:55 UTC (rev 21356)
+++ packages/python-virtualenv/trunk/debian/patches/series	2012-04-22 15:28:01 UTC (rev 21357)
@@ -1,2 +1,5 @@
 look_for_external_files.patch
 add_distribute.patch
+cleanup_tmpdirs.patch
+rebuild_script.patch
+system-python.patch

Added: packages/python-virtualenv/trunk/debian/patches/system-python.patch
===================================================================
--- packages/python-virtualenv/trunk/debian/patches/system-python.patch	                        (rev 0)
+++ packages/python-virtualenv/trunk/debian/patches/system-python.patch	2012-04-22 15:28:01 UTC (rev 21357)
@@ -0,0 +1,12 @@
+Description: Use /usr/bin/python in the shebang.
+Bug-Debian: #663228
+Author: Stefano Rivera <stefanor at debian.org>
+Forwarded: not-needed
+
+--- a/scripts/virtualenv
++++ b/scripts/virtualenv
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/python
+ import virtualenv
+ virtualenv.main()

Modified: packages/python-virtualenv/trunk/debian/rules
===================================================================
--- packages/python-virtualenv/trunk/debian/rules	2012-04-22 11:39:55 UTC (rev 21356)
+++ packages/python-virtualenv/trunk/debian/rules	2012-04-22 15:28:01 UTC (rev 21357)
@@ -3,5 +3,15 @@
 %:
 	dh $@ --with python2
 
+override_dh_auto_configure:
+	# Rebuild the embedded parts, we may be quilt patching their sources
+	[ -e virtualenv.py.orig ] || cp virtualenv.py virtualenv.py.orig
+	python bin/rebuild-script.py
+	dh_auto_configure
+
+override_dh_auto_clean:
+	[ ! -e virtualenv.py.orig ] || mv virtualenv.py.orig virtualenv.py
+	dh_auto_clean
+
 override_dh_installchangelogs:
 	dh_installchangelogs docs/news.txt




More information about the Python-modules-commits mailing list