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..f2029ec --- /dev/null +++ b/SOURCES/polish-error-msg-when-file-is-passed.patch @@ -0,0 +1,27 @@ +From c55552b32d58e678eb860f8dca161c984e2eeec8 Mon Sep 17 00:00:00 2001 +From: Robert Kuska +Date: Thu, 10 Mar 2016 10:08:17 +0100 +Subject: [PATCH] Add better error message when trying file is passed + +--- + virtualenv.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/virtualenv.py b/virtualenv.py +index 353ed73..4ec3961 100755 +--- a/virtualenv.py ++++ b/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') +-- +2.5.0 + diff --git a/SPECS/python-virtualenv.spec b/SPECS/python-virtualenv.spec index 84aa7e0..b648008 100644 --- a/SPECS/python-virtualenv.spec +++ b/SPECS/python-virtualenv.spec @@ -3,7 +3,7 @@ Name: %{?scl_prefix}python-virtualenv Version: 13.1.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Tool to create isolated Python environments Group: Development/Languages @@ -18,6 +18,11 @@ BuildRequires: %{?scl_prefix}python-sphinx Requires: %{?scl_prefix}python-setuptools Requires: %{?scl_prefix}python-devel +# 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#1353206 +Patch0: polish-error-msg-when-file-is-passed.patch + %description virtualenv is a tool to create isolated Python environments. virtualenv is a successor to workingenv, and an extension of virtual-python. It is @@ -28,6 +33,8 @@ licensed under an MIT-style permissive license. %setup -q -n virtualenv-%{version} %{__sed} -i -e "1s|#!/usr/bin/env python||" virtualenv.py +%patch0 -p1 + %build # Build code %{?scl:scl enable %{scl} "} @@ -57,6 +64,11 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/virtualenv* %changelog +* Tue Jul 19 2016 Charalampos Stratakis - 13.1.2-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#1353206 + * Sat Feb 13 2016 Robert Kuska 13.1.2-1 - Update to 13.1.2