SOURCES: tccs - hopefully fixed units recalculation as suggested by Adrian ...

gotar gotar at pld-linux.org
Wed May 21 01:12:48 CEST 2008


Author: gotar                        Date: Tue May 20 23:12:48 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- hopefully fixed units recalculation as suggested by Adrian Ban; that's
  supposed to be compliant with http://physics.nist.gov/cuu/Units/binary.html
- prevent error messages when no tccs.rc file or any data in stream are found

---- Files affected:
SOURCES:
   tccs (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/tccs
diff -u SOURCES/tccs:1.5 SOURCES/tccs:1.6
--- SOURCES/tccs:1.5	Mon May 19 09:51:16 2008
+++ SOURCES/tccs	Wed May 21 01:12:43 2008
@@ -1,6 +1,6 @@
 #!/usr/bin/perl -w
 
-# copyright gotar <gotar at pld-linux.org>, 2005
+# copyright 2005-2008 Tomasz Pala <gotar at pld-linux.org>
 # license: GPL
 
 #use strict;
@@ -21,7 +21,7 @@
 my $speedlevel=0;
 my %translate;
 
-eval `cat tccs.rc`;
+eval `cat tccs.rc 2>/dev/null`;
 
 GetOptions('recurse=s'=>\$recurse,
 		'fastest=s'=>\$speedlevel);
@@ -48,10 +48,17 @@
 	}
 	if(/^ rate (\S+)(bit|bps) /) {
 		# print "BPS rate!\n" if $2 eq "bps";
+	if ($2 eq "bps") {
 		($crate=$1)=~s/K/*1024/;
 		$crate=~s/M/*1024*1024/;
 		$crate=eval $crate;
 		$crate*=8/1000;
+	} else {
+		($crate=$1)=~s/K/*1000/;
+		$crate=~s/M/*1000*1000/;
+		$crate=eval $crate;
+		$crate/=1000;
+	}
 		next;
 	}
 	if(/^class (\S+) (\S+:\S+) (root|parent (\S+:\S+)) .*rate (\S+) ceil (\S+)/) {
@@ -103,6 +110,8 @@
 
 #@{$tree{'root'}}[0]="\n";
 #list('root');
+if(defined $tree{'root'}) {
 foreach (sort {my_sort($a,$b)} (@{$tree{'root'}})) {
 	list($_);
 }
+}
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/tccs?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list