version 1.26, 2024/07/09 14:18:16
|
version 1.29, 2024/07/31 03:39:20
|
Line 373 if ($dist =~ /^debian(\d+)$/) {
|
Line 373 if ($dist =~ /^debian(\d+)$/) {
|
if ($1 >= 22) { |
if ($1 >= 22) { |
$needs_inputrc_check = 1; |
$needs_inputrc_check = 1; |
} |
} |
} elsif ($dist =~ /^(?:redhat|oracle|alma|rocky|centos-stream)(\d+)$/) { |
} elsif ($dist =~ /^(?:rhes|oracle|alma|rocky|centos)(\d+)(?:|\-stream)$/) { |
if ($1 >= 9) { |
if ($1 >= 9) { |
$needs_inputrc_check = 1; |
$needs_inputrc_check = 1; |
} |
} |
Line 388 if ($needs_inputrc_check) {
|
Line 388 if ($needs_inputrc_check) {
|
if (!-e $bash_www_cnf) { |
if (!-e $bash_www_cnf) { |
system("touch $bash_www_cnf"); |
system("touch $bash_www_cnf"); |
if (open(my $fh,'>',$bash_www_cnf)) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
print $fh "set enable-bracketed-paste off\n"; |
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
|
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
close($fh); |
close($fh); |
} else { |
} else { |
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
warn "**** Error: could not open $bash_www_cnf to add 'set enable-bracketed-paste to off'"; |
Line 399 if ($needs_inputrc_check) {
|
Line 407 if ($needs_inputrc_check) {
|
chown($wwwuid,$wwwgid,$bash_www_cnf); |
chown($wwwuid,$wwwgid,$bash_www_cnf); |
} |
} |
} else { |
} else { |
my ($bracketed_paste_on,$bracketed_paste_off,@preserve); |
my (%bracketed_paste_on,%bracketed_paste_off,@preserve,$condition); |
|
$condition = ''; |
if (open(my $fh,'<',$bash_www_cnf)) { |
if (open(my $fh,'<',$bash_www_cnf)) { |
while (my $line=<$fh>) { |
while (my $line=<$fh>) { |
chomp($line); |
chomp($line); |
|
if ($line =~ /^\$if\s+(\w+)\s*$/) { |
|
if ($1 eq 'R') { |
|
$condition = 'r'; |
|
} elsif ($1 eq 'maxima') { |
|
$condition = 'maxima'; |
|
} else { |
|
$condition = 'other'; |
|
} |
|
} elsif ($line =~ /^\$endif\s*$/) { |
|
$condition = ''; |
|
} |
if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { |
if ($line =~ /^\s*set\s+enable\-bracketed\-paste\s+(off|on)\s*$/) { |
if ($1 eq 'off') { |
if ($1 eq 'off') { |
$bracketed_paste_off = 1; |
if ($condition ne '') { |
|
$bracketed_paste_off{$condition} = 1; |
|
} else { |
|
$bracketed_paste_off{all} = 1; |
|
} |
|
push(@preserve,$line); |
} else { |
} else { |
$bracketed_paste_on = 1; |
if ($condition ne '') { |
|
$bracketed_paste_on{$condition} = 1; |
|
if (($condition eq 'r') || ($condition eq 'maxima')) { |
|
push(@preserve,' set enable-bracketed-paste off'); |
|
} else { |
|
push(@preserve,$line); |
|
} |
|
} else { |
|
$bracketed_paste_on{all} = 1; |
|
push(@preserve,$line); |
|
} |
} |
} |
} else { |
} else { |
push(@preserve,$line); |
push(@preserve,$line); |
Line 415 if ($needs_inputrc_check) {
|
Line 450 if ($needs_inputrc_check) {
|
} |
} |
close($fh); |
close($fh); |
} |
} |
if ($bracketed_paste_on || !$bracketed_paste_off) { |
if (($bracketed_paste_on{r} || $bracketed_paste_on{maxima}) || |
|
(!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r}) && |
|
!exists($bracketed_paste_off{maxima}) && !exists($bracketed_paste_on{maxima}))) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
if (open(my $fh,'>',$bash_www_cnf)) { |
print $fh "set enable-bracketed-paste off\n"; |
|
if (@preserve) { |
if (@preserve) { |
foreach my $entry (@preserve) { |
foreach my $entry (@preserve) { |
print $fh "$entry\n"; |
print $fh "$entry\n"; |
} |
} |
|
if (!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r})) { |
|
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
|
} |
|
if (!exists($bracketed_paste_off{r}) && !exists($bracketed_paste_on{r})) { |
|
print $fh <<'END'; |
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
|
} |
|
} else { |
|
print $fh <<'END'; |
|
$if R |
|
set enable-bracketed-paste off |
|
$endif |
|
|
|
$if maxima |
|
set enable-bracketed-paste off |
|
$endif |
|
END |
} |
} |
close($fh); |
close($fh); |
} else { |
} else { |