On Jan 30, 2009, at 2:41 AM, freeslkr wrote:
It seems like size_get_sf() should return None for files smaller
than X with --max-file-size=X. It looks like that's what happens
when --exclude doesn't match (though I don't code in python, so
forgive me if I'm wrong). Hmmm, it looks like I should add an item
to my todo list ....


Oh goodness, you're completely correct. I apologize for posting without properly familiarizing myself with the code...


Fortunately, the fix is simple. In selection.py just change lines 534 and 535:

                if min_max: sel_func = lambda rp: (rp.getsize() <= size)
                else: sel_func = lambda rp: (rp.getsize() >= size)

to

                if min_max: sel_func = lambda rp: (rp.getsize() <= size) and 
None
                else: sel_func = lambda rp: (rp.getsize() >= size) and None

(that is, put "and None" at the end)


I think I will put this change in the 1.3.x branch ... do people think this should be a new option? or should we just change the semantics of --max-file-size / --min-file-size ? (I'm leaning towards the latter ...)

While we're talking about this, I noticed that this function doesn't do any special handling for directories... anyone care to comment? I think it would be strange to have rdiff-backup exclude a directory because it had too many or too few files when using these options.


Andrew


_______________________________________________
rdiff-backup-users mailing list at [email protected]
http://lists.nongnu.org/mailman/listinfo/rdiff-backup-users
Wiki URL: http://rdiff-backup.solutionsfirst.com.au/index.php/RdiffBackupWiki

Reply via email to