Skip Menu |
 

This queue is for tickets about the PAR-Packer CPAN distribution.

Report information
The Basics
Id: 55994
Status: resolved
Priority: 0/
Queue: PAR-Packer

People
Owner: RSCHUPP [...] cpan.org
Requestors: DJIBEL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.002
Fixed in: (no value)

Attachments


Subject: Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220.
Download (untitled) / with headers
text/plain 2.8k
Dear, I am using ActivePerl v5.10.1 built for MSWin32-x86-multi-thread build 1007. I have installed PAR::Packer 1.002 by downloading PAR::Packer on cpan and compilation perl Makefile.PL dmake dmake install I have gcc. When I package a perl program (pp -o test.exe test.pl), no problem, it is work but if I want to add an icon, it is failed with this error message : C:\Users\user\Documents\INFORMATIQUE\PROGRAMMATION\perl\Images>pp -o test.exe test.pl -i logo.ico -v Set up gcc environment - 4.3.3 C:\Perl\site\bin/pp: Packing auvergne-habitat.pl C:\Perl\site\bin/pp: Generating a fresh 'parl'. Set up gcc environment - 4.3.3 Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220. Why it is impossible to add and icon to exe with this PAR::Packer version 1.002. NB : During the compilation, if I try dmake test, I have the same message : C:\PAR-Packer-1.002>dmake test C:\Perl\bin\perl.exe -e "chmod(oct('0600'), '..\blib\lib\PAR\StrippedPARL\Static.pm');" C:\Perl\bin\perl.exe encode_append.pl static.exe ..\blib\lib\PAR\StrippedPARL\Static.pm C:\Perl\bin\perl.exe -e "chmod(oct('0444'), '..\blib\lib\PAR\StrippedPARL\Static.pm');" C:\Perl\bin\perl.exe -e "chmod(oct('0600'), '..\blib\lib\PAR\StrippedPARL\Dynamic.pm');" C:\Perl\bin\perl.exe encode_append.pl par.exe ..\blib\lib\PAR\StrippedPARL\Dynamic.pm C:\Perl\bin\perl.exe -e "chmod(oct('0444'), '..\blib\lib\PAR\StrippedPARL\Dynamic.pm');" C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib\lib', 'blib\arch')" t/00-pod.t t/10-parl-ge neration.t t/20-pp.t t/30-current_exec.t t/40-packer_cd_option.t t/00-pod.t ............... skipped: Set environment variable PERL_TEST_POD=1 to test POD t/10-parl-generation.t ... ok t/20-pp.t ................ 31/34 Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220. t/20-pp.t ................ 32/34 # Failed test 'pp_gui_tests # amsg572: sub pp_gui_tests cannot system pp --gui --icon hi.ico -o hello.exe hello.pl:No such file or directory: # ' # at automated_pp_test.pl line 8445. t/20-pp.t ................ 34/34 # Looks like you failed 1 test of 34. t/20-pp.t ................ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/34 subtests t/30-current_exec.t ...... # Please wait t/30-current_exec.t ...... ok t/40-packer_cd_option.t .. ok Test Summary Report ------------------- t/20-pp.t (Wstat: 256 Tests: 34 Failed: 1) Failed test: 32 Non-zero exit status: 1 Files=5, Tests=71, 604 wallclock secs ( 0.08 usr + 0.11 sys = 0.19 CPU) Result: FAIL Failed 1/5 test programs. 1/71 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' Best regards, djibel
Download (untitled) / with headers
text/plain 212b
Dear, Win32::exe have been updated and problem with icon have been resolved : https://rt.cpan.org/Public/Bug/Display.html?id=57013. When We would have an update of PAR::Packer module ? Best regards, Djibril
Download (untitled) / with headers
text/plain 1.9k
Le Lun 24 Mai 2010 16:33:41, DJIBEL a écrit : Show quoted text
> Dear, > > Win32::exe have been updated and problem with icon have been resolved : > https://rt.cpan.org/Public/Bug/Display.html?id=57013. > > When We would have an update of PAR::Packer module ? > > Best regards, > > Djibril
Dear, I have write a patch to PAR::PAcker. For New Win32::Exe module, Exe need a resource section. That is a patch to PAR::Packer 1.004 ===================================================== @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '1.005'; +our $VERSION = '1.004'; =head1 NAME @@ -821,6 +821,9 @@ and 0 # XXX - broken on larger icon files - XXX ) { my $tkdll = Win32::Exe->new($map{$pfile}); + if ($^O eq 'MSWin32') { + $tkdll = $tkdll->create_resource_section if !$tkdll->has_resource_section; + } my $ico = Win32::Exe::IconFile->new($opt->{i}); $tkdll->set_icons(scalar $ico->icons); @@ -1260,10 +1263,21 @@ } elsif (eval { require Win32::Exe; 1 }) { $self->_move_parl(); - Win32::Exe->new($self->{parl})->update( - icon => $opt->{i}, - info => $opt->{N}, - ); + if ($^O eq 'MSWin32') { + my $exe = Win32::Exe->new($self->{parl}); + $exe = $exe->create_resource_section if !$exe->has_resource_section; + $exe->update( + icon => $opt->{i}, + info => $opt->{N}, + ); + $exe->write; + } + else { + Win32::Exe->new($self->{parl})->update( + icon => $opt->{i}, + info => $opt->{N}, + ); + } $self->_append_parl(); $self->_generate_output(); ===================================================== For makefile.PL, Win32::Exe requires 'Win32::Exe' => 0.14; Best Regards, Djibril (djibel cpan)
Sorry, that is the real patch. Best Regards, Djibril
Subject: patch_PAR-Packer.1.004.txt
--- C:/Perl/site/lib/PAR/Packer_old.pm Mon May 24 23:23:44 2010 +++ C:/Perl/site/lib/PAR/Packer_new.pm Mon May 24 23:23:56 2010 @@ -3,7 +3,7 @@ use strict; use warnings; -our $VERSION = '1.004'; +our $VERSION = '1.005'; =head1 NAME @@ -821,6 +821,9 @@ and 0 # XXX - broken on larger icon files - XXX ) { my $tkdll = Win32::Exe->new($map{$pfile}); + if ($^O eq 'MSWin32') { + $tkdll = $tkdll->create_resource_section if !$tkdll->has_resource_section; + } my $ico = Win32::Exe::IconFile->new($opt->{i}); $tkdll->set_icons(scalar $ico->icons); @@ -1260,10 +1263,21 @@ } elsif (eval { require Win32::Exe; 1 }) { $self->_move_parl(); - Win32::Exe->new($self->{parl})->update( - icon => $opt->{i}, - info => $opt->{N}, - ); + if ($^O eq 'MSWin32') { + my $exe = Win32::Exe->new($self->{parl}); + $exe = $exe->create_resource_section if !$exe->has_resource_section; + $exe->update( + icon => $opt->{i}, + info => $opt->{N}, + ); + $exe->write; + } + else { + Win32::Exe->new($self->{parl})->update( + icon => $opt->{i}, + info => $opt->{N}, + ); + } $self->_append_parl(); $self->_generate_output();
Download (untitled) / with headers
text/plain 370b
On Mon May 24 17:27:05 2010, DJIBEL wrote: Show quoted text
> Sorry, that is the real patch.
Looks reasonable to me, except for the if ($^O eq 'MSWin32') ... tests. Is there any sense of calling Win32::Exe methods if NOT running on MSWin32? Also, which is the minimum version of Win32::Exe that contains the fixes (so that I can update PAR::Packer's requirements)? Cheers, Roderich
Download (untitled) / with headers
text/plain 731b
Le Mar 25 Mai 2010 04:35:44, RSCHUPP a écrit : Show quoted text
> On Mon May 24 17:27:05 2010, DJIBEL wrote:
> > Sorry, that is the real patch.
> > Looks reasonable to me, except for the > > if ($^O eq 'MSWin32') ... > > tests. Is there any sense of calling Win32::Exe > methods if NOT running on MSWin32?
No. You can remove the two tests of MSWin32 because it is already present in the else condition : eval { require Win32::Exe; 1 } in line 819 and 820, and 1260. Sorry. Show quoted text
> Also, which is the minimum version of Win32::Exe that > contains the fixes (so that I can update PAR::Packer's > requirements)?
The minimum of version of Win32::Exe that contains the fixes is the last version 0.14. Best Regards, Djibril Show quoted text
> Cheers, Roderich
Download (untitled) / with headers
text/plain 134b
Thanks, Djibril. I've commited your patch with slight modifications and bumped the requirement on Win32:Exe to 0.14 Cheers, Roderich
Subject: Re: [rt.cpan.org #55994] Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220.
Date: Fri, 28 May 2010 17:51:38 +0200
To: bug-PAR-Packer [...] rt.cpan.org
From: Reini Urban <rurban [...] x-ray.at>
Download (untitled) / with headers
text/plain 820b
2010/5/25 RSCHUPP via RT <bug-PAR-Packer@rt.cpan.org>: Show quoted text
> Tue May 25 04:35:44 2010: Request 55994 was acted upon. > Transaction: Correspondence added by RSCHUPP >       Queue: PAR-Packer >     Subject: Can't call method "remove" on an undefined value at C:/Perl/site/lib/Win32/Exe.pm line 220. >   Broken in: 1.002 >    Severity: Critical >       Owner: Nobody >  Requestors: DJIBEL@cpan.org >      Status: open >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55994 > > > > On Mon May 24 17:27:05 2010, DJIBEL wrote:
>> Sorry, that is the real patch.
> > Looks reasonable to me, except for the > >  if ($^O eq 'MSWin32') ... > > tests. Is there any sense of calling Win32::Exe > methods if NOT running on MSWin32?
yes, cygwin -- Reini Urban http://phpwiki.org/ http://murbreak.at/
Fixed in 1.005 Cheers, Roderich


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.