~mvo/software-center/3.0-history

« back to all changes in this revision

Viewing changes to softwarecenter/paths.py

  • Committer: Michael Vogt
  • Date: 2010-10-01 07:57:36 UTC
  • Revision ID: michael.vogt@ubuntu.com-20101001075736-r2ipzn0eycrdjr0t
ensure we don't create directories in /home when running as
root

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from xdg import BaseDirectory as xdg
22
22
 
 
23
# ensure we don't create directories in /home/$user
 
24
if os.getuid() == 0 and "SUDO_USER" in os.environ and "HOME" in os.environ:
 
25
    del os.environ["HOME"]
 
26
 
23
27
SOFTWARE_CENTER_CONFIG_DIR = os.path.join(xdg.xdg_config_home, "software-center")
24
28
SOFTWARE_CENTER_CACHE_DIR = os.path.join(xdg.xdg_cache_home, "software-center")
25
29
SOFTWARE_CENTER_CONFIG_FILE = os.path.join(SOFTWARE_CENTER_CONFIG_DIR, "softwarecenter.cfg")