scp2 template generation: don't duplicate make's job in the script

it is make's job to determine whether the script should be run
again/whether the prerequisites have been touched since the target
was made. Also the case where the list of languages didn't change
had already been disabled/never was active in the first place

Change-Id: I065faa00162f2d734330b798d9ac17ea47861686
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172736
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
This commit is contained in:
Christian Lohmaier 2024-09-02 11:44:40 +02:00
parent b429507707
commit a444f410e2

View file

@ -32,11 +32,6 @@ if ( !defined $completelangiso_var) {
startup_check();
# if ( "$completelangiso_var" eq "$lastcompletelangiso_var" ) {
# print STDERR "No new languages. Keeping old file\n";
# exit 0;
# }
my @completelangiso = split " +", $completelangiso_var;
open OUTFILE, ">$outfile" or die "$0 ERROR: cannot open $outfile for writing!\n";
@ -147,25 +142,6 @@ sub startup_check
die "Template file \"$infile\" not found!\n";
exit 1;
}
if ( -f "$outfile" ) {
# changed script - run always
return if (stat($0))[9] > (stat("$outfile"))[9] ;
# changed template file - run always
return if (stat($infile))[9] > (stat("$outfile"))[9] ;
open OLDFILE, "$outfile" or die "$0 - ERROR: $outfile exists but isn't readable.\n";
while ( $line = <OLDFILE> ) {
if ( $line =~ /^\/\/.*completelangiso:/ ) {
$lastcompletelangiso_var = $line;
chomp $lastcompletelangiso_var;
$lastcompletelangiso_var =~ s/^\/\/.*completelangiso:\s*//;
last;
}
}
close OLDFILE;
}
}
sub usage