From patchwork Thu Oct 12 15:14:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 824911 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) 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 3yCZC70BYLz9t2V for ; Fri, 13 Oct 2017 02:14:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E7B6A2EFE1; Thu, 12 Oct 2017 15:14:38 +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 elpB-UW1R9xh; Thu, 12 Oct 2017 15:14:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 284972E7AA; Thu, 12 Oct 2017 15:14:37 +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 813801C0ADF for ; Thu, 12 Oct 2017 15:14:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7AFFA2E7AA for ; Thu, 12 Oct 2017 15:14:35 +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 fz+BxoFBYS40 for ; Thu, 12 Oct 2017 15:14:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.ind.br (mx.datacom.ind.br [177.66.5.10]) by silver.osuosl.org (Postfix) with ESMTPS id CF6D62CF11 for ; Thu, 12 Oct 2017 15:14:33 +0000 (UTC) Received: from mail.datacom.ind.br (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTPS id E9FDA15746FB; Thu, 12 Oct 2017 12:13:26 -0300 (BRT) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.ind.br (Postfix) with ESMTP id DCBB615746E3; Thu, 12 Oct 2017 12:13:26 -0300 (BRT) Received: from mail.datacom.ind.br ([127.0.0.1]) by localhost (mail.datacom.ind.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Bv8GnadOutsi; Thu, 12 Oct 2017 12:13:26 -0300 (BRT) Received: from p7-1130br.casantos.org (unknown [177.134.39.78]) by mail.datacom.ind.br (Postfix) with ESMTPSA id 7E51E15746F7; Thu, 12 Oct 2017 12:13:26 -0300 (BRT) From: Carlos Santos To: buildroot@buildroot.org Date: Thu, 12 Oct 2017 12:14:18 -0300 Message-Id: <20171012151418.3523-2-casantos@datacom.ind.br> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171012151418.3523-1-casantos@datacom.ind.br> References: <20171012151418.3523-1-casantos@datacom.ind.br> Subject: [Buildroot] [PATCH] netcat: add forced dependence on BusyBox X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" It may be necessary if packages become built in parallel, leading to a race condition on the creation of the "nc" link. Moreover, netcat is as shy as BusyBox and would not override an existing file/link, so we must remove $(TARGET_DIR)/usr/bin/nc in advance. Of course this still leaves a race conditon if other netcat competitors but we must assume thet the user is a grown-up person who knows what is doing. Signed-off-by: Carlos Santos --- package/netcat/netcat.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/package/netcat/netcat.mk b/package/netcat/netcat.mk index eb7ddcac27..c032eea56d 100644 --- a/package/netcat/netcat.mk +++ b/package/netcat/netcat.mk @@ -9,4 +9,15 @@ NETCAT_SITE = http://downloads.sourceforge.net/project/netcat/netcat/$(NETCAT_VE NETCAT_LICENSE = GPL-2.0+ NETCAT_LICENSE_FILES = COPYING +# Ensure Busybox gets built/installed before, so that this package +# overrides Busybox nc. We must remove an existing file/link because +# netcat is as shy as Busybox and would not override existing files. +ifeq ($(BR2_PACKAGE_BUSYBOX),y) +NETCAT_DEPENDENCIES += busybox +define NETCAT_RMOVE_NC_LINK + rm -f $(TARGET_DIR)/usr/bin/nc +endef +NETCAT_PRE_INSTALL_TARGET_HOOKS += NETCAT_RMOVE_NC_LINK +endif + $(eval $(autotools-package))