mirror of https://github.com/openssl/openssl.git
Make generated files read-only
This is an attempt to discouraged manual changes of generated files, as people have done so, just to get their changes over-written next time those files are re-generated. Reference: https://github.com/openssl/openssl/discussions/28269 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/28612)
This commit is contained in:
parent
60c4feacce
commit
da9fd71ab6
|
@ -950,7 +950,9 @@ EOF
|
||||||
} elsif (-f $inprologue) {
|
} elsif (-f $inprologue) {
|
||||||
my $local_scripture .= <<"EOF";
|
my $local_scripture .= <<"EOF";
|
||||||
$outprologue : $inprologue
|
$outprologue : $inprologue
|
||||||
|
IF F$SEARCH("$outprologue") .EQS. "" SET FILE/PROT=(O:RWD) $outprologue
|
||||||
COPY $inprologue $outprologue
|
COPY $inprologue $outprologue
|
||||||
|
SET FILE/PROT=(O:RD) $outprologue
|
||||||
EOF
|
EOF
|
||||||
$includefile_cache{$outprologue} = $local_scripture;
|
$includefile_cache{$outprologue} = $local_scripture;
|
||||||
|
|
||||||
|
@ -962,7 +964,9 @@ EOF
|
||||||
} elsif (-f $inepilogue) {
|
} elsif (-f $inepilogue) {
|
||||||
my $local_scripture .= <<"EOF";
|
my $local_scripture .= <<"EOF";
|
||||||
$outepilogue : $inepilogue
|
$outepilogue : $inepilogue
|
||||||
|
IF F$SEARCH("$outepilogue") .EQS. "" SET FILE/PROT=(O:RWD) $outepilogue
|
||||||
COPY $inepilogue $outepilogue
|
COPY $inepilogue $outepilogue
|
||||||
|
SET FILE/PROT=(O:RD) $outepilogue
|
||||||
EOF
|
EOF
|
||||||
$includefile_cache{$outepilogue} = $local_scripture;
|
$includefile_cache{$outepilogue} = $local_scripture;
|
||||||
|
|
||||||
|
@ -1116,7 +1120,9 @@ EOF
|
||||||
|
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$args{src} : $gen0 $deps
|
$args{src} : $gen0 $deps
|
||||||
|
IF F$SEARCH("\$\@") .EQS. "" SET FILE/PROT=(O:RWD) \$\@
|
||||||
\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
|
\$(PERL)$perlmodules $dofile "-o$target{build_file}" $gen0$gen_args > \$\@
|
||||||
|
SET FILE/PROT=(O:RD) \$\@
|
||||||
$decc_include_scripture
|
$decc_include_scripture
|
||||||
EOF
|
EOF
|
||||||
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
||||||
|
@ -1479,10 +1485,11 @@ EOF
|
||||||
rel2abs($config{builddir}));
|
rel2abs($config{builddir}));
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$script : $sources configdata.pm
|
$script : $sources configdata.pm
|
||||||
\$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
|
IF F$SEARCH("$script") .EQS. "" SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
|
||||||
|
\$(PERL) "-I\$(BLDDIR)" "-Mconfigdata" $dofile -
|
||||||
"-o$target{build_file}" $sources > $script
|
"-o$target{build_file}" $sources > $script
|
||||||
SET FILE/PROT=(S:RWED,O:RWED,G:RE,W:RE) $script
|
SET FILE/PROT=(S:RWED,O:RE,G:RE,W:RE) $script
|
||||||
PURGE $script
|
PURGE $script
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
"" # Important! This becomes part of the template result.
|
"" # Important! This becomes part of the template result.
|
||||||
|
|
|
@ -1683,7 +1683,9 @@ EOF
|
||||||
|
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$args{src}: $gen0 $deps
|
$args{src}: $gen0 $deps
|
||||||
|
if [ -r "\$@" ]; then chmod u+w \$@; fi
|
||||||
\$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args > \$@
|
\$(PERL)$perlmodules "$dofile" "-o$target{build_file}" $gen0$gen_args > \$@
|
||||||
|
chmod a-w \$@
|
||||||
EOF
|
EOF
|
||||||
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
||||||
#
|
#
|
||||||
|
@ -2040,10 +2042,11 @@ EOF
|
||||||
rel2abs($config{builddir}));
|
rel2abs($config{builddir}));
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$script: $sources configdata.pm
|
$script: $sources configdata.pm
|
||||||
|
if [ -r "$script" ]; then chmod u+w $script; fi
|
||||||
\$(RM) "$script"
|
\$(RM) "$script"
|
||||||
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
\$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
||||||
"-o$target{build_file}" $sources > "$script"
|
"-o$target{build_file}" $sources > "$script"
|
||||||
chmod a+x $script
|
chmod a+x,a-w $script
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
sub generatedir {
|
sub generatedir {
|
||||||
|
|
|
@ -845,7 +845,9 @@ EOF
|
||||||
|
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$args{src}: "$gen0" $deps
|
$args{src}: "$gen0" $deps
|
||||||
|
if exist \$@ attrib -r \$@
|
||||||
"\$(PERL)"$perlmodules "$dofile" "-o$target{build_file}" "$gen0"$gen_args > \$@
|
"\$(PERL)"$perlmodules "$dofile" "-o$target{build_file}" "$gen0"$gen_args > \$@
|
||||||
|
attrib +r \$@
|
||||||
EOF
|
EOF
|
||||||
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
} elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
|
||||||
#
|
#
|
||||||
|
@ -1054,8 +1056,10 @@ EOF
|
||||||
rel2abs($config{builddir}));
|
rel2abs($config{builddir}));
|
||||||
return <<"EOF";
|
return <<"EOF";
|
||||||
$script: $sources configdata.pm
|
$script: $sources configdata.pm
|
||||||
|
if exist $script attrib -r $script
|
||||||
"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
"\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
|
||||||
"-o$target{build_file}" $sources > \$@
|
"-o$target{build_file}" $sources > \$@
|
||||||
|
attrib +r $script
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
sub generatedir {
|
sub generatedir {
|
||||||
|
|
Loading…
Reference in New Issue