From patchwork Sun Feb 7 23:25:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 77644 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o17NPho7022239 for ; Sun, 7 Feb 2010 23:25:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756563Ab0BGXZn (ORCPT ); Sun, 7 Feb 2010 18:25:43 -0500 Received: from mail.gmx.net ([213.165.64.20]:40754 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756460Ab0BGXZm (ORCPT ); Sun, 7 Feb 2010 18:25:42 -0500 Received: (qmail invoked by alias); 07 Feb 2010 23:25:40 -0000 Received: from p57BD139E.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.19.158] by mail.gmx.net (mp066) with SMTP; 08 Feb 2010 00:25:40 +0100 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1+gbvIjYwugznrJTQ0jYqV0ANiuq4Y/94zDMBKhWB U5WuNXwdfLhgUH Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1NeGVr-0004Ah-7a; Mon, 08 Feb 2010 00:25:59 +0100 Date: Mon, 8 Feb 2010 00:25:59 +0100 (CET) From: Guennadi Liakhovetski To: Michal Marek cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH v2] tags: include headers before source files In-Reply-To: <4B6C94AC.7000301@suse.cz> Message-ID: References: <4B6C94AC.7000301@suse.cz> MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-FuHaFi: 0.46999999999999997 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 07 Feb 2010 23:25:44 +0000 (UTC) diff --git a/scripts/tags.sh b/scripts/tags.sh index 1a0c44d..6f0985d 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -32,13 +32,20 @@ fi # find sources in arch/$ARCH find_arch_sources() { - find ${tree}arch/$1 $ignore -name "$2" -print; + for i in $archincludedir; do + prune+="-wholename $i -prune -o " + done + find ${tree}arch/$1 $ignore $prune -name "$2" -print; } # find sources in arch/$1/include find_arch_include_sources() { - find ${tree}arch/$1/include $ignore -name "$2" -print; + include=$(find ${tree}arch/$1/ -name include -type d); + if [ -n "$include" ]; then + archincludedir+="$include " + find $include $ignore -name "$2" -print; + fi } # find sources in include/ @@ -63,14 +70,15 @@ find_sources() all_sources() { - for arch in $ALLSOURCE_ARCHS - do - find_sources $arch '*.[chS]' - done + find_arch_include_sources ${ARCH} '*.[chS]' if [ ! -z "$archinclude" ]; then find_arch_include_sources $archinclude '*.[chS]' fi find_include_sources '*.[chS]' + for arch in $ALLSOURCE_ARCHS + do + find_sources $arch '*.[chS]' + done find_other_sources '*.[chS]' }