Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156229 - Bug removing dead scripts in vim-plugin.eclass (update_vim_afterscripts)
Summary: Bug removing dead scripts in vim-plugin.eclass (update_vim_afterscripts)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-25 09:53 UTC by Leonardo Boshell (RETIRED)
Modified: 2007-01-12 05:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leonardo Boshell (RETIRED) gentoo-dev 2006-11-25 09:53:12 UTC
Hi guys. I came across this problem after emerging app-vim/gtk-syntax yesterday. Confused to see that apparently the new syntax wasn't being picked up by vim, I started to track the problem, and found the cause in vim-plugin.eclass.

The file /usr/share/vim/vimfiles/after/syntax/c.vim which was being auto-generated in update_vim_afterscripts() was being removed right away. The problem is what I presume is a bad typo in a grep call. This simple patch fixes this:


Index: vim-plugin.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/vim-plugin.eclass,v
retrieving revision 1.18
diff -u -d -r1.18 vim-plugin.eclass
--- vim-plugin.eclass   10 Oct 2006 15:47:34 -0000      1.18
+++ vim-plugin.eclass   25 Nov 2006 17:37:36 -0000
@@ -92,7 +92,7 @@
                # This is a generated file, but might be abandoned.  Check
                # if there's no corresponding .d directory, or if the
                # file's effectively empty
-               if [[ ! -d "${f}.d" || -z "$(grep -v '^"')" ]]; then
+               if [[ ! -d "${f}.d" || -z "$(grep -v '^"' ${f})" ]]; then
                        rm -f "${f}"
                fi
        done


This bug has the following effect at the moment:
* If only one auto-generated file is found under /usr/share/vim/vimfiles/after, it is always deleted. I happened to see this because gtk-syntax was the first ebuild I emerged that installs stuff under ../vimfiles/after.
* If two or more auto-generated files are found, then the while loop stops at the first match and nothing gets ever removed.

The reason for this has to do with the grep call consuming the rest of stdin that's supposed to be for 'read' in line 89.

Thanks.
Comment 1 Mike Kelly (RETIRED) gentoo-dev 2007-01-12 05:18:35 UTC
Fixed in CVS. Thanks for the reporty!