On Thu, Jul 15, 2010 at 2:14 AM, Brooks, Phil wrote:
>
> Yes, I do have a directory called "
> /usr/share/vim/vimfiles" in /usr now.
>
>
> :echon $VIM just says "/usr/share/vim" -- no extra stuff.
>
> I removed the /usr/ " directory and then
> I ran with VIM set to /usr/share/vim and got the same result -- everything
> got added to /usr/ /usr...
It looks like 'gvim' is a wrapper script written by RedHat, around the
gvim binary, that prefixes 26 spaces to the output of ':echon $VIM'
when Vim is run with options '-esX'.
The solution is to strip the white spaces from this output, and to
abort the installation when the result is not an existing directory.
The attached patch does that.
Commands to apply the patch:
tar xzf pyclewn-1.2.tar.gz
cd pyclewn-1.2
patch -p1 < /path/to/missing-data-files.patch
> I will be out for a couple of days -- I'll try again on Monday. Looking
> forward to
> trying it out.
Nice to hear that you want to try out pyclewn. I have tried to include
in pyclewn most of the suggestions you made for clewn.
Xavier
diff -u pyclewn-1.2.orig/pyclewn_install.py pyclewn-1.2/pyclewn_install.py
--- pyclewn-1.2.orig/pyclewn_install.py 2010-01-22 19:10:34.000000000 +0100
+++ pyclewn-1.2/pyclewn_install.py 2010-07-16 13:37:46.000000000 +0200
@@ -11,6 +11,7 @@
from distutils.file_util import copy_file
import clewn.vim as vim
+import clewn.misc as misc
ICON_NAME = 'clewn.ico'
PYCLEWN_SHORTCUT = 'Pyclewn.lnk'
@@ -41,16 +42,21 @@
raise ClewnInstallError, 'auto commands support in vim is required'
print >> sys.stderr, 'yes'
-def vimdir(dir=[]):
[email protected]_evaluation
+def vimdir():
"""Return the vim runtime files directory."""
- # do it only once
- if not dir:
- if os.environ.has_key('vimdir'):
- dir.append(os.environ['vimdir'])
- else:
- path = vim.exec_vimcmd(['echon $VIM'])
- dir.append(pathjoin(path, 'vimfiles'))
- return dir[0]
+ if os.environ.has_key('vimdir'):
+ dir = os.environ['vimdir']
+ else:
+ path = vim.exec_vimcmd(['echon $VIM'])
+ path = path.strip(' \t\r\n')
+ if not os.path.isdir(path):
+ nodir = ('Invalid data files path. $VIM="%s" is returned'
+ ' by Vim, but this is not an existing directory.' % path)
+ raise ClewnInstallError, nodir
+ dir = pathjoin(path, 'vimfiles')
+ print 'Vim user data files location: "%s"' % dir
+ return dir
def build_vimhelp():
"""Add pyclewn help to Vim help."""
diff -u pyclewn-1.2.orig/setup.py pyclewn-1.2/setup.py
--- pyclewn-1.2.orig/setup.py 2010-01-30 17:52:38.000000000 +0100
+++ pyclewn-1.2/setup.py 2010-07-16 11:37:13.000000000 +0200
@@ -39,25 +39,23 @@
if os.name == 'nt':
SCRIPTS = ['pyclewn', 'pyclewn_install.py']
- VIMDIR = ['pyclewn']
+ vimdir = 'pyclewn'
LONG_DESCRIPTION = WINDOWS_INSTALL
else:
SCRIPTS = ['pyclewn']
- VIMDIR = []
+ vimdir = pyclewn_install.vimdir()
LONG_DESCRIPTION = DESCRIPTION
DEBUGGERS = ('simple', 'gdb')
DATA_FILES = [
- (pyclewn_install.vimdir(VIMDIR),
- ['runtime/pyclewn.vim']),
- (pathjoin(pyclewn_install.vimdir(VIMDIR), 'doc'),
- ['runtime/doc/pyclewn.txt']),
- (pathjoin(pyclewn_install.vimdir(VIMDIR), 'macros'),
+ (vimdir, ['runtime/pyclewn.vim']),
+ (pathjoin(vimdir, 'doc'), ['runtime/doc/pyclewn.txt']),
+ (pathjoin(vimdir, 'macros'),
[('runtime/.pyclewn_keys.%s' % d) for d in DEBUGGERS]),
- (pathjoin(pyclewn_install.vimdir(VIMDIR), 'syntax'),
- ['runtime/syntax/dbgvar.vim'])]
+ (pathjoin(vimdir, 'syntax'), ['runtime/syntax/dbgvar.vim']),
+ ]
if os.name == 'nt':
- DATA_FILES.append(pyclewn_install.icon(VIMDIR[0]))
+ DATA_FILES.append(pyclewn_install.icon(vimdir))
RE_VERSION = r'(?P<name>pyclewn-)(?P<num>\d+\.\d+)' \
r'# RE: pyclewn-d.d'
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Pyclewn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyclewn-general