Wayne Davison | 1 Sep 01:23 2006
Picon

Re: protecting files from deletion, and using --delete-excluded

On Thu, Aug 31, 2006 at 06:09:08PM -0400, Matt McCutchen wrote:
> That's the wrong fix.

No, it's just an incomplete fix.  In order to be compatible with older
rsync versions, we must continue to completely eliminate the .cvsignore
file when --delete-excluded is used (or else we'd get spurious errors
about the filter rules being too modern when they aren't really).

Thanks for the additional patch.  I'll look into integrating it soon.

..wayne..
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Wayne Davison | 1 Sep 01:30 2006
Picon

Re: file-attr-restore and dollar signs

On Thu, Aug 31, 2006 at 04:47:31PM -0400, Matt McCutchen wrote:
> Wouldn't it be easier to just use a single-quoted string?  That gives
> you escape sequences but not variable references.

No, escape sequences are not parsed in a single-quoted string in perl
(with the exception of \' and \\).  What is needed is a way to turn off
variable interpolation while not disabling backslash decoding.  There
might be a way to do that more easily than my current solution, but I
can't remember it if there is.

..wayne..
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Matt McCutchen | 1 Sep 01:32 2006
Picon

Re: protecting files from deletion, and using --delete-excluded

On 8/31/06, Wayne Davison <wayned <at> samba.org> wrote:
> No, it's just an incomplete fix.  In order to be compatible with older
> rsync versions, we must continue to completely eliminate the .cvsignore
> file when --delete-excluded is used (or else we'd get spurious errors
> about the filter rules being too modern when they aren't really).

I assume you mean receiving rsync versions too old to understand -C and :C?

Good point.  I keep forgetting that rsync 2.6.9 has to Do The Best
Correct Thing when talking to the zillion older versions of rsync that
people are for some reason still using.  That requirement makes
everything several times more complicated, because the current version
of rsync needs to know the best way to produce a desired behavior in
each older version of rsync that could be on the other side.  It seems
to me that rsync is much harder hit by version compatibility issues
than most software packages.

Matt
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Matt McCutchen | 1 Sep 01:46 2006
Picon

Re: file-attr-restore and dollar signs

On 8/31/06, Wayne Davison <wayned <at> samba.org> wrote:
> No, escape sequences are not parsed in a single-quoted string in perl
> (with the exception of \' and \\).  What is needed is a way to turn off
> variable interpolation while not disabling backslash decoding.  There
> might be a way to do that more easily than my current solution, but I
> can't remember it if there is.

OK, that makes sense.  However, you need to backslash backslashes
themselves in addition to $,  <at> , and %.  Otherwise the script
interpolates $fn if the input contains a filename "foo\$fn".  Attached
is a patch.

Matt
Attachment (far-bs-bs.diff): text/x-patch, 401 bytes
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Matt McCutchen | 1 Sep 02:02 2006
Picon

Re: file-attr-restore and dollar signs

On 8/31/06, Matt McCutchen <hashproduct+rsync <at> gmail.com> wrote:
> However, you need to backslash backslashes themselves in addition to $,  <at> , and %.

Oops, never mind that!  That breaks all the other escape sequences.
Maybe instead ban \$, \ <at> , and \% in the input by replacing the \D with
something along the lines of [^\d$ <at> %].

Matt
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Wayne Davison | 1 Sep 02:48 2006
Picon

Re: protecting files from deletion, and using --delete-excluded

On Thu, Aug 31, 2006 at 07:32:57PM -0400, Matt McCutchen wrote:
> I assume you mean receiving rsync versions too old to understand -C
> and :C?

Yeah.  I got bit by this once before, so I'm now wary to ensure that we
keep the -C option backward compatible.

I checked in some more code that fixes the latest problem you pointed
out (the dropping of include/exclude rules read from merge files on the
receiving side).

Much appreciated!

..wayne..
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Wayne Davison | 1 Sep 02:49 2006
Picon

Re: file-attr-restore and dollar signs

On Thu, Aug 31, 2006 at 07:46:08PM -0400, Matt McCutchen wrote:
> However, you need to backslash backslashes

The find command already puts a backslash in front of a backslash in the
name (because it is inserting backslash escapes into the name).

..wayne..
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Matt McCutchen | 1 Sep 03:08 2006
Picon

Re: protecting files from deletion, and using --delete-excluded

On 8/31/06, Wayne Davison <wayned <at> samba.org> wrote:
> I checked in some more code that fixes the latest problem you pointed
> out (the dropping of include/exclude rules read from merge files on the
> receiving side).

I would never have realized that filters might appear before
--delete-excluded on the command line.  I'm glad you added a test.

Tell me if I understand correctly: There are now two checks for
--delete-excluded.  The one in send_rules catches all rules loaded
during command-line processing.  The one in parse_rule_tok catches all
rules loaded after --delete-excluded is seen on the command line,
which includes rules from dir-merge files.  Every rule will be checked
at least once; some might be checked twice, which is fine.

I don't think marking cvsignores as sender-side in parse_rule_tok is
strictly necessary.  Compatibility is only an issue for rules that
will be sent to the remote rsync, and all those go through the check
in send_rules.

Matt
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Matt McCutchen | 1 Sep 03:24 2006
Picon

Re: file-attr-restore and dollar signs

On 8/31/06, Wayne Davison <wayned <at> samba.org> wrote:
> The find command already puts a backslash in front of a backslash in the
> name (because it is inserting backslash escapes into the name).

That's not what I am concerned about.  find never produces a "\$"
sequence.  However, if the input for some reason contained a "\$", it
would be nice if the script either rejected it or interpreted it in
some way that did not involve an unexpected interpolation.

Matt
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Aaron Morris | 1 Sep 14:18 2006
Picon

Re: file-attr-restore and dollar signs

On 8/31/06, Robert Siemer <Robert.Siemer-rsync <at> backsla.sh> wrote:
>
> I haven't even read the problem, but avoiding variable replacment in a
> shell is done with single quotes:
>
> file-attr-restore 'foo$bar'
>
> Your example does not help here.

Yeah, I knew that... I am not sure why I typed it that way.  I guess I
was thinking about files with spaces in them.

-- 
Aaron W Morris (decep) <aaronwmorris <at> gmail.com>
--

-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Gmane