diff --git a/fix_editor_stderr.patch b/fix_editor_stderr.patch new file mode 100644 index 0000000..336c85b --- /dev/null +++ b/fix_editor_stderr.patch @@ -0,0 +1,23 @@ +# HG changeset patch +# User desaintmartin +# Date 1369996392 0 +# Branch desaintmartin/fixed-which-calls-being-verbose-to-stder-1369996337663 +# Node ID 6743615a4a69908de97714e6673f14bfb96d3e6c +# Parent a1818298610cb601c6ed5691531cd224ed59e6b5 +Fixed "which" calls being verbose to stderr. +Add "vi" to the list of possible editors. + +diff --git a/cmd2.py b/cmd2.py +--- a/cmd2.py ++++ b/cmd2.py +@@ -420,8 +420,8 @@ + if sys.platform[:3] == 'win': + editor = 'notepad' + else: +- for editor in ['gedit', 'kate', 'vim', 'emacs', 'nano', 'pico']: +- if subprocess.Popen(['which', editor], stdout=subprocess.PIPE).communicate()[0]: ++ for editor in ['gedit', 'kate', 'vim', 'vi', 'emacs', 'nano', 'pico']: ++ if subprocess.Popen(['which', editor], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0]: + break + + colorcodes = {'bold':{True:'\x1b[1m',False:'\x1b[22m'}, diff --git a/python-cmd2.changes b/python-cmd2.changes index 25da2b1..ce7b1a8 100644 --- a/python-cmd2.changes +++ b/python-cmd2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 25 15:35:32 UTC 2013 - dheidler@suse.de + +- Backport editor stderr fix + ------------------------------------------------------------------- Mon Apr 29 11:18:38 UTC 2013 - dmueller@suse.com diff --git a/python-cmd2.spec b/python-cmd2.spec index 5872bff..5136954 100644 --- a/python-cmd2.spec +++ b/python-cmd2.spec @@ -24,6 +24,7 @@ License: MIT Group: Development/Languages/Python Url: http://packages.python.org/cmd2/ Source: http://pypi.python.org/packages/source/c/cmd2/cmd2-%{version}.tar.gz +Patch0: fix_editor_stderr.patch BuildRequires: python-devel Requires: python-pyparsing BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -56,6 +57,7 @@ Drop-in replacement adds several features for command-prompt tools: %setup -q -n cmd2-%{version} chmod -x README.txt sed -i "s/\r//g" README.txt +%patch0 -p1 %build python setup.py build