[otrs-cvs] otrs/bin otrs.CheckModules.pl,1.48,1.49

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/bin
In directory lancelot:/tmp/cvs-serv10090/bin

Modified Files:
	otrs.CheckModules.pl 
Log Message:
Added option to do not show output colors.

Author: cr

Index: otrs.CheckModules.pl
===================================================================
RCS file: /home/cvs/otrs/bin/otrs.CheckModules.pl,v
retrieving revision 1.48
retrieving revision 1.49
diff -2 -u -d -r1.48 -r1.49
--- otrs.CheckModules.pl	15 Jan 2013 20:22:39 -0000	1.48
+++ otrs.CheckModules.pl	15 Jan 2013 21:06:58 -0000	1.49
@@ -481,8 +481,14 @@
 }
 
+my $Options = shift || '';
+my $NoColors;
+if ( $Options =~ m{\A nocolors}msxi ) {
+    $NoColors = 1;
+}
+
 # try to determine module version number
 my $Depends = 0;
 for my $Module (@NeededModules) {
-    _Check( $Module, $Depends );
+    _Check( $Module, $Depends, $NoColors );
 }
 
@@ -490,5 +496,5 @@
 
 sub _Check {
-    my ( $Module, $Depends ) = @_;
+    my ( $Module, $Depends, $NoColors ) = @_;
 
     print "  " x ( $Depends + 1 );
@@ -551,8 +557,18 @@
 
         if ($ErrorMessage) {
-            print color('red') . "FAILED!" . color('reset') . " $ErrorMessage\n";
+            if ($NoColors) {
+                print "FAILED! $ErrorMessage\n";
+            }
+            else {
+                print color('red') . "FAILED!" . color('reset') . " $ErrorMessage\n";
+            }
         }
         else {
-            print color('green') . "ok" . color('reset') . " (v$Version)\n";
+            if ($NoColors) {
+                print "ok (v$Version)\n";
+            }
+            else {
+                print color('green') . "ok" . color('reset') . " (v$Version)\n";
+            }
         }
     }
@@ -568,10 +584,15 @@
             $Required = 'optional';
         }
-        print color($Color) . "Not installed!" . color('reset') . " ($Required - $Comment)\n";
+        if ($NoColors) {
+            print "Not installed! ($Required - $Comment)\n";
+        }
+        else {
+            print color($Color) . "Not installed!" . color('reset') . " ($Required - $Comment)\n";
+        }
     }
 
     if ( $Module->{Depends} ) {
         for my $ModuleSub ( @{ $Module->{Depends} } ) {
-            _Check( $ModuleSub, $Depends + 1 );
+            _Check( $ModuleSub, $Depends + 1, $NoColors );
         }
     }
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.