diff options
author | 2010-07-07 23:44:22 +0200 | |
---|---|---|
committer | 2010-07-07 23:44:22 +0200 | |
commit | 7d2b58595850ae248460bb12c59b882404e47f1e (patch) | |
tree | 7f95bac10076a334f1ace303606ec7ad88f1d852 | |
parent | Support depending on core libraries (diff) | |
download | g-cran-7d2b58595850ae248460bb12c59b882404e47f1e.tar.gz g-cran-7d2b58595850ae248460bb12c59b882404e47f1e.tar.bz2 g-cran-7d2b58595850ae248460bb12c59b882404e47f1e.zip |
Fix finding portage directory for portage-based systems
-rw-r--r-- | g_cran/cran_read.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/g_cran/cran_read.py b/g_cran/cran_read.py index 3e703fd..d505d75 100644 --- a/g_cran/cran_read.py +++ b/g_cran/cran_read.py @@ -17,8 +17,11 @@ def portage_dir(): elif os.path.exists('/etc/make.conf'): #portage stores portage location here conffile=open('/etc/make.conf') for line in conffile: - if 'PORTDIR' in line and '=' in line: - portage_location=re.sub('\"(.*)\"','\\1',line[line.find('=')+1:]).strip() + find_portdir=re.match('\s*PORTDIR\s*=\s*"?(.*)"?\s*',line) + if find_portdir: + portage_location=find_portdir.group(1).strip() + else: + portage_location='/usr/portage' elif os.path.exists('/usr/portage'): #default location portage_location='/usr/portage' else: |