Hello community, here is the log from the commit of package python-virtualenv-clone for openSUSE:Factory checked in at 2016-03-03 15:16:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-virtualenv-clone (Old) and /work/SRC/openSUSE:Factory/.python-virtualenv-clone.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-virtualenv-clone" Changes: -------- --- /work/SRC/openSUSE:Factory/python-virtualenv-clone/python-virtualenv-clone.changes 2014-12-10 23:44:34.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-virtualenv-clone.new/python-virtualenv-clone.changes 2016-03-03 15:16:36.000000000 +0100 @@ -1,0 +2,6 @@ +Mon Feb 29 12:14:12 UTC 2016 - someuniquename@gmail.com + +- Update to version 2.6 + * Fix symlinks that point to the old virtual env + +------------------------------------------------------------------- Old: ---- virtualenv-clone-0.2.5.tar.gz New: ---- virtualenv-clone-0.2.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-virtualenv-clone.spec ++++++ --- /var/tmp/diff_new_pack.TXL0Jk/_old 2016-03-03 15:16:37.000000000 +0100 +++ /var/tmp/diff_new_pack.TXL0Jk/_new 2016-03-03 15:16:37.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-virtualenv-clone # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-virtualenv-clone -Version: 0.2.5 +Version: 0.2.6 Release: 0 Summary: Script to clone virtualenvs License: MIT ++++++ virtualenv-clone-0.2.5.tar.gz -> virtualenv-clone-0.2.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/virtualenv-clone-0.2.5/PKG-INFO new/virtualenv-clone-0.2.6/PKG-INFO --- old/virtualenv-clone-0.2.5/PKG-INFO 2014-04-27 16:57:38.000000000 +0200 +++ new/virtualenv-clone-0.2.6/PKG-INFO 2015-06-29 12:34:32.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: virtualenv-clone -Version: 0.2.5 +Version: 0.2.6 Summary: script to clone virtualenvs. Home-page: http://github.com/edwardgeorge/virtualenv-clone Author: Edward George diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/virtualenv-clone-0.2.5/clonevirtualenv.py new/virtualenv-clone-0.2.6/clonevirtualenv.py --- old/virtualenv-clone-0.2.5/clonevirtualenv.py 2014-04-27 16:53:42.000000000 +0200 +++ new/virtualenv-clone-0.2.6/clonevirtualenv.py 2015-06-29 12:30:34.000000000 +0200 @@ -1,13 +1,16 @@ +#!/usr/bin/env python from __future__ import with_statement import logging import optparse import os +import os.path import re import shutil import subprocess import sys +import itertools -version_info = (0, 2, 4) +version_info = (0, 2, 6) __version__ = '.'.join(map(str, version_info)) @@ -89,6 +92,25 @@ v_sys = _virtualenv_sys(dst_dir) remaining = has_old(v_sys[1]) assert not remaining, v_sys + fix_symlink_if_necessary(src_dir, dst_dir) + +def fix_symlink_if_necessary(src_dir, dst_dir): + #sometimes the source virtual environment has symlinks that point to itself + #one example is $OLD_VIRTUAL_ENV/local/lib points to $OLD_VIRTUAL_ENV/lib + #this function makes sure + #$NEW_VIRTUAL_ENV/local/lib will point to $NEW_VIRTUAL_ENV/lib + #usually this goes unnoticed unless one tries to upgrade a package though pip, so this bug is hard to find. + logger.info("scanning for internal symlinks that point to the original virtual env") + for dirpath, dirnames, filenames in os.walk(dst_dir): + for a_file in itertools.chain(filenames, dirnames): + full_file_path = os.path.join(dirpath, a_file) + if os.path.islink(full_file_path): + target = os.path.realpath(full_file_path) + if target.startswith(src_dir): + new_target = target.replace(src_dir, dst_dir) + logger.debug('fixing symlink in {}'.format(full_file_path)) + os.remove(full_file_path) + os.symlink(new_target, full_file_path) def fixup_scripts(old_dir, new_dir, version, rewrite_env_python=False): @@ -267,6 +289,7 @@ try: old_dir, new_dir = args except ValueError: + print("virtualenv-clone {}".format(__version__)) parser.error("not enough arguments given.") old_dir = os.path.normpath(os.path.abspath(old_dir)) new_dir = os.path.normpath(os.path.abspath(new_dir)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/virtualenv-clone-0.2.5/setup.py new/virtualenv-clone-0.2.6/setup.py --- old/virtualenv-clone-0.2.5/setup.py 2014-04-27 16:54:14.000000000 +0200 +++ new/virtualenv-clone-0.2.6/setup.py 2015-06-29 12:34:06.000000000 +0200 @@ -25,7 +25,7 @@ setup(name="virtualenv-clone", - version='0.2.5', + version='0.2.6', description='script to clone virtualenvs.', author='Edward George', author_email='edwardgeorge@gmail.com', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/virtualenv-clone-0.2.5/virtualenv_clone.egg-info/PKG-INFO new/virtualenv-clone-0.2.6/virtualenv_clone.egg-info/PKG-INFO --- old/virtualenv-clone-0.2.5/virtualenv_clone.egg-info/PKG-INFO 2014-04-27 16:57:19.000000000 +0200 +++ new/virtualenv-clone-0.2.6/virtualenv_clone.egg-info/PKG-INFO 2015-06-29 12:34:32.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: virtualenv-clone -Version: 0.2.5 +Version: 0.2.6 Summary: script to clone virtualenvs. Home-page: http://github.com/edwardgeorge/virtualenv-clone Author: Edward George