mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-04 08:55:51 +02:00
Don't compute sha1 hash when testing
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
3f0e4959a1
commit
e49f31fb42
@ -913,7 +913,7 @@ sub compiler {
|
|||||||
#
|
#
|
||||||
# Close, rename and secure the script
|
# Close, rename and secure the script
|
||||||
#
|
#
|
||||||
finalize_script ( $export );
|
finalize_script ( $export, $test );
|
||||||
#
|
#
|
||||||
# And generate the auxilary config file
|
# And generate the auxilary config file
|
||||||
#
|
#
|
||||||
|
@ -2015,12 +2015,13 @@ sub generate_sha1() {
|
|||||||
#
|
#
|
||||||
# Finalize the script file
|
# Finalize the script file
|
||||||
#
|
#
|
||||||
sub finalize_script( $ ) {
|
sub finalize_script( $$ ) {
|
||||||
my $export = $_[0];
|
my ( $export, $test ) = @_;
|
||||||
close $script;
|
close $script;
|
||||||
$script = 0;
|
$script = 0;
|
||||||
|
|
||||||
if ( $file ne '-' ) {
|
if ( $file ne '-' ) {
|
||||||
|
unless ( $test ) {
|
||||||
my $sha1sum = generate_sha1;
|
my $sha1sum = generate_sha1;
|
||||||
my $sha1sum1 = join( '-', 'sha-lh', substr( $sha1sum, 0, 20 ) );
|
my $sha1sum1 = join( '-', 'sha-lh', substr( $sha1sum, 0, 20 ) );
|
||||||
my $sha1sum2 = join( '-', 'sha-rh', substr( $sha1sum, -20 ) );
|
my $sha1sum2 = join( '-', 'sha-rh', substr( $sha1sum, -20 ) );
|
||||||
@ -2033,6 +2034,7 @@ sub finalize_script( $ ) {
|
|||||||
s/g_sha1sum2=/g_sha1sum2=$sha1sum2/;
|
s/g_sha1sum2=/g_sha1sum2=$sha1sum2/;
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rename $tempfile, $file or fatal_error "Cannot Rename $tempfile to $file: $!";
|
rename $tempfile, $file or fatal_error "Cannot Rename $tempfile to $file: $!";
|
||||||
chmod 0700, $file or fatal_error "Cannot secure $file for execute access";
|
chmod 0700, $file or fatal_error "Cannot secure $file for execute access";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user