From patchwork Thu Aug 16 00:13:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Forney X-Patchwork-Id: 10566905 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9362B1390 for ; Thu, 16 Aug 2018 00:13:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 377642AD3E for ; Thu, 16 Aug 2018 00:13:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B9D62ADA9; Thu, 16 Aug 2018 00:13:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65A942AD3E for ; Thu, 16 Aug 2018 00:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731420AbeHPDI3 (ORCPT ); Wed, 15 Aug 2018 23:08:29 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:44131 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728981AbeHPDI3 (ORCPT ); Wed, 15 Aug 2018 23:08:29 -0400 Received: by mail-pf1-f196.google.com with SMTP id k21-v6so1169536pff.11 for ; Wed, 15 Aug 2018 17:13:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=GRIXwWu+jlPZlpGLazcyrz7TLRSQxOY/k/9cCDCa0N8=; b=LA6sj5caMp4zos5WNnRrkc1sg41dfVLYPEbQXYC6YhuqBWg44uwC4R2dSS/I7kVWH1 KoOyzlvLAa4mFogPcBzyeTLzEh7AhkFbqNeplB0dIRtJ2wyJ43IuQVv+P6OLJNXjezSo R8UgL3YP4IwVi4ztFdfBUIhRZEUSg7afyhb5KfYfiE3EKWxctYJq7ZM5uBmx+DIJ0l/f aYibpr4Xp6z9BythoenEoN/NzrWmdseagOAj+WsmvONQAZc+gT3NCgb4+IVaQrSsCAwk VrKyNJQjQ74NF6Uxx7tETvNbnjb/b/rlKcp24+mqrgL8xpo+l+SYNNOkV/7pQJj5zM/g sczw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=GRIXwWu+jlPZlpGLazcyrz7TLRSQxOY/k/9cCDCa0N8=; b=WmNQlYYH3kBRt6gyVaMeHpOtGeuC7/y/Al15m31UYSIu66Zwsik2D4norUDuL3w0Ij mveDfGYVjW7WWB4pkSjB7UakDRpLQFjjmxDwjFwDcFklVW97TD1o4zjh02pRVVeUNUb3 iHbKwR8ZzcQGNo4uej5BnE4oMdQN2lEGGVjxVU4ZnljfDNuiQnpQ7lU2hVKok+ACp7we NRq4W725EbfqcqhYLagDgcG+C6vYfAZSFMuJPQQR5OJ0mik/A27sxRYEz/r7UL96UZ3H Im4WFb56DM49oa9b9UjwFMd5HDrOBUpGYEzkPAhIYI0zWytltYMjVTkHKbjdDVl8ZbTH QqWQ== X-Gm-Message-State: AOUpUlFPPk7OouoRziWZvvb6ciYcevveC6JshDo7Af2OS9hqMqlDubLg Msn3QTwYJIWT5Nr42QVsfs/QsNPvrqU= X-Google-Smtp-Source: AA+uWPxkcUHIJSgUx2wIT6DeKPVnnc9NvBZHxgKswoM/7lmXO+Xc77si3fMreEM9Y92kc5LShalRnA== X-Received: by 2002:a62:569c:: with SMTP id h28-v6mr29978420pfj.201.1534378431726; Wed, 15 Aug 2018 17:13:51 -0700 (PDT) Received: from localhost ([2601:647:5180:35d7::5eb6]) by smtp.gmail.com with ESMTPSA id 3-v6sm580810pfq.10.2018.08.15.17.13.50 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Aug 2018 17:13:50 -0700 (PDT) From: Michael Forney To: linux-kbuild@vger.kernel.org Subject: [PATCH] kbuild: Add a space after `!` to prevent parsing as file pattern Date: Wed, 15 Aug 2018 17:13:50 -0700 Message-Id: <20180816001350.7516-1-mforney@mforney.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some shells use !(pattern|...|pattern) to match file names not containing the specified patterns. This may result in output like $ ./scripts/clang-version.sh gcc ./scripts/clang-version.sh[18]: COPYING: not found printf: %d __clang_major__: conversion error printf: %d __clang_minor__: conversion error printf: %d __clang_patchlevel__: conversion error 00000 $ and set CONFIG_CLANG_VERSION to the invalid value '00000'. POSIX says[0] If the pipeline begins with the reserved word ! and command1 is a subshell command, the application shall ensure that the ( operator at the beginning of command1 is separated from the ! by one or more characters. The behavior of the reserved word ! immediately followed by the ( operator is unspecified. So, just add a to prevent this. [0] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_02 Signed-off-by: Michael Forney --- scripts/clang-version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/clang-version.sh b/scripts/clang-version.sh index dbf0a31eb111..e65fbc3079d4 100755 --- a/scripts/clang-version.sh +++ b/scripts/clang-version.sh @@ -12,7 +12,7 @@ compiler="$*" -if !( $compiler --version | grep -q clang) ; then +if ! ( $compiler --version | grep -q clang) ; then echo 0 exit 1 fi