diff options
| author | Paul Buetow (centauri) <puppet@mx.buetow.org> | 2015-05-23 22:00:37 +0100 |
|---|---|---|
| committer | Paul Buetow (centauri) <puppet@mx.buetow.org> | 2015-05-23 22:00:37 +0100 |
| commit | 2fab3867d291514b6666a8bd582fe8ae4896a1c0 (patch) | |
| tree | 996160703a47ac88c61d2496187118a5fc0675b8 /dev.buetow.org/content/projectlist.inc.pl | |
| parent | ee1d9d4243e970d102ea4f57bfacb379e5b25b3a (diff) | |
| parent | e43a989acd2055661bb2d93454f2f7aa4e6e5177 (diff) | |
Merge
Diffstat (limited to 'dev.buetow.org/content/projectlist.inc.pl')
| -rw-r--r-- | dev.buetow.org/content/projectlist.inc.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/dev.buetow.org/content/projectlist.inc.pl b/dev.buetow.org/content/projectlist.inc.pl new file mode 100644 index 0000000..4d1d4f2 --- /dev/null +++ b/dev.buetow.org/content/projectlist.inc.pl @@ -0,0 +1,42 @@ +my $hostroot = $config->get_hostroot(); + +sub getf ($) { + open my $f, $_[0] or die "$!: $_[0]\n"; + my @slurp = <$f>; + close $f; + @slurp; +} + +sub nl () { "<br />\n" } + +sub list (*) { + my $tag = shift; + my @found = sort `find $hostroot -name $tag`; + my $ret = ''; + + + for my $found (@found) { + $found =~ /.*hosts.(.*?).$tag/; + my $host = $1; + + my @content = getf $found; + + $ret .= "<b><a href=http://$host>$host</a></b>" . nl; + if (@content) { + $ret .= join " ", @content; + $ret .= nl; + } + $ret .= nl; + } + + $ret; +} + +my $ret = list PROJECT; + +$ret .= "<b><i>Older projects (not active at the moment):</i></b>" . nl x 2; +$ret .= list OLDPROJECT; +$ret .= "<b><i>Obsolete projects (no work will be done anymore and the software may be broken):</i></b>" . nl x 2; +$ret .= list OBSOLETEPROJECT; + +return $ret; |
