#!/bin/rc -e . /sys/lib/shithub/common.rc cd $1shift cache=/usr/web/cache/shitlist.cachetcache=/usr/web/cache/shitlist.cache.tmp.$pidif(test -e $cache && ! test $cache -older 1m){ exec cat $cache exit} rfork nenl='' { prelude '' 'the fragrant git host' echo '<img src="/static/'$logo'" /><br/>' if(~ $#intro 0) echo '<h2>Repositories</h2><br/>' if not echo $intro udir=() for(repo in `$nl{ls */ >[2]/dev/null || echo}){ ndir=`{basename -d $repo} if(! ~ $udir $ndir) echo '</dl>' if(! ~ $udir $ndir){ echo '<h3><a href="/'$ndir'/usr.html" name="'$ndir'">'$ndir'</a></h3>' echo '<dl>' udir=$ndir } if(test -e $repo/.git/webpublish){ echo '<dt><a href="/'$repo'/HEAD/info.html">'$repo'</a></dt>' echo '<dd>' if(test -f $repo/.git/desc) htcat $repo/.git/desc if not if(test -f $repo/.git/description) htcat $repo/.git/description if not echo 'probably some code' echo '</dd>' } }} > $tcache && mv $tcache $cachecat $cache
#!/bin/rc -e
. /sys/lib/shithub/common.rc
cd $1
shift
cache=/usr/web/cache/shitlist.cache
tcache=/usr/web/cache/shitlist.cache.tmp.$pid
if(test -e $cache && ! test $cache -older 1m){
exec cat $cache
exit
}
rfork ne
nl='
'
{
prelude '' 'the fragrant git host'
echo '<img src="/static/'$logo'" /><br/>'
if(~ $#intro 0)
echo '<h2>Repositories</h2><br/>'
if not
echo $intro
udir=()
for(repo in `$nl{ls */ >[2]/dev/null || echo}){
ndir=`{basename -d $repo}
if(! ~ $udir $ndir)
echo '</dl>'
if(! ~ $udir $ndir){
echo '<h3><a href="/'$ndir'/usr.html" name="'$ndir'">'$ndir'</a></h3>'
echo '<dl>'
udir=$ndir
}
if(test -e $repo/.git/webpublish){
echo '<dt><a href="/'$repo'/HEAD/info.html">'$repo'</a></dt>'
echo '<dd>'
if(test -f $repo/.git/desc)
htcat $repo/.git/desc
if not if(test -f $repo/.git/description)
htcat $repo/.git/description
if not
echo 'probably some code'
echo '</dd>'
}
}
} > $tcache && mv $tcache $cache
cat $cache