skip = False
if d:
try:
- if long(d.get("MTIME")) == long(s.st_mtime):
+ if long(d["MTIME"]) == long(s.st_mtime):
skip = True
- except ValueError:
+ except (KeyError, ValueError):
pass
if skip and not self._pkgindex_keys.difference(d):
pkg_paths[mycpv] = mypath
writemsg_stdout("--- !md5 %s %s\n" % ("obj", obj))
continue
try:
- if statobj.st_nlink > 1:
- portage.writemsg("There are "+str(st.st_nlink-1)+ \
- " hardlinks to '%s'\n" % obj)
- # Always blind chmod 0 before unlinking to avoid race conditions.
- os.chmod(obj, 0000)
+ if statobj.st_mode & (stat.S_ISUID | stat.S_ISGID):
+ # Always blind chmod 0 before unlinking to avoid race conditions.
+ os.chmod(obj, 0000)
+ if statobj.st_nlink > 1:
+ portage.writemsg("setXid: "+str(st.st_nlink-1)+ \
+ " hardlinks to '%s'\n" % obj)
os.unlink(obj)
except (OSError, IOError), e:
pass