[Bug 11253] New: --exclude=dir doesn't work with --files-from=

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug 11253] New: --exclude=dir doesn't work with --files-from=

samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11253

            Bug ID: 11253
           Summary: --exclude=dir doesn't work with --files-from=
           Product: rsync
           Version: 3.1.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: core
          Assignee: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]

Created attachment 11015
  --> https://bugzilla.samba.org/attachment.cgi?id=11015&action=edit
Reproducer/test case

If I just pass --exclude=file or --exclude=dir to rsync, the file or dir is
excluded correctly.

However, if you pass a list of files in --files-from= that includes the file I
want to exclude, then only --exclude=file works as before; --exclude=dir
doesn't seem to do anything at all.

As a workaround, I've found that --exclude=dir/** will actually exclude dir, as
I originally wanted.

This behaviour is counter-intuitive to me; at the very least, I'd expect
--exclude=dir to work the same as --exclude=file.

I've checked that the behaviour is present in latest git master. I've also
included a simple reproducer script (uncomment 1 of the 4 rsync commands and
run it to see the result of the transfer).

--
You are receiving this mail because:
You are the QA Contact for the bug.
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

[Bug 11253] --exclude=dir doesn't work with --files-from=

samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11253

Wayne Davison <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #1 from Wayne Davison <[hidden email]> ---
Excludes don't affect args, just items that are found in recursion. A
files-from list is the same as specifying all the names as args on the
command-line, and thus are not affected.  Specifying an exclude of just the dir
name matches only that dir itself, so when recursing inside the dir, that rule
won't match anything.  If you don't want a particular arg to be included, you
can filter it out of the files-from file.  Your exclude of dir/** (or dir/***)
is also a good solve, as it tells rsync to affect the contents of a particular
path.

One filter solution:

egrep -v '/dir(/|$)' files_from | rsync -aiv --files-from=- / /to/

--
You are receiving this mail because:
You are the QA Contact for the bug.
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

[Bug 11253] --exclude=dir doesn't work with --files-from=

samba-bugs
In reply to this post by samba-bugs
https://bugzilla.samba.org/show_bug.cgi?id=11253

--- Comment #2 from Vegard Nossum <[hidden email]> ---
(In reply to Wayne Davison from comment #1)

Thank you for the explanation.

--
You are receiving this mail because:
You are the QA Contact for the bug.
--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html