[Mageia-sysadm] [339] - add switches to have a less verbose module

root at mageia.org root at mageia.org
Tue Jan 25 01:40:32 CET 2011


Revision: 339
Author:   misc
Date:     2011-01-25 01:40:32 +0100 (Tue, 25 Jan 2011)
Log Message:
-----------
- add switches to have a less verbose module

Modified Paths:
--------------
    build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm

Modified: build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm
===================================================================
--- build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm	2011-01-22 14:49:03 UTC (rev 338)
+++ build_system/mdv-youri-core/trunk/lib/Youri/Repository/Mageia_upload.pm	2011-01-25 00:40:32 UTC (rev 339)
@@ -326,7 +326,7 @@
 
     # if have section already, check if it exists, and may return immediately
     if ($section) {
-	print "Using requested section $section\n";
+	print "Using requested section $section\n" if $self->{_verbose};
 	if ($media->{$arch}{$section}) { 
 	    return $section
 	} else {
@@ -374,7 +374,7 @@
     # first try to find section for the specific version, as it is possibly already there;
     # this is the case for when called in Youri::Submit::Action::Archive, to find the
     # section the package got installed
-    print "Looking for package $name with version $version-$release\n";
+    print "Looking for package $name with version $version-$release\n" if $self->{_verbose};
     foreach my $m (keys %{$media->{$arch}}) {
         print " .. section '$m' path '".$media->{$arch}{$m}."'\n" if $self->{_verbose};
         # - prefer source for non-debug packages, use binary if there is no source media configured
@@ -429,7 +429,7 @@
     # next time we don't need to search everything again
     $self->{packages}{$file}{section} = $section;
 
-    print "Section is '$section'.\n";
+    print "Section is '$section'.\n" if $self->{_verbose};
 
     return $section;
 }
@@ -453,7 +453,7 @@
 		    s/^\@\d+://;
 		    return if ! /^$pattern/; 
 		    return if /\.info$/; 
-		    print "Find $_\n"; 
+		    print "Find $_\n" if $self->{_verbose} > 1; 
 		    push @packages, $File::Find::name if $package->check_ranges_compatibility("== $name", "< $_")
 		}, $path);
 	}
@@ -472,7 +472,7 @@
 
     my $svn_entry = $ctx->ls("$self->{_svn}/$srpm_name", 'HEAD', 0);
     if ($svn_entry) {
-	print "Package $srpm_name is in the SVN\n";
+	print "Package $srpm_name is in the SVN\n" if $self->{_verbose};
 	return 1
     }
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/mageia-sysadm/attachments/20110125/379893a4/attachment.html>


More information about the Mageia-sysadm mailing list