qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/tools/qsoslint qsoslint


From: Goneri Le Bouder
Subject: [Qsos-commits] qsos/tools/qsoslint qsoslint
Date: Fri, 10 Nov 2006 22:37:20 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Changes by:     Goneri Le Bouder <goneri>       06/11/10 22:37:20

Modified files:
        tools/qsoslint : qsoslint 

Log message:
        now qsoslint can be called from anywhere and is able to find it's plugin
        some warnings hidded

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/tools/qsoslint/qsoslint?cvsroot=qsos&r1=1.2&r2=1.3

Patches:
Index: qsoslint
===================================================================
RCS file: /sources/qsos/qsos/tools/qsoslint/qsoslint,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- qsoslint    18 Apr 2006 09:47:55 -0000      1.2
+++ qsoslint    10 Nov 2006 22:37:20 -0000      1.3
@@ -1,16 +1,19 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
-use Data::Dumper;
+#use Data::Dumper;
 use QSOS::Document;
 use utf8;
 use encoding 'utf8';
 use File::Glob ':glob';
+use FindBin;
+
 
 ### Global vars
 
-my @plugin_dirs = ("plugins/", "/usr/share/qsoslint/plugins/", 
"/usr/local/share/qsoslint/plugins/");
+my @plugin_dirs = ("$FindBin::Bin/plugins/", "/usr/share/qsoslint/plugins/", 
"/usr/local/share/qsoslint/plugins/");
 
 
 #####
@@ -55,9 +58,11 @@
 my @err;
 my @warn;
 foreach my $plugin (@plugins_list) {
+  no strict;
   if (!eval ("require (\"$plugin\")")) {
-    print "problem with $plugin: $@" if $@;
+    print "failed to loads `$plugin'". (address@hidden": $@":"");
   }
+  use strict;
   my $ret = check($file,$qsos);
   if (defined ($ret->{err}) && @{$ret->{err}}) {
     push @err, @{$ret->{err}};
@@ -66,8 +71,11 @@
     push @err, @{$ret->{warn}};
   } 
 }
-
+no warnings;
+exit 0 unless (@warn,@err);
+use warnings;
 print scalar @err." error(s)\n";
 print "-\t$_\n" foreach (@err);
 print scalar @warn." warning(s)\n";
 print "-\t$_\n" foreach (@warn);
+exit 1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]