From c2fe445b82f490f686a699e4ae2f7b4f5a11f26e Mon Sep 17 00:00:00 2001 From: uriel Date: Sun, 6 Jul 2008 01:49:45 +0200 Subject: [PATCH] Add some new debug facilities, and also fix a minnor bug in the new blog-sidebar-menu --- bin/controller.rc | 13 +++++++++---- etc/initrc | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/controller.rc b/bin/controller.rc index 123d734..49df0a5 100755 --- 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 "" } @@ -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 index 685c02b..a6deed9 100644 --- a/etc/initrc +++ b/etc/initrc @@ -1,3 +1,4 @@ masterSite=cat-v.org siteTitle='cat-v' siteSubTitle='Considered harmful' +debug=true