On 06/27/12 23:52, Abhinandan Ekande wrote:
A better fix would cwd out of the directory being deleted, no?
I agree with Bart; we should chdir to the parent directory of the
repository if the working directory is inside of it.
I wouldn't want us to just ignore the EINVAL.
Thanks Bart and Shawn for review. I have incorporated the suggestion.
The updated webrev :
https://cr.opensolaris.org/action/browse/pkg/ae112802/7140762-rev2/webrev/
Please provide comments.
What happens if another file exists in that directory?
Perhaps:
def rmdir(d):
"""rmdir; but ignores non-empty directories."""
try:
os.rmdir(d)
except OSError, e:
if e.errno == errno.EINVAL and \
os.getcwd != self.root:
# In case of EINVAL error we could be
# in directory we're removing;
# chdir to repository root and
# recurse
os.chdir(self.root)
rmdir(d)
elif e.errno in (
errno.ENOTEMPTY,
errno.EEXIST):
pass
else:
raise
- Bart
--
Bart Smaalders Solaris Kernel Performance
[email protected] http://blogs.oracle.com/barts
"You will contribute more with Mercurial than with Thunderbird."
"Civilization advances by extending the number of important
operations which we can perform without thinking about them."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss