X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=utils%2Finstall4j%2Fauto_file_associations-i4j8.pl;fp=utils%2Finstall4j%2Fauto_file_associations-i4j8.pl;h=bf24b11b79c765799279de17c099447bc917efb3;hb=e978baf3e628c2fb6f952d8265ef0498ae828658;hp=e0916818de6e1f77bb9ba3fb71720bc388d68f61;hpb=647ab2685d475e3f0c89d0a8f06f80358d7d4ea6;p=jalview.git diff --git a/utils/install4j/auto_file_associations-i4j8.pl b/utils/install4j/auto_file_associations-i4j8.pl index e091681..bf24b11 100755 --- a/utils/install4j/auto_file_associations-i4j8.pl +++ b/utils/install4j/auto_file_associations-i4j8.pl @@ -120,25 +120,16 @@ close(IN); my %all_associations = (%$file_associations, %$add_associations); -my $num = 0; -my $i4jcount = 0; my @ordered = (@put_first, @non_primary); for my $key (sort keys %all_associations) { next if grep($_ eq $key, @ordered); push(@ordered, $key); } -for my $key (@ordered) { - my $a = $all_associations{$key}; - next if (ref($a) ne "HASH"); - - my $extensions = $a->{extensions}; - my @extensions = @$extensions; - - $num++ -} +my $num = $#ordered + 1; warn("--\n"); +my $i4jcount = 0; for my $shortname (@ordered) { my $a = $all_associations{$shortname}; next if (ref($a) ne "HASH"); @@ -192,9 +183,9 @@ for my $shortname (@ordered) { my $ext = join(",",sort(@extensions)); my $xdisplayext = xml_escape(join(", ", map(".$_",sort(@extensions)))); - $i4jcount++; my $progresspercent = int(($i4jcount/$num)*100); $progresspercent = 100 if $progresspercent > 100; + $i4jcount++; my $xext = xml_escape($ext); my $addunixextension = "true";