Skip Menu |

This queue is for tickets about the Module-ScanDeps CPAN distribution.

Report information
The Basics
Id: 47209
Status: resolved
Priority: 0/
Queue: Module-ScanDeps

People
Owner: Nobody in particular
Requestors: lamprecht [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.90
Fixed in: (no value)



Subject: Missing dependencies with Tk::Widget -> setPalette() (patch)
Hi, given code like this: use warnings; use strict; use Tk; my $mw = MainWindow->new(); $mw -> setPalette('#fcfafa'); MainLoop(); M::SD misses some dependencies in the Tk Library. This is due to Tk's dynamically loading of some of the core widgets in this case, which hides their constructor from M::SD. Patch attached. Discussed on perlmonks (reported by srikrishnan): http://perlmonks.org/?node_id=773263 Cheers, Christoph
Subject: M-ScanDeps.pm.patch
--- C:\Dokumente und Einstellungen\chris\Desktop\devel\ngre\Module\ScanDeps09-ori.pm So Jun 21 12:51:20 2009 +++ C:\Dokumente und Einstellungen\chris\Desktop\devel\ngre\Module\ScanDeps.pm So Jun 21 12:54:13 2009 @@ -813,6 +813,13 @@ push @modules, "Tk/$1.pm"; push @modules, "Tk/Scrollbar.pm"; } + while (/->\s*setPalette/g) { + push @modules, ('Tk/Labelframe.pm', + 'Tk/Message.pm', + 'Tk/Spinbox.pm', + 'Tk/Text.pm', + ); + } return \@modules; } return;
Subject: Re: [rt.cpan.org #47209] Missing dependencies with Tk::Widget -> setPalette() (patch)
Date: Mon, 22 Jun 2009 00:12:34 +0200
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Roderich Schupp <roderich.schupp [...] googlemail.com>
On Sun, Jun 21, 2009 at 1:05 PM, Lamprecht Christoph via RT <bug-Module-ScanDeps@rt.cpan.org> wrote: Show quoted text
> M::SD misses some dependencies in the Tk Library. This is due to Tk's > dynamically loading of some of the core widgets in this case, which > hides their constructor from M::SD. > Patch attached.
Reading the source of setPalette (in Tk/Widget.pm) this patch misses a few widgets. It should look like: @@ -813,6 +813,12 @@ push @modules, "Tk/$1.pm"; push @modules, "Tk/Scrollbar.pm"; } + if (/->\s*setPalette/g) { + push @modules, map { "Tk/$_pm" } qw(Button Canvas Checkbutton Entry + Frame Label Labelframe Listbox + Menubutton Menu Message Radiobutton + Scale Scrollbar Spinbox Text) + } return \@modules; } return; Cheers, Roderich
Subject: Re: [rt.cpan.org #47209] Missing dependencies with Tk::Widget -> setPalette() (patch)
Date: Mon, 22 Jun 2009 09:17:28 +0200
To: bug-Module-ScanDeps [...] rt.cpan.org
From: Ch Lamprecht <ch.l.ngre [...] online.de>
Roderich Schupp via RT schrieb: Show quoted text
> On Sun, Jun 21, 2009 at 1:05 PM, Lamprecht Christoph via RT > <bug-Module-ScanDeps@rt.cpan.org> wrote:
>> M::SD misses some dependencies in the Tk Library. This is due to Tk's >> dynamically loading of some of the core widgets in this case, which >> hides their constructor from M::SD. >> Patch attached.
> > Reading the source of setPalette (in Tk/Widget.pm) this patch > misses a few widgets. It should look like:
Show quoted text
> + if (/->\s*setPalette/g) { > + push @modules, map { "Tk/$_pm" } qw(Button Canvas > Checkbutton Entry > + > Frame Label Labelframe Listbox > + > Menubutton Menu Message Radiobutton > + > Scale Scrollbar Spinbox Text) > + } > return \@modules; > } > return; >
Hi Roderich, thanks for taking a look - and for catching the 'while' ;) the Modules I didn't include in the list are getting picked up anyway in presence of 'use Tk': Cheers, Christoph Show quoted text
>echo "use Tk;" > testdeps.pl
Show quoted text
>scandeps test.pl | grep Tk
'Tk::ColorEditor' => '4.010', 'Tk::DirTree' => '4.019', 'Tk::Event' => '4.019', 'Tk::FBox' => '4.019', 'Tk::Config' => '804.028', 'Tk::Image' => '4.011', 'Tk::MainWindow' => '4.013', 'Tk::Widget' => '4.033', 'Tk::Submethods' => '4.005', 'Tk::Canvas' => '4.012', 'Tk::Optionmenu' => '4.014', 'Tk::Scale' => '4.004', 'Tk::Pretty' => '4.006', 'Tk::Pixmap' => '4.004', 'Tk::Menubutton' => '4.005', 'Tk::Menu' => '4.023', 'Tk::DialogBox' => '4.015', 'Tk::Tree' => '4.72', 'Tk::Event::IO' => '4.008', 'Tk::IconList' => '4.007', 'Tk::LabEntry' => '4.006', 'Tk::Dialog' => '4.005', 'Tk::Button' => '4.010', 'Tk::Listbox' => '4.014', 'Tk::Toplevel' => '4.006', 'Tk::widgets' => '4.005', 'Tk::Wm' => '4.015', 'Tk::Frame' => '4.010', 'Tk::Configure' => '4.008', 'Tk::Derived' => '4.010', 'Tk::Entry' => '4.017', 'Tk::Clipboard' => '4.008', 'Tk::CmdLine' => '4.007', 'Tk::Menu::Item' => '4.005', 'Tk::Radiobutton' => '4.006', 'Tk::HList' => '4.015', 'Tk::Adjuster' => '4.008', 'Tk::After' => '4.007', 'Tk::Checkbutton' => '4.006', 'Tk::Scrollbar' => '4.010', 'Tk::Label' => '4.006', 'Tk::DummyEncode' => '4.007', 'Tk' => '804.028', 'Tk::FileSelect' => '4.017',
Hi Christoph, On Mon Jun 22 03:17:49 2009, ch.l.ngre@online.de wrote: Show quoted text
> Roderich Schupp via RT schrieb:
> > Reading the source of setPalette (in Tk/Widget.pm) this patch > > misses a few widgets. It should look like:
Show quoted text
> the Modules I didn't include in the list are getting picked up anyway in > presence of 'use Tk':
thank you for the patch. I opted for applying Roderich's version since having a few duplicates in @modules seems a better tradeoff than potentially breaking on a future change to Tk.pm. Of course, that can happen anyway, but the explicit dependencies for setPalette should minimize that. Cheers, Steffen