]> arthur.barton.de Git - bup.git/commit
vfs: try_lresolve() was a bad idea. Create try_resolve() instead.
authorAvery Pennarun <apenwarr@gmail.com>
Mon, 26 Jul 2010 04:30:29 +0000 (00:30 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Mon, 26 Jul 2010 04:30:29 +0000 (00:30 -0400)
commitf77a082904b0e5e97b28652dc13315652cf41592
tree839ccaf912aaadad069f8a70ca55351fdada96b0
parentd349af0005f6b4181544a99729023d5b413213cf
vfs: try_lresolve() was a bad idea.  Create try_resolve() instead.

Also add some comments to describe the actual differences between resolve()
and lresolve(), and clean things up a bit so that they actually work as
they're supposed to.

Basically, all of lresolve(), resolve(), and try_resolve() depend on
*intermediate* paths being resolvable; all of them will throw an exception
if not.  They only differ in the very last node in the path, when that node
is a symlink:

  resolve() will dereference it or throw an exception if it can't;
  try_resolve() will try to dereference it, but return self if it can't;
  lresolve() will not dereference it at all, like lstat() doesn't.

With that in mind, we can fix up cmd/ftp and cmd/web to use the right calls,
thus fixing an unexpected error in ftp's tab completion reported by Gabriel
Filion, which would happen if you tried to tab complete inside a directory
that contained a broken symlink.  We only care what the symlink points to so
we can decide whether or not to append '/' to the tab completion, so we want
it to fail silently if it's going to fail.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/ftp-cmd.py
cmd/web-cmd.py
lib/bup/vfs.py