| … | |
… | |
| 75 | ## pg file. |
75 | ## pg file. |
| 76 | ## |
76 | ## |
| 77 | |
77 | |
| 78 | sub get_library_sets { |
78 | sub get_library_sets { |
| 79 | my $top = shift; my $dir = shift; |
79 | my $top = shift; my $dir = shift; |
| 80 | my @lis = readDirectory($dir); my @pgdirs; |
80 | # ignore directories that give us an error |
|
|
81 | my @lis = eval { readDirectory($dir) }; |
|
|
82 | if ($@) { |
|
|
83 | warn $@; |
|
|
84 | return (0); |
|
|
85 | } |
| 81 | return (0) if grep /^=library-ignore$/, @lis; |
86 | return (0) if grep /^=library-ignore$/, @lis; |
| 82 | |
87 | |
|
|
88 | my @pgdirs; |
|
|
89 | |
| 83 | my $pgcount = scalar(grep { m/\.pg$/ and (not m/(Header|-text)\.pg$/) and -f "$dir/$_"} @lis); |
90 | my $pgcount = scalar(grep { m/\.pg$/ and (not m/(Header|-text)\.pg$/) and -f "$dir/$_"} @lis); |
| 84 | my $others = scalar(grep { (!m/\.pg$/ || m/(Header|-text)\.pg$/) && |
91 | my $others = scalar(grep { (!m/\.pg$/ || m/(Header|-text)\.pg$/) && |
| 85 | !m/(\.(tmp|bak)|~)$/ && -f "$dir/$_" } @lis); |
92 | !m/(\.(tmp|bak)|~)$/ && -f "$dir/$_" } @lis); |
| 86 | |
93 | |
| 87 | my @dirs = grep {!$ignoredir{$_} and -d "$dir/$_"} @lis; |
94 | my @dirs = grep {!$ignoredir{$_} and -d "$dir/$_"} @lis; |