[LON-CAPA-cvs] cvs: loncom /configuration Checksumming.pm

raeburn raeburn at source.lon-capa.org
Sat Feb 20 15:58:59 EST 2016


raeburn		Sat Feb 20 20:58:59 2016 EDT

  Modified files:              
    /loncom/configuration	Checksumming.pm 
  Log:
  - Use Digest::SHA for all distros.
  
  
Index: loncom/configuration/Checksumming.pm
diff -u loncom/configuration/Checksumming.pm:1.6 loncom/configuration/Checksumming.pm:1.7
--- loncom/configuration/Checksumming.pm:1.6	Sat Jun 29 16:59:09 2013
+++ loncom/configuration/Checksumming.pm	Sat Feb 20 20:58:59 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Checksum installed LON-CAPA modules and some configuration files
 #
-# $Id: Checksumming.pm,v 1.6 2013/06/29 16:59:09 raeburn Exp $
+# $Id: Checksumming.pm,v 1.7 2016/02/20 20:58:59 raeburn Exp $
 #
 # The LearningOnline Network with CAPA
 #
@@ -34,6 +34,7 @@
 use lib '/home/httpd/lib/perl/';
 use Apache::lonlocal();
 use Apache::loncommon();
+use Digest::SHA;
 
 sub get_checksums {
     my ($distro,$londaemons,$lonlib,$lonincludes,$lontabdir) = @_;
@@ -62,12 +63,8 @@
     }
     push(@paths,('/home/httpd/cgi-bin/*.pl','/home/httpd/cgi-bin/*.png'));
     my $confdir = '/etc/httpd/conf';
-    my $sha = 'SHA1';
     if ($distro =~ /^(ubuntu|debian)(\d+)$/) {
         $confdir = '/etc/apache2';
-        if (($1 eq 'ubuntu') && ($2 >= 12)) {
-            $sha = 'SHA';
-        }
     } elsif ($distro =~ /^sles(\d+)$/) {
         if ($1 >= 10) {
             $confdir = '/etc/apache2';
@@ -78,11 +75,6 @@
         }
     }
     push(@paths,("$confdir/loncapa_apache.conf","$confdir/startup.pl"));
-    if ($sha eq 'SHA1') {
-        require Digest::SHA1;
-    } else {
-        require Digest::SHA;
-    }
     if (@paths) {
         my $pathstr = join (' ', at paths);
         if (open($dirh,"grep '$revtag' $pathstr 2>&1 |")) {
@@ -98,12 +90,7 @@
             my $sum;
             if (open(my $fh,"<$key")) {
                 binmode $fh;
-                my $sha_obj;
-                if ($sha eq 'SHA') {
-                    $sha_obj = Digest::SHA->new();
-                } else {
-                    $sha_obj = Digest::SHA1->new();
-                }
+                my $sha_obj = Digest::SHA->new();
                 $sha_obj->addfile($fh);
                 $sum = $sha_obj->hexdigest;
                 close($fh);




More information about the LON-CAPA-cvs mailing list