hardcoded paths

Bug #345814 reported by umaxx
2
Affects Status Importance Assigned to Milestone
Entertainer Media Center
Fix Released
Low
Matt Layman

Bug Description

I'm playing with entertainer from repsitory on openbsd and found some problems/bugs:

setup.py:

        target = os.path.join(self.root, "usr", "share", "icons", "hicolor")
better use:
        target = os.path.join(sys.prefix, "share", "icons", "hicolor")

but I think the whole install class is the wrong approach, installing manpages and updating gtk icon cache should be done by package tools like rpm/deb/...

utils/configuration.py:

better use this:
    # Hardcoded path for a package install
    'package' : os.path.join(sys.prefix, "share", "entertainer", "cfg")

utils/configuration.py:

    CFG_DIR = os.path.expanduser("~/.config/entertainer")

better use standard module for this:
    import user
    CFG_DIR = os.path.join(user.home, "config", "entertainer")

in general: avoid absolute paths with "/" - use os.path.join always.

Revision history for this message
Matt Layman (mblayman) wrote :

umaxx, thanks for the report. I think that you raise a valid issue and paths should sys.prefix.

I do disagree with you about the installation of manpages and icon cache. Entertainer is trying to be a distro agnostic upstream. In order to be that, `python setup.py install` must do the right thing and provide the full installation for a user. Without the steps we've taken, it would not be possible to install properly from source.

I believe our Debian package removes this code in the diff.gz and lets the packaging system do the work. I think that this is the right approach to support specific distros and those who just want the source.

Changed in entertainer:
assignee: nobody → laymansterms
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Matt Layman (mblayman) wrote :

umaxx, fyi, the user module is deprecated in python 2.6 so I will probably continue to use the expanduser method unless I find some other documentation about what is the python community's preferred convention.

Revision history for this message
umaxx (umaxx) wrote :

ok, i was not aware of the fact that it is deprecated, maybe then better use something like this:

CFG_DIR = os.path.expanduser(os.path.join("~", "config", "entertainer")

Revision history for this message
Matt Layman (mblayman) wrote :

The new resource module should eliminate the hardcoded path issues.

Changed in entertainer:
milestone: none → entertainer-0.5
status: Triaged → In Progress
Matt Layman (mblayman)
Changed in entertainer:
status: In Progress → Fix Committed
Matt Layman (mblayman)
Changed in entertainer:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.