hi,

the attached patch, tries to search /etc/yum.repos.d/ for the oscar repo 
and if it finds such, will inspect the gpgcheck value of the oscar section.

this is in line with our documentation, but may fail for people who have 
named the oscar repo differently.

this is just a suggestion.

kind regards
Thilo
Index: yum-check.pl
===================================================================
--- yum-check.pl	(revision 8678)
+++ yum-check.pl	(working copy)
@@ -38,22 +38,49 @@
 my $rc = SUCCESS;
 
 if ( -f "/etc/yum.conf" ) {
+
+  # Check if the oscar repo has been added to /etc/yum.repos.d
+  my $file;
+  my $value;
+  $file = `grep bison.csm.ornl.gov /etc/yum.repos.d/* | awk -F':' '{print \$1}'`;
+  chomp $file;
+
+  if ($file ne "") {
     # When you want the value of a key, the key name has to follow the AppConfig
     # syntax. It means that to access the key gpgcheck under the main section of
-    # the configuration file, the key name is "main_gpgcheck".
-    my $value = OSCAR::ConfigFile::get_value ("/etc/yum.conf",
+    # the configuration file, the key name is "oscar_gpgcheck".
+    $value = OSCAR::ConfigFile::get_value ($file,
                                               undef,
+                                              "oscar_gpgcheck");
+    if (defined ($value) && $value == 1) {
+        print "----------------------------------------------\n";
+        print " ERROR: Yum configuration is invalid\n";
+        print " The gpgcheck is set to 1, it will be impossible\n";
+        print " to install OSCAR packages.\n";
+        print " Please, set the gpgcheck to 0 (\"gpgcheck=0\" in \n";
+        print "$file).\n";
+        print "----------------------------------------------\n";
+        $rc = FAILURE;
+    }
+     
+  } else {
+    print "WARNING: Could not find oscar repo in /etc/yum.repos.d/\n";
+    print "  Checking /etc/yum.conf\n";
+
+    $value = OSCAR::ConfigFile::get_value ("/etc/yum.conf",
+                                              undef,
                                               "main_gpgcheck");
     if (defined ($value) && $value == 1) {
         print "----------------------------------------------\n";
         print " ERROR: Yum configuration is invalid\n";
-        print " The gpgkey is set to 1, it will be impossible\n";
+        print " The gpgcheck is set to 1, it will be impossible\n";
         print " to install OSCAR packages.\n";
-        print " Please, set the gpgkey to 0 (\"gpgkey=0\" in \n";
+        print " Please, set the gpgcheck to 0 (\"gpgcheck=0\" in \n";
         print "/etc/yum.conf).\n";
         print "----------------------------------------------\n";
         $rc = FAILURE;
     }
+  }
 }
 
 exit ($rc);

Attachment: signature.asc
Description: This is a digitally signed message part.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Oscar-users mailing list
Oscar-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-users

Reply via email to