Re: trailing spaces in exclude-from file

2022-01-27 Thread Wayne Davison via rsync
On Mon, Jan 24, 2022 at 1:08 AM Jürgen Bausa via rsync <
rsync@lists.samba.org> wrote:

> However, it didn't work in the beginning and took me some time to find
> out, that a space at the end (e.g. "+ /mnt/Windows/Users " in the second
> line) will be interpreted and thus, the directory is assumed to be "Users "
> and not "Users".


When working on some filter rules it helps to use --debug=FILTER or
--debug=FILTER2 options. (While these are implied by -vv and -vvv
respectively, it's better to be more specific in what you want to debug.)
The FILTER2 level mentions the add_rule(RULE_HERE) call where a trailing
space would be visible prior to the trailing paren, though it might not be
immediately obvious.  I've just made a change in git that makes rsync
output a warning message in either debug-filter level if there is a
trailing space or tab on a rule, which will help someone notice it if they
didn't intend to specify it.

..wayne..
-- 
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


Re: trailing spaces in exclude-from file

2022-01-24 Thread Bill Campbell via rsync
On Mon, Jan 24, 2022, Paul Slootman via rsync wrote:
>On Mon 24 Jan 2022, Jürgen Bausa via rsync wrote:
>> 
>> However, that's just a proposal. But the behavior of trailing spaces is 
>> something I guess should be corrected.
>
>Is it?
>How would you otherwise specify a space that you *do* intend to be
>relevant?

If rsync uses pcre, then one or more \s should do it.

Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www2.celestial.com/ 6641 E. Mercer Way
Mobile: (206) 947-5591  PO Box 820
Fax:(206) 232-9186  Mercer Island, WA 98040-0820

Americans are so enamored of equality that they would rather be equal
in slavery than unequal in freedom.
-- Alexis de Tocqueville, 1805-1859

-- 
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


re: trailing spaces in exclude-from file

2022-01-24 Thread Jürgen Bausa via rsync
On Mon 24 Jan 2022, Paul Slootman via rsync wrote:
>
>On Mon 24 Jan 2022, Jürgen Bausa via rsync wrote:
>> 
>> However, that's just a proposal. But the behavior of trailing spaces is 
>> something I guess should be corrected.
>
>Is it?
>How would you otherwise specify a space that you *do* intend to be
>relevant?
>
>
>Paul

Thats a good point. Seems the problem is more complex than I thought I did not 
think that someone would intent to have a space at the end of a directory or 
file name. But this can of course happen. Changing the interpretation of 
trailing spaces would break backwards compabilty.

So at least there should be a warning in the documentation. Maybe there is 
already one, but I didnt find it.

jba

-- 
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


Re: trailing spaces in exclude-from file

2022-01-24 Thread Paul Slootman via rsync
On Mon 24 Jan 2022, Jürgen Bausa via rsync wrote:
> 
> However, that's just a proposal. But the behavior of trailing spaces is 
> something I guess should be corrected.

Is it?
How would you otherwise specify a space that you *do* intend to be
relevant?


Paul

-- 
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


trailing spaces in exclude-from file

2022-01-24 Thread Jürgen Bausa via rsync
I am running debian bullseye which comes with rsync 3.2.3. and was struggling 
with writing a correct exclude-from file. I want to exclude everything under 
/tmp and /mnt, but include everything under/mnt/Windows/Users/jba. This is what 
I came up in the end and what works:

+ /mnt/Windows/Users/jba
+ /mnt/Windows/Users
+ /mnt/Windows
- /mnt/Windows/Users/*
- /mnt/Windows/*
- /mnt/*
- /tmp/*

However, it didn't work in the beginning and took me some time to find out, 
that a space at the end (e.g. "+ /mnt/Windows/Users " in the second line) will 
be interpreted and thus, the directory is assumed to be "Users " and not 
"Users". So with the space it just didn't work.

Is this the intended behavior? Its really hard to find this problem because 
trailing spaces are normally not directly visible. And they are dropped in 
every other software (at least the ones I use).

The other thing I was thinking about is, that the above syntax is far from 
being intuitive. Especially if you have long path names it would be much easier 
if the following could be used:

+ /mnt/Windows/Users/jba
- /mnt/*
- /tmp/*

In order to not break compatibility a special character (like "!") could be 
added at the end of the first line. Meaning "match to any subpath of this 
also". So create /mnt/Windows and /mnt/Windows/Users, but not their contents.

However, that's just a proposal. But the behavior of trailing spaces is 
something I guess should be corrected.

jba

-- 
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