packaging: remove resolve_variables_in_downloadname
OOODOWNLOADNAME was set in the global section of openoffice.lst, so the code always did set the target path with set_download_filename. Thus remove the superfluous sub and then also the no longer used OOODOWNLOADNAME variables In the same vein: the "script that extracts a tarball that is appended to it" method is no longer in use since many years, delete that as well. Change-Id: I43481a3ec09e064ef77138e1cbfc1dba6854f2d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110017 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
@@ -31,7 +31,6 @@ Globals
|
||||
UPDATE_DATABASE_LISTNAME finals_instsetoo.txt
|
||||
PACKAGEMAP package_names.txt,package_names_ext.txt
|
||||
WINDOWSPATCHLEVEL 8
|
||||
OOODOWNLOADNAME 1
|
||||
64BITPRODUCT @WINDOWS_X64@
|
||||
WINDOWSSDKVERSION @WINDOWS_SDK_VERSION@
|
||||
CRASHDUMPENABLE @DEFAULT_CRASHDUMP_VALUE@
|
||||
@@ -65,7 +64,6 @@ LibreOffice
|
||||
ROOTMODULEGID gid_Module_Root
|
||||
GLOBALPATCHFILEGID gid_File_Txt_Patchfiles
|
||||
SPELLCHECKERFILE spellchecker_selection.txt
|
||||
OOODOWNLOADNAME 1
|
||||
CHANGETARGETDIR 1
|
||||
PATCHCODEFILE ooo_patchcodes.txt
|
||||
STARTCENTER_ADDFEATURE_URL https://extensions.libreoffice.org/
|
||||
@@ -114,7 +112,6 @@ LibreOfficeDev
|
||||
ROOTMODULEGID gid_Module_Root
|
||||
GLOBALPATCHFILEGID gid_File_Txt_Patchfiles
|
||||
SPELLCHECKERFILE spellchecker_selection.txt
|
||||
OOODOWNLOADNAME 1
|
||||
CHANGETARGETDIR 1
|
||||
PATCHCODEFILE ooodev_patchcodes.txt
|
||||
CODEFILENAME codes_ooodev.txt
|
||||
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
# This file incorporates work covered by the following license notice:
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed
|
||||
# with this work for additional information regarding copyright
|
||||
# ownership. The ASF licenses this file to you under the Apache
|
||||
# License, Version 2.0 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
#
|
||||
|
||||
linenum=LINENUMBERPLACEHOLDER
|
||||
|
||||
UNPACKDIR=/var/tmp/unpack_PRODUCTNAMEPLACEHOLDER
|
||||
diskSpaceRequired=DISCSPACEPLACEHOLDER
|
||||
checksum=CHECKSUMPLACEHOLDER
|
||||
|
||||
EXTRACTONLY="no"
|
||||
if [ "$1" = "-x" ]
|
||||
then
|
||||
EXTRACTONLY=yes
|
||||
fi
|
||||
|
||||
# Determining current platform
|
||||
|
||||
platform=`uname -s`
|
||||
|
||||
case $platform in
|
||||
SunOS)
|
||||
tail_prog="tail"
|
||||
;;
|
||||
Linux)
|
||||
tail_prog="tail -n"
|
||||
;;
|
||||
*)
|
||||
tail_prog="tail"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Asking for the unpack directory
|
||||
|
||||
echo
|
||||
echo "Select the directory in which to save the unpacked files. [$UNPACKDIR] "
|
||||
read reply leftover
|
||||
if [ "x$reply" != "x" ]
|
||||
then
|
||||
UNPACKDIR="$reply"
|
||||
fi
|
||||
|
||||
if [ -d $UNPACKDIR ]; then
|
||||
printf "Directory $UNPACKDIR already exists.\n"
|
||||
printf "Please select a new directory name.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Unpacking
|
||||
|
||||
mkdir -m 700 $UNPACKDIR
|
||||
|
||||
diskSpace=`df -k $UNPACKDIR | $tail_prog -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
|
||||
if [ $diskSpace -lt $diskSpaceRequired ]; then
|
||||
printf "The selected drive does not have enough disk space available.\n"
|
||||
printf "PRODUCTNAMEPLACEHOLDER requires at least %s kByte.\n" $diskSpaceRequired
|
||||
exit 1
|
||||
fi
|
||||
|
||||
trap 'rm -rf $UNPACKDIR; exit 1' HUP INT QUIT TERM
|
||||
|
||||
if [ -x /usr/bin/sum ] ; then
|
||||
echo "File is being checked for errors ..."
|
||||
|
||||
sum=`$tail_prog +$linenum $0 | /usr/bin/sum`
|
||||
sum=`echo $sum | awk '{ print $1 }'`
|
||||
|
||||
if [ $sum != $checksum ]; then
|
||||
echo "The download file appears to be corrupted. Please download PRODUCTNAMEPLACEHOLDER again."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Unpacking ..."
|
||||
|
||||
$tail_prog +$linenum $0 | (cd $UNPACKDIR; tar xf -)
|
||||
|
||||
echo "All files have been successfully unpacked."
|
||||
|
||||
if [ "$EXTRACTONLY" != "yes" ]
|
||||
then
|
||||
if [ -f $UNPACKDIR/setup ]
|
||||
then
|
||||
chmod 775 $UNPACKDIR/setup
|
||||
$UNPACKDIR/setup
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -896,8 +896,7 @@ sub run {
|
||||
# Creating directories
|
||||
####################################################
|
||||
|
||||
if ( $allvariableshashref->{'OOODOWNLOADNAME'} ) { installer::download::set_download_filename($languagestringref, $allvariableshashref); }
|
||||
else { installer::download::resolve_variables_in_downloadname($allvariableshashref, "", $languagestringref); }
|
||||
installer::download::set_download_filename($languagestringref, $allvariableshashref);
|
||||
|
||||
$installdir = installer::worker::create_installation_directory($shipinstalldir, $languagestringref, \$current_install_number);
|
||||
|
||||
@@ -1660,8 +1659,7 @@ sub run {
|
||||
if ( $installer::globals::iswindowsbuild )
|
||||
{
|
||||
$create_download = 0;
|
||||
if ( $allvariableshashref->{'OOODOWNLOADNAME'} ) { $$downloadname = installer::download::set_download_filename($languagestringref, $allvariableshashref); }
|
||||
else { $$downloadname = installer::download::resolve_variables_in_downloadname($allvariableshashref, $$downloadname, $languagestringref); }
|
||||
$$downloadname = installer::download::set_download_filename($languagestringref, $allvariableshashref);
|
||||
installer::systemactions::rename_one_file( $finalinstalldir . $installer::globals::separator . $installer::globals::shortmsidatabasename, $finalinstalldir . $installer::globals::separator . $$downloadname . ".msi" );
|
||||
}
|
||||
if (( $is_success ) && ( $create_download ) && ( $ENV{'ENABLE_DOWNLOADSETS'} ))
|
||||
|
||||
@@ -541,48 +541,6 @@ sub create_tar_gz_file_from_directory
|
||||
return $targzname;
|
||||
}
|
||||
|
||||
#########################################################
|
||||
# Setting the variables in the download name
|
||||
#########################################################
|
||||
|
||||
sub resolve_variables_in_downloadname
|
||||
{
|
||||
my ($allvariables, $downloadname, $languagestringref) = @_;
|
||||
|
||||
# Typical name: soa-{productversion}-{extension}-bin-{os}-{languages}
|
||||
|
||||
my $productversion = "";
|
||||
if ( $allvariables->{'PRODUCTVERSION'} ) { $productversion = $allvariables->{'PRODUCTVERSION'}; }
|
||||
$downloadname =~ s/\{productversion\}/$productversion/;
|
||||
|
||||
my $packageversion = "";
|
||||
if ( $allvariables->{'PACKAGEVERSION'} ) { $packageversion = $allvariables->{'PACKAGEVERSION'}; }
|
||||
$downloadname =~ s/\{packageversion\}/$packageversion/;
|
||||
|
||||
my $extension = "";
|
||||
if ( $allvariables->{'PRODUCTEXTENSION'} ) { $extension = $allvariables->{'PRODUCTEXTENSION'}; }
|
||||
$extension = lc($extension);
|
||||
$downloadname =~ s/\{extension\}/$extension/;
|
||||
|
||||
my $os = "";
|
||||
if ( $installer::globals::iswindowsbuild ) { $os = "windows"; }
|
||||
elsif ( $installer::globals::issolarissparcbuild ) { $os = "solsparc"; }
|
||||
elsif ( $installer::globals::issolarisx86build ) { $os = "solia"; }
|
||||
elsif ( $installer::globals::islinuxbuild ) { $os = "linux"; }
|
||||
elsif ( $installer::globals::ismacbuild ) { $os = "macosxx"; }
|
||||
else { $os = ""; }
|
||||
$downloadname =~ s/\{os\}/$os/;
|
||||
|
||||
my $languages = $$languagestringref;
|
||||
$downloadname =~ s/\{languages\}/$languages/;
|
||||
|
||||
$downloadname =~ s/\-\-\-/\-/g;
|
||||
$downloadname =~ s/\-\-/\-/g;
|
||||
$downloadname =~ s/\-\s*$//;
|
||||
|
||||
return $downloadname;
|
||||
}
|
||||
|
||||
##############################################################
|
||||
# Returning the complete block in all languages
|
||||
# for a specified string
|
||||
@@ -701,8 +659,7 @@ sub create_download_sets
|
||||
|
||||
# evaluating the name of the download file
|
||||
|
||||
if ( $allvariableshashref->{'OOODOWNLOADNAME'} ) { $downloadname = set_download_filename($languagestringref, $allvariableshashref); }
|
||||
else { $downloadname = resolve_variables_in_downloadname($allvariableshashref, $downloadname, $languagestringref); }
|
||||
$downloadname = set_download_filename($languagestringref, $allvariableshashref);
|
||||
|
||||
if ( ! $installer::globals::iswindowsbuild ) # Unix specific part
|
||||
{
|
||||
@@ -711,46 +668,7 @@ sub create_download_sets
|
||||
my $usefakeroot = 0;
|
||||
if (( $installer::globals::issolarisbuild ) || ( $installer::globals::islinuxbuild )) { $usefakeroot = 1; }
|
||||
|
||||
if ( $allvariableshashref->{'OOODOWNLOADNAME'} )
|
||||
{
|
||||
my $downloadfile = create_tar_gz_file_from_directory($installationdir, $usefakeroot, $downloaddir, $downloadname);
|
||||
}
|
||||
else
|
||||
{
|
||||
# find and read setup script template
|
||||
my $scriptfilename = $ENV{'SRCDIR'} . "/setup_native/scripts/downloadscript.sh";
|
||||
|
||||
if (! -f $scriptfilename) { installer::exiter::exit_program("ERROR: Could not find script file $scriptfilename!", "create_download_sets"); }
|
||||
my $scriptfile = installer::files::read_file($scriptfilename);
|
||||
|
||||
$infoline = "Found script file $scriptfilename \n";
|
||||
push( @installer::globals::logfileinfo, $infoline);
|
||||
|
||||
# add product name into script template
|
||||
put_productname_into_script($scriptfile, $allvariableshashref);
|
||||
|
||||
# replace linenumber in script template
|
||||
put_linenumber_into_script($scriptfile);
|
||||
|
||||
# create tar file
|
||||
my $temporary_tarfile_name = $downloaddir . $installer::globals::separator . 'installset.tar';
|
||||
my $size = tar_package($installationdir, $temporary_tarfile_name, $usefakeroot);
|
||||
installer::exiter::exit_program("ERROR: Could not create tar file $temporary_tarfile_name!", "create_download_sets") unless $size;
|
||||
|
||||
# calling sum to determine checksum and size of the tar file
|
||||
my $sumout = call_sum($temporary_tarfile_name);
|
||||
|
||||
# writing checksum and size into scriptfile
|
||||
put_checksum_and_size_into_script($scriptfile, $sumout);
|
||||
|
||||
# saving the script file
|
||||
my $newscriptfilename = determine_scriptfile_name($downloadname);
|
||||
$newscriptfilename = save_script_file($downloaddir, $newscriptfilename, $scriptfile);
|
||||
|
||||
installer::logger::print_message( "... including installation set into $newscriptfilename ... \n" );
|
||||
# Append tar file to script
|
||||
include_tar_into_script($newscriptfilename, $temporary_tarfile_name);
|
||||
}
|
||||
my $downloadfile = create_tar_gz_file_from_directory($installationdir, $usefakeroot, $downloaddir, $downloadname);
|
||||
}
|
||||
|
||||
return $downloaddir;
|
||||
|
||||
@@ -530,17 +530,7 @@ sub create_simple_package
|
||||
|
||||
my $locallanguage = $installer::globals::csp_languagestring;
|
||||
|
||||
if ( $allvariables->{'OOODOWNLOADNAME'} )
|
||||
{
|
||||
$packagename = installer::download::set_download_filename(\$locallanguage, $allvariables);
|
||||
}
|
||||
else
|
||||
{
|
||||
$downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "downloadname");
|
||||
if ( $installer::globals::languagepack ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "langpackdownloadname"); }
|
||||
if ( $installer::globals::helppack ) { $downloadname = installer::ziplist::getinfofromziplist($allsettingsarrayref, "helppackdownloadname"); }
|
||||
$packagename = installer::download::resolve_variables_in_downloadname($allvariables, $$downloadname, \$locallanguage);
|
||||
}
|
||||
$packagename = installer::download::set_download_filename(\$locallanguage, $allvariables);
|
||||
}
|
||||
|
||||
# Work around Windows problems with long pathnames (see issue 50885) by
|
||||
|
||||
Reference in New Issue
Block a user