[cage] Remove duplicate lines in MANIFEST.generated
[parrot.git] / tools / dev / fetch_languages.pl
blob6788151f322a62be02d5ba9f8baa8c3ec6bd7f12
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 => 'c99',
64 scm => 'SVN',
65 repository => 'https://svn.parrot.org/languages/c99/trunk'
69 name => 'cardinal',
70 scm => 'GIT',
71 repository => 'git://github.com/cardinal/cardinal.git'
75 name => 'chitchat',
76 scm => 'SVN',
77 repository => 'https://svn.parrot.org/languages/chitchat/trunk'
81 name => 'dotnet',
82 scm => 'SVN',
83 repository => 'https://svn.parrot.org/languages/dotnet/trunk'
87 name => 'eclectus',
88 scm => 'GIT',
89 repository => 'git://github.com/bschmalhofer/eclectus.git'
93 name => 'ecmascript',
94 scm => 'SVN',
95 repository => 'https://svn.parrot.org/languages/ecmascript/trunk'
99 name => 'forth',
100 scm => 'SVN',
101 repository => 'https://svn.parrot.org/languages/forth/trunk'
105 name => 'fun',
106 scm => 'GIT',
107 repository => 'git://github.com/TiMBuS/fun.git'
111 name => 'gil',
112 scm => 'GIT',
113 repository => 'git://github.com/tene/gil.git'
117 name => 'hq9plus',
118 scm => 'GIT',
119 repository => 'git://github.com/bschmalhofer/hq9plus.git'
123 name => 'jako',
124 scm => 'SVN',
125 repository => 'https://svn.parrot.org/languages/jako/trunk'
129 name => 'json',
130 scm => 'SVN',
131 repository => 'https://svn.parrot.org/languages/json/trunk'
135 name => 'kea-cl',
136 scm => 'SVN',
137 repository => 'https://rgrjr.dyndns.org/svn/kea-cl/trunk'
141 name => 'lazy-k',
142 scm => 'GIT',
143 repository => 'git://github.com/bschmalhofer/lazy-k.git'
147 name => 'lisp',
148 scm => 'SVN',
149 repository => 'https://svn.parrot.org/languages/lisp/trunk'
153 name => 'lolcode',
154 scm => 'SVN',
155 repository => 'https://svn.parrot.org/languages/lolcode/trunk'
159 name => 'lua',
160 scm => 'GIT',
161 repository => 'git://github.com/fperrad/lua.git'
165 name => 'm4',
166 scm => 'GIT',
167 repository => 'git://github.com/bschmalhofer/m4.git'
171 name => 'markdown',
172 scm => 'GIT',
173 repository => 'git://github.com/fperrad/markdown.git'
177 name => 'matrixy',
178 scm => 'SVN',
179 repository => 'http://matrixy.googlecode.com/svn/trunk'
183 name => 'ook',
184 scm => 'SVN',
185 repository => 'https://svn.parrot.org/languages/ook/trunk'
189 name => 'paraplegic',
190 scm => 'SVN',
191 repository => 'http://paraplegic.googlecode.com/svn/trunk'
195 name => 'perk',
196 scm => 'GIT',
197 repository => 'git://github.com/chrisdolan/perk.git'
201 name => 'pheme',
202 scm => 'SVN',
203 repository => 'https://svn.parrot.org/languages/pheme/trunk'
207 name => 'pipp',
208 scm => 'GIT',
209 repository => 'git://github.com/bschmalhofer/pipp.git'
213 name => 'pir',
214 scm => 'SVN',
215 repository => 'https://svn.parrot.org/languages/pir/trunk'
219 name => 'pjs',
220 scm => 'SVN',
221 repository => 'http://parrotjs.googlecode.com/svn/trunk'
225 name => 'pod',
226 scm => 'SVN',
227 repository => 'https://svn.parrot.org/languages/pod/trunk'
231 name => 'porcupine',
232 scm => 'SVN',
233 repository => 'http://porcupinepascal.googlecode.com/svn/trunk'
237 name => 'primitivearc',
238 scm => 'GIT',
239 repository => 'git://github.com/stefano/primitivearc.git'
243 name => 'punie',
244 scm => 'SVN',
245 repository => 'https://svn.parrot.org/languages/punie/trunk'
249 name => 'pynie',
250 scm => 'SVN',
251 repository => 'http://pynie.googlecode.com/svn/trunk'
255 name => 'rakudo',
256 scm => 'GIT',
257 repository => 'git://github.com/rakudo/rakudo.git'
261 name => 'scheme',
262 scm => 'SVN',
263 repository => 'https://svn.parrot.org/languages/scheme/trunk'
267 name => 'shakespeare',
268 scm => 'HG',
269 repository => 'http://bitbucket.org/riffraff/shakespeare-parrot'
273 name => 'steme',
274 scm => 'GIT',
275 repository => 'git://github.com/tene/steme.git'
279 name => 'tcl',
280 scm => 'SVN',
281 repository => 'http://partcl.googlecode.com/svn/trunk'
285 name => 'unlambda',
286 scm => 'GIT',
287 repository => 'git://github.com/bschmalhofer/unlambda.git'
291 name => 'urm',
292 scm => 'SVN',
293 repository => 'https://svn.parrot.org/languages/urm/trunk'
297 name => 'wmlscript',
298 scm => 'GIT',
299 repository => 'git://github.com/fperrad/wmlscript.git'
303 name => 'xml',
304 scm => 'GIT',
305 repository => 'git://github.com/fperrad/xml.git'
309 foreach (@hlls) {
310 next if $lang_flag && $_->{name} ne $lang_flag;
311 if ($checkout_flag && ! -d $_->{name}) {
312 my @cmd = ( @{ $checkout_cmd{ $_->{scm} } }, $_->{repository}, $_->{name} );
313 my $dir = getcwd();
314 print "Running: '@cmd' in $dir.\n";
315 system(@cmd);
317 if ($update_flag) {
318 chdir $_->{name};
319 my @cmd = ( @{ $update_cmd{ $_->{scm} } } );
320 my $dir = getcwd();
321 print "Running: '@cmd' in $dir.\n";
322 system(@cmd);
323 chdir '..';
327 # Local Variables:
328 # mode: cperl
329 # cperl-indent-level: 4
330 # fill-column: 100
331 # End:
332 # vim: expandtab shiftwidth=4: