From: Ben Soares Date: Fri, 30 Aug 2019 13:32:54 +0000 (+0100) Subject: JAL-3394 JAL-3420 Temporary measure limits unix file extension to be the shortest... X-Git-Tag: Develop-2_11_2_0-d20201215~80^2~28^2~30^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ftask%2FJAL-3394_install4j8_option;p=jalview.git JAL-3394 JAL-3420 Temporary measure limits unix file extension to be the shortest one for each mime-type --- diff --git a/utils/install4j/auto_file_associations-i4j8.pl b/utils/install4j/auto_file_associations-i4j8.pl index 9a607c6..71044fe 100755 --- a/utils/install4j/auto_file_associations-i4j8.pl +++ b/utils/install4j/auto_file_associations-i4j8.pl @@ -178,6 +178,18 @@ for my $shortname (@ordered) { $i4jentry =~ s/\$\$MIMETYPE\$\$/$xmimetype/g; $i4jentry =~ s/\$\$ICONFILE\$\$/$xiconfile/g; + my $unixext; + for my $ext (sort @extensions) { + if (not defined($unixext)) { + $unixext = $ext; + next; + } + if (length($ext) < length($unixext)) { + $unixext = $ext; + next; + } + } + for my $ext (@extensions) { $i4jcount++; #print "COUNT: $i4jcount\n"; @@ -185,7 +197,10 @@ for my $shortname (@ordered) { #print "PC: $progresspercent\n"; $progresspercent = 100 if $progresspercent > 100; my $xext = xml_escape($ext); + my $addunixextension = ($ext eq $unixext)?"true":"false"; + my $i4jextentry = $i4jentry; + $i4jextentry =~ s/\$\$ADDUNIXEXTENSION\$\$/$addunixextension/g; $i4jextentry =~ s/\$\$EXTENSION\$\$/$xext/g; $i4jextentry =~ s/\$\$PROGRESSPERCENT\$\$/$progresspercent/g; $i4jextentry =~ s/\$\$ID\$\$/$id/g; diff --git a/utils/install4j/file_associations_auto-install4j8.xml b/utils/install4j/file_associations_auto-install4j8.xml index 52438d1..05c307f 100644 --- a/utils/install4j/file_associations_auto-install4j8.xml +++ b/utils/install4j/file_associations_auto-install4j8.xml @@ -193,7 +193,7 @@ - + Jalview-File.png @@ -403,7 +403,7 @@ - + Jalview-File.png @@ -487,7 +487,7 @@ - + Jalview-File.png @@ -613,7 +613,7 @@ - + Jalview-File.png @@ -781,7 +781,7 @@ - + Jalview-File.png @@ -865,7 +865,7 @@ - + Jalview-File.png @@ -1201,7 +1201,7 @@ - + Jalview-File.png diff --git a/utils/install4j/file_associations_template-install4j8.xml b/utils/install4j/file_associations_template-install4j8.xml index ee3aec8..cb9ebf8 100644 --- a/utils/install4j/file_associations_template-install4j8.xml +++ b/utils/install4j/file_associations_template-install4j8.xml @@ -25,7 +25,7 @@ - + $$ICONFILE$$.png