Author: arielch Date: Fri May 25 10:20:36 2012 New Revision: 1342559 URL: http://svn.apache.org/viewvc?rev=1342559&view=rev Log: Make packimages verbose
Modified: incubator/ooo/trunk/main/packimages/pack/makefile.mk incubator/ooo/trunk/main/solenv/bin/packimages.pl Modified: incubator/ooo/trunk/main/packimages/pack/makefile.mk URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/packimages/pack/makefile.mk?rev=1342559&r1=1342558&r2=1342559&view=diff ============================================================================== --- incubator/ooo/trunk/main/packimages/pack/makefile.mk (original) +++ incubator/ooo/trunk/main/packimages/pack/makefile.mk Fri May 25 10:20:36 2012 @@ -30,6 +30,15 @@ TARGET=packimages RSCCUSTOMIMG*=$(PRJ) .INCLUDE: target.mk + +.IF "$(VERBOSE_PACKIMG)"=="TRUE" +VERBOSESWITCH=-vv +.ELIF "$(VERBOSE)"=="TRUE" +VERBOSESWITCH=-v +.ELSE +VERBOSESWITCH= +.ENDIF + IMAGES := $(COMMONBIN)$/images.zip SORTED_LIST=$(RES)$/img$/sorted.lst # Custom sets, at 24x24 & 16x16 fall-back to industrial preferentially @@ -54,10 +63,10 @@ $(RES)$/img$/commandimagelist.ilst .PHON $(PERL) $(SOLARENV)$/bin$/diffmv.pl $@.$(INPATH) $@ $(COMMONBIN)$/images.zip .PHONY: $(RES)$/img$/commandimagelist.ilst - $(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@ + $(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -l $(SOLARCOMMONRESDIR)$/img -s $(SORTED_LIST) -l $(RES)$/img -o $@ images_% : $(RES)$/img$/commandimagelist.ilst - $(PERL) $(SOLARENV)$/bin$/packimages.pl -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -c $(SOLARSRC)$/ooo_custom_images$/$(@:s/images_//) -c $(MISC)$/$(@:s/images_//) $(CUSTOM_PREFERRED_FALLBACK_1) $(CUSTOM_PREFERRED_FALLBACK_2) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -s $(SORTED_LIST) -o $(COMMONBIN)$/$@.zip + $(PERL) $(SOLARENV)$/bin$/packimages.pl $(VERBOSESWITCH) -g $(SOLARSRC)$/$(RSCDEFIMG) -m $(SOLARSRC)$/$(RSCDEFIMG) -c $(RSCCUSTOMIMG) -c $(SOLARSRC)$/ooo_custom_images$/$(@:s/images_//) -c $(MISC)$/$(@:s/images_//) $(CUSTOM_PREFERRED_FALLBACK_1) $(CUSTOM_PREFERRED_FALLBACK_2) -l $(SOLARCOMMONRESDIR)$/img -l $(RES)$/img -s $(SORTED_LIST) -o $(COMMONBIN)$/$@.zip # make sure to have one to keep packing happy $(COMMONBIN)$/images_brand.zip: Modified: incubator/ooo/trunk/main/solenv/bin/packimages.pl URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/solenv/bin/packimages.pl?rev=1342559&r1=1342558&r2=1342559&view=diff ============================================================================== --- incubator/ooo/trunk/main/solenv/bin/packimages.pl (original) +++ incubator/ooo/trunk/main/solenv/bin/packimages.pl Fri May 25 10:20:36 2012 @@ -98,7 +98,7 @@ sub parse_options '-h' => \$opt_help, '-o=s' => \$out_file, '-g=s' => \$global_path, - '-s=s' => \$sort_file, + '-s=s' => \$sort_file, '-m=s' => \$module_path, '-c=s' => \@custom_path_list, '-e=s' => \$custom_path_extended, @@ -113,6 +113,10 @@ sub parse_options usage(); exit(1); } + + # if extra-verbose, set also verbose + if ($extra_verbose) { $verbose = 1; } + #define intermediate output file $tmp_out_file="$out_file"."$$".$ENV{INPATH}; # Sanity checks. @@ -218,22 +222,22 @@ sub find_custom my $custom_hash_ref = shift; my $keep_back; for my $path (@custom_path) { - find({ wanted => \&wanted, no_chdir => 0 }, $path); - foreach ( @custom_list ) { - if ( /^\Q$path\E\/(.*)$/ ) { - $keep_back=$1; - if (!defined $custom_hash_ref->{$keep_back}) { - $custom_hash_ref->{$keep_back} = $path; - } - } - } + find({ wanted => \&wanted, no_chdir => 0 }, $path); + foreach ( @custom_list ) { + if ( /^\Q$path\E\/(.*)$/ ) { + $keep_back=$1; + if (!defined $custom_hash_ref->{$keep_back}) { + $custom_hash_ref->{$keep_back} = $path; + } + } + } } } sub wanted { my $file = $_; - + if ( $file =~ /.*\.png$/ && -f $file ) { push @custom_list, $File::Find::name; } @@ -284,14 +288,14 @@ sub is_file_newer { my $test_hash_ref = shift; my $reference_stamp = 0; - + print_message("checking timestamps ...") if $verbose; if ( -e $out_file ) { $reference_stamp = (stat($out_file))[9]; print_message("found $out_file with $reference_stamp ...") if $verbose; } return 1 if $reference_stamp == 0; - + foreach ( sort keys %{$test_hash_ref} ) { my $path = $test_hash_ref->{$_}; $path .= "/" if "$path" ne ""; @@ -308,8 +312,8 @@ sub optimize_zip_layout($) my $zip_hash_ref = shift; if (!defined $sort_file) { - print_message("no sort file - sorting alphabetically ...") if $verbose; - return sort keys %{$zip_hash_ref}; + print_message("no sort file - sorting alphabetically ...") if $verbose; + return sort keys %{$zip_hash_ref}; } print_message("sorting from $sort_file ...") if $verbose; @@ -318,21 +322,21 @@ sub optimize_zip_layout($) my @sorted; open ($orderh, $sort_file) || die "Can't open $sort_file: $!"; while (<$orderh>) { - /^\#.*/ && next; # comments - s/[\r\n]*$//; - /^\s*$/ && next; - my $file = $_; - if (!defined $zip_hash_ref->{$file}) { - print "unknown file '$file'\n" if ($extra_verbose); - } else { - push @sorted, $file; - $included{$file} = 1; - } + /^\#.*/ && next; # comments + s/[\r\n]*$//; + /^\s*$/ && next; + my $file = $_; + if (!defined $zip_hash_ref->{$file}) { + print "unknown file '$file'\n" if ($extra_verbose); + } else { + push @sorted, $file; + $included{$file} = 1; + } } close ($orderh); for my $img (sort keys %{$zip_hash_ref}) { - push @sorted, $img if (!$included{$img}); + push @sorted, $img if (!$included{$img}); } print_message("done sort ...") if $verbose;