[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Thu Jul 3 10:11:43 EDT 2014


raeburn		Thu Jul  3 14:11:43 2014 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - When parsing dns_checksums/X.Y.Z.tab file (for LON-CAPA version X.Y.Z)
    apply fixup to location of web server config files for Ubuntu/Debian/SuSE. 
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1263 loncom/lonnet/perl/lonnet.pm:1.1264
--- loncom/lonnet/perl/lonnet.pm:1.1263	Wed Jun 25 00:55:26 2014
+++ loncom/lonnet/perl/lonnet.pm	Thu Jul  3 14:11:43 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1263 2014/06/25 00:55:26 raeburn Exp $
+# $Id: lonnet.pm,v 1.1264 2014/07/03 14:11:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -11832,8 +11832,22 @@
 # ------------------------------------------------------Get DNS checksums file
 sub parse_dns_checksums_tab {
     my ($lines,$hashref) = @_;
-    my $machine_dom = &Apache::lonnet::host_domain($perlvar{'lonHostID'});
+    my $lonhost = $perlvar{'lonHostID'};
+    my $machine_dom = &Apache::lonnet::host_domain($lonhost);
     my $loncaparev = &get_server_loncaparev($machine_dom);
+    my $distro = (split(/\:/,&get_server_distarch($lonhost)))[0];
+    my $webconfdir = '/etc/httpd/conf';
+    if ($distro =~ /^(ubuntu|debian)(\d+)$/) {
+        $webconfdir = '/etc/apache2';
+    } elsif ($distro =~ /^sles(\d+)$/) {
+        if ($1 >= 10) {
+            $webconfdir = '/etc/apache2';
+        }
+    } elsif ($distro =~ /^suse(\d+\.\d+)$/) {
+        if ($1 >= 10.0) {
+            $webconfdir = '/etc/apache2';
+        }
+    }
     my ($release,$timestamp) = split(/\-/,$loncaparev);
     my (%chksum,%revnum);
     if (ref($lines) eq 'ARRAY') {
@@ -11842,6 +11856,11 @@
         if ($version eq $release) {  
             foreach my $line (@{$lines}) {
                 my ($file,$version,$shasum) = split(/,/,$line);
+                if ($file =~ m{^/etc/httpd/conf}) {
+                    if ($webconfdir eq '/etc/apache2') {
+                        $file =~ s{^\Q/etc/httpd/conf/\E}{$webconfdir/};
+                    }
+                }
                 $chksum{$file} = $shasum;
                 $revnum{$file} = $version;
             }




More information about the LON-CAPA-cvs mailing list