Ignore:
Timestamp:
Apr 20, 2014, 11:24:46 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Change interface of mr_file_read_all_link to returning a hash of hash.
  • When recursing with a hash used, declare it with our so it's available correctly at all levels.
  • mr_file_read_all_link now really returns all the links neeed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/MondoRescue/bin/mr-read-all-link

    r3231 r3262  
    1010use Data::Dumper;
    1111use MondoRescue::File;
     12# For pbdebug
     13use ProjectBuilder::Base;
    1214
    1315=pod
     
    5456=cut
    5557
     58$pbdebug = 2 if ((defined $ARGV[0]) && ($ARGV[0] eq "-v"));
    5659
    5760my $file = mr_file_read_all_link(@ARGV) if (defined $ARGV[0]);
    58 
    59 my $verbose = undef;
    60 $verbose = 1 if ((defined $ARGV[0]) && ($ARGV[0] eq "-v"));
     61my %h;
    6162
    6263#print Dumper($file);
    6364
    6465foreach my $f (sort keys %$file) {
    65     print "$f\n" if (defined $verbose);
    66     print "--\n" if (defined $verbose);
     66    print "$f\n" if ($pbdebug >= 1);
     67    print "--\n" if ($pbdebug >= 1);
    6768    #print Dumper($f);
    68     foreach my $l (@{$file->{$f}}) {
    69         print "$l\n";
     69    foreach my $l (sort keys $file->{$f}) {
     70        print "==" if ($pbdebug >= 1);
     71        print "$l\n" if ($pbdebug >= 1);
     72        $h{$l} = 1;
    7073    }
    71     print "--\n" if (defined $verbose);
     74    print "--\n" if ($pbdebug >= 1);
    7275}
     76
     77foreach my $l (sort keys %h) {
     78    print "$l\n";
     79}
Note: See TracChangeset for help on using the changeset viewer.