[svn-commits] tzafrir: branch tools/tzafrir/sysfs r8750 - /tools/team/tzafrir/sysfs/xpp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 3 18:07:34 CDT 2010


Author: tzafrir
Date: Thu Jun  3 18:07:31 2010
New Revision: 8750

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8750
Log:
Add '-H' option to dahdi_spanmap

Modified:
    tools/team/tzafrir/sysfs/xpp/dahdi_spanmap

Modified: tools/team/tzafrir/sysfs/xpp/dahdi_spanmap
URL: http://svnview.digium.com/svn/dahdi/tools/team/tzafrir/sysfs/xpp/dahdi_spanmap?view=diff&rev=8750&r1=8749&r2=8750
==============================================================================
--- tools/team/tzafrir/sysfs/xpp/dahdi_spanmap (original)
+++ tools/team/tzafrir/sysfs/xpp/dahdi_spanmap Thu Jun  3 18:07:31 2010
@@ -24,11 +24,13 @@
 }
 
 my %opts;
-getopts('', \%opts) || usage;
+getopts('H', \%opts) || usage;
 @ARGV == 0 or usage;
 
 my @devices = Dahdi::Hardware->device_list;
 my @spans = Dahdi::spans;
+my %seen_hardware;
+my %seen_location;
 
 my $format = "%-3s %-18s %-15s %-18s %-25s %-10s %s\n";
 
@@ -37,9 +39,12 @@
 	my $alias = $span->alias || '-';
 	my $hardware_id = $span->hardware_id || '-';
 	my $location = $span->location || '-';
+	next if $opts{'H'} and ($seen_hardware{$hardware_id} or $seen_location{$location});
 	printf $format,
 		(0+$span->num), $span->name, $alias, $hardware_id, $location,
 		$span->span_id, $span->spantype;
+	$seen_hardware{$hardware_id}++;
+	$seen_location{$location}++;
 }
 
 __END__




More information about the svn-commits mailing list