From patchwork Wed Jul 18 12:34:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 945700 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.com.br Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41VxS32wDkz9s0w for ; Wed, 18 Jul 2018 22:34:58 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 72EB5307B8; Wed, 18 Jul 2018 12:34:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id b9heGcLSUfXk; Wed, 18 Jul 2018 12:34:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id AA2CC307DB; Wed, 18 Jul 2018 12:34:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id E981E1BFFDD for ; Wed, 18 Jul 2018 12:34:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E72AB307DB for ; Wed, 18 Jul 2018 12:34:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id g5zQW0mSEQhx for ; Wed, 18 Jul 2018 12:34:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by silver.osuosl.org (Postfix) with ESMTPS id 52C15307B8 for ; Wed, 18 Jul 2018 12:34:53 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id 17D011BA10C3; Wed, 18 Jul 2018 09:35:39 -0300 (-03) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id 0433A1BA10AB; Wed, 18 Jul 2018 09:35:39 -0300 (-03) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PUjorOv33XAk; Wed, 18 Jul 2018 09:35:38 -0300 (-03) Received: from pedeld202344.datacom.net (pedeld202344.datacom.net [10.0.120.87]) by mail.datacom.com.br (Postfix) with ESMTPSA id A86301BA0D50; Wed, 18 Jul 2018 09:35:38 -0300 (-03) From: Carlos Santos To: buildroot@buildroot.org Date: Wed, 18 Jul 2018 09:34:43 -0300 Message-Id: <20180718123443.7242-1-casantos@datacom.com.br> X-Mailer: git-send-email 2.14.4 Subject: [Buildroot] [PATCH] vim: install /bin/vi as a relative symlink X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yann Morin , ratbert90 MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "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 --- 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)