From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by mx.groups.io with SMTP id smtpd.web12.3028.1588363259190881156 for ; Fri, 01 May 2020 13:00:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@bsdio.com header.s=xmission header.b=AGcJA/Tq; spf=pass (domain: bsdio.com, ip: 166.70.13.232, mailfrom: rebecca@bsdio.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=simple/simple; d=bsdio.com; s=xmission; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=wHOMxaFGfhplVOSncBaJ/tdGPgnzynZ9XbQ9p676M9Y=; b=AGcJA/Tq05ep+M+EJ2AuhZgAUM lrUeBQOIThT/Gh0EtIrCElxyDeWfg7dUlXiSEAVeC1s9BcIVNWK4rIIpi2lBF4LORmsCiAcD0HmCH 6bAOCyUu9YQ/Oxm4IYUauZ5CjXboOHylX0CsWBv7OJXWrifNpWuys/LyqSglT0xh/wVM=; Received: from in02.mta.xmission.com ([166.70.13.52]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUbqD-0002Yn-QU; Fri, 01 May 2020 14:00:57 -0600 Received: from mta3.zcs.xmission.com ([166.70.13.67]) by in02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.87) (envelope-from ) id 1jUbqC-0000Z3-UD; Fri, 01 May 2020 14:00:57 -0600 Received: from localhost (localhost [127.0.0.1]) by mta3.zcs.xmission.com (Postfix) with ESMTP id 9A484161535; Fri, 1 May 2020 14:00:56 -0600 (MDT) X-Amavis-Modified: Mail body modified (using disclaimer) - mta3.zcs.xmission.com Received: from mta3.zcs.xmission.com ([127.0.0.1]) by localhost (mta3.zcs.xmission.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WmLMMoeYNDrC; Fri, 1 May 2020 14:00:56 -0600 (MDT) Received: from photon.int.bluestop.org (muon.bluestop.org [65.103.231.193]) (Authenticated sender: rebecca@bsdio.com) by mta3.zcs.xmission.com (Postfix) with ESMTPSA id 4E222161488; Fri, 1 May 2020 14:00:56 -0600 (MDT) From: "Rebecca Cran" To: devel@edk2.groups.io Cc: Rebecca Cran , Bob Feng , Liming Gao Date: Fri, 1 May 2020 14:00:44 -0600 Message-Id: <20200501200044.16648-1-rebecca@bsdio.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-XM-SPF: eid=1jUbqC-0000Z3-UD;;;mid=<20200501200044.16648-1-rebecca@bsdio.com>;;;hst=in02.mta.xmission.com;;;ip=166.70.13.67;;;frm=rebecca@bsdio.com;;;spf=pass X-SA-Exim-Connect-IP: 166.70.13.67 X-SA-Exim-Mail-From: rebecca@bsdio.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa08.xmission.com X-Spam-Level: * X-Spam-Status: No, score=1.3 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TooManySym_01,XMNoVowels autolearn=disabled version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.4950] * 1.5 XMNoVowels Alpha-numberic number with no vowels * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa08 1397; IP=ok Body=1 Fuz1=1] [Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa08 1397; IP=ok Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;devel@edk2.groups.io X-Spam-Relay-Country: X-Spam-Timing: total 655 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 13 (2.0%), b_tie_ro: 11 (1.7%), parse: 0.87 (0.1%), extract_message_metadata: 17 (2.6%), get_uri_detail_list: 1.79 (0.3%), tests_pri_-1000: 5 (0.8%), tests_pri_-950: 1.32 (0.2%), tests_pri_-900: 1.17 (0.2%), tests_pri_-90: 73 (11.1%), check_bayes: 71 (10.8%), b_tokenize: 7 (1.0%), b_tok_get_all: 7 (1.1%), b_comp_prob: 2.1 (0.3%), b_tok_touch_all: 49 (7.5%), b_finish: 1.58 (0.2%), tests_pri_0: 259 (39.4%), check_dkim_signature: 0.55 (0.1%), check_dkim_adsp: 58 (8.9%), poll_dns_idle: 328 (50.1%), tests_pri_10: 2.9 (0.4%), tests_pri_500: 280 (42.7%), rewrite_mail: 0.00 (0.0%) Subject: [PATCH 1/1] BaseTools: add repo name option to SetupGit.py X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Content-Transfer-Encoding: 8bit Allow users who didn't clone one of the TianoCore repos from a canonical URL to specify the name of the repo (edk2, edk2-platforms or edk2-non-osi) when running SetupGit.py to allow them to configure their repo properly. The new option is: -n repo, --name repo set the repo name to configure for, if not detected automatically Signed-off-by: Rebecca Cran Cc: Bob Feng Cc: Liming Gao --- Tested with: pylama : no new issues detected Option tested: -n : correctly said a parameter was needed -n edk2 : configured the repo for edk2 -n edk2-foo : errored out with a list of repo names -n edk2-platforms : updated the configuration for edk2-platforms Note the error block in __main__ if the upstream isn't found is redundant, since it already errors out and exits in get_upstream. BaseTools/Scripts/SetupGit.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/BaseTools/Scripts/SetupGit.py b/BaseTools/Scripts/SetupGit.py index e320ba2f887e..4416111ac0a5 100644 --- a/BaseTools/Scripts/SetupGit.py +++ b/BaseTools/Scripts/SetupGit.py @@ -106,10 +106,11 @@ def fuzzy_match_repo_url(one, other): return False -def get_upstream(url): +def get_upstream(url, name): """Extracts the dict for the current repo origin.""" for upstream in UPSTREAMS: - if fuzzy_match_repo_url(upstream['repo'], url): + if (fuzzy_match_repo_url(upstream['repo'], url) or + upstream['name'] == name): return upstream print("Unknown upstream '%s' - aborting!" % url) sys.exit(3) @@ -143,6 +144,11 @@ if __name__ == '__main__': help='overwrite existing settings conflicting with program defaults', action='store_true', required=False) + PARSER.add_argument('-n', '--name', type=str, metavar='repo', + choices=['edk2', 'edk2-platforms', 'edk2-non-osi'], + help='set the repo name to configure for, if not ' + 'detected automatically', + required=False) PARSER.add_argument('-v', '--verbose', help='enable more detailed output', action='store_true', @@ -156,7 +162,7 @@ if __name__ == '__main__': URL = REPO.remotes.origin.url - UPSTREAM = get_upstream(URL) + UPSTREAM = get_upstream(URL, ARGS.name) if not UPSTREAM: print("Upstream '%s' unknown, aborting!" % URL) sys.exit(7) -- 2.25.1