Ticket #1317 (closed defect: fixed)

Opened 2 years ago

Last modified 3 months ago

[Patch] Hard coded paths in tgsetup

Reported by: cappen Assigned to: 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 (0.7 kB) - added by tbradshaw on 03/26/07 01:11:22.
Patch to honor the prefix in the situation described. Has weird filenames.

Change History

03/26/07 01:11:22 changed by tbradshaw

  • attachment honor_prefix.patch added.

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

03/26/07 01:12:59 changed 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.)

04/06/07 17:29:28 changed by alberto

tgsetup is here ;)

Alberto

04/06/07 23:37:59 changed 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!)

04/06/07 23:38:46 changed by tbradshaw

(fixed in revision [2857])

03/04/08 22:26:27 changed 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 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?

07/21/08 12:33:57 changed by Chris Arndt

  • owner changed from tbradshaw to Chris Arndt.
  • status changed from reopened to new.

07/21/08 12:49:36 changed by Chris Arndt

  • status changed from new to assigned.

09/09/08 15:49:02 changed 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.

09/11/08 08:23:00 changed by Chris Arndt

  • status changed from assigned to closed.
  • resolution set to fixed.

Fixed in r5387.