diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2011-10-04 22:01:30 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2011-10-04 22:01:30 +0200 |
commit | ed169177fbfd1fedb0750f3ba18737aba5596451 (patch) | |
tree | 4410859c72a75d3ca453521b881d0d40456e2749 /mktar.pl | |
parent | 168c94858d20f79247aad40daf2c54cd54182565 (diff) | |
download | screen-ed169177fbfd1fedb0750f3ba18737aba5596451.tar.gz |
Imported Upstream version 4.0.3+git201108019upstream/4.0.3+git201108019
Diffstat (limited to 'mktar.pl')
-rwxr-xr-x | mktar.pl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mktar.pl b/mktar.pl new file mode 100755 index 0000000..79b1731 --- /dev/null +++ b/mktar.pl @@ -0,0 +1,44 @@ +#! /usr/bin/perl -w +# +# create a tar ball snapshot from cvs repository. +# +# 2005-12-15, jw +# + +use Data::Dumper; + +my $srcdir = 'src'; +my $version_file = "$srcdir/patchlevel.h"; +my %symlinks = +( + 'FAQ' => 'doc/FAQ', + 'doc/install.sh' => '../install.sh' +); + +for my $l (keys %symlinks) + { + my $ll = "$srcdir/$l"; + next if -l $ll; + print "replacing $ll with a symlink to $symlinks{$l}\n"; + unlink $ll; + symlink $symlinks{$l}, $ll; + } + +my %version; +open IN, "<", $version_file or die "unable to read $version_file: $!"; +while (defined(my $line = <IN>)) + { + $version{$1} = (defined $3) ? $3 : $4 if $line =~ m{^#\s*define\s+(\w+)\s+("([^"]*)"|(\S+))}; + } +close IN; + +my $version = "$version{REV}.$version{VERS}.$version{PATCHLEVEL}"; +my $tmpdir = "/tmp/mktar-$^T"; +mkdir $tmpdir or die "cannot mkdir $tmpdir: $!"; +system "cp -a $srcdir $tmpdir" and die "'cp -a $srcdir $tmpdir' failed: $!"; +rename "$tmpdir/$srcdir", "$tmpdir/screen-$version" or die "rename to screen-$version failed: $!"; + +system "tar zcf - -C $tmpdir > screen-$version.tar.gz screen-$version"; +system "rm -rf $tmpdir"; + +print "screen-$version.tar.gz written.\n"; |