|
|
| |
def read_makeconf(mymakeconffile): | def read_makeconf(mymakeconffile): |
if os.path.exists(mymakeconffile): | if os.path.exists(mymakeconffile): |
try: |
try: |
myf=open(mymakeconffile,"r") |
try: |
mylines=myf.readlines() |
import snakeoil.fileutils |
myf.close() |
return snakeoil.fileutils.read_bash_dict(mymakeconffile, sourcing_command="source") |
return parse_makeconf(mylines) |
except ImportError: |
except: |
try: |
raise CatalystError, "Could not open make.conf file "+mymakeconffile |
import portage_util |
|
return portage_util.getconfig(mymakeconffile, tolerant=1, allow_sourcing=True) |
|
except ImportError: |
|
myf=open(mymakeconffile,"r") |
|
mylines=myf.readlines() |
|
myf.close() |
|
return parse_makeconf(mylines) |
|
except: |
|
raise CatalystError, "Could not parse make.conf file "+mymakeconffile |
else: | else: |
makeconf={} |
makeconf={} |
return makeconf |
return makeconf |
| |
def msg(mymsg,verblevel=1): | def msg(mymsg,verblevel=1): |
if verbosity>=verblevel: | if verbosity>=verblevel: |