Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4177229imm; Fri, 18 May 2018 00:11:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpaQX4l7FnIegY9ANx7spHusNZRInmHJJnhHjZ9/JYHwkWru0OgtV8+8hPKUehvZP9v+v1r X-Received: by 2002:a17:902:d886:: with SMTP id b6-v6mr8362712plz.361.1526627478859; Fri, 18 May 2018 00:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526627478; cv=none; d=google.com; s=arc-20160816; b=vzPB3nKsbBhdB3nfwsHMgscvzi+TP0mhiIGJkEixynb6q7xH5qMWmqumieqfsokLrk deg+nPBoQHo+A6iIY6tyQ5I7gzrS8Db6q1w0cjfBNNgWwPzMceDZhH6Z/rq3CspFI8Ke 06s6sHt+y/Ail1oNo59c2Yp5rIjguD8rIJagQxTC+uYvWnINmd9ezW3/iARcWVdEzQJt mHidK8c/TfSexBVPIJnRRRTii0+7O+HZw1e8ZTi9FQ18WuWR9mmKNC5QWmvhA2qbvEH9 GmWb1hDtb+gyy0v5nbHu3Zmj3dmL0vJWuUQwr92/OXb26lDPfGa74IHRkbmZBPQiDykm m3zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-filter :arc-authentication-results; bh=n1wnTsVLkkhY9sQvXX9SyQbreoZpi50Ksx186RBfi8w=; b=I/ytwNTuZq/M7NDPNptUA3T3AqWqqo2q/AFRWqSKz+tO5myIWyJZfXS837NcfOjLtf Nq3BFykPxuYSRUNJxgiWoKEpME69wD8ShyvHuSBCvQFz2YrtLQ5ELgvlGRe93qI+Ts0Z a2yJr1VG7eRx1pKuXCWOFLjltMXw4xZXGNCpH2kudogb7f7kwyfZqu6c3e8u5rEH90a6 1lmBDD4ybo+d1gHwAFF1ptCPxRGWCrXdxVNrIuQQVSB4N850abdA7CW5oURQeInxyJcr wNGAdU5u7xHlTyWt+nULB/WLB8vCZg/6P4Ysk975/O+qS4O2q/GuVcV7T8wfaijlSHNa g9ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2iFiU9so; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si6684079plk.521.2018.05.18.00.11.04; Fri, 18 May 2018 00:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2iFiU9so; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752014AbeERHJl (ORCPT + 99 others); Fri, 18 May 2018 03:09:41 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:63004 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750763AbeERHJk (ORCPT ); Fri, 18 May 2018 03:09:40 -0400 Received: from mail-ua0-f175.google.com (mail-ua0-f175.google.com [209.85.217.175]) (authenticated) by conssluserg-03.nifty.com with ESMTP id w4I79PMS016924 for ; Fri, 18 May 2018 16:09:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com w4I79PMS016924 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1526627366; bh=n1wnTsVLkkhY9sQvXX9SyQbreoZpi50Ksx186RBfi8w=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=2iFiU9soKtDBSUq2wL8INRGNqKHwp4z2d2Txxa/6a1tKEP7n/Rmv8oyH64dnWwiMI wTg1BJVC01PqEcYOAf5fxv7++PbjzPCjixQyf66srlqj386V7/FG1/SVZcattWmizK agLdDxtn+VunJ55Ne2f9T7RkqX9/JtY0qpOC3tMaFQ/93AqlF8HDARuefuBSg2/cTK N2LMmuvHBERwlatbX+8nh7MPy5oliSLFMpmgK9FOtb6euVW43avP4yhjxXcgTyJMVO 7sLV/pPqnIM5KO4LMNClkBr//sdr4VUU105HePlqPsruDPWiA57if/VdulJbZ+9/jA JhbaFFhKLizCA== X-Nifty-SrcIP: [209.85.217.175] Received: by mail-ua0-f175.google.com with SMTP id g9-v6so4697646uak.7 for ; Fri, 18 May 2018 00:09:26 -0700 (PDT) X-Gm-Message-State: ALKqPwfrGE9PJwDc49Ilf9TdGPtYYZgA9QlJ4Qzv5BI9Vp/SAQNQWeyy 4mITQKNOljX4vZkhUpS7n3rihEMhRDMOCNga2oE= X-Received: by 2002:ab0:6aa:: with SMTP id g39-v6mr6634159uag.82.1526627365234; Fri, 18 May 2018 00:09:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.85.216 with HTTP; Fri, 18 May 2018 00:08:44 -0700 (PDT) In-Reply-To: <20180518062553.kodjjrlrosrg7vfq@gmail.com> References: <20180518062553.kodjjrlrosrg7vfq@gmail.com> From: Masahiro Yamada Date: Fri, 18 May 2018 16:08:44 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] scripts/tags.sh: don't parse `ls` for $ALLSOURCE_ARCHS generation To: Joey Pabalinas Cc: Andrew Morton , Linux Kernel Mailing List , Arend van Spriel , Robert Jarzmik Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-05-18 15:25 GMT+09:00 Joey Pabalinas : > Parsing `ls` is fragile at best and _will_ fail when $tree > contains spaces. Replace this with a glob-generated string > and directly assign it to $ALLSOURCE_ARCHS (Kconfig is > removed as it isn't an architecture); a subshell is implied > by $(), so `cd` doesn't affect the current working directory. > > Signed-off-by: Joey Pabalinas > > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/scripts/tags.sh b/scripts/tags.sh > index 78e546ff689c2d5f40..e4aba2983f6272fc44 100755 > --- a/scripts/tags.sh > +++ b/scripts/tags.sh > @@ -29,14 +29,12 @@ fi > ignore="$ignore ( -path ${tree}tools ) -prune -o" > > # Find all available archs > find_all_archs() > { > - ALLSOURCE_ARCHS="" > - for arch in `ls ${tree}arch`; do > - ALLSOURCE_ARCHS="${ALLSOURCE_ARCHS} "${arch##\/} > - done > + ALLSOURCE_ARCHS="$(cd "${tree}arch/" && echo *)" > + ALLSOURCE_ARCHS="${ALLSOURCE_ARCHS/Kconfig}" > } > > # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH > if [ "${ALLSOURCE_ARCHS}" = "" ]; then > ALLSOURCE_ARCHS=${SRCARCH} > -- > 2.17.0.rc1.35.g90bbd502d54fe92035.dirty > I do not like hard-coding the file(s) in arch/. Don't you have an idea to list only directories? 'find -type d' or 'ls -F' or something? For example, the following worked for me, I wonder if there is a cleverer way... # Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH if [ "${ALLSOURCE_ARCHS}" = "" ]; then ALLSOURCE_ARCHS=${SRCARCH} elif [ "${ALLSOURCE_ARCHS}" = "all" ]; then ALLSOURCE_ARCHS="$(cd "${tree}arch" && ls -1 -F | sed -n 's:/$::p')" fi -- Best Regards Masahiro Yamada