changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Fix and simplify config loading process.

changeset 355: 80ecc1f8e78c
parent 354: 6aa689efe8ce
child 356: 21d4d464fdef
author: uriel@engel.se.cat-v.org
date: Fri, 23 Jan 2009 16:46:48 +0100
files: bin/werc.rc
description: Fix and simplify config loading process.
     1.1--- a/bin/werc.rc	Fri Jan 23 16:46:25 2009 +0100
     1.2+++ b/bin/werc.rc	Fri Jan 23 16:46:48 2009 +0100
     1.3@@ -13,8 +13,7 @@
     1.4         echo -n lib/$1
     1.5 }
     1.6 
     1.7-# Don't change var name or trailing ';', dirfilter might be changed from _werc/config!
     1.8-# ls -F style input of the form: $sitedir/path/to/files/
     1.9+# Expected input: ls -F style, $sitedir/path/to/files/
    1.10 #          <ls -F+x><symlink hack><Useless?><hiden files  >
    1.11 dirfilter='s/\*$//; s,/+\./+,/,g; s,^\./,,; /\/[._][^\/]/d; /'^$forbidden_uri_chars^'/d; /^\/(robots|sitemap)\.txt$|\/index\.(md|html|txt|tpl)$/d; /_werc\/?$/d; '
    1.12 dirclean=' s/\.(md|html|txt)$//; '
    1.13@@ -184,13 +183,15 @@
    1.14     perm_redirect $req_path^'/'
    1.15 
    1.16 cd $sitedir
    1.17+req_paths_list='/' # Note: req_paths_list doesn't include 'stnythetic' dirs.
    1.18+conf_wd='/' # Used in config files to know where we are in the document tree.
    1.19 if(test -f _werc/config)
    1.20     . _werc/config
    1.21-conf_wd='' # This can be used inside config files to know where we are in the document tree.
    1.22-for(i in ('' $args)) {
    1.23-    config_wd=($"config_wd^/^$i)
    1.24-    req_paths_list=($req_paths_list $config_wd)
    1.25+for(i in $args) {
    1.26+    conf_wd=$conf_wd^$i
    1.27+    req_paths_list=($req_paths_list $conf_wd)
    1.28     if(test -d $i) {
    1.29+        conf_wd=$conf_wd^'/'
    1.30         cd $i
    1.31         if(test -f _werc/config)
    1.32             . _werc/config