From patchwork Tue Feb 4 14:24:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 1233365 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=kbBheQhe; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48Bn5t1zFGzB3xT for ; Wed, 5 Feb 2020 01:25:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 32E808632E; Tue, 4 Feb 2020 14:25:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iJQH2GXzvjW5; Tue, 4 Feb 2020 14:25:00 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 19EDD86229; Tue, 4 Feb 2020 14:25:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 91F741BF3D8 for ; Tue, 4 Feb 2020 14:24:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 8EAB086132 for ; Tue, 4 Feb 2020 14:24:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id suSeIQN69f4U for ; Tue, 4 Feb 2020 14:24:57 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1108786229 for ; Tue, 4 Feb 2020 14:24:57 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id y19so12305465lfl.9 for ; Tue, 04 Feb 2020 06:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id; bh=/GN+33ofHSxu1jvze/Vbk8eZmkjH4RCVfyhbxGmg0og=; b=kbBheQheuBSSb2UgTXjCIAulPyShc8/tmLCNH511XfSf5Ch7saz4kQM5hYQa4BaoIu hZ0Q3il0xtRNWn4AW05DoLZZ4DPRSTerj7Otz/TZFRcJilo8VcZzI5TGSNr0wqGqixw6 fjaf0SZz/m6DD1obf5j+xPpdiva42LaiB4QW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/GN+33ofHSxu1jvze/Vbk8eZmkjH4RCVfyhbxGmg0og=; b=bBCVNB2hVMh2Bgjj4U+KBqjz1KmQApkBOyQCmfKyVZX0ZmtQCj0TcVyqhQ+amNlqla BnNJuwRjBLP59V/C1KrzM4sliE4LFG7TTkT0qq7/W1gwe9sHEB5jb15T8bTQ+oYsTTs4 A/xU7ZOJ141VBSt9idgdz0CIuJraAMPSqDdxGQFdh/+Y7VMFuDSO1lChZKD9+9Uc3iTc 4xzqW81Vms47O6sT+jheo35DgaIvDjU2vhbWt0cgUODXTHy1xyh8kbWe8aNLL0iuLimd PVa4mAkP86mVPL8pF7BCevCkjLM9uok4MlUdAngX1SEx3+C1AxX3Q7ZzUJPZIXj4uyHh LXEw== X-Gm-Message-State: APjAAAVd1KuxwdANv8i4ANAF3vK1LPBHuOGwn8hMbbvo3+e3qyAoYyqc 4cApn0K0ZG6R658Njws20qwSiVkob+s4Jg== X-Google-Smtp-Source: APXvYqwTjgs/6gsaWcOXLiilT2nGSFGkaxMLlLzSkIHIqeylQFb21oSoKVwMSalCtBaxIlkuWtLaYQ== X-Received: by 2002:a19:cb95:: with SMTP id b143mr15019813lfg.158.1580826294771; Tue, 04 Feb 2020 06:24:54 -0800 (PST) Received: from localhost.localdomain ([2620:0:1055:fd00:4da8:e122:c3b:1b67]) by smtp.gmail.com with ESMTPSA id 21sm11621798ljv.19.2020.02.04.06.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Feb 2020 06:24:54 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Tue, 4 Feb 2020 15:24:47 +0100 Message-Id: <1580826287-1343-1-git-send-email-angelo@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 Subject: [Buildroot] [PATCH v2] package/grep: fix egrep/fgrep shebang X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Angelo Compagnucci MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" egrep/fgrep are using autotools SHELL variable to exec the grep executable with correct options, SHELL is defaulted to /bin/bash which we usually don't have on target. This patch defaults on /bin/sh, when /bin/sh is not available on target, we simply remove the aliases. Signed-off-by: Angelo Compagnucci --- Changelog: v1 -> v2: * Handling the corner case when BR2_SYSTEM_BIN_SH_NONE as suggested by Yann package/grep/Config.in | 2 ++ package/grep/grep.mk | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/package/grep/Config.in b/package/grep/Config.in index 5b0471b..47ced41 100644 --- a/package/grep/Config.in +++ b/package/grep/Config.in @@ -5,6 +5,8 @@ config BR2_PACKAGE_GREP help The GNU regular expression matcher. + egrep/fgrep aliases need /bin/sh to be available. + http://www.gnu.org/software/grep/grep.html comment "grep needs a toolchain w/ wchar" diff --git a/package/grep/grep.mk b/package/grep/grep.mk index be3e53b..02d8b50 100644 --- a/package/grep/grep.mk +++ b/package/grep/grep.mk @@ -12,6 +12,15 @@ GREP_LICENSE_FILES = COPYING GREP_DEPENDENCIES = $(TARGET_NLS_DEPENDENCIES) GREP_CONF_OPTS = --exec-prefix=/ +ifeq ($(BR2_SYSTEM_BIN_SH_NONE),y) +define GREP_REMOVE_ALIAS + $(RM) $(TARGET_DIR)/bin/[fe]grep +endef +GREP_POST_INSTALL_TARGET_HOOKS += GREP_REMOVE_ALIAS +else +GREP_CONF_OPTS += SHELL=/bin/sh +endif + # link with iconv if enabled ifeq ($(BR2_PACKAGE_LIBICONV),y) GREP_CONF_ENV += LIBS=-liconv