Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Apr 2001 17:15:22 -0400
From:      "John W. De Boskey" <jwd@bsdwins.com>
To:        current@FreeBSD.ORG
Cc:        Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
Subject:   Re: cp -u patch
Message-ID:  <20010426171522.A51935@bsdwins.com>
In-Reply-To: <20010426222132.B55566@daemon.ninth-circle.org>; from asmodai@wxs.nl on Thu, Apr 26, 2001 at 10:21:32PM %2B0200
References:  <20010426222132.B55566@daemon.ninth-circle.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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,
-John

----- 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@[wxs.nl|freebsd.org]
> Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
> http://www.freebsd.org/doc/en_US.ISO_8859-1/books/developers-handbook/
> Only in sleep can one find salvation that resembles Death...


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010426171522.A51935>