[LON-CAPA-cvs] cvs: doc /loncapafiles axe_config_check.piml
raeburn
raeburn at source.lon-capa.org
Mon Aug 17 20:42:18 EDT 2026
raeburn Tue Aug 18 00:42:18 2026 EDT
Modified files:
/doc/loncapafiles axe_config_check.piml
Log:
- Run npm install --ignore-scripts in node.js/axe subdir if lonAxeUse is 'Y'
Index: doc/loncapafiles/axe_config_check.piml
diff -u doc/loncapafiles/axe_config_check.piml:1.9 doc/loncapafiles/axe_config_check.piml:1.10
--- doc/loncapafiles/axe_config_check.piml:1.9 Sun Aug 9 02:13:32 2026
+++ doc/loncapafiles/axe_config_check.piml Tue Aug 18 00:42:18 2026
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/piml.dtd">
<!-- axe_config_check.piml -->
-<!-- $Id: axe_config_check.piml,v 1.9 2026/08/09 02:13:32 raeburn Exp $ -->
+<!-- $Id: axe_config_check.piml,v 1.10 2026/08/18 00:42:18 raeburn Exp $ -->
<!--
@@ -38,19 +38,50 @@
use Cwd;
use POSIX();
+my $distro = '<DIST />';
+my ($dist,$version);
+if ($distro =~ /^centos(\d+)\-stream$/) {
+ $version = $1;
+ $dist = 'centos-stream';
+} else {
+ ($dist,$version) = ($distro =~ /^([A-Za-z]+)([\d\.]+)$/);
+}
+
+my $confdir = '/etc/httpd/conf/';
+if ((($dist eq 'sles') && ($version > 9)) ||
+ (($dist eq 'suse') && ($version >= 10.1)) ||
+ ($dist eq 'debian') || ($dist eq 'ubuntu')) {
+ $confdir = '/etc/apache2/';
+}
+my $filename='loncapa.conf';
+my $lonAxeUse;
+if (-e "$confdir$filename") {
+ if (open(my $fh,'<',$confdir.$filename)) {
+ while (my $configline=<$fh>) {
+ next unless ($configline =~ /lonAxeUse/);
+ if ($configline =~ /^[^\#]*PerlSetVar/) {
+ my ($unused,$varname,$varvalue)=split(/\s+/,$configline);
+ chomp($varvalue);
+ $lonAxeUse=$varvalue if $varvalue!~/^\{\[\[\[\[/;
+ }
+ }
+ close($fh);
+ }
+}
+
+exit unless ($lonAxeUse eq 'Y');
+
my $addexport = 1;
my $wwwuid = getpwnam('www');
my $wwwgid = getgrnam('www');
my $path_to_browser = '/usr/bin/chromium-browser';
-if (('<DIST />' eq 'debian10') || ('<DIST />' eq 'debian11') ||
- ('<DIST />' eq 'debian12') || ('<DIST />' eq 'debian13')) {
+if ($dist eq 'debian') {
$path_to_browser = '/usr/bin/chromium';
-} elsif (('<DIST />' eq 'ubuntu22') || ('<DIST />' eq 'ubuntu24') ||
- ('<DIST />' eq 'ubuntu26')) {
+} elsif (($dist eq 'ubuntu') && ($version >= 22)) {
$path_to_browser = '/usr/bin/google-chrome-stable';
-} elsif ('<DIST />' eq 'sles12') {
+} elsif ($distro eq 'sles12') {
$path_to_browser = '/usr/bin/firefox';
-}
+}
if (-e '/home/www/.bashrc') {
if (open(my $fh,'<','/home/www/.bashrc')) {
More information about the LON-CAPA-cvs
mailing list