diff options
author | Justin Davis <jrcd83@gmail.com> | 2011-08-16 17:45:10 +0200 |
---|---|---|
committer | Justin Davis <jrcd83@gmail.com> | 2011-08-16 17:45:10 +0200 |
commit | 78d2430cdf857b32451192dcb5a577ec82f0c066 (patch) | |
tree | 7759f587c23ce5be1a8244d1f922e7de10282d4f /bin/macros/perl-dist | |
parent | 99211786100275e502299f58e822c0b5a64300f0 (diff) | |
download | genpkg-78d2430cdf857b32451192dcb5a577ec82f0c066.tar.gz genpkg-78d2430cdf857b32451192dcb5a577ec82f0c066.tar.xz |
Let's avoid creating a symlink to itself...
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 |