From patchwork Mon Jul 24 16:49:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Jackson X-Patchwork-Id: 9859811 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A416F600F5 for ; Mon, 24 Jul 2017 16:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E0D9283ED for ; Mon, 24 Jul 2017 16:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81A8C2858B; Mon, 24 Jul 2017 16:51:48 +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=-4.2 required=2.0 tests=BAYES_00, 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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 00F48283ED for ; Mon, 24 Jul 2017 16:51:47 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZgXr-0002K7-7u; Mon, 24 Jul 2017 16:49:23 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZgXq-0002K1-2H for xen-devel@lists.xenproject.org; Mon, 24 Jul 2017 16:49:22 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id D2/AE-09901-11526795; Mon, 24 Jul 2017 16:49:21 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGLMWRWlGSWpSXmKPExsXitHRDpK6Aalm kwYnFlhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bKJ9vZCj5xVfTN3sfUwLiSo4uRk0NCwF9i c9cvFhCbTUBXomnLX7YuRg4OEQEVidt7DUDCzAK1Eqv2zGAHsYUF3CW2Hp7CCmKzCKhKfJmxF 8zmFfCU2P9iAhvESDmJ88d/MoOMERJQk5i7Ph6iRFDi5MwnLBAjJSQOvnjBPIGRexaS1CwkqQ WMTKsY1YtTi8pSi3TN9JKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAsOAAQh2MM4 74X+IUZKDSUmUV4ipLFKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO9tZaCcYFFqempFWmYOMCBh 0hIcPEoivIEgad7igsTc4sx0iNQpRl2OVxP+f2MSYsnLz0uVEueNUwEqEgApyijNgxsBi45Lj LJSwryMQEcJ8RSkFuVmlqDKv2IU52BUEuYNAlnFk5lXArfpFdARTEBHzJlRCnJESSJCSqqBMW qy1N5+1tDubZnFt9ol961x/ve02l1X/cXeAt/qNdfWbTzl5LClT7Ixi31lmv+B1LTNMhNbLhu ttFgkPHvPxIkZT3jtH/PXGf0+PPF02PmXG0RPqPe7V4Q/v3lUqD9/D+u8lSfeuRR8/iJ0KG67 W98xCdsdk0OOqX84+zCyoWOV5H7h1VM6nimxFGckGmoxFxUnAgC47IldiQIAAA== X-Env-Sender: prvs=371027d51=Ian.Jackson@citrix.com X-Msg-Ref: server-2.tower-21.messagelabs.com!1500914959!60789475!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.25; banners=-,-,- X-VirusChecked: Checked Received: (qmail 19502 invoked from network); 24 Jul 2017 16:49:20 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-2.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 24 Jul 2017 16:49:20 -0000 X-IronPort-AV: E=Sophos;i="5.40,407,1496102400"; d="scan'208";a="432731707" From: Ian Jackson To: Date: Mon, 24 Jul 2017 17:49:03 +0100 Message-ID: <1500914943-14384-1-git-send-email-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [OSSTEST PATCH] anointments: Provide ./mg-anoint list-prepared X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP CC: Roger Pau Monne Signed-off-by: Ian Jackson --- mg-anoint | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/mg-anoint b/mg-anoint index 4bb8ab0..837e608 100755 --- a/mg-anoint +++ b/mg-anoint @@ -20,6 +20,9 @@ # if nothing anointed yet, prints nothing and exits 0 # if anointment not prepared, fails # +# ./mg-anoint list-prepared REFKEY-GLOB +# => possibly empty list of REFKEYs +# # ./mg-anoint list # => human-readable output @@ -65,6 +68,7 @@ use Osstest; use Osstest::TestSupport; use Osstest::Executive; use IO::Handle; +use Text::Glob qw(glob_to_regex); csreadconfig(); @@ -337,6 +341,31 @@ END pr_o(); } +sub cmd_list_prepared { + die unless @ARGV==1; + die if $ARGV[0] =~ m/^-/; + my ($pat) = @ARGV; + my $re = glob_to_regex $pat; + + my $tq = $dbh_tests->prepare(<execute(); + while (my $t = $tq->fetchrow_hashref()) { + next unless $t->{refkey} =~ m{$re}o; + push @o, $t->{refkey}; + } + }); + pr_o(); +} + die 'need operation' unless @ARGV; die 'no global options understood' if $ARGV[0] =~ m/^-/;