Diff for /loncom/build/CHECKRPMS between versions 1.16 and 1.17

version 1.16, 2011/12/08 17:22:37 version 1.17, 2017/04/09 14:54:02
Line 43  to LON-CAPA systems. distprobe is used t Line 43  to LON-CAPA systems. distprobe is used t
 The utility which is used to complete the check depends on the distro:  The utility which is used to complete the check depends on the distro:
   
 fedora, rhel >= 5, centos, scientific - yum  fedora, rhel >= 5, centos, scientific - yum
   fedora >= 22 - dnf
 suse 9.X and sles9 - you  suse 9.X and sles9 - you
 suse 10.2,10.3,11.1,11.2,11.3,11.4,sles11 - zypper   suse 10.2,10.3,11.1,11.2,11.3,11.4,sles11 - zypper 
 sles10,suse10.1 - rug  sles10,suse10.1 - rug
Line 92  if ($docroot ne '') { Line 93  if ($docroot ne '') {
 }  }
   
 my ($cmd,$send,$addsubj);  my ($cmd,$send,$addsubj);
 if ($distro =~ /^fedora\d+$/) {  if ($distro =~ /^fedora(\d+)$/) {
     $cmd = 'yum update';      my $version =$1;
     &prepare_msg($tmpfile,$cmd);      if ($version > 21) {
     ($send,$addsubj) = &check_with_yum($tmpfile);          $cmd = 'dnf update';
           &prepare_msg($tmpfile,$cmd);
           ($send,$addsubj) = &check_with_dnf($tmpfile);
       } else {
           $cmd = 'yum update';
           &prepare_msg($tmpfile,$cmd);
           ($send,$addsubj) = &check_with_yum($tmpfile);
       }
 } elsif ($distro =~ /^(suse|sles)9\.?\d?$/) {  } elsif ($distro =~ /^(suse|sles)9\.?\d?$/) {
     $cmd = 'you';      $cmd = 'you';
     &prepare_msg($tmpfile,$cmd);      &prepare_msg($tmpfile,$cmd);
Line 244  sub check_with_yum { Line 252  sub check_with_yum {
     }      }
     return ($sendflag,$append_to_subj);      return ($sendflag,$append_to_subj);
 }  }
   
   sub check_with_dnf {
       my ($tmpfile) = @_;
       my $dnf = '/usr/bin/dnf';
       my $sendflag = 0;
       my $append_to_subj;
   
       #
       # Execute dnf command
       my $command = $dnf.' check-update '.'>>'.$tmpfile;
       system($command);
   
       my $returnvalue = $?>>8;
   
       #
       # Determine status of dnf run
       if (100 == $returnvalue) {
           $sendflag = 1;
           $append_to_subj = ' RPMS to upgrade';
       } elsif (0 != $returnvalue) {
           $sendflag = 1;
           $append_to_subj = ' Error running RPM update script';
       } else {
           # dnf returned 0, so everything is up to date.
       }
       return ($sendflag,$append_to_subj);
   }
   
 sub check_with_up2date {  sub check_with_up2date {
     my ($tmpfile) = @_;      my ($tmpfile) = @_;

Removed from v.1.16  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>