diff options
Diffstat (limited to 'bin/macros/perl-dist')
-rwxr-xr-x | bin/macros/perl-dist | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/bin/macros/perl-dist b/bin/macros/perl-dist index 82d298b..3dd2263 100755 --- a/bin/macros/perl-dist +++ b/bin/macros/perl-dist @@ -334,9 +334,7 @@ sub main my $file = basename($distpath); my $info = distinfo($file); - $dir = catdir($dir, 'src'); - prepsrcdir($dir, $file); - chdir $dir or die "chdir $dir: $!"; + chsrcdir(catdir($dir, 'src'), $file); $dir = extractdist($file); my $meta = loadmeta($dir); @@ -366,18 +364,18 @@ sub main printjam(\%pbvars); } -sub prepsrcdir +# Create the src/ directory and tarball symlink. Then chdir into it. + +sub chsrcdir { my ($srcdir, $distfile) = @_; - unless (-d $srcdir) { - mkdir $srcdir or die "mkdir $srcdir: $!"; - } - - symlink $distfile, catfile($srcdir, $distfile) + mkdir $srcdir or die "mkdir $srcdir: $!"; + chdir $srcdir or die "chdir $srcdir: $!"; + symlink catfile('..', $distfile), $distfile or die "symlink $distfile: $!"; - return; + return $srcdir; } sub envvar |