The bug lies in the process_directory - method of the apt-mirror script. It is called recursively for every subdirectory while using a global DIRHANDLE so the DIRHANDLE of the parent directories always gets overwritten and so the closedir() call tries to close a subdirectory which has already been closed :D
I have created a little patch for the apt-mirror 0.4.5-1ubuntu1 package:
The bug lies in the process_directory - method of the apt-mirror script. It is called recursively for every subdirectory while using a global DIRHANDLE so the DIRHANDLE of the parent directories always gets overwritten and so the closedir() call tries to close a subdirectory which has already been closed :D
I have created a little patch for the apt-mirror 0.4.5-1ubuntu1 package:
528a529,530 $dirhandle) ) {
> my $dirhandle;
>
530,531c532,533
< opendir(DIR, $dir) or die "apt-mirror: can't opendir $dir: $!";
< foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir(DIR)) {
---
> opendir($dirhandle, $dir) or die "apt-mirror: can't opendir $dir: $!";
> foreach (grep { !/^\.$/ && !/^\.\.$/ } readdir(
537c539
< closedir DIR;
---
> closedir $dirhandle;
Maybe that helps to get the bug fixed :D