]> arthur.barton.de Git - bup.git/commitdiff
drecurse.py: handle initial pathnames that aren't directories.
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Feb 2010 05:02:58 +0000 (00:02 -0500)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Feb 2010 05:06:25 +0000 (00:06 -0500)
drecurse.py

index b62e58a6884416ff446468793182c7ea3d81b484..33bcca4cb23d4b31e6dc06478e7ff9d5e0ce2920 100644 (file)
@@ -67,8 +67,15 @@ def recursive_dirlist(paths, xdev):
         assert(type(paths) != type(''))
         for path in paths:
             try:
-                rpath = os.path.realpath(path)
-                pfile = OsFile(rpath)
+                pst = os.lstat(path)
+                if stat.S_ISLNK(pst.st_mode):
+                    yield (path, pst)
+                    continue
+            except OSError, e:
+                add_error(e)
+                continue
+            try:
+                pfile = OsFile(path)
             except OSError, e:
                 add_error(e)
                 continue