Add /etc/darcsweb after '.' in sys.path.
Sun Oct 14 15:42:34 UTC 2007 Alberto Bertogli <albertito@gmail.com>
* Add /etc/darcsweb after '.' in sys.path.
Add it second place, so it goes after '.' but before the normal path. This
allows per-directory config files (desirable for multiple darcsweb
installations on the same machin), and avoids name clashing if there's a
config.py in the standard path.
This was reported by Philipp Kern <pkern@debian.org> in Debian bug 399751
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=399751).
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2013-07-18 20:19:11.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2013-07-18 20:19:11.000000000 +0000
@@ -25,8 +25,11 @@
# In order to be able to store the config file in /etc/darcsweb, it has to be
# added to sys.path. It's mainly used by distributions, which place the
-# default configuration there.
-sys.path.append('/etc/darcsweb')
+# default configuration there. Add it second place, so it goes after '.' but
+# before the normal path. This allows per-directory config files (desirable
+# for multiple darcsweb installations on the same machin), and avoids name
+# clashing if there's a config.py in the standard path.
+sys.path.insert(1, '/etc/darcsweb')
# empty configuration class, we will fill it in later depending on the repo
class config: