From owner-freebsd-current Thu Apr 26 14:15:27 2001 Delivered-To: freebsd-current@freebsd.org Received: from bsdone.bsdwins.com (www.bsdwins.com [192.58.184.33]) by hub.freebsd.org (Postfix) with ESMTP id BF6FA37B422 for ; Thu, 26 Apr 2001 14:15:23 -0700 (PDT) (envelope-from jwd@bsdwins.com) Received: (from jwd@localhost) by bsdone.bsdwins.com (8.11.1/8.11.0) id f3QLFMn52113; Thu, 26 Apr 2001 17:15:22 -0400 (EDT) (envelope-from jwd) Date: Thu, 26 Apr 2001 17:15:22 -0400 From: "John W. De Boskey" To: current@FreeBSD.ORG Cc: Jeroen Ruigrok/Asmodai Subject: Re: cp -u patch Message-ID: <20010426171522.A51935@bsdwins.com> References: <20010426222132.B55566@daemon.ninth-circle.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010426222132.B55566@daemon.ninth-circle.org>; from asmodai@wxs.nl on Thu, Apr 26, 2001 at 10:21:32PM +0200 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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