From patchwork Fri Aug 30 20:09:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Kurth X-Patchwork-Id: 11124493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A015813B1 for ; Fri, 30 Aug 2019 20:11:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 865F423439 for ; Fri, 30 Aug 2019 20:11:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 865F423439 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDg-0004ev-CJ; Fri, 30 Aug 2019 20:10:04 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDf-0004d7-Ah for xen-devel@lists.xenproject.org; Fri, 30 Aug 2019 20:10:03 +0000 X-Inumbo-ID: 260ee6ee-cb62-11e9-951b-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 260ee6ee-cb62-11e9-951b-bc764e2007e4; Fri, 30 Aug 2019 20:10:02 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDc-0007hW-Mm; Fri, 30 Aug 2019 20:10:00 +0000 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by xenbits.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDc-0003Pk-Gm; Fri, 30 Aug 2019 20:10:00 +0000 From: Lars Kurth To: xen-devel@lists.xenproject.org Date: Fri, 30 Aug 2019 21:09:51 +0100 Message-Id: <0944333a4a0b503789d10afa63f8229bd0441290.1567195654.git-series.lars.kurth@citrix.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: Subject: [Xen-devel] [PATCH v3 1/3] Remove hardcoding from scripts/add_maintainers.pl X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Lars Kurth , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Instead of using a hardcoded location, inherit the location from $0 Signed-off-by: Lars Kurth --- scripts/add_maintainers.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/add_maintainers.pl b/scripts/add_maintainers.pl index 09e9f66..5a6d0f6 100755 --- a/scripts/add_maintainers.pl +++ b/scripts/add_maintainers.pl @@ -26,9 +26,9 @@ sub insert ($$$$); sub hastag ($$); # Tool Variables -my $get_maintainer = "./scripts/get_maintainer.pl"; - my $tool = $0; +my $get_maintainer = $tool; +$get_maintainer =~ s/add_maintainers/get_maintainer/; my $usage = < X-Patchwork-Id: 11124499 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5236417E0 for ; Fri, 30 Aug 2019 20:11:54 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 383B823439 for ; Fri, 30 Aug 2019 20:11:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 383B823439 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDl-00051w-MN; Fri, 30 Aug 2019 20:10:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDk-00051h-BE for xen-devel@lists.xenproject.org; Fri, 30 Aug 2019 20:10:08 +0000 X-Inumbo-ID: 278d51a4-cb62-11e9-b95f-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 278d51a4-cb62-11e9-b95f-bc764e2007e4; Fri, 30 Aug 2019 20:10:04 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDe-0007hr-Va; Fri, 30 Aug 2019 20:10:02 +0000 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by xenbits.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDe-0003Pk-PI; Fri, 30 Aug 2019 20:10:02 +0000 From: Lars Kurth To: xen-devel@lists.xenproject.org Date: Fri, 30 Aug 2019 21:09:52 +0100 Message-Id: <84a9fed12bc752498bb90a7db3fdb46912736d6a.1567195654.git-series.lars.kurth@citrix.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: Subject: [Xen-devel] [PATCH v3 2/3] Add V section entry to allow identification of Xen MAINTAINERS file X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Lars Kurth , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" This change provides sufficient information to allow get_maintainer.pl / add_maintainers.pl scripts to be run on xen sister repositories such as mini-os.git, osstest.git, etc A suggested template for sister repositories of Xen is ======================================================== This file follows the same conventions as outlined in xen.git:MAINTAINERS. Please refer to the file in xen.git for more information. THE REST M: MAINTAINER1 M: MAINTAINER2 L: xen-devel@lists.xenproject.org S: Supported F: * F: */ V: xen-maintainers-1 ======================================================== Signed-off-by: Lars Kurth Acked-by: Jan Beulich --- MAINTAINERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 77413e0..bb3da43 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -97,6 +97,9 @@ Descriptions of section entries: matches patches or files that contain one or more of the words printk, pr_info or pr_err One regex pattern per line. Multiple K: lines acceptable. + V: Version identifier that must be under THE REST and follows + the format: + xen-maintainers- The meaning of nesting: @@ -541,3 +544,4 @@ L: xen-devel@lists.xenproject.org S: Supported F: * F: */ +V: xen-maintainers-1 From patchwork Fri Aug 30 20:09:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Kurth X-Patchwork-Id: 11124495 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7635513B1 for ; Fri, 30 Aug 2019 20:11:23 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CBE423439 for ; Fri, 30 Aug 2019 20:11:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CBE423439 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDp-00056v-W5; Fri, 30 Aug 2019 20:10:14 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDp-00056h-Cp for xen-devel@lists.xenproject.org; Fri, 30 Aug 2019 20:10:13 +0000 X-Inumbo-ID: 299afaa0-cb62-11e9-951b-bc764e2007e4 Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 299afaa0-cb62-11e9-951b-bc764e2007e4; Fri, 30 Aug 2019 20:10:07 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDi-0007i7-At; Fri, 30 Aug 2019 20:10:06 +0000 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by xenbits.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i3nDi-0003Pk-1a; Fri, 30 Aug 2019 20:10:06 +0000 From: Lars Kurth To: xen-devel@lists.xenproject.org Date: Fri, 30 Aug 2019 21:09:53 +0100 Message-Id: X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: Subject: [Xen-devel] [PATCH v3 3/3] Add logic to use V section entry in THE REST for identifying xen trees X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Lars Kurth , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Specifically: * Move check until after the MAINTAINERS file has been read * Add get_xen_maintainers_file_version() for check * Remove top_of_tree as not needed any more * Faiul with extended error message when used out of tree Signed-off-by: Lars Kurth --- scripts/get_maintainer.pl | 58 ++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 174dfb7..fe84a12 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -265,11 +265,6 @@ if ($email && die "$P: Please select at least 1 email option\n"; } -if (!top_of_tree($xen_path)) { - die "$P: The current directory does not appear to be " - . "a Xen source tree.\n"; -} - ## Read MAINTAINERS for type/value pairs my @typevalue = (); @@ -311,6 +306,16 @@ while (<$maint>) { } close($maint); +# Check whether we have a V entry under the REST +# hnd use it to get the file's version number +my $maintainers_file_version = get_xen_maintainers_file_version(); +if (!$maintainers_file_version) { + die "$P: the MAINTAINERS file ". + "in the current directory does not appear to be from ". + "the xen.git source tree or a sister tree.\n\n". + "A 'V: xen-maintainers-' entry under THE REST ". + "is needed to identify a Xen MAINTAINERS file.\n\n"; +} # # Read mail address map @@ -564,6 +569,32 @@ sub range_has_maintainer { return 0; } +sub get_xen_maintainers_file_version { + my $tvi = find_first_section(); + + while ($tvi < @typevalue) { + my $start = find_starting_index($tvi); + my $end = find_ending_index($tvi); + my $i; + + for ($i = $start; $i < $end; $i++) { + my $line = $typevalue[$i]; + if ($line =~ m/^V:\s*(.*)/) { + my $type = $1; + # Note that get_maintainer_role() requires processing + # of more of the file. So do it directly + if ($typevalue[$start] eq "THE REST") { + if ($line =~ m/xen-maintainers-(.*)/) { + return $1; + } + } + } + } + $tvi = $end + 1; + } + return 0; +} + sub get_maintainers { %email_hash_name = (); %email_hash_address = (); @@ -867,23 +898,6 @@ Notes: EOT } -sub top_of_tree { - my ($xen_path) = @_; - - if ($xen_path ne "" && substr($xen_path,length($xen_path)-1,1) ne "/") { - $xen_path .= "/"; - } - if ( (-f "${xen_path}COPYING") - && (-f "${xen_path}MAINTAINERS") - && (-f "${xen_path}Makefile") - && (-d "${xen_path}docs") - && (-f "${xen_path}CODING_STYLE") - && (-d "${xen_path}xen")) { - return 1; - } - return 0; -} - sub parse_email { my ($formatted_email) = @_;