Browse files

Use perl6/ecosystem projects.list instead of our own, simplify stuff

  • Loading branch information...
1 parent eb5afb4 commit 951a7afa53a38275d221dee1e608722c1267b2d5 @tadzik committed Sep 19, 2010
Showing with 14 additions and 99 deletions.
  1. +14 −30 bin/neutro
  2. +0 −69 modules.list
View
44 bin/neutro
@@ -22,15 +22,14 @@ sub checklist {
unless $CONFIGDIR.IO ~~ :d {
mkdir $CONFIGDIR, :p;
}
- unless "$CONFIGDIR/modules.list".IO ~~ :f {
+ unless "$CONFIGDIR/projects.list".IO ~~ :f {
updatedb;
}
- my $fh = open "$CONFIGDIR/modules.list";
+ my $fh = open "$CONFIGDIR/projects.list";
for $fh.lines -> $line {
next if $line ~~ /^\#/;
- my ($name, $protoname, $url) = $line.split: ' ';
- %modules{$name}<protoname> = $protoname;
- %modules{$name}<url> = $url;
+ my ($name, $url) = $line.split: ' ';
+ %modules{$name} = $url;
}
$fh.close;
}
@@ -40,40 +39,25 @@ sub crap (Str $msg) {
exit 1;
}
-sub dirname (Str $name) {
- (~$name).trans(':' => ',')
-}
-
sub fetch (Str $name) {
my $res;
mkdir $SRCDIR, :p;
chdir $SRCDIR;
notice "Fetching $name";
- if "$SRCDIR/{dirname $name}".IO ~~ :d {
- chdir dirname $name;
+ if "$SRCDIR/$name".IO ~~ :d {
+ chdir $name;
$res = run 'git pull -q';
crap "Failed updating the $name repo" if $res;
} else {
- $res = run "git clone -q %modules{$name}<url> {dirname $name}";
+ $res = run "git clone -q %modules{$name} $name";
crap "Failed cloning the $name repo" if $res;
- chdir dirname $name;
- }
-}
-
-# translate proto module name to our module name (if needed)
-sub getname (Str $name) {
- return $name if %modules.exists($name);
- for %modules.kv -> $module, $data {
- if $data<protoname> eq $name {
- return $module;
- }
+ chdir $name;
}
- return;
}
sub install (Str $module, Bool $strict?, Bool $v?) {
my $res;
- my $name = getname $module or crap "Unknown module '$module'";
+ my $name = $module or crap "Unknown module '$module'";
fetch $name;
installdeps $name;
notice "Building $name";
@@ -117,7 +101,7 @@ sub installdeps (Str $name) {
next if $dep ~~ /^\#/;
next if $dep eq '';
unless isinstalled $dep {
- my $realdep = getname $dep
+ my $realdep = $dep
or crap "No such module: $dep ($name dependency)";
notice "$name depends on $realdep, installing now";
install $dep;
@@ -129,7 +113,7 @@ sub installdeps (Str $name) {
}
sub isinstalled (Str $module) {
- eval "use {getname($module)}";
+ eval "use {$module}";
return $! ?? False !! True;
}
@@ -144,10 +128,10 @@ sub notice (Str $what) {
sub updatedb {
notice 'Updating modules database';
chdir $CONFIGDIR;
- unlink 'modules.list' if 'modules.list'.IO ~~ :e;
+ unlink 'projects.list' if 'projects.list'.IO ~~ :e;
LWP::Simple.new.getstore:
- 'http://github.com/tadzik/neutro/raw/master/modules.list',
- 'modules.list';
+ 'http://github.com/perl6/ecosystem/raw/master/projects.list',
+ 'projects.list';
}
sub MAIN ($command, $param?, Bool :$strict, Bool :$v) {
View
69 modules.list
@@ -1,69 +0,0 @@
-ABC ABC git://github.com/LastOfTheCarelessMen/ABC.git
-Acme::Meow perl6-Acme-Meow git://github.com/tadzik/perl6-Acme-Meow.git
-Algorithm::Viterbi Algorithm-Viterbi git://github.com/arnsholt/Algorithm-Viterbi.git
-Benchmark benchmark git://github.com/perlpilot/benchmark.git
-Bennu Bennu git://github.com/ekiru/Bennu.git
-BioPerl6 bioperl6 git://github.com/cjfields/bioperl6.git
-CGI::Application CGI-Application git://github.com/moritz/CGI-Application.git
-Config::INI perl6-Config-INI git://github.com/tadzik/perl6-Config-INI.git
-CSV csv git://github.com/masak/csv.git
-DateTime::Parse DateTime-Parse git://github.com/KodiB/DateTime-Parse.git
-# DBDI DBDI git://github.com/timbunce/DBDI.git How to install this stuff?
-Digest::MD5 perl6-digest-md5 git://github.com/cosimo/perl6-digest-md5.git
-Digest::Sum Digest-sum git://github.com/xenu/Digest-sum.git
-# Druid druid git://github.com/masak/druid.git (no Web)
-Faz faz git://github.com/ruoso/faz.git
-File::Tools perl6-File-Tools git://github.com/tadzik/perl6-File-Tools.git
-Form form git://github.com/mathw/form.git
-# Gamebase gamebase git://github.com/quietfanatic/gamebase.git no lib/ here
-GGE gge git://github.com/masak/gge.git
-Grampa grampa git://github.com/masak/grampa.git
-HTML::Template html-template git://github.com/masak/html-template.git
-HTTP::Server::Simple http-server-simple git://github.com/mberends/http-server-simple.git
-IO::Prompt io-prompt git://github.com/pnu/io-prompt.git
-JSON json git://github.com/moritz/json.git
-# Link::C link-c git://github.com/quietfanatic/link-c.git no lib/
-List::Utils List-Utils git://github.com/colomon/List-Utils.git
-Literate perl6-literate git://github.com/masak/perl6-literate.git
-# LOLSQL lolsql git://github.com/jnthn/lolsql.git no lib/
-LWP::Simple perl6-lwp-simple git://github.com/cosimo/perl6-lwp-simple.git
-# Mandelbrot mandelbrot git://github.com/colomon/mandelbrot.git no lib/
-Math::Model Math-Model git://github.com/moritz/Math-Model.git
-Math::Polynomial Math-Polynomial git://github.com/colomon/Math-Polynomial.git
-Math::RungeKutta Math-RungeKutta git://github.com/moritz/Math-RungeKutta.git
-Math::Vector Math-Vector git://github.com/colomon/Math-Vector.git
-Module::Tools perl6-Module-Tools git://github.com/tadzik/perl6-Module-Tools.git
-MessagePack messagepack-pm6 git://github.com/uasi/messagepack-pm6.git
-MIME::Base64 Perl6-MIME-Base64 git://github.com/snarkyboojum/Perl6-MIME-Base64.git
-MiniDBI MiniDBI git://github.com/mberends/MiniDBI.git
-Nonogram Nonogram git://github.com/moritz/Nonogram.git
-November november git://github.com/viklund/november.git
-neutro neutro git://github.com/tadzik/neutro.git
-# PPM ppm git://github.com/dcarrera/ppm.git no lib/
-# Proto proto git://github.com/masak/proto.git no binary is installed, proto is useless then :(
-# Pun pun git://github.com/masak/pun.git no lib/
-Puppet::Parser perl6-puppet-parser git://github.com/cosimo/perl6-puppet-parser.git
-SCGI SCGI git://github.com/supernovus/SCGI.git
-SQL::Grammar SQL-Grammar git://github.com/arnsholt/SQL-Grammar.git
-SQLite perl6-sqlite git://github.com/tene/perl6-sqlite.git
-Statistics::Lite statistics-lite git://github.com/aff/statistics-lite.git
-String::CRC32 perl6-string-crc32 git://github.com/cosimo/perl6-string-crc32.git
-SVG svg git://github.com/moritz/svg.git
-SVG::Plot svg-plot git://github.com/moritz/svg-plot.git
-# Tardis tardis git://github.com/masak/tardis.git no bin/, useless :(
-Temporal::Utils temporal-utils git://github.com/supernovus/temporal-utils.git
-Term::ANSIColor perl6-Term-ANSIColor git://github.com/tadzik/perl6-Term-ANSIColor.git
-TestML testml-pm6 git://github.com/ingydotnet/testml-pm6.git
-Test::Mock test-mock git://github.com/jnthn/test-mock.git
-# Tree Tree git://github.com/wayland/Tree.git no lib/ here
-Ufo ufo git://github.com/masak/ufo.git
-URI uri git://github.com/ihrd/uri.git
-Vector Vector git://github.com/LastOfTheCarelessMen/Vector.git
-# Web web git://github.com/masak/web.git no http-daemon (a dep)
-XML xml git://github.com/krunen/xml.git
-XML::OPML XML-OPML git://github.com/radus/XML-OPML.git
-XML::Writer xml-writer git://github.com/masak/xml-writer.git
-YAML yaml-pm6 git://github.com/ingydotnet/yaml-pm6.git
-Yapsi yapsi git://github.com/masak/yapsi.git
-# Yarn yarn git://github.com/masak/yarn.git no http-daemon (web dep)
-Zavolaj zavolaj git://github.com/jnthn/zavolaj.git

0 comments on commit 951a7af

Please sign in to comment.