From ef3a7bf0df83ff4fccdcc13dcdd26fc415e3529f Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 30 Aug 2019 14:32:54 +0100 Subject: [PATCH] JAL-3394 JAL-3420 Temporary measure limits unix file extension to be the shortest one for each mime-type --- utils/install4j/auto_file_associations-i4j8.pl | 15 +++++++++++++++ utils/install4j/file_associations_auto-install4j8.xml | 14 +++++++------- .../install4j/file_associations_template-install4j8.xml | 2 +- 3 files changed, 23 insertions(+), 8 deletions(-) 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 -- 1.7.10.2