-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-tarballs
executable file
·47 lines (38 loc) · 1.67 KB
/
make-tarballs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
my $RSV_VERSION = "3.7.9";
my $dir = dirname($0);
my @lines = `svn status --show-updates $dir 2>&1`;
# Ignore lines that begin with '?' or 'Status against revision:'
my @bad = grep !/^(\?|Status against revision:)/, @lines;
if(@bad) {
print "Subversion checkout is not up-to-date\n";
print "Lines:\n";
print "@bad";
exit 1;
}
# Form the tarballs
system("cp -r rsv-metrics rsv-metrics-$RSV_VERSION");
system("tar zcf rsv-metrics-$RSV_VERSION.tar.gz `find rsv-metrics-$RSV_VERSION ! -name \*~ ! -name .#\* ! -type d | grep -v '\.svn'`");
system("rm -fr rsv-metrics-$RSV_VERSION");
system("cp -r rsv-core rsv-core-$RSV_VERSION");
# Modify the version in rsv_control.py
my $file = "rsv-core-$RSV_VERSION/lib/python/rsv/rsv_control.py";
open(IN, '<', $file) or die("Can't open rsv_control.py to edit version: $!");
my $contents = join("", <IN>);
close(IN);
$contents =~ s/\@\@VERSION\@\@/$RSV_VERSION/;
open(OUT, '>', $file) or die("Can't open rsv_control.py for writing: $!");
print OUT $contents;
close(OUT);
system("tar zcf rsv-core-$RSV_VERSION.tar.gz `find rsv-core-$RSV_VERSION ! -name \*~ ! -name .#\* ! -type d | grep -v '\.svn'`");
system("rm -fr rsv-core-$RSV_VERSION");
system("cp -r rsv-consumers rsv-consumers-$RSV_VERSION");
system("tar zcf rsv-consumers-$RSV_VERSION.tar.gz `find rsv-consumers-$RSV_VERSION ! -name \*~ ! -name .#\* ! -type d | grep -v '\.svn'`");
system("rm -fr rsv-consumers-$RSV_VERSION");
$dir = "/p/vdt/public/html/upstream/rsv/$RSV_VERSION";
print "Likely installation instructions:\n";
print "\tmkdir $dir\n";
print "\tmv *.tar.gz $dir/\n";