Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 117 lines (92 sloc) 3.54 kB
cba15d1 @obra pull this live
obra authored
1 #!/home/rtcpan/perl/bin/perl
2
6458960 @ruz support skipping parts we pull and support git
ruz authored
3 use Getopt::Long;
4
5 my (@skip, @only);
6 GetOptions(
7 "skip=s@" => \@skip,
8 "only=s@" => \@only,
9 );
10
11 sub skip($);
12
cba15d1 @obra pull this live
obra authored
13 my $perl = $ENV{'PERL'} = '/home/rtcpan/perl/bin/perl';
14
472adc0 @ruz update pull script with 3.8 code
ruz authored
15 my $root = $ENV{'RTHOME'} = "/home/rtcpan/rt38";
cba15d1 @obra pull this live
obra authored
16
17 my $rt_opts =
18 " --prefix=$root"
19 ." --with-db-type=mysql"
20 ." --with-db-host=''" # connect via socket
21 ." --with-db-port=3307"
472adc0 @ruz update pull script with 3.8 code
ruz authored
22 ." --with-db-database=rt_cpan_org_38"
23 ." --disable-gpg"
24 ." --with-web-handler=fastcgi-server"
cba15d1 @obra pull this live
obra authored
25 ." --with-web-user=rtcpan"
26 ." --with-web-group=rtcpan";
27
28 use File::Temp qw(tempdir);
29 use File::Path qw(rmtree);
30
31 my @UPDATE = qw{
32 RT-Extension-MergeUsers
33 RT-Authen-Bitcard
34 RT-Authen-PAUSE
35 RT-BugTracker
36 RT-BugTracker-Public
37 RT-Extension-rt_cpan_org
38 RT-Extension-QuickDelete
6458960 @ruz support skipping parts we pull and support git
ruz authored
39 RT-Extension-ReportSpam
cba15d1 @obra pull this live
obra authored
40 RT-Authen-OpenID
472adc0 @ruz update pull script with 3.8 code
ruz authored
41 RT-Extension-Utils
cba15d1 @obra pull this live
obra authored
42 CPAN2RT
43 };
44
45 my %REPOS = (
46 'CPAN2RT' => 'svn://svn.bestpractical.com/CPAN2RT/',
47 'RT-Authen-Bitcard' => 'svn://svn.bestpractical.com/RT-Authen-Bitcard/',
48 'RT-Authen-OpenID' => 'svn://svn.bestpractical.com/RT-Authen-OpenID/',
49 'RT-Authen-PAUSE' => 'svn://svn.bestpractical.com/RT-Authen-PAUSE/',
50 'RT-BugTracker' => 'svn://svn.bestpractical.com/RT-BugTracker/',
51 'RT-BugTracker-Public' => 'svn://svn.bestpractical.com/RT-BugTracker-Public/',
6458960 @ruz support skipping parts we pull and support git
ruz authored
52 'RT-Extension-MergeUsers' => 'git://github.com/bestpractical/rt-extension-mergeusers.git',
cba15d1 @obra pull this live
obra authored
53 'RT-Extension-QuickDelete' => 'svn://svn.bestpractical.com/RT-Extension-QuickDelete/',
54 'RT-Extension-rt_cpan_org' => 'svn://svn.bestpractical.com/RT-Extension-rt_cpan_org/',
6458960 @ruz support skipping parts we pull and support git
ruz authored
55 'RT-Extension-ReportSpam' => 'svn://svn.bestpractical.com/RT-Extension-ReportSpam/',
472adc0 @ruz update pull script with 3.8 code
ruz authored
56 'RT-Extension-Utils' => 'git://github.com/bestpractical/rt-extension-utils.git',
cba15d1 @obra pull this live
obra authored
57 );
58
59 my $tmp_dir = tempdir( CLEAN => 1 )
60 or die "Couldn't get temp dir";
61
62 chdir $tmp_dir;
63
6458960 @ruz support skipping parts we pull and support git
ruz authored
64 unless ( skip 'RT' ) {
65 my $repo = 'git://github.com/bestpractical/rt.git';
66 ($_ = `git clone $repo`)
67 or !$? or die "$_\n\nCouldn't export repo";
472adc0 @ruz update pull script with 3.8 code
ruz authored
68 ($_ = `cd rt && git checkout origin/3.8-trunk && sh ./configure.ac $rt_opts && sudo make install`)
6458960 @ruz support skipping parts we pull and support git
ruz authored
69 or !$? or die "$_\n\nCouldn't upgrade RT";
70 }
cba15d1 @obra pull this live
obra authored
71
72
73 foreach my $module (@UPDATE) {
6458960 @ruz support skipping parts we pull and support git
ruz authored
74 next if skip $module;
75
cba15d1 @obra pull this live
obra authored
76 print "Trying to install $module...\n";
77
78 my $repo = $REPOS{ $module };
79 print "Getting $repo...\n";
6458960 @ruz support skipping parts we pull and support git
ruz authored
80 if ( $repo =~ /^svn/ ) {
cba15d1 @obra pull this live
obra authored
81 ($_ = `svn export --quiet --non-interactive --force $repo $module`)
82 or !$? or die "$_\n\nCouldn't export repo";
6458960 @ruz support skipping parts we pull and support git
ruz authored
83 } else {
84 ($_ = `git clone $repo $module`)
85 or !$? or die "$_\n\nCouldn't export repo";
86 }
cba15d1 @obra pull this live
obra authored
87
88 print "Installing $module...\n";
89 ($_ = `cd $module && $perl ./Makefile.PL && make && sudo make install`)
90 or !$? or die "$_\n\nCouldn't install module";
91
92 rmtree($module);
93 }
94
95 # adjust bugs-per-dist.data and queue-addresses
472adc0 @ruz update pull script with 3.8 code
ruz authored
96 foreach my $path (qw(/local/plugins/RT-Extension-rt_cpan_org/html/Public/bugs-per-dist.data /local/plugins/RT-Extension-rt_cpan_org/html/NoAuth/cpan)) {
cba15d1 @obra pull this live
obra authored
97 my $f = $root . $path;
98 `touch $f` unless -e $f;
2433fc3 @ruz s/queue/distribution/ in exporter
ruz authored
99 ($_ = `chown -R rtcpan:rtcpan $f`)
cba15d1 @obra pull this live
obra authored
100 or !$? or die "$_\n\nCouldn't change owner of '$f'";
101 }
102
472adc0 @ruz update pull script with 3.8 code
ruz authored
103 # clean mason cache
104 ($_ = `rm -fr $root/var/mason_data/obj/`)
105 or !$? or die "$_\n\nCouldn't clean mason cache";
106
107
cba15d1 @obra pull this live
obra authored
108 exit 0;
6458960 @ruz support skipping parts we pull and support git
ruz authored
109
110 sub skip($) {
111 my $name = shift;
112 return 1 if @skip && grep $name eq $_, @skip;
113 return 1 if @only && !grep $name eq $_, @only;
114 return 0;
115 }
116
Something went wrong with that request. Please try again.