From f1ad1d68e59d35096445de142fb12f682707b7e1 Mon Sep 17 00:00:00 2001 From: Steve Mynott Date: Fri, 19 Jan 2018 11:29:29 +0000 Subject: we don't use panda now --- tools/build/panda-state.p6 | 56 ---------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 tools/build/panda-state.p6 diff --git a/tools/build/panda-state.p6 b/tools/build/panda-state.p6 deleted file mode 100644 index 0d7dd23..0000000 --- a/tools/build/panda-state.p6 +++ /dev/null @@ -1,56 +0,0 @@ - -try mkdir 'install'; -try mkdir 'install/share'; -try mkdir 'install/share/perl6'; -try mkdir 'install/share/perl6/site'; -try mkdir 'install/share/perl6/site/panda'; - -my $state-file = 'install/share/perl6/site/panda/state'; -my $projects-file = 'install/share/perl6/site/panda/projects.json'; - -fetch-projects-json($projects-file); - -my $projects = from-json $projects-file.IO.slurp; - -# In case we ship a project that is just a fork of a project listed in the ecosystem, add -# the mapping here. -my %ex; -# 'git://github.com/FROGGS/perl6-digest-md5' => 'git://github.com/cosimo/perl6-digest-md5', -#Nil; - -# Walk the submodules and put its project information in panda's state file. -my $fh = $state-file.IO.open(:w); -for '.gitmodules'.IO.lines.grep(/^\turl/).map({ /$=[\S+]$/; ~$ }) -> $url { - my $p = $projects.first({defined . && $_. ~~ /^ "{%ex{$url} // $url}" '.git'? $/}); - $p = 'git'; - $p = $url; - $fh.say: $p ~ ' installed ' ~ to-json($p).subst(/\n+/, '', :g); -} -$fh.close; - -say $state-file; -say $projects-file; - -sub fetch-projects-json($to) { - try unlink $to; - my $s; - if %*ENV { - my ($host, $port) = %*ENV.split('/').[2].split(':'); - $s = IO::Socket::INET.new(host=>$host, port=>$port.Int); - } - else { - $s = IO::Socket::INET.new(:host, :port(80)); - } - $s.print("GET http://ecosystem-api.p6c.org/projects.json HTTP/1.1\nHost: ecosystem-api.p6c.org\nAccept: */*\nConnection: Close\n\n"); - # gobble up all header line: - 1 while $s.get; - - # read the body: - my ($buf, $g) = ''; - $buf ~= "$g\n" while $g = $s.get; - - if %*ENV { - $buf.=subst(:g,/'git://'/,'http://'); - } - spurt($to, $buf); -} -- cgit v1.1