From e91387a44c73c9a8bfdbb8f150e51f29c0951f66 Mon Sep 17 00:00:00 2001 From: owsla Date: Thu, 4 Sep 2008 23:36:20 +0000 Subject: Expand --exclude-if-present option to also support directories, symlinks, etc. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@935 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/CHANGELOG | 2 ++ rdiff-backup/rdiff_backup/selection.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG index 541774e..abb77a6 100644 --- a/rdiff-backup/CHANGELOG +++ b/rdiff-backup/CHANGELOG @@ -1,6 +1,8 @@ New in v1.2.2 (????/??/??) --------------------------- +Adjust --exclude-if-present option to support directories, symlinks, device +files, etc. Closes bug #24192. Thanks to Vadim Zeitlin for the suggestion. New in v1.2.1 (2008/08/24) diff --git a/rdiff-backup/rdiff_backup/selection.py b/rdiff-backup/rdiff_backup/selection.py index e9476ac..b2975ee 100644 --- a/rdiff-backup/rdiff_backup/selection.py +++ b/rdiff-backup/rdiff_backup/selection.py @@ -478,7 +478,9 @@ probably isn't what you meant.""" % assert include == 0 or include == 1 def sel_func(rp): - if rp.isdir() and rp.readable() and rp.append(presence_filename).isreg(): return include + if rp.isdir() and rp.readable() and \ + rp.append(presence_filename).lstat(): + return include return None sel_func.exclude = not include -- cgit v1.2.1