Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1317 (closed defect: fixed)

Opened 11 years ago

Last modified 9 years ago

[Patch] Hard coded paths in tgsetup

Reported by: cappen Owned by: Chris Arndt
Priority: high Milestone: 1.0.x bugfix
Component: Installation Version: 1.0.6
Severity: normal Keywords: tgsetup
Cc:

Description

It seems that around line 199 in the tgsetup.py file, the path "/usr/local/bin" is hardcoded. (On the webpage  http://www.turbogears.org/download/index.html, the link  http://www.turbogears.org/download/tgsetup.py)

The reason that this was a problem for me, is that I want to install the application in my home directory, since I do not have root rights on that particular machine.

All the other parts of the script work correctly with respect to the --prefix directive, but only this line will make the script crash, and will stop the installation. (Without root rights it is not allowed to create the pgadmin file in the /usr/local/bin directory.)

Except for the fact that it doesn't work for me, I think it is general bad form to ignore the --prefix directive and just put a file in that directory.

My suggestion is to retrieve the path of the --prefix directive from somewhere. I don't know how it works, but since the remainder of the script installs to the correct directories suggests this should be possible.

Attachments

honor_prefix.patch Download (740 bytes) - added by tbradshaw 11 years ago.
Patch to honor the prefix in the situation described. Has weird filenames.

Change History

Changed 11 years ago by tbradshaw

Patch to honor the prefix in the situation described. Has weird filenames.

comment:1 Changed 11 years ago by tbradshaw

  • Owner changed from anonymous to tbradshaw
  • Status changed from new to assigned
  • Summary changed from Hard coded paths in tgsetup to [Patch] Hard coded paths in tgsetup

I attached a patch that should solve the behavior described. I was unable to find this file in the svn repository, and so my patch has weird filenames. (I just downloaded tgsetup.py and then diff -Nuar 'd it with a tgsetup_new.py that had the changes.)

comment:2 Changed 11 years ago by alberto

tgsetup is here ;)

Alberto

comment:3 Changed 11 years ago by tbradshaw

  • Status changed from assigned to closed
  • Resolution set to fixed

Thanks Alberto!

I located the file and applied the patch. :)

(w00t! First commit!)

comment:4 Changed 11 years ago by tbradshaw

(fixed in revision [2857])

comment:5 Changed 10 years ago by Chris Arndt

  • Status changed from closed to reopened
  • Severity changed from minor to normal
  • Priority changed from low to normal
  • Version changed from 1.0 to 1.0.4.3
  • Milestone changed from 1.0.2 to 1.0.x bugfix
  • Resolution fixed deleted

tgsetup.py still overrides the script installation path settings from ~/.pydistutils.cfg or when using  virtualenv.

This is rather annoying, since you always need to use the --install-dir option in this case, which confuses many users and leads to unnecessary support requests.

I wonder what the rationale for setting script-dir to /usr/local/bin is anyway, when tgsetup.py doesn't care, where the packages are installed too. Why not just let distutils/setuptools decide?

comment:6 Changed 9 years ago by Chris Arndt

  • Status changed from reopened to new
  • Owner changed from tbradshaw to Chris Arndt

comment:7 Changed 9 years ago by Chris Arndt

  • Status changed from new to assigned

comment:8 Changed 9 years ago by guest

  • Priority changed from normal to high
  • Version changed from 1.0.4.3 to 1.0.6

I second Chris Arndt's suggestion that /usr/local/bin should be jettisoned in favor of allowing distutils/setuptools to decide where to put the binaries.

That's the pythonic way overall.

comment:9 Changed 9 years ago by Chris Arndt

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed in r5387.

Note: See TracTickets for help on using tickets.