swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit c4803c2543b818d1bd6174cd2ede6f5783ff252e
parent 5d9386b9294c8551e4c1994ed85c0c0d7773b6f0
Author: uriel@suckless.org <unknown>
Date:   Sun,  6 Jul 2008 01:49:45 +0200

Add some new debug facilities, and also fix a minnor bug in the new blog-sidebar-menu
Diffstat:
Mbin/controller.rc | 13+++++++++----
Metc/initrc | 1+
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/controller.rc b/bin/controller.rc @@ -38,10 +38,9 @@ fn hide_paths { fn menu { lsArgs = ('-F') # XXX will not work properly for $#blogDirs > 1 and matching is hackish - if ( (! ~ $#inBlog 0) || ! ~ $#blogDirs 0 && (~ $blogDirs^/ *$1 *$1/) ) { # Work in progress XXX + if ( ! ~ $#inBlog 0 || ! ~ $#blogDirs 0 && ~ $blogDirs^/ *$1 *$1/ ) { # Work in progress XXX lsArgs = ($lsArgs -r) } - ls $lsArgs $1 | sed $dirfilter | awk -F/ ' BEGIN { print "<ul class=\"sidebar\">" } END { print "</ul>" } @@ -146,6 +145,14 @@ fn genbody { . etc/initrc +fn dprint { + echo $* >[1=2] +} + +if(! ~ $#debug 0) { + echo $SERVER_NAME - $REQUEST_URI - >[1=2] +} + if (! ~ $args '') { #title=$args($#args) title=$args @@ -169,7 +176,6 @@ for (i in ('' $args)) { inBlog = 'yes' } -echo $body $redirectPermanent>> /tmp/foo # Redirections and other preprocessing if (~ $#redirectPermanent 1) { echo 'Status: 301 Moved Permanantly @@ -211,7 +217,6 @@ if(! ~ $#blogDirs 0 || ! ~ $#inBlog 0) { } - fn template { template.awk | rc $rcargs | awk '{ diff --git a/etc/initrc b/etc/initrc @@ -1,3 +1,4 @@ masterSite=cat-v.org siteTitle='cat-v' siteSubTitle='Considered harmful' +debug=true