[Buildroot] [PATCH] vim: be more careful when removing the documentation

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Mon Dec 5 12:09:30 UTC 2016


Hello,

On Mon, 05 Dec 2016 12:03:45 +0000, Mateusz Furdyna wrote:
> How about we are even more careful, for instance when vim version changes
> and also the directory name changes to sth like vim81?
> 
> like so:
> 
>  define VIM_REMOVE_DOCS
> -       find $(TARGET_DIR)/usr/share/vim -type f -name "*.txt" -delete
> +       $(RM) -rf $(find $(TARGET_DIR)/usr/share/vim -type d -name "doc")
>  endef
> 
> Rationale:
> * we cannot use find -delete because it doesn't work on empty directories
> * we cannot use find -exec rm... because it then tries to traverse
> directories it has just removed
> * we probably cannot use rm -rf /usr/share/vim/vim80/doc, because then we
> have vim version hardcoded into the path
> * we must use -f flag in case find returns nothing OR we try to delete doc
> directory nested in another doc directory that we've just deleted...
> 
> What do you think?

What about just:

	$(RM) -rf $(TARGET_DIR)/usr/share/vim/vim*/doc

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


More information about the buildroot mailing list