[cage] Add some karma aliases for myself
[parrot.git] / tools / dev / fetch_languages.pl
blobe9ac290789b7d49fedad9454472c41b909532740
1 # Copyright (C) 2009, Parrot Foundation.
2 # $Id$
4 =head1 NAME
6 fetch_languages.pl - A helper to fetch language implementations from the SCM repoistories
8 =head1 SYNOPSIS
10 perl fetch_languages.pl
12 perl fetch_languages.pl [--update] [--lang=<hll>]
15 =head1 DESCRIPTION
17 Creates a directory called 'languages' and checks out the languages.
19 =head1 HISTORY
21 2009-03-14 Salvaged from https:/svn.parrot.org/parrot/trunk/config/gen/makefiles/languages.in@37396.
23 2009-06-28 --lang=<hll> option added by s1n++.
25 =cut
27 use strict;
28 use warnings;
29 use 5.008;
31 use Getopt::Long;
32 use Pod::Usage;
33 use Cwd;
35 my ( $update_flag, $checkout_flag, $lang_flag ) = ( 0, 1, undef );
36 GetOptions( 'lang=s' => \$lang_flag, 'update' => \$update_flag ) or pod2usage();
38 my $languages_dir = 'languages';
39 mkdir $languages_dir;
40 chdir $languages_dir;
42 # some commands
43 my %checkout_cmd = (
44 SVN => [qw(svn checkout)],
45 GIT => [qw(git clone)],
46 HG => [qw(hg clone)],
48 my %update_cmd = (
49 SVN => [qw(svn update)],
50 GIT => [qw(git pull)],
51 HG => [qw(hg pull)],
54 my @hlls = (
57 name => 'bf',
58 scm => 'SVN',
59 repository => 'https://svn.parrot.org/languages/bf/trunk'
63 name => 'blizkost',
64 scm => 'GIT',
65 repository => 'git://github.com/jnthn/blizkost.git'
69 name => 'c99',
70 scm => 'SVN',
71 repository => 'https://svn.parrot.org/languages/c99/trunk'
75 name => 'cardinal',
76 scm => 'GIT',
77 repository => 'git://github.com/cardinal/cardinal.git'
81 name => 'chitchat',
82 scm => 'SVN',
83 repository => 'https://svn.parrot.org/languages/chitchat/trunk'
87 name => 'dotnet',
88 scm => 'SVN',
89 repository => 'https://svn.parrot.org/languages/dotnet/trunk'
93 name => 'eclectus',
94 scm => 'GIT',
95 repository => 'git://github.com/bschmalhofer/eclectus.git'
99 name => 'ecmascript',
100 scm => 'SVN',
101 repository => 'https://svn.parrot.org/languages/ecmascript/trunk'
105 name => 'forth',
106 scm => 'SVN',
107 repository => 'https://svn.parrot.org/languages/forth/trunk'
111 name => 'fun',
112 scm => 'GIT',
113 repository => 'git://github.com/TiMBuS/fun.git'
117 name => 'gil',
118 scm => 'GIT',
119 repository => 'git://github.com/tene/gil.git'
123 name => 'hq9plus',
124 scm => 'GIT',
125 repository => 'git://github.com/bschmalhofer/hq9plus.git'
129 name => 'jako',
130 scm => 'SVN',
131 repository => 'https://svn.parrot.org/languages/jako/trunk'
135 name => 'json',
136 scm => 'SVN',
137 repository => 'https://svn.parrot.org/languages/json/trunk'
141 name => 'kea-cl',
142 scm => 'SVN',
143 repository => 'https://rgrjr.dyndns.org/svn/kea-cl/trunk'
147 name => 'lazy-k',
148 scm => 'GIT',
149 repository => 'git://github.com/bschmalhofer/lazy-k.git'
153 name => 'lisp',
154 scm => 'SVN',
155 repository => 'https://svn.parrot.org/languages/lisp/trunk'
159 name => 'lolcode',
160 scm => 'SVN',
161 repository => 'https://svn.parrot.org/languages/lolcode/trunk'
165 name => 'lua',
166 scm => 'GIT',
167 repository => 'git://github.com/fperrad/lua.git'
171 name => 'm4',
172 scm => 'GIT',
173 repository => 'git://github.com/bschmalhofer/m4.git'
177 name => 'markdown',
178 scm => 'GIT',
179 repository => 'git://github.com/fperrad/markdown.git'
183 name => 'matrixy',
184 scm => 'GIT',
185 repository => 'git://github.com/Whiteknight/matrixy.git'
189 name => 'ook',
190 scm => 'SVN',
191 repository => 'https://svn.parrot.org/languages/ook/trunk'
195 name => 'paraplegic',
196 scm => 'SVN',
197 repository => 'http://paraplegic.googlecode.com/svn/trunk'
201 name => 'perk',
202 scm => 'GIT',
203 repository => 'git://github.com/chrisdolan/perk.git'
207 name => 'pheme',
208 scm => 'SVN',
209 repository => 'https://svn.parrot.org/languages/pheme/trunk'
213 name => 'pipp',
214 scm => 'GIT',
215 repository => 'git://github.com/bschmalhofer/pipp.git'
219 name => 'pir',
220 scm => 'SVN',
221 repository => 'https://svn.parrot.org/languages/pir/trunk'
225 name => 'pjs',
226 scm => 'SVN',
227 repository => 'http://parrotjs.googlecode.com/svn/trunk'
231 name => 'pod',
232 scm => 'SVN',
233 repository => 'https://svn.parrot.org/languages/pod/trunk'
237 name => 'porcupine',
238 scm => 'SVN',
239 repository => 'http://porcupinepascal.googlecode.com/svn/trunk'
243 name => 'primitivearc',
244 scm => 'GIT',
245 repository => 'git://github.com/stefano/primitivearc.git'
249 name => 'punie',
250 scm => 'SVN',
251 repository => 'https://svn.parrot.org/languages/punie/trunk'
255 name => 'pynie',
256 scm => 'SVN',
257 repository => 'http://pynie.googlecode.com/svn/trunk'
261 name => 'rakudo',
262 scm => 'GIT',
263 repository => 'git://github.com/rakudo/rakudo.git'
267 name => 'scheme',
268 scm => 'SVN',
269 repository => 'https://svn.parrot.org/languages/scheme/trunk'
273 name => 'shakespeare',
274 scm => 'HG',
275 repository => 'http://bitbucket.org/riffraff/shakespeare-parrot'
279 name => 'steme',
280 scm => 'GIT',
281 repository => 'git://github.com/tene/steme.git'
285 name => 'tcl',
286 scm => 'GIT',
287 repository => 'git://github.com/partcl/partcl.git'
291 name => 'unlambda',
292 scm => 'GIT',
293 repository => 'git://github.com/bschmalhofer/unlambda.git'
297 name => 'urm',
298 scm => 'SVN',
299 repository => 'https://svn.parrot.org/languages/urm/trunk'
303 name => 'wmlscript',
304 scm => 'GIT',
305 repository => 'git://github.com/fperrad/wmlscript.git'
309 name => 'xml',
310 scm => 'GIT',
311 repository => 'git://github.com/fperrad/xml.git'
315 foreach (@hlls) {
316 next if $lang_flag && $_->{name} ne $lang_flag;
317 if ($checkout_flag && ! -d $_->{name}) {
318 my @cmd = ( @{ $checkout_cmd{ $_->{scm} } }, $_->{repository}, $_->{name} );
319 my $dir = getcwd();
320 print "Running: '@cmd' in $dir.\n";
321 system(@cmd);
323 if ($update_flag) {
324 chdir $_->{name};
325 my @cmd = ( @{ $update_cmd{ $_->{scm} } } );
326 my $dir = getcwd();
327 print "Running: '@cmd' in $dir.\n";
328 system(@cmd);
329 chdir '..';
333 # Local Variables:
334 # mode: cperl
335 # cperl-indent-level: 4
336 # fill-column: 100
337 # End:
338 # vim: expandtab shiftwidth=4: