diff options
author | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-02-06 02:46:44 +0300 |
---|---|---|
committer | Thorvald Natvig <slicer@users.sourceforge.net> | 2010-02-06 02:46:44 +0300 |
commit | a349a0872dc76a83d2f9c9b4b21c5af1dec72e95 (patch) | |
tree | f3c504fc9e12da9135f30f2294fc0611b1b79e63 /scripts/release.pl | |
parent | 3a051894b1dbbe1a366f8660c01707dcaebe6a37 (diff) |
Use symlinks in release tarball
Diffstat (limited to 'scripts/release.pl')
-rw-r--r-- | scripts/release.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/release.pl b/scripts/release.pl index 25849a9c4..aa7e763c3 100644 --- a/scripts/release.pl +++ b/scripts/release.pl @@ -5,10 +5,12 @@ use warnings; use Carp; use Switch; use Archive::Tar; +use Archive::Tar::Constant; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); use Compress::Zlib; use POSIX; use File::Copy; +use File::stat; sub adddir($$) { my ($dir, $ref) = @_; @@ -171,13 +173,17 @@ my $zipdir = $zip->addDirectory($dir); foreach my $file ('LICENSE', sort keys %files) { print "Adding $file\n"; open(F, $file) or croak "Missing $file"; - sysread(F, $blob, 1000000000); + sysread(F, $blob, stat($file)->size); if ($file eq "src/Version.h") { $blob =~ s/(\#ifndef MUMBLE_VERSION)/$1\n\#define MUMBLE_VERSION $ver\n\#endif\n$1/; } - $tar->add_data($dir . $file, $blob); + if (-l $file) { + $tar->add_data($dir . $file, "", { linkname => readlink($file), type => Archive::Tar::Constant::SYMLINK }); + } else { + $tar->add_data($dir . $file, $blob); + } my $zipmember=$zip->addString($blob, $dir . $file); $zipmember->desiredCompressionMethod( COMPRESSION_DEFLATED ); $zipmember->desiredCompressionLevel( 9 ); |