You are one brave soul if the only precedent you have for this
patch is GNU cp.

Personally, I see nothing wrong with it.

With respect to how you short circuit the copy if
the mtimes are 'ok', you probably need to return a value
different than 1 so that your caller can distinquish between
a failed copy (badcp = rval = 1) and a skipped copy.

Thus, the return code from 'cp' will be correct. With your
patch, if the -u option skips a file, the return code from
cp is 1.

Just my .02 cents,

----- Jeroen Ruigrok/Asmodai's Original Message -----
> Please test this further.
> This adds -u to our cp, which is a reimplemented GNU feature after Jim
> Mock asked me if we supported -u in our cp.
> Basically cp -u compares src and dest and only overwrites if dest's
> mtime < src's mtime.
> Only caveat which I haven't yet solved is that it still shows dirs on
> cp -Ruv copy actions, whilst it doesn't copy the directory.  Solutions
> welcome.
> Question is, do we want to add this to our cp?
> I found it handy for stuff like:
> cp -Ruv mozilla mozilla-test
> so that my mozilla CVS tree [not touched] only overwrites the
> mozilla-test files which are older.
> -- 
> Jeroen Ruigrok van der Werven/Asmodai --=-- asmodai@[|]
> Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
> Only in sleep can one find salvation that resembles Death...

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to