Kaydet (Commit) c17e15a4 authored tarafından Petr Mladek's avatar Petr Mladek

clean up of the code that defines the download file names

Change-Id: I3241801d49673cac33eb923fb986c6ceb2c39503
üst a575f124
...@@ -431,57 +431,64 @@ sub get_download_architecture ...@@ -431,57 +431,64 @@ sub get_download_architecture
} }
######################################################### #########################################################
# Setting the installation type for the download name # Setting the content type for the download name
######################################################### #########################################################
sub get_install_type sub get_download_content
{ {
my ($allvariables) = @_; my ($allvariables) = @_;
my $type = ""; my $content = "";
# content type included in the installer # content type included in the installer
if ( $installer::globals::isrpmbuild ) if ( $installer::globals::isrpmbuild )
{ {
$type .= "rpm"; $content = "rpm";
} }
elsif ( $installer::globals::isdebbuild ) elsif ( $installer::globals::isdebbuild )
{ {
$type .= "deb"; $content = "deb";
} }
elsif ( $installer::globals::packageformat eq "archive" ) elsif ( $installer::globals::packageformat eq "archive" )
{ {
$type .= "archive"; $content = "archive";
} }
$type .= "_" if ($type); return $content;
}
#########################################################
# Setting the functionality type for the download name
#########################################################
sub get_download_functionality
{
my ($allvariables) = @_;
my $functionality = "";
# functionality type
if ( $installer::globals::languagepack ) if ( $installer::globals::languagepack )
{ {
$type .= "langpack"; $functionality = "langpack";
} }
elsif ( $installer::globals::helppack ) elsif ( $installer::globals::helppack )
{ {
$type .= "helppack"; $functionality = "helppack";
} }
elsif ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" ) elsif ( $allvariables->{'POSTVERSIONEXTENSION'} eq "SDK" )
{ {
$type .= "sdk"; $functionality = "sdk";
} }
elsif ( $allvariables->{'POSTVERSIONEXTENSION'} eq "TEST" ) elsif ( $allvariables->{'POSTVERSIONEXTENSION'} eq "TEST" )
{ {
$type .= "test"; $functionality = "test";
} }
elsif ( $allvariables->{'PRODUCTNAME'} eq "URE" ) elsif ( $allvariables->{'PRODUCTNAME'} eq "URE" )
{ {
$type .= "ure"; $functionality = "ure";
} }
# get rid of trailing _ if functionality type was not set return $functionality;
$type =~ s/\_$//;
return $type;
} }
############################################################################################### ###############################################################################################
...@@ -498,21 +505,25 @@ sub set_download_filename ...@@ -498,21 +505,25 @@ sub set_download_filename
my $versionstring = get_download_version($allvariables); my $versionstring = get_download_version($allvariables);
my $platform = get_download_platformname(); my $platform = get_download_platformname();
my $architecture = get_download_architecture(); my $architecture = get_download_architecture();
my $type = get_install_type($allvariables); my $content = get_download_content($allvariables);
my $functionality = get_download_functionality($allvariables);
my $language = get_downloadname_language($languagestringref); my $language = get_downloadname_language($languagestringref);
# Setting the extension happens automatically # Setting the extension happens automatically
my $filename = $start . "_" . $versionstring . "_" . "_" . $platform . "_" . $architecture . "_" . $type . "_" . $language; my $filename = $start . "_" . $versionstring . "_" . $platform . "_" . $architecture . "_" . $content . "_" . $functionality . "_" . $language;
$filename =~ s/\_\_/\_/g; # necessary, if $versionstring or $platform or $language are empty # get rid of duplicit "_" delimiters when some strings are empty
$filename =~ s/\_\s*$//; # necessary, if $language and $addon are empty $filename =~ s/\_\_\_/\_/g;
$filename =~ s/\_\_/\_/g;
$filename =~ s/\_\s*$//;
$installer::globals::ooodownloadfilename = $filename; $installer::globals::ooodownloadfilename = $filename;
return $filename; return $filename;
} }
######################################################### #########################################################
# Creating a tar.gz file # Creating a tar.gz file
######################################################### #########################################################
......
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