for path in config_paths.split ():
path = portage.normalize_path(portage_const.EPREFIX + path)
try:
- mymode = os.lstat(path).st_mode
+ mymode = os.stat(path).st_mode
except OSError:
continue
basename = "*"
"return our locally-maintained environment"
mydict={}
for x in self.keys():
- mydict[x]=self[x]
+ myvalue = self[x]
+ if not isinstance(myvalue, basestring):
+ writemsg("!!! Non-string value in config: %s=%s\n" % \
+ (x, myvalue), noiselevel=-1)
+ continue
+ mydict[x] = myvalue
if not mydict.has_key("HOME") and mydict.has_key("BUILD_PREFIX"):
writemsg("*** HOME not set. Setting to "+mydict["BUILD_PREFIX"]+"\n")
mydict["HOME"]=mydict["BUILD_PREFIX"][:]
mygroups = mygroups.split()
pgroups = settings["ACCEPT_KEYWORDS"].split()
myarch = settings["ARCH"]
+ if pgroups and myarch not in pgroups:
+ """For operating systems other than Linux, ARCH is not necessarily a
+ valid keyword."""
+ myarch = pgroups[0].lstrip("~")
pkgdict = settings.pkeywordsdict
cp = dep_getkey(mycpv)
os.path.join(self.myroot, x.lstrip(os.path.sep)))
mystat = None
try:
- """Use lstat so that anything, even a broken symlink can be
- protected."""
- if stat.S_ISDIR(os.lstat(ppath).st_mode):
- self._dirs.add(ppath)
- self.protect.append(ppath)
- """Now use stat in case this is a symlink to a directory."""
if stat.S_ISDIR(os.stat(ppath).st_mode):
self._dirs.add(ppath)
+ self.protect.append(ppath)
except OSError:
# If it doesn't exist, there's no need to protect it.
pass