-
Notifications
You must be signed in to change notification settings - Fork 3
/
mkdist
41 lines (32 loc) · 1.21 KB
/
mkdist
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
#!/usr/bin/perl
use strict;
use warnings;
my $CVSROOT = ":pserver:anoncvs\@cvs.webwork.rochester.edu:/webwork/cvs/system";
unless (@ARGV == 1) {
print STDERR "Usage: $0 version\n";
exit 1;
}
my $vers = $ARGV[0];
my ($maj, $min, $patch) = split /\./, $vers;
my $release_tag = "rel-$maj-$min-$patch";
my $branch_tag = "rel-$maj-$min-dev";
my $version_suffix = "-$vers";
my %modules = (
webwork2 => "webwork$version_suffix",
pg => "pg$version_suffix",
);
sub call_system($) {
warn "SYSTEM: $_[0]\n";
system $_[0];
}
foreach my $module (keys %modules) {
my $checkout_dir = $modules{$module};
call_system qq#cvs -d "$CVSROOT" checkout -r "$release_tag" -d "$checkout_dir" "$module"#;
call_system qq#cd "$checkout_dir" && find . -regex '.*/CVS/\\(Tag\\|Entries\\)' -print0 | xargs -0 perl -pi -e 's/$release_tag\$/$branch_tag/'#;
call_system qq#tar -czf "$checkout_dir".tar.gz "$checkout_dir"#;
call_system qq#tar -cjf "$checkout_dir".tar.bz2 "$checkout_dir"#;
# call_system qq#ftp -a -u ftp://upload.sf.net/incoming/ "$checkout_dir".tar.gz#;
# call_system qq#ftp -a -u ftp://upload.sf.net/incoming/ "$checkout_dir".tar.bz2#;
}
print "Upload command reminder:\n";
print "ftp -a -u ftp://upload.sf.net/incoming/ *.tar.*\n"