Perl-Dist-WiX

changeset 1052:85daa4d3caf6

Also attempt to get a packlist based on the dist name.
author Curtis Jewell <perl@curtisjewell.name>
date Fri Jun 10 06:32:13 2011 -0600 (2011-06-10)
parents 577482ccb4e3
children c119e1860e96
files lib/Perl/Dist/WiX/Asset/Module.pm lib/Perl/Dist/WiX/Role/NonURLAsset.pm
line diff
     1.1 --- a/lib/Perl/Dist/WiX/Asset/Module.pm	Thu Jun 09 20:25:59 2011 -0600
     1.2 +++ b/lib/Perl/Dist/WiX/Asset/Module.pm	Fri Jun 10 06:32:13 2011 -0600
     1.3 @@ -328,7 +328,7 @@
     1.4  				push @modules_installed, $module_name;
     1.5  				if ($packlist_flag) {
     1.6  					# The filelist is filtered during _search_packlist.
     1.7 -					my $filelist = $self->_search_packlist($module_name, $output_file);					
     1.8 +					my $filelist = $self->_search_packlist($module_name, $output_file, $dist_installed);					
     1.9  					$filelists{$module_name} = $filelist;
    1.10  				} elsif (1 < scalar @dist_info) {
    1.11  					# Can't pass in 0 to packlist and install more than 1 module.
     2.1 --- a/lib/Perl/Dist/WiX/Role/NonURLAsset.pm	Thu Jun 09 20:25:59 2011 -0600
     2.2 +++ b/lib/Perl/Dist/WiX/Role/NonURLAsset.pm	Fri Jun 10 06:32:13 2011 -0600
     2.3 @@ -143,9 +143,21 @@
     2.4  
     2.5  
     2.6  sub _search_packlist { ## no critic(ProhibitUnusedPrivateSubroutines)
     2.7 -	my ( $self, $module, $output ) = @_;
     2.8 +	my ( $self, $module, $output, $dist_installed ) = @_;
     2.9  	$output ||= catfile( $self->_get_output_dir(), 'debug.out' );
    2.10 -
    2.11 +	$dist_installed ||= q{};
    2.12 +	
    2.13 +	# Try and get a second module name to try from the name of the
    2.14 +	# distribution's tarball.
    2.15 +	my ($second_module) = $dist_installed =~ m{ 
    2.16 +		/ ([^/]*)            # Grab whatever's after the last slash ...
    2.17 +		-\d+(?:.*)           # up to the first thing that starts with a digit ...
    2.18 +		\.                   # and then match a dot ...
    2.19 +		(?:tar\.gz|tgz|zip)  # and then an extension ...
    2.20 +		\z                   # that ends the string.
    2.21 +	}msx;
    2.22 +	$second_module =~ s/-/::/msg;
    2.23 +	
    2.24  	# We don't use the error until later, if needed.
    2.25  	my $error = <<"EOF";
    2.26  No .packlist found for $module.
    2.27 @@ -167,6 +179,17 @@
    2.28  		catdir( $image_dir, qw{perl        lib auto}, @module_dirs ),
    2.29  	);
    2.30  
    2.31 +	# If the second name wasn't equal to the first, try and get it.
    2.32 +	if ($second_module ne $module) {
    2.33 +		my @second_module_dirs = split /::/ms, $second_module;
    2.34 +		push @dirs, (
    2.35 +			catdir( $image_dir, qw{perl vendor lib auto}, @second_module_dirs ),
    2.36 +			catdir( $image_dir, qw{perl site   lib auto}, @second_module_dirs ),
    2.37 +			catdir( $image_dir, qw{perl        lib auto}, @second_module_dirs ),
    2.38 +		);
    2.39 +	}
    2.40 +	
    2.41 +	# If we were given a packlist location, try there, too!
    2.42  	my $packlist_location = $self->_get_packlist_location();
    2.43  	if ( defined $packlist_location ) {
    2.44  		push @dirs,