Ticket #7348: firewire_primer.patch

File firewire_primer.patch, 1.7 KB (added by rhpot1991@…, 11 years ago)

Patch to add args

Line 
119,22d18
2< # Modified: 2009-10-16
3< # Modification Author: John Baab (rhpot1991@ubuntu.com)
4< # Modification Description: Added command line args so this will be easier to support in Mythbuntu
5< #
630,40d25
7<     my $retry = 0;
8<     my $connection = "";
9<     my $fw_tester_options = "-B";
10<     
11<     my $usage = "\nHow to use firewire_primer.pl:\n"
12<     ."--connection -c = Type of connection, available options: broadcast, p2p, broadcast-fix.  (default: broadcast-fix)\n"
13<     ."--retry -r = Retry attempts, any integer.  (default: 1)\n"
14<     ."--help -h = Displays Help.\n"
15<     ."\nExamples:\nfirewire_primer.pl --connection=broadcast --retry=5"
16<     ."\nfirewire_primer.pl -c=broadcast -r=5"
17<     ."\nfirewire_primer.pl -cbroadcast -r5\n\n";
1847,76d31
19<     
20< # Get our command line args
21<     foreach (@ARGV){
22<         if ($_ =~ m/\-\-retry=(\d+)/ || $_ =~ m/\-r=?(\d+)/) {
23<             $retry = $1;
24<         }
25<         elsif ($_ =~ m/\-\-connection=(\w+)/ || $_ =~ m/\-c=?(\w+)/) {
26<             $connection = $1;
27<         }
28<         else{
29<             die "$usage";
30<         }
31<     }
32<   
33< # Figure out what to do with the args   
34<     if($connection =~ m/^broadcast$/){
35<         $fw_tester_options = "-b";
36<     }
37<     elsif($connection =~ m/^p2p$/){
38<         $fw_tester_options = "-p";
39<     }
40<     else{
41<         if($connection !~ m/^broadcast\-fix$/  && $connection ne ""){
42<             die "$usage";
43<         }
44<     }
45<     
46<     if($retry > 0){
47<         $fw_tester_options .= " -r $retry";
48<     }
49124c79
50<             my $results = `$firewire_tester $fw_tester_options -P $guid_list{$guid}{host} -n $guid_list{$guid}{node}`;
51---
52>             my $results = `$firewire_tester -B -P $guid_list{$guid}{host} -n $guid_list{$guid}{node}`;