Hello,

Just checked in a new framework for sanity check. This new framework allows to 
remove all the rpm based commands that are still in the install_cluster 
script.
Typically, the framework checks the basic configuration of the local 
repository and the perl-qt version. For that, the framework has two  
components: one for RPM based Linux distributions and one for Deb based Linux 
distributions (therefore the Sanity_Check framework should work with all the 
current supported Linux distributions).
With that framework, install_cluster should not be based on a specific binary 
package format, which will ease the port to new platforms (debian in my 
case).

In order to ease the development and the maintenance of OCA frameworks, I also 
checked in a debugger mechanism (lib/OSCAR/OCA/Debugger.pm). This file is 
based on Logger.pm; two functions are available: oca_debug_section() and 
oca_debug_subsection(). If the environment variable OCA_DEBUG is set to 
"y" (export OCA_DEBUG="y"), debugging messages are printed.
If you want to use the debugging functions, just add "use 
OSCAR::OCA::Debugger;" in your files.

Furthermore. the Sanity_Check framework is _not_ currently active, if you want 
to use the framework, apply the following patch:

Index: install_cluster
===================================================================
--- install_cluster     (revision 4383)
+++ install_cluster     (working copy)
@@ -35,6 +35,7 @@
 use vars qw($VERSION);
 use OSCAR::Logger;
 use OSCAR::OCA::OS_Detect;
+use OSCAR::OCA::Sanity_Check;
 use POSIX;
 use Carp;
 use File::Basename;
@@ -192,19 +193,12 @@

 system("chmod 755 packages/*/scripts/*");

-my $pqtv = `rpm -q --quiet --qf '%{VERSION}' perl-Qt 2>/dev/null`;
-if ( $pqtv && $pqtv < 3 ) {
-  !system("rpm -e perl-Qt") or warn("Couldn't remove perl-Qt");
-  oscar_log_subsection("Removing installed perl-Qt RPM because version is < 
3");
+my $check_ret = OSCAR::OCA::Sanity_Check::open();
+if (!$check_ret) {
+    print("ERROR: This is an unsupported system or the sanity check failed!
\n");
+        die("Cannot continue");
 }

-# get rid of installed tftp-server, it conflicts with atftp
-# (there should be a check whether this is an RPM based distro here!)
-if (!system("rpm -q tftp-server >/dev/null 2>&1")) {
-  oscar_log_subsection("Removing installed tftp-server RPM, this conflicts 
with OSCAR atftp-server");
-  !system("rpm -e tftp-server") or warn("Couldn't remove tftp-server");
-}
-
 # TJN (10/4/2005): Note, a fairly evil, totally non-obvious issue
 #    occurs if you have /tftpboot setup as a symlink,
 #    e.g., /tftpboot -> /var/tftpboot/,  and remove 'tftp-server'.
===================================================================

Any comments are welcome! :-)

Thanks,
-- 
Geoffroy Vallee


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Oscar-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to