From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [OSSTEST PATCH 01/25] Osstest.pm: Provide new db_prepare helper with built-in debugging Date: Thu, 18 Jun 2015 16:46:23 +0100 Message-ID: <1434642383.28264.47.camel@citrix.com> References: <1434559521-8751-1-git-send-email-ian.jackson@eu.citrix.com> <1434559521-8751-2-git-send-email-ian.jackson@eu.citrix.com> <21890.58544.135482.842395@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5cbt-00065Z-98 for xen-devel@lists.xenproject.org; Thu, 18 Jun 2015 16:24:13 +0000 In-Reply-To: <21890.58544.135482.842395@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-06-18 at 16:33 +0100, Ian Jackson wrote: > Ian Jackson writes ("[OSSTEST PATCH 01/25] Osstest.pm: Provide new db_prepare helper with built-in debugging"): > > No callers, so no functional change, as yet. > > > +sub db_prepare ($) { > > + # caller must ensure global filehandle DEBUG is open > > + my ($stmt) = @_; > > + print ::DEBUG "DB PREPARING:\n$stmt\n"; > > + return $dbh_tests->prepare($stmt); > > This generates: > > Name "main::DEBUG" used only once: possible typo at Osstest.pm line > 274. > > Here is a v2 of this patch which fixes it. > > Ian. > > commit bd7cf4f0f1a8c45d840528bc28dbd89b34732d7a > Author: Ian Jackson > Date: Fri May 29 13:19:39 2015 +0000 > > Osstest.pm: Provide new db_prepare helper with built-in debugging > > No callers, so no functional change, as yet. > > Signed-off-by: Ian Jackson > Acked-by: Ian Campbell > --- > v2: Suppress "used only once" warning > > diff --git a/Osstest.pm b/Osstest.pm > index e8bd77b..8948666 100644 > --- a/Osstest.pm > +++ b/Osstest.pm > @@ -35,7 +35,7 @@ BEGIN { > getmethod > postfork > $dbh_tests db_retry db_retry_retry db_retry_abort > - db_begin_work > + db_begin_work db_prepare > ensuredir get_filecontents_core_quiet system_checked > nonempty visible_undef show_abs_time > ); > @@ -49,6 +49,10 @@ our $mjobdb; > > our $dbh_tests; > > +scalar *main::DEBUG; > +# declaration prevents `Name "main::DEBUG" used only once' > +# scalar prevents `useless use of a variable in void context' um, wow ;-) I suppose you will push this?