On 06/28/12 23:01, Bart Smaalders wrote:
What happens if another file exists in that directory?
Thanks Bart for review. Yes, if multiple versions of package exist in
the repository
then previous fix would traceback. I have updated the webrev with your
suggestion :
https://cr.opensolaris.org/action/browse/pkg/ae112802/7140762-rev3/webrev/
Would like to point that after the "pkgrepo remove" operation user would
land in a directory
which has been deleted.
Thanks,
Abhi.
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
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss