Changeset 8034 in genesis for tools/proxy-8.0/g_list.pl
- Timestamp:
- May 25, 2010, 5:30:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/proxy-8.0/g_list.pl
r7037 r8034 40 40 foreach $dir (sort @tmpdirs) { 41 41 no warnings "once"; 42 if( not exists($removefromnodelist{$dir}) ) 42 my $remove = 0; 43 foreach $pattern (@removefromnodelist) { 44 print $pattern; 45 if ($dir =~ /$pattern/i) { 46 $remove = 1; 47 break; 48 } 49 }; 50 if( $remove == 0 ) 43 51 { 44 52 push(@nodelist, $dir); … … 50 58 use warnings "once"; 51 59 }; 52 return @nodelist; 60 # Looks like magic, but actually just sorting an array, first based on 61 # the Alpha key and next numerics sort on the numeric port 62 return sort { 63 $a =~ m/^([a-zA-Z]+)([0-9]+)$/; $nameA = $1; $numberA = $2; 64 $b =~ m/^([a-zA-Z]+)([0-9]+)$/; $nameB = $1; $numberB = $2; 65 if ($nameA == $nameB) { 66 $numberA <=> $numberB; 67 } else { 68 $nameA cmp $nameB; 69 } } @nodelist; 53 70 } 54 71 … … 158 175 159 176 @dirs = listnodes( ); 160 foreach $dir ( sort@dirs) {177 foreach $dir (@dirs) { 161 178 if( $dir=~/attic/ ) { 162 179 next;
Note:
See TracChangeset
for help on using the changeset viewer.