diff --git a/SOURCES/polish-error-msg-when-file-is-passed.patch b/SOURCES/polish-error-msg-when-file-is-passed.patch new file mode 100644 index 0000000..9f7f4d4 --- /dev/null +++ b/SOURCES/polish-error-msg-when-file-is-passed.patch @@ -0,0 +1,18 @@ +@@ -, +, @@ +--- + virtualenv.py | 4 ++++ + 1 file changed, 4 insertions(+) +--- a/virtualenv.py ++++ a/virtualenv.py +@@ -791,6 +791,10 @@ def main(): + sys.exit(2) + + home_dir = args[0] ++ if os.path.exists(home_dir) and os.path.isfile(home_dir): ++ logger.fatal('ERROR: File already exists and is not a directory.') ++ logger.fatal('Please provide a different path or delete the file.') ++ sys.exit(3) + + if os.environ.get('WORKING_ENV'): + logger.fatal('ERROR: you cannot run virtualenv while in a workingenv') +-- diff --git a/SPECS/python-virtualenv.spec b/SPECS/python-virtualenv.spec index 78806af..7ccd34e 100644 --- a/SPECS/python-virtualenv.spec +++ b/SPECS/python-virtualenv.spec @@ -3,13 +3,17 @@ Name: python-virtualenv Version: 1.10.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Tool to create isolated Python environments Group: Development/Languages License: MIT URL: http://pypi.python.org/pypi/virtualenv Source0: http://pypi.python.org/packages/source/v/virtualenv/virtualenv-%{version}.tar.gz +# Patch that shows a custom error message when a FILE passed to virtualenv +# to be used as 'home dir' already exists and is NOT a directory. +# rhbz#1306513 +Patch0: polish-error-msg-when-file-is-passed.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -30,6 +34,7 @@ licensed under an MIT-style permissive license. %prep %setup -q -n virtualenv-%{version} +%patch0 -p1 %{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py @@ -66,6 +71,11 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon May 09 2016 Tomas Orsava - 1.10.1-3 +- Added a patch that shows a custom error message when a FILE passed to + virtualenv to be used as 'home dir' already exists and is NOT a directory. +Resolves: rhbz#1306513 + * Fri Dec 27 2013 Daniel Mach - 1.10.1-2 - Mass rebuild 2013-12-27