From ab5d0f02bafbb9f266715c756984534ac42b729e Mon Sep 17 00:00:00 2001 From: "Paul C. Buetow (mars.fritz.box)" Date: Sun, 27 Apr 2014 12:48:30 +0200 Subject: Are you making all this up as you go along? --- dev.buetow.org/content/projectlist.inc.pl | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dev.buetow.org/content/projectlist.inc.pl (limited to 'dev.buetow.org/content/projectlist.inc.pl') 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 () { "
\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 .= "$host" . nl; + if (@content) { + $ret .= join " ", @content; + $ret .= nl; + } + $ret .= nl; + } + + $ret; +} + +my $ret = list PROJECT; + +$ret .= "Older projects (not active at the moment):" . nl x 2; +$ret .= list OLDPROJECT; +$ret .= "Obsolete projects (no work will be done anymore and the software may be broken):" . nl x 2; +$ret .= list OBSOLETEPROJECT; + +return $ret; -- cgit v1.2.3