From patchwork Fri Aug 16 10:42:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars Kurth X-Patchwork-Id: 11097475 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 DEF071398 for ; Fri, 16 Aug 2019 10:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C10E628797 for ; Fri, 16 Aug 2019 10:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1B0E205A8; Fri, 16 Aug 2019 10:44:46 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 63203205A8 for ; Fri, 16 Aug 2019 10:44:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hyZhE-0000M9-Ai; Fri, 16 Aug 2019 10:43:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hyZhC-0000M4-On for xen-devel@lists.xenproject.org; Fri, 16 Aug 2019 10:42:58 +0000 X-Inumbo-ID: 9b1192d0-c012-11e9-8bb4-12813bfff9fa Received: from mail.xenproject.org (unknown [104.130.215.37]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 9b1192d0-c012-11e9-8bb4-12813bfff9fa; Fri, 16 Aug 2019 10:42:55 +0000 (UTC) Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hyZh6-0001Jb-GT; Fri, 16 Aug 2019 10:42:52 +0000 Received: from localhost ([127.0.0.1] helo=MacBook-Pro.Home) by xenbits.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hyZh6-0007vB-8x; Fri, 16 Aug 2019 10:42:52 +0000 From: Lars Kurth To: xen-devel@lists.xenproject.org Date: Fri, 16 Aug 2019 11:42:48 +0100 Message-Id: <4b535bb616f62ad685fef0f06d3b5138b1539688.1565951950.git.lars.kurth@citrix.com> X-Mailer: git-send-email 2.13.0 Subject: [Xen-devel] [PATCH] get_maintainers.pl: Enable running the script on unikraft repos 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: Felipe Huici , Lars Kurth , Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Florian Schmidt , Julien Grall , Jan Beulich , Simon Kuenzer MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Unikraft repos follow the same syntax as xen.git with the following exceptions: * MAINTAINERS files are called MAINTAINERS.md * M: ... etc blocks are preceded by whitespaces for rendering as markup files This change will - load MAINTAINERS.md if MAINTAINERS is not present - deal with indented M: ... blocks Signed-off-by: Lars Kurth --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Julien Grall Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu CC: Simon Kuenzer CC: Florian Schmidt CC: Felipe Huici --- scripts/get_maintainer.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index f1e9c904ee..bdb09f8f65 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -284,12 +284,18 @@ if (!top_of_tree($xen_path)) { my @typevalue = (); my %keyword_hash; -open (my $maint, '<', "${xen_path}MAINTAINERS") - or die "$P: Can't open MAINTAINERS: $!\n"; +my $maint; +my $maintainers_file = "MAINTAINERS"; +if (! open ($maint, '<', ${xen_path}.$maintainers_file)) { + $maintainers_file = "MAINTAINERS.md"; + open ($maint, '<', ${xen_path}.$maintainers_file) + or die "$P: Can't open MAINTAINERS or MAINTAINERS.md: $!\n"; +} + while (<$maint>) { my $line = $_; - if ($line =~ m/^([A-Z]):\s*(.*)/) { + if ($line =~ m/^\s*([A-Z]):\s*(.*)/) { my $type = $1; my $value = $2; @@ -421,7 +427,7 @@ foreach my $file (@ARGV) { } if ($from_filename) { push(@files, $file); - if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) { + if ($file ne $maintainers_file && -f $file && ($keywords || $file_emails)) { open(my $f, '<', $file) or die "$P: Can't open $file: $!\n"; my $text = do { local($/) ; <$f> };