Kaydet (Commit) 9e8e2937 authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile

Make packimages verbose

üst c71c09b5
......@@ -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 .PHONY : $(SORTED_LIST)
$(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:
......
......@@ -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,15 +222,15 @@ 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;
}
}
}
}
}
}
}
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment