* [Buildroot] [PATCH] vim: be more careful when removing the documentation
@ 2016-12-05 11:16 Thomas Petazzoni
[not found] ` <CAEGTJuPZKHuu5qd9gK-GyhPkxXdV+X0+V6RAvdX_rmJ5h4vPMg@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2016-12-05 11:16 UTC (permalink / raw)
To: buildroot
The current VIM_REMOVE_DOCS hook removes all .txt files from
/usr/share/vim. Unfortunately, this also removes the rgb.txt file,
which is needed at runtime for vim, as reported in bug #9466.
This commit changes VIM_REMOVE_DOCS to remove only
/usr/share/vim/vim80/doc/. Size-wise, it's equivalent because:
- We are no longer removing a few README.txt in other directories,
taking more space.
- We are now removing the /usr/share/vim/vim80/doc/ folder entirely,
which contained a few files not named *.txt
So overall, the size of /usr/share/vim/ before and after this patch is
still 11MB.
Fixes bug #9466.
Reported-by: sir.ferdek+buildroot at gmail.com
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
package/vim/vim.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/vim/vim.mk b/package/vim/vim.mk
index d4a1f82..ee216c7 100644
--- a/package/vim/vim.mk
+++ b/package/vim/vim.mk
@@ -61,7 +61,7 @@ define VIM_INSTALL_RUNTIME_CMDS
endef
define VIM_REMOVE_DOCS
- find $(TARGET_DIR)/usr/share/vim -type f -name "*.txt" -delete
+ $(RM) -rf $(TARGET_DIR)/usr/share/vim/vim80/doc/
endef
# Avoid oopses with vipw/vigr, lack of $EDITOR and 'vi' command expectation
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <CAEGTJuPZKHuu5qd9gK-GyhPkxXdV+X0+V6RAvdX_rmJ5h4vPMg@mail.gmail.com>]
* [Buildroot] [PATCH] vim: be more careful when removing the documentation [not found] ` <CAEGTJuPZKHuu5qd9gK-GyhPkxXdV+X0+V6RAvdX_rmJ5h4vPMg@mail.gmail.com> @ 2016-12-05 12:09 ` Thomas Petazzoni 2016-12-05 12:14 ` Mateusz Furdyna 0 siblings, 1 reply; 3+ messages in thread From: Thomas Petazzoni @ 2016-12-05 12:09 UTC (permalink / raw) To: buildroot 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 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] vim: be more careful when removing the documentation 2016-12-05 12:09 ` Thomas Petazzoni @ 2016-12-05 12:14 ` Mateusz Furdyna 0 siblings, 0 replies; 3+ messages in thread From: Mateusz Furdyna @ 2016-12-05 12:14 UTC (permalink / raw) To: buildroot Sounds good to me. pon., 5.12.2016 o 13:09 u?ytkownik Thomas Petazzoni < thomas.petazzoni@free-electrons.com> napisa?: > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20161205/e35b2c3d/attachment.html> ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-05 12:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 11:16 [Buildroot] [PATCH] vim: be more careful when removing the documentation Thomas Petazzoni
[not found] ` <CAEGTJuPZKHuu5qd9gK-GyhPkxXdV+X0+V6RAvdX_rmJ5h4vPMg@mail.gmail.com>
2016-12-05 12:09 ` Thomas Petazzoni
2016-12-05 12:14 ` Mateusz Furdyna
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox