Ticket #963 (closed defect: fixed)
Trac's setup.py does not honor --home
| Reported by: | markus.stenberg@… | Owned by: | jonas |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10 |
| Component: | general | Version: | 0.8 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
In Python, it is possible to do something like
python setup.py install --home=/my/installation/prefix
However, unfortunately it does not seem to be supported by trac's setup.py.
Fix is trivial:
mstenber@mylly /work/tools/trac-0.8>diff -wu setup.py~ setup.py
--- setup.py~ 2004-10-21 23:48:23.000000000 +0300
+++ setup.py 2004-11-19 11:29:03.000000000 +0200
@@ -30,9 +30,10 @@
self.siteconfig()
def siteconfig(self):
- templates_dir = os.path.join(self.prefix, 'share','trac','templates')
- htdocs_dir = os.path.join(self.prefix, 'share','trac','htdocs')
- wiki_dir = os.path.join(self.prefix, 'share','trac','wiki-default')
+ prefix = self.home or self.prefix
+ templates_dir = os.path.join(prefix, 'share','trac','templates')
+ htdocs_dir = os.path.join(prefix, 'share','trac','htdocs')
+ wiki_dir = os.path.join(prefix, 'share','trac','wiki-default')
f = open(_p('trac/siteconfig.py'),'w')
f.write("""
The self.home is None if --home is not specified, and otherwise the path. self.prefix is NOT SET if --home is used => problems ensue.
This works at least with my Python 2.3 - caveat emptor.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


