Edgewall Software
Modify

Opened 19 years ago

Closed 18 years ago

#963 closed defect (fixed)

Trac's setup.py does not honor --home

Reported by: markus.stenberg@… Owned by: Jonas Borgström
Priority: normal Milestone: 0.10
Component: general Version: 0.8
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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 (0)

Change History (4)

comment:1 by Christopher Lenz, 18 years ago

#2524 has been marked as duplicate of this ticket.

comment:2 by Christopher Lenz, 18 years ago

Milestone: 1.0

comment:3 by Christopher Lenz, 18 years ago

Milestone: 1.00.10

#3296 has been marked as duplicate of this ticket, and provides an enhanced patch.

comment:4 by Matthew Good, 18 years ago

Resolution: fixed
Status: newclosed

Ok. Added in [3449].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.