-my $has_man1dir = $opts{man1dir} ne '' && -d $opts{man1dir};
-my $fh = open_or_die('utils.lst');
-while (<$fh>) {
- next if /^#/;
- chomp;
- my ($path, $leaf) = m|^(\S*/(\S+))|;
- # Have we already installed the manpage for this? (eg perldoc)
- next if $man1{$leaf};
- pod2man({$leaf, $path}, $opts{man1dir}, $opts{man1ext});
- if ($has_man1dir) {
- if (my ($link) = m|#.*link\s*=\s*\S+/(\S+)|) {
- my $old = "$opts{man1dir}/$leaf.$opts{man1ext}";
- my $new = "$opts{man1dir}/$link.$opts{man1ext}";
- unlink($new);
- link($old, $new);
- $old =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
- $new =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
- $packlist->{$new} = { from => $old, type => 'link' };
+if ($opts{man1dir} ne '') {
+ my $has_man1dir = -d $opts{man1dir};
+ my $fh = open_or_die('utils.lst');
+ while (<$fh>) {
+ next if /^#/;
+ chomp;
+ my ($path, $leaf) = m|^(\S*/(\S+))|;
+ # Have we already installed the manpage for this? (eg perldoc)
+ next if $man1{$leaf};
+ pod2man({$leaf, $path}, $opts{man1dir}, $opts{man1ext});
+ if ($has_man1dir) {
+ if (my ($link) = m|#.*link\s*=\s*\S+/(\S+)|) {
+ my $old = "$opts{man1dir}/$leaf.$opts{man1ext}";
+ my $new = "$opts{man1dir}/$link.$opts{man1ext}";
+ unlink($new);
+ link($old, $new);
+ $old =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ $new =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ $packlist->{$new} = { from => $old, type => 'link' };
+ }