Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] vim: install /bin/vi as a relative symlink
@ 2018-07-18 12:34 Carlos Santos
  2018-07-18 13:03 ` Thomas Petazzoni
  2018-08-05 12:43 ` Thomas Petazzoni
  0 siblings, 2 replies; 14+ messages in thread
From: Carlos Santos @ 2018-07-18 12:34 UTC (permalink / raw)
  To: buildroot

Prevent creating a dangling symlink when vim is not present on the host
machine. With BR2_ROOTFS_MERGED_USR, just link to "vim", since they are
on the same directory, otherwise link to "../usr/bin/vim".

Signed-off-by: Carlos Santos <casantos@datacom.com.br>
---
 package/vim/vim.mk | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/vim/vim.mk b/package/vim/vim.mk
index dbf71c573f..ee0c8b61e4 100644
--- a/package/vim/vim.mk
+++ b/package/vim/vim.mk
@@ -63,9 +63,15 @@ define VIM_REMOVE_DOCS
 endef
 
 # Avoid oopses with vipw/vigr, lack of $EDITOR and 'vi' command expectation
+ifeq ($(BR2_ROOTFS_MERGED_USR),y)
 define VIM_INSTALL_VI_SYMLINK
-	ln -sf /usr/bin/vim $(TARGET_DIR)/bin/vi
+	ln -sf vim $(TARGET_DIR)/usr/bin/vi
 endef
+else
+define VIM_INSTALL_VI_SYMLINK
+	ln -sf ../usr/bin/vim $(TARGET_DIR)/bin/vi
+endef
+endif
 VIM_POST_INSTALL_TARGET_HOOKS += VIM_INSTALL_VI_SYMLINK
 
 ifeq ($(BR2_PACKAGE_VIM_RUNTIME),y)
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-08-23 22:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-18 12:34 [Buildroot] [PATCH] vim: install /bin/vi as a relative symlink Carlos Santos
2018-07-18 13:03 ` Thomas Petazzoni
2018-07-18 14:10   ` Carlos Santos
2018-07-19  2:57   ` Baruch Siach
2018-07-19 10:58     ` Carlos Santos
2018-07-20  5:58       ` Baruch Siach
2018-07-20 11:42         ` Carlos Santos
2018-07-23 13:17           ` Thomas Petazzoni
2018-07-24  7:55             ` Arnout Vandecappelle
2018-07-24  8:30               ` Thomas Petazzoni
2018-07-26  8:39                 ` Arnout Vandecappelle
2018-07-23 13:08     ` Thomas Petazzoni
2018-08-05 12:43 ` Thomas Petazzoni
2018-08-23 22:09   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox