Hi everyone,

Attached is a patch about vim-plugin.eclass which I'm about to commit.
The patch is aimed to make the eclass usable by packages not under
app-vim but come with their own vim plugin stuff (like git). It limits
setting default DEPEND,SLOT and SRC_URI to packages under category
app-vim and checks for VIM_PLUGIN_VERSION to add a dependency upon vim
or gvim. This way the eclass doesn't unconditionally depend on vim but
still give the option to set VIM_PLUGIN_VERSION in the ebuild make the
eclass add the dependencies.

What do you think? Do you think it's the right way to implement it?
Please comment.

-- 
Regards,
Ali Polatel
Index: vim-plugin.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/vim-plugin.eclass,v
retrieving revision 1.21
diff -u -r1.21 vim-plugin.eclass
--- vim-plugin.eclass   7 May 2007 19:06:14 -0000       1.21
+++ vim-plugin.eclass   6 Apr 2008 11:20:33 -0000
@@ -10,14 +10,20 @@
 inherit vim-doc
 EXPORT_FUNCTIONS src_install pkg_postinst pkg_postrm
 
-VIM_PLUGIN_VIM_VERSION="${VIM_PLUGIN_VIM_VERSION:-6.4}"
+if [ "${CATEGORY}" = "app-vim" ]; then
+       IUSE=""
+       SRC_URI="mirror://gentoo/${P}.tar.bz2"
+       SLOT="0"
+fi
 
-IUSE=""
-DEPEND="|| ( >=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
+if [ -n "${VIM_PLUGIN_VERSION}" ]; then
+       DEPEND="|| ( >=app-editors/vim-${VIM_PLUGIN_VIM_VERSION}
        >=app-editors/gvim-${VIM_PLUGIN_VIM_VERSION} )"
+elif [ "${CATEGORY}" = "app-vim" ]; then
+       # Default fallback for packages under app-vim/
+       DEPEND="|| ( app-editors/vim app-editors/gvim )"
+fi
 RDEPEND="${DEPEND}"
-SRC_URI="mirror://gentoo/${P}.tar.bz2"
-SLOT="0"
 
 vim-plugin_src_install() {
        local f

Attachment: pgp8VwhnhxbIl.pgp
Description: PGP signature

Reply via email to