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 d48fa43..4e09b40 100644 --- a/SPECS/python-virtualenv.spec +++ b/SPECS/python-virtualenv.spec @@ -3,7 +3,7 @@ Name: %{?scl_prefix}python-virtualenv Version: 13.1.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tool to create isolated Python environments Group: Development/Languages @@ -11,6 +11,11 @@ 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}/%{pkg_name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -27,6 +32,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 @@ -59,6 +65,11 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/virtualenv* %changelog +* Mon Jan 16 2017 Tomas Orsava - 13.1.0-2 +- 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#1353200 + * Fri Apr 15 2016 Charalampos Stratakis - 13.1.0-1 - Update to 13.1.0 Resolves: rhbz#1327559